
/* ============================================
   家装展示后台管理系统 - 专业UI设计
   设计理念：温暖、专业、现代、简约
   ============================================ */

/* CSS 变量定义 */
:root {
    /* 主色调 - 温暖的大地色系 */
    --primary-color: #8B7355;
    --primary-dark: #6B5344;
    --primary-light: #A89078;
    
    /* 强调色 - 金铜色 */
    --accent-color: #C9A86C;
    --accent-light: #E8D4A8;
    
    /* 中性色 */
    --text-primary: #2D2A26;
    --text-secondary: #5C5650;
    --text-muted: #9A948C;
    --text-light: #B8B2A8;
    
    /* 背景色 */
    --bg-primary: #FAFAF8;
    --bg-secondary: #F5F4F2;
    --bg-card: #FFFFFF;
    --bg-sidebar: #2D2A26;
    --bg-sidebar-hover: #3D3A36;
    --bg-sidebar-active: #4D4A46;
    
    /* 边框色 */
    --border-color: #E8E6E3;
    --border-light: #F0EEEB;
    
    /* 状态色 */
    --success-color: #6B8E6B;
    --success-bg: #EDF5ED;
    --warning-color: #C9A86C;
    --warning-bg: #FDF8ED;
    --danger-color: #B85C5C;
    --danger-bg: #FAEDED;
    --info-color: #6B7B8E;
    --info-bg: #EDF0F5;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 24px rgba(45, 42, 38, 0.12);
    --shadow-xl: 0 16px 48px rgba(45, 42, 38, 0.16);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* 侧边栏宽度 */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

/* 全局重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   登录页面
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F5F4F2 0%, #E8E6E3 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 150%;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.08) 0%, rgba(201, 168, 108, 0.05) 100%);
    border-radius: 50%;
    transform: rotate(-15deg);
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 100%;
    background: linear-gradient(135deg, rgba(201, 168, 108, 0.06) 0%, rgba(139, 115, 85, 0.03) 100%);
    border-radius: 50%;
}

.login-box {
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.login-box .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 36px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: white;
}

.login-logo svg {
    width: 32px;
    height: 32px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all var(--transition-normal);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
}

.login-form input::placeholder {
    color: var(--text-light);
}

.error-msg {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 16px;
    text-align: center;
    padding: 12px;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
}

/* ============================================
   按钮样式
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-normal);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-light);
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 12px;
}

.btn-text:hover {
    background: rgba(139, 115, 85, 0.08);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #A04E4E;
}

.btn-block {
    width: 100%;
    display: flex;
    padding: 14px 20px;
    font-size: 15px;
    margin-top: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ============================================
   主布局
   ============================================ */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   侧边栏
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: white;
    line-height: 1.3;
}

.logo-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    margin-top: 2px;
}

.nav-menu {
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.nav-item .icon svg {
    width: 18px;
    height: 18px;
}

.nav-item span:not(.icon) {
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ============================================
   顶部栏
   ============================================ */
.header {
    background: var(--bg-card);
    padding: 0 32px;
    height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--danger-bg);
    color: var(--danger-color);
}

.connection-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.connection-status.connected {
    background: var(--success-bg);
    color: var(--success-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   内容区域
   ============================================ */
.content {
    padding: 32px;
    flex: 1;
}

/* ============================================
   页面标题
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-header-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    width: 240px;
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ============================================
   统计卡片
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 8px;
}

.stat-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #E8D4A8 0%, #C9A86C 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #D4E8D4 0%, #6B8E6B 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #D4E0E8 0%, #6B7B8E 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #E8D4D4 0%, #B85C5C 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -1px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    color: var(--success-color);
}

.stat-trend.down {
    color: var(--danger-color);
}

/* ============================================
   表格样式
   ============================================ */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.data-table .thumb-sm {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.empty-text {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px !important;
    font-size: 14px;
}

.text-ellipsis {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   状态标签
   ============================================ */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.active {
    background: var(--success-bg);
    color: var(--success-color);
}

.status-tag.inactive {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.status-tag.clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.status-tag.clickable:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.pagination span {
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination .btn {
    min-width: 100px;
}

/* ============================================
   弹窗
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 42, 38, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.image-picker-modal {
    z-index: 1100;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.modal-content.modal-lg {
    max-width: 720px;
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: var(--danger-bg);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* ============================================
   表单样式
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-normal);
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235C5650' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    appearance: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============================================
   配置表单
   ============================================ */
.config-form {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.config-section {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-light);
}

.config-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.config-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.config-form .form-group {
    background: var(--bg-secondary);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.config-form .form-group:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.config-form .form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.config-key {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    background: var(--bg-card);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.config-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.page-config .config-form {
    max-width: 900px;
}

/* ============================================
   二维码表单
   ============================================ */
.qrcode-form {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    max-width: 500px;
}

.qrcode-result {
    margin-top: 24px;
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.qrcode-result img {
    max-width: 200px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Toast 提示
   ============================================ */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    animation: toastSlideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #5A7D5A 100%);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger-color) 0%, #A04E4E 100%);
}

.toast.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #5A6A7D 100%);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   图库样式
   ============================================ */
.page-gallery {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.gallery-item {
    position: relative;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

.gallery-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.gallery-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    padding: 12px;
    background: var(--bg-secondary);
}

.gallery-item-info .filename {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.gallery-item-info .filesize {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.gallery-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-item-actions {
    opacity: 1;
}

.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

/* 视频缩略图 */
.video-thumbnail {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-thumbnail svg {
    opacity: 0.8;
}

.video-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(201, 169, 110, 0.9);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
}

.gallery-item.video-item:hover .video-thumbnail {
    background: linear-gradient(135deg, #1a1a3e, #16215e);
}

/* 视频选择器 */
.video-picker-item .video-thumbnail {
    height: 100px;
}

.picker-item-name {
    font-size: 11px;
    color: var(--text-primary);
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    background: var(--bg-secondary);
}

.picker-tip {
    font-size: 13px;
    color: var(--text-muted);
}

.empty-gallery::before {
    content: '';
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.batch-actions span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   上传进度
   ============================================ */
.upload-progress {
    margin: 20px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    height: 36px;
    border: 1px solid var(--border-color);
}

.upload-progress .progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transition: width 0.3s ease;
}

.upload-progress span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   图片选择器弹窗
   ============================================ */
.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.picker-item {
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.picker-item:hover {
    border-color: var(--primary-light);
}

.picker-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.2);
}

.picker-item img {
    width: 100%;
    height: 85px;
    object-fit: cover;
    display: block;
}

.empty-picker {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

/* ============================================
   图片输入组
   ============================================ */
.image-input-group {
    display: flex;
    gap: 12px;
}

.image-input-group input {
    flex: 1;
}

.image-input-group .btn {
    white-space: nowrap;
}

/* ============================================
   图片预览
   ============================================ */
.image-preview {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.image-preview img {
    max-width: 220px;
    max-height: 160px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   上传按钮
   ============================================ */
.upload-btn {
    cursor: pointer;
}

.upload-btn input[type="file"] {
    display: none;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .logo h2,
    .sidebar .logo-subtitle,
    .sidebar .nav-item span:not(.icon),
    .sidebar .nav-section-title {
        display: none;
    }
    
    .sidebar .logo {
        justify-content: center;
        padding: 20px 12px;
    }
    
    .sidebar .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .sidebar .nav-item .icon {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-input {
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ============================================
   选择框美化
   ============================================ */
::selection {
    background: rgba(139, 115, 85, 0.2);
    color: var(--text-primary);
}

/* ============================================
   动画效果
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-dashboard,
.page-banners,
.page-categories,
.page-goods,
.page-videos,
.page-favorites,
.page-cms,
.page-config,
.page-gallery,
.page-qrcode {
    animation: fadeIn 0.3s ease;
}

.stat-card {
    animation: slideUp 0.4s ease;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.3s; }

/* ============================================
   打印样式
   ============================================ */
@media print {
    .sidebar,
    .header,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 0;
    }
}

/* ============================================
   多图管理样式
   ============================================ */
.label-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.multi-image-container {
    margin-top: 8px;
}

.multi-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-height: 160px;
}

.multi-image-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
    aspect-ratio: 1;
}

.multi-image-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.multi-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.multi-image-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 42, 38, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.multi-image-item:hover .multi-image-actions {
    opacity: 1;
}

.multi-image-actions .btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
}

.multi-image-actions .btn-move {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-secondary);
}

.multi-image-actions .btn-move:hover:not(:disabled) {
    background: white;
    color: var(--primary-color);
}

.multi-image-actions .btn-move:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.multi-image-actions .btn-delete {
    background: var(--danger-color);
    color: white;
}

.multi-image-actions .btn-delete:hover {
    background: #A04E4E;
}

.multi-image-index {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    background: rgba(45, 42, 38, 0.8);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-image-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    background: var(--bg-card);
    aspect-ratio: 1;
    min-height: 100px;
}

.multi-image-add:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(139, 115, 85, 0.05);
}

.multi-image-add svg {
    opacity: 0.6;
}

.multi-image-add span {
    font-size: 12px;
    font-weight: 500;
}

.multi-image-tip {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .multi-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
        padding: 12px;
    }
    
    .multi-image-actions .btn-icon {
        width: 24px;
        height: 24px;
    }
    
    .multi-image-index {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
}

/* ============================================
   图文混排编辑器样式
   ============================================ */
.rich-editor-container {
    margin-top: 8px;
}

.rich-editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-btn svg {
    opacity: 0.8;
}

.rich-editor-content {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    min-height: 200px;
}

.content-block {
    margin-bottom: 12px;
    position: relative;
}

.content-block:last-child {
    margin-bottom: 0;
}

.text-block {
    position: relative;
}

.text-block textarea {
    padding-right: 40px;
    resize: vertical;
    min-height: 80px;
}

.text-block .block-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-color);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.text-block:hover .block-remove {
    opacity: 1;
}

.text-block .block-remove:hover {
    background: var(--danger-color);
    color: white;
}

.image-block {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
}

.image-block:hover {
    border-color: var(--primary-color);
}

.image-block img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.image-block-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 42, 38, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.image-block:hover .image-block-actions {
    opacity: 1;
}

.image-block-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
}

.image-block-actions .btn-move {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-secondary);
}

.image-block-actions .btn-move:hover:not(:disabled) {
    background: white;
    color: var(--primary-color);
}

.image-block-actions .btn-move:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.image-block-actions .btn-delete {
    background: var(--danger-color);
    color: white;
}

.image-block-actions .btn-delete:hover {
    background: #A04E4E;
}

.add-content-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    margin-top: 12px;
}

.add-content-block:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(139, 115, 85, 0.05);
}

.add-content-block svg {
    opacity: 0.6;
}

.add-content-block span {
    font-size: 13px;
    font-weight: 500;
}

.rich-editor-tip {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .rich-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .toolbar-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .image-block img {
        max-height: 200px;
    }
}

/* ============================================
   管理员设置页面样式
   ============================================ */
.page-admins {
    animation: fadeIn 0.3s ease;
}

.permission-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.permission-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.permission-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.permission-item:first-child {
    padding-top: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* 权限状态标签在表格中的样式 */
.page-admins .status-tag {
    min-width: 50px;
    text-align: center;
}