/* 后台管理样式 - 优化版 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0f2744;
    --primary-gradient: linear-gradient(135deg, #1a3a5c 0%, #2c5282 100%);

    /* 强调色 */
    --accent-color: #c9a962;
    --accent-light: #d4bc7a;

    /* 功能色 */
    --success-color: #27ae60;
    --success-light: #2ecc71;
    --danger-color: #e74c3c;
    --danger-light: #ff6b6b;
    --warning-color: #f39c12;
    --info-color: #3498db;

    /* 中性色 */
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #95a5a6;
    --bg-color: #f5f7fa;
    --bg-light: #ffffff;
    --border-color: #e8e8e8;
    --border-light: #f0f0f0;

    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);

    /* 尺寸 */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 暗色模式 */
body.dark-mode {
    --text-color: #ecf0f1;
    --text-light: #bdc3c7;
    --bg-color: #1a1a2e;
    --bg-light: #16213e;
    --border-color: #2d3748;
    --border-light: #2d3748;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

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

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

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

.login-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(201, 169, 98, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(44, 82, 130, 0.5);
    bottom: -50px;
    right: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(39, 174, 96, 0.2);
    top: 50%;
    right: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-text {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 3px;
}

.login-logo .logo-cn {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: 8px;
    margin-top: 8px;
}

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

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

.login-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.login-box label i {
    color: var(--primary-color);
    width: 16px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: all var(--transition-fast);
    background: var(--bg-light);
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    letter-spacing: 2px;
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: hidden;
}

.btn-login .btn-loading {
    display: none;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loading {
    display: inline;
}

.login-tip {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.login-tip i {
    margin-right: 6px;
}

/* ==================== 管理后台布局 ==================== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    z-index: 1000;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo .logo-text {
    display: block;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-logo .logo-cn {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 3px;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    font-size: 14px;
    gap: 12px;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--accent-color);
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 25px;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.version-info {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-light);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border-radius: var(--border-radius);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-color);
}

.top-bar h2 {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(15deg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    color: var(--text-muted);
    font-size: 11px;
}

/* 标签页内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* 内容卡片 */
.content-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

/* ==================== 控制台 ==================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-primary { border-top: 4px solid var(--primary-color); }
.card-accent { border-top: 4px solid var(--accent-color); }
.card-warning { border-top: 4px solid var(--warning-color); }
.card-success { border-top: 4px solid var(--success-color); }

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 20px 20px 0;
    border-radius: var(--border-radius-sm);
}

.card-primary .card-icon { background: rgba(26, 58, 92, 0.1); color: var(--primary-color); }
.card-accent .card-icon { background: rgba(201, 169, 98, 0.1); color: var(--accent-color); }
.card-warning .card-icon { background: rgba(243, 156, 18, 0.1); color: var(--warning-color); }
.card-success .card-icon { background: rgba(39, 174, 96, 0.1); color: var(--success-color); }

.card-content {
    padding: 0 20px 20px;
}

.card h3 {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.dashboard-section {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.section-header h3 {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: var(--primary-color);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-color);
}

.quick-action-btn i {
    font-size: 24px;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn:hover i {
    color: white;
}

.recent-activity {
    max-height: 300px;
    overflow-y: auto;
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.activity-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
}

.activity-item i {
    font-size: 18px;
    color: var(--primary-color);
    margin-top: 3px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== 表单样式 ==================== */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: var(--primary-color);
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* 带按钮的输入框样式 */
.input-with-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-btns select,
.input-with-btns input {
    flex: 1;
    width: auto;
}

.input-btns {
    display: flex;
    gap: 4px;
}

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

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

.btn-icon.btn-primary:hover {
    background: var(--primary-light);
}

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

.btn-icon.btn-danger:hover {
    background: #c0392b;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    justify-content: center;
}

.btn i {
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

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

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    padding: 0 12px;
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary-color);
}

.search-box input {
    border: none;
    background: none;
    padding: 10px;
    font-size: 14px;
    width: 200px;
}

.search-box input:focus {
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 14px;
}

.search-btn:hover {
    color: var(--primary-color);
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-color);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== 数据表格 ==================== */
.data-table {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 60px 1.5fr 1fr 1fr 140px;
    padding: 16px 20px;
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 50px 60px 1.5fr 1fr 1fr 140px;
    padding: 16px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    transition: background var(--transition-fast);
}

.table-row > span {
    text-align: left;
}

.table-header > span:nth-child(4),
.table-header > span:nth-child(5),
.table-row > span:nth-child(4),
.table-row > span:nth-child(5) {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
}

.table-actions-header {
    text-align: right;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--bg-color);
}

.table-row.selected {
    background: rgba(26, 58, 92, 0.05);
}

.checkbox-cell input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.table-image {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

/* 产品类型标签 */
.product-type {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 120px;
    justify-content: center;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 排序按钮样式 */
.sort-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sort-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    color: #555;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sort-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.sort-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-btn i {
    font-weight: 900;
}

.sort-number {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: #333;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sort-input {
    width: 60px !important;
    padding: 4px 8px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    text-align: center !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
}

.sort-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1) !important;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 2px solid var(--border-color);
}

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

.pagination {
    display: flex;
    gap: 8px;
}

.pagination button {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.pagination button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ==================== 时间轴列表 ==================== */
.timeline-list {
    position: relative;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    padding: 20px;
    position: relative;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item:hover {
    background: var(--bg-color);
}

.timeline-year {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
}

.timeline-dot {
    position: absolute;
    left: 22px;
    top: 28px;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid var(--bg-light);
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.1);
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.timeline-description {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.timeline-actions {
    display: flex;
    gap: 8px;
    align-self: flex-start;
}

/* ==================== 联系信息网格 ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.contact-item-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.contact-item .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ==================== 图片上传 ==================== */
.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    transition: border-color var(--transition-fast);
}

.image-upload:focus-within {
    border-color: var(--primary-color);
}

.image-preview {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.image-preview.has-image {
    padding: 0;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius-sm);
}

.image-preview i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.image-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}

.image-actions input[type="text"] {
    flex: 1;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal-dialog {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

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

.modal-header h3 {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
}

/* ==================== 系统设置 ==================== */
.settings-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-title {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-title i {
    color: var(--primary-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.setting-label {
    display: flex;
    flex-direction: column;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 开关切换 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-fast);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* ==================== Toast 消息 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--primary-color);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }

.toast i {
    font-size: 18px;
}

.toast.success i { color: var(--success-color); }
.toast.error i { color: var(--danger-color); }
.toast.warning i { color: var(--warning-color); }

.toast-message {
    flex: 1;
    color: var(--text-color);
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

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

/* ==================== 说明书编辑器 ==================== */
.modal-dialog.modal-xl {
    max-width: 1000px;
}

.manual-content-editor {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.manual-content-editor:focus-within {
    border-color: var(--primary-color);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    color: var(--text-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition-fast);
}

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

.editor-content {
    min-height: 300px;
    padding: 15px;
    background: var(--bg-light);
    outline: none;
    line-height: 1.8;
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
}

.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 10px 0;
}

.editor-content h1,
.editor-content h2,
.editor-content h3,
.editor-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.editor-content p {
    margin-bottom: 10px;
}

.editor-content ul,
.editor-content ol {
    margin-bottom: 10px;
    padding-left: 25px;
}

/* ==================== 说明书列表 ==================== */
.manual-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.manual-card:last-child {
    border-bottom: none;
}

.manual-card:hover {
    background: var(--bg-color);
}

.manual-cover {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    background: var(--bg-color);
}

.manual-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manual-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.manual-product {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.manual-product i {
    color: var(--accent-color);
}

.manual-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-radius: 20px;
    font-size: 12px;
    width: fit-content;
}

.manual-video-badge i {
    font-size: 12px;
}

.manual-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.manual-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.manual-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: center;
}

/* ==================== 前端展示 - 说明书详情 ==================== */
.manual-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    overflow-y: auto;
}

.manual-detail-modal.show {
    display: block;
}

.manual-detail-content {
    background: var(--bg-light);
    min-height: 100vh;
    padding: 40px 20px;
}

.manual-detail-header {
    max-width: 900px;
    margin: 0 auto 30px;
    text-align: center;
}

.manual-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.manual-detail-cover {
    max-width: 400px;
    max-height: 250px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.manual-detail-video {
    max-width: 800px;
    margin: 30px auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
}

.manual-detail-video iframe,
.manual-detail-video video {
    width: 100%;
    height: 450px;
    border: none;
}

.manual-detail-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.manual-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 15px 0;
}

.manual-detail-body h1,
.manual-detail-body h2,
.manual-detail-body h3 {
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

.manual-detail-body p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.manual-detail-body ul,
.manual-detail-body ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.manual-detail-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 3001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.manual-detail-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .manual-card {
        grid-template-columns: 1fr;
    }

    .manual-cover {
        height: 180px;
    }

    .manual-actions {
        flex-direction: row;
    }

    .manual-detail-video iframe,
    .manual-detail-video video {
        height: 250px;
    }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .table-header,
    .table-row {
        grid-template-columns: 50px 60px 1fr 80px 120px;
    }

    .table-header:nth-child(5),
    .table-row:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .user-details {
        display: none;
    }

    .table-header,
    .table-row {
        grid-template-columns: 50px 50px 1fr 100px;
    }

    .table-header:nth-child(5),
    .table-row:nth-child(5),
    .table-header:nth-child(6),
    .table-row:nth-child(6) {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: stretch;
    }

    .search-box {
        flex: 1;
    }

    .search-box input {
        width: 100%;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .top-bar,
    .toolbar,
    .btn,
    .modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 类别管理样式 */
.category-add-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.category-add-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.category-add-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.categories-list {
    max-height: 400px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-light);
    transition: all var(--transition-fast);
}

.category-item:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-item span {
    font-weight: 500;
    color: var(--text-color);
}
