/**
 * 基础样式 - 管理系统通用样式
 * 包含：CSS 变量、导航栏、表格、按钮、弹窗、Toast、响应式等
 */

/* ==================== CSS 变量 ==================== */
:root {
    --primary: #5b5ff0;
    --primary-light: #818cf8;
    --primary-lighter: #c7d2fe;
    --primary-dark: #4f46e5;
    --primary-bg: #eef2ff;
    --accent-rose: #f43f5e;
    --accent-rose-light: #ffe4e6;
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fef3c7;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --info: #06b6d4;
    --info-hover: #0891b2;
    --info-light: #cffafe;
    --info-bg: #ecfeff;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Type scale */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;

    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-navbar: #ffffff;
    --bg-hover: #f3f4f6;
    --bg-active: #f0f0ff;
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;
    --bg-overlay: rgba(255,255,255,0.6);
    --bg-modal-overlay: rgba(15,23,42,0.6);
    --bg-tooltip: rgba(30,41,59,0.95);
    --bg-skeleton: #f1f5f9;
    --bg-skeleton-highlight: #e2e8f0;
    --bg-form-section: linear-gradient(180deg, #f8fafc, #f1f5f9);
    --bg-error: #fff5f5;
    --bg-import-logs: #ffffff;
    --bg-dropdown: #ffffff;
    --bg-dropdown-hover: #f3f4f6;
    --bg-nav-overlay: rgba(0,0,0,0.5);
    --bg-toast-success: #10b981;
    --bg-toast-error: #ef4444;
    --bg-toast-warning: #f59e0b;
    --bg-toast-info: #6366f1;
    --bg-loading-overlay: rgba(255,255,255,0.6);
    --bg-mobile-menu: #ffffff;
    --bg-login-container: #ffffff;
    --bg-login-border: rgba(255,255,255,0.5);
    --shadow-login: 0 25px 50px -12px rgba(0,0,0,0.1);
    --bg-stat-card: #ffffff;
    --bg-chart-section: #ffffff;
    --text-stat-value: #1e293b;
    --text-stat-label: #64748b;

    --text-navbar: #1f2937;
    --text-nav-item: #6b7280;
    --text-nav-item-hover: #374151;
    --text-nav-item-active: #6366f1;
    --text-page-title: #111827;
    --text-white: #ffffff;
    --text-inverse: #ffffff;
    --text-danger-hover: #dc2626;
    --text-success: #047857;
    --text-warning: #b45309;
    --text-info: #0e7490;
    --text-scrapped: #64748b;
    --text-change: #0e7490;
    --text-action-delete: #dc2626;
    --text-action-add: #047857;
    --text-action-edit: #2563eb;

    --border-navbar: #e5e7eb;
    --border-card: #f0f0f0;
    --border-input: #e2e8f0;
    --border-dropdown: #e5e7eb;
    --border-modal: rgba(255,255,255,0.1);
    --border-danger: #fca5a5;

    --accent-glow: rgba(99,102,241,0.3);
    --accent-glow-strong: rgba(99,102,241,0.4);
    --accent-focus-ring: rgba(99,102,241,0.1);
    --success-glow: rgba(16,185,129,0.3);
    --success-glow-strong: rgba(16,185,129,0.4);
    --warning-glow: rgba(245,158,11,0.3);
    --warning-glow-strong: rgba(245,158,11,0.4);
    --danger-glow: rgba(239,68,68,0.3);
    --danger-glow-strong: rgba(239,68,68,0.4);
    --info-glow: rgba(6,182,212,0.3);
    --info-glow-strong: rgba(6,182,212,0.4);

    --shadow-dropdown: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    --shadow-modal: 0 25px 50px -12px rgba(0,0,0,0.25);
    --shadow-toast: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-tooltip: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-mobile-menu: 0 10px 20px rgba(0,0,0,0.1);
    --shadow-btn: 0 2px 8px rgba(0,0,0,0.15);

    --row-overdue-bg: #fff5f5;
    --row-abnormal-bg: #fef2f2;
    --row-expiring-bg: #fffbeb;
    --row-idle-bg: #f0fdf4;
    --row-overdue-tint: rgba(239,68,68,0.06);
    --row-abnormal-tint: rgba(239,68,68,0.05);
    --row-expiring-tint: rgba(245,158,11,0.07);
    --row-idle-tint: rgba(16,185,129,0.06);
    --row-sticky-hover: #f8faff;

    color-scheme: light dark;
}

/* ==================== 环境光晕背景 ==================== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(91, 95, 240, 0.07), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.05), transparent);
}

/* ==================== 噪点纹理 ==================== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.025;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.dark {
    --bg: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-bg: #1e1b4b;
    --success-hover: #34d399;
    --success-light: #064e3b;
    --success-bg: rgba(16,185,129,0.14);
    --warning-hover: #fbbf24;
    --warning-light: #451a03;
    --warning-bg: rgba(245,158,11,0.14);
    --danger-hover: #f87171;
    --danger-light: #450a0a;
    --danger-bg: rgba(239,68,68,0.14);
    --info-hover: #22d3ee;
    --info-light: #164e63;
    --info-bg: rgba(6,182,212,0.14);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.4);

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-navbar: #0f172a;
    --bg-hover: #1e293b;
    --bg-active: #1e1b4b;
    --bg-input: #0f172a;
    --bg-input-focus: #1e293b;
    --bg-overlay: rgba(15,23,42,0.8);
    --bg-modal-overlay: rgba(0,0,0,0.7);
    --bg-tooltip: rgba(15,23,42,0.95);
    --bg-skeleton: #1e293b;
    --bg-skeleton-highlight: #334155;
    --bg-form-section: #1e293b;
    --bg-error: #450a0a;
    --bg-import-logs: #0f172a;
    --bg-dropdown: #1e293b;
    --bg-dropdown-hover: #334155;
    --bg-nav-overlay: rgba(0,0,0,0.7);
    --bg-toast-success: #059669;
    --bg-toast-error: #dc2626;
    --bg-toast-warning: #d97706;
    --bg-toast-info: #4f46e5;
    --bg-loading-overlay: rgba(15,23,42,0.8);
    --bg-mobile-menu: #0f172a;
    --bg-login-container: rgba(30,41,59,0.8);
    --bg-login-border: rgba(255,255,255,0.1);
    --shadow-login: 0 25px 50px -12px rgba(0,0,0,0.5);
    --bg-stat-card: #1e293b;
    --bg-chart-section: #1e293b;
    --text-stat-value: #f1f5f9;
    --text-stat-label: #94a3b8;

    --text-navbar: #f1f5f9;
    --text-nav-item: #94a3b8;
    --text-nav-item-hover: #e2e8f0;
    --text-nav-item-active: #818cf8;
    --text-page-title: #f1f5f9;
    --text-white: #ffffff;
    --text-inverse: #0f172a;
    --text-danger-hover: #fca5a5;
    --text-success: #34d399;
    --text-warning: #fbbf24;
    --text-info: #22d3ee;
    --text-scrapped: #94a3b8;
    --text-change: #22d3ee;
    --text-action-delete: #f87171;
    --text-action-add: #34d399;
    --text-action-edit: #60a5fa;

    --border-navbar: #334155;
    --border-card: #334155;
    --border-input: #475569;
    --border-dropdown: #334155;
    --border-modal: rgba(255,255,255,0.05);
    --border-danger: #7f1d1d;

    --accent-glow: rgba(91, 95, 240, 0.4);
    --accent-glow-strong: rgba(91, 95, 240, 0.5);
    --accent-focus-ring: rgba(91, 95, 240, 0.2);
    --success-glow: rgba(16,185,129,0.4);
    --success-glow-strong: rgba(16,185,129,0.5);
    --warning-glow: rgba(245,158,11,0.4);
    --warning-glow-strong: rgba(245,158,11,0.5);
    --danger-glow: rgba(239,68,68,0.4);
    --danger-glow-strong: rgba(239,68,68,0.5);
    --info-glow: rgba(6,182,212,0.4);
    --info-glow-strong: rgba(6,182,212,0.5);

    --shadow-dropdown: 0 8px 24px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
    --shadow-modal: 0 25px 50px -12px rgba(0,0,0,0.5);
    --shadow-toast: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-tooltip: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-mobile-menu: 0 10px 20px rgba(0,0,0,0.3);
    --shadow-btn: 0 2px 8px rgba(0,0,0,0.3);

    --row-overdue-bg: #450a0a;
    --row-abnormal-bg: #450a0a;
    --row-expiring-bg: #451a03;
    --row-idle-bg: #064e3b;
    --row-overdue-tint: rgba(239,68,68,0.13);
    --row-abnormal-tint: rgba(239,68,68,0.11);
    --row-expiring-tint: rgba(245,158,11,0.12);
    --row-idle-tint: rgba(16,185,129,0.11);
    --row-sticky-hover: #1e293b;
}

.dark body::before {
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(91, 95, 240, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.08), transparent);
}

.dark .navbar {
    border-bottom-color: rgba(255,255,255,0.05);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

body, .card, .btn, input, select, table, .modal-content, .stat-card, .chart-section, .login-container, .order-card, .toolbar, .table-container, .filter-input, .pagination button, .user-dropdown-menu, .navbar, .nav-item, .toast, .skeleton-card, .form-group input, .form-group select, .form-group textarea, .autocomplete-items, .import-logs, .page-jump input {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: 'Plus Jakarta Sans','Microsoft YaHei',-apple-system,sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-navbar);
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* 品牌区域 */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-navbar);
    flex-shrink: 0;
}

.navbar-brand .logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 16px;
}

.navbar-brand .logo svg {
    width: 18px;
    height: 18px;
}

/* 导航链接容器 */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

/* 单个导航项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-nav-item);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    white-space: nowrap;
}

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

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-nav-item-active);
    font-weight: 500;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 用户区域 */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-nav-item);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.navbar-user:hover {
    background: var(--bg-hover);
}

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

/* 用户下拉菜单 */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 52px;
    right: 24px;
    background: var(--bg-dropdown);
    border-radius: 10px;
    min-width: 140px;
    box-shadow: var(--shadow-dropdown);
    z-index: 200;
    overflow: hidden;
    border: 1px solid var(--border-dropdown);
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-nav-item-hover);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.user-dropdown-menu a:hover {
    background: var(--bg-dropdown-hover);
    color: var(--text-navbar);
}

.user-dropdown-menu a.danger {
    color: var(--danger);
}

.user-dropdown-menu a.danger:hover {
    background: var(--danger-light);
    color: var(--text-danger-hover);
}

/* 移动端汉堡菜单按钮 */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-nav-item); margin: 5px 0; transition: all 0.3s; border-radius: 2px; }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }



/* ==================== 主容器 ==================== */
.container { max-width: 1280px; margin: 0 auto; padding: 28px 32px; }

/* ==================== 页面头部 ==================== */
.page-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border); position: relative; }
.page-title { font-size: var(--text-2xl); font-weight: 800; color: var(--text-page-title); letter-spacing: -0.02em; line-height: var(--leading-tight); }
.page-subtitle { color: var(--text-muted); font-size: var(--text-sm); margin-top: 4px; line-height: var(--leading-normal); }

/* ==================== 工具栏 ==================== */
.toolbar { background: var(--card); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.filter-section { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-input { padding: 8px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: var(--text-sm); width: 160px; transition: all 0.2s; background: var(--bg); color: var(--text-primary); }
.filter-input:focus { outline: none; border-color: var(--primary); background: var(--bg-input-focus); box-shadow: 0 0 0 3px var(--accent-focus-ring); }
.filter-input::placeholder { color: var(--text-muted); }

/* ==================== 按钮 ==================== */
.btn { padding: 8px 16px; border: none; border-radius: var(--radius); cursor: pointer; font-size: var(--text-sm); font-weight: 600; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); display: inline-flex; align-items: center; gap: 6px; position: relative; overflow: hidden; }
.btn:active { transform: scale(0.98); transition-duration: 0.1s; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--primary); color: var(--text-white); box-shadow: 0 2px 8px var(--accent-glow); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 12px var(--accent-glow-strong); transform: translateY(-2px) scale(1.02); }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 70%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.btn-primary:hover::after { opacity: 1; }
.btn-lg { padding: 10px 20px; font-size: var(--text-base); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border-light); border-color: var(--text-muted); }
.btn-success { background: var(--success); color: var(--text-white); box-shadow: 0 2px 8px var(--success-glow); }
.btn-success:hover:not(:disabled) { background: var(--success-hover); box-shadow: 0 4px 12px var(--success-glow-strong); transform: translateY(-2px) scale(1.02); }
.btn-warning { background: var(--warning); color: var(--text-white); box-shadow: 0 2px 8px var(--warning-glow); }
.btn-warning:hover:not(:disabled) { background: var(--warning-hover); box-shadow: 0 4px 12px var(--warning-glow-strong); transform: translateY(-2px) scale(1.02); }
.btn-danger { background: var(--danger); color: var(--text-white); box-shadow: 0 2px 8px var(--danger-glow); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); box-shadow: 0 4px 12px var(--danger-glow-strong); transform: translateY(-2px) scale(1.02); }
.btn-info { background: var(--info); color: var(--text-white); box-shadow: 0 2px 8px var(--info-glow); }
.btn-info:hover:not(:disabled) { background: var(--info-hover); box-shadow: 0 4px 12px var(--info-glow-strong); transform: translateY(-2px) scale(1.02); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ==================== 表格容器 ==================== */
.table-container { background: var(--card); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); border: 1px solid var(--border); position: relative; }
.table-container::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; width: 40px;
    background: linear-gradient(to left, var(--card), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.table-container.is-scrollable::after { opacity: 1; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { padding: 12px 14px; text-align: center; white-space: nowrap; }
th { background: var(--bg-input); font-weight: 600; color: var(--text-muted); font-size: var(--text-xs); letter-spacing: 0.3px; text-transform: uppercase; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
td { border-bottom: 1px solid var(--border-light); color: var(--text-secondary); font-size: var(--text-base); }
tr { transition: background-color 0.2s ease; }
tr:hover td { background: rgba(91, 95, 240, 0.03); }
tr:last-child td { border-bottom: none; }

/* ==================== 状态标签 ==================== */
.status-tag { padding: 4px 12px; border-radius: 20px; font-size: var(--text-xs); font-weight: 600; display: inline-block; letter-spacing: 0.3px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }
.status-idle { background: var(--success-light); color: var(--text-success); box-shadow: 0 0 12px var(--success-glow); }
.status-rented { background: var(--warning-light); color: var(--text-warning); }
.status-scrapped { background: var(--bg-primary); color: var(--text-scrapped); }
.status-success { background: var(--success-light); color: var(--text-success); box-shadow: 0 0 12px var(--success-glow); }
.status-change { background: var(--info-light); color: var(--text-change); }
.row-idle td { background: transparent !important; }
.row-idle td:first-child { box-shadow: inset 4px 0 0 var(--success); background: var(--row-idle-tint) !important; }
.action-delete { color: var(--text-action-delete); font-weight: 600; }
.action-add { color: var(--text-action-add); font-weight: 600; }
.action-edit { color: var(--text-action-edit); font-weight: 600; }
.detail-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-cell:hover { white-space: normal; word-break: break-all; }

/* ==================== 分页 ==================== */
.pagination { display: flex; justify-content: center; align-items: center; margin: 24px 0; gap: 6px; }
.pagination button { padding: 8px 12px; border: 1px solid var(--border); background: var(--card); cursor: pointer; border-radius: 8px; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.pagination button:not(:disabled):hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); transform: translateY(-1px); }
.pagination button.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: var(--text-white); border-color: transparent; box-shadow: 0 4px 12px var(--accent-glow); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { color: var(--text-muted); font-size: var(--text-sm); margin-left: 16px; }
.page-dots { color: var(--text-muted); font-size: var(--text-sm); padding: 8px 4px; }
.page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-size: var(--text-sm); color: var(--text-muted); }
.page-jump input { width: 50px; padding: 6px 8px; border: 1.5px solid var(--border); border-radius: 6px; font-size: var(--text-sm); text-align: center; color: var(--text-primary); background: var(--bg-input); }
.page-jump input:focus { outline: none; border-color: var(--primary); background: var(--bg-input-focus); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: var(--bg-modal-overlay);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#confirmModal {
    z-index: 10000;
}
.modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-content {
    background: var(--card);
    margin: 3% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 760px;
    max-height: 94vh;
    overflow-y: auto;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.1) inset,
        var(--shadow-modal);
    border: 1px solid var(--border-modal);
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.modal-header { padding: 24px 28px; border-bottom: none; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.modal-title-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-white); }
.modal-title-icon svg { width: 18px; height: 18px; }
.close { color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 8px 12px; border-radius: 10px; transition: all 0.2s; background: var(--bg); border: none; }
.close:hover { color: var(--text-primary); background: var(--border-light); }
.modal-body { padding: 0 28px 28px; }
.form-section { background: var(--bg-form-section); border-radius: 14px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border-light); }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.form-section-title::before { content: ''; width: 4px; height: 16px; background: linear-gradient(180deg, var(--primary), var(--primary-light)); border-radius: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; }
.required { color: var(--danger); margin-left: 2px; }
.form-group input, .form-group select, .form-group textarea { padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; transition: all 0.2s; background: var(--bg-input); color: var(--text-primary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--accent-focus-ring); background: var(--bg-input-focus); }
.form-group input.error, .form-group select.error { border-color: var(--danger); background: var(--bg-error); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 12px; background: transparent; border-radius: 0 0 20px 20px; }

/* ==================== 确认对话框 ==================== */
.confirm-dialog { text-align: center; padding: 20px; }
.confirm-dialog .confirm-icon { width: 52px; height: 52px; margin: 0 auto 16px; color: var(--warning); display: flex; align-items: center; justify-content: center; background: var(--warning-light); border-radius: 50%; }
.confirm-dialog .confirm-icon svg { width: 28px; height: 28px; }
.confirm-dialog .confirm-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.confirm-dialog .confirm-message { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.confirm-dialog .confirm-buttons { display: flex; justify-content: center; gap: 12px; }

/* ==================== Toast 容器 ==================== */
#toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 10px;
    box-shadow: var(--shadow-toast);
    animation: slideIn 0.3s ease;
    min-width: 280px; max-width: 400px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.toast-icon svg { width: 20px; height: 20px; }
.toast-message { flex: 1; font-size: 14px; font-weight: 500; }
.toast-close { background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer; font-size: 18px; padding: 0 4px; transition: opacity 0.2s; }
.toast-close:hover { opacity: 1; }
.toast-success { background: var(--bg-toast-success); color: var(--text-white); }
.toast-error { background: var(--bg-toast-error); color: var(--text-white); }
.toast-warning { background: var(--bg-toast-warning); color: var(--text-white); }
.toast-info { background: var(--bg-toast-info); color: var(--text-white); }

.daily-todo-reminder {
    width: 380px;
    max-width: 100%;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--card);
    color: var(--text-primary);
    box-shadow: var(--shadow-toast);
    animation: slideIn 0.3s ease;
}

.daily-todo-reminder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.daily-todo-reminder-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
}

.daily-todo-reminder-title svg {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

.daily-todo-reminder-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.daily-todo-reminder-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.daily-todo-reminder-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.daily-todo-reminder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.daily-todo-reminder-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--bg-input);
}

.daily-todo-reminder-time {
    color: var(--warning-hover);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.daily-todo-reminder-text {
    min-width: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.daily-todo-reminder-more {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.daily-todo-reminder-actions {
    display: flex;
    justify-content: flex-end;
}

.daily-todo-reminder-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
}

.daily-todo-reminder-link:hover {
    background: var(--primary);
    color: var(--text-white);
}

.daily-todo-reminder-inline {
    width: 100%;
    max-width: none;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.6fr) auto;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.25s ease;
}

.daily-todo-reminder-inline .daily-todo-reminder-head,
.daily-todo-reminder-inline .daily-todo-reminder-list,
.daily-todo-reminder-inline .daily-todo-reminder-more {
    margin: 0;
}

.daily-todo-reminder-inline .daily-todo-reminder-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.daily-todo-reminder-inline .daily-todo-reminder-actions {
    justify-content: flex-end;
}

/* ==================== 加载状态 ==================== */
.loading-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-loading-overlay); backdrop-filter: blur(4px); z-index: 9998; justify-content: center; align-items: center; flex-direction: column; }
.loading-overlay.active { display: flex; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 12px; color: var(--text-secondary); font-size: 14px; }

/* ==================== 空状态 ==================== */
.empty-state { text-align: center; padding: 80px 20px; animation: fadeInUp 0.5s ease; }
.empty-state-icon { font-size: 48px; margin-bottom: 20px; opacity: 0.6; }
.empty-state-icon svg { width: 56px; height: 56px; color: var(--text-muted); opacity: 0.5; margin-bottom: 20px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-state-desc { font-size: 14px; color: var(--text-muted); }

/* ==================== Focus 状态 ==================== */
*:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-focus-ring); border-radius: inherit; }
.btn:focus-visible, .filter-input:focus-visible { outline-offset: 1px; }

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .navbar-nav { gap: 2px; }
    .nav-item { padding: 6px 10px; font-size: 13px; }
    .nav-item svg { width: 16px; height: 16px; }
}
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .navbar-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        height: auto;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        background: var(--bg-mobile-menu);
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 4px;
        box-shadow: var(--shadow-mobile-menu);
        border-bottom: 1px solid var(--border-navbar);
        z-index: 150;
    }
    .navbar-nav.show { display: flex; }
    .nav-item { padding: 12px 16px; border-radius: 8px; width: 100%; }
    .navbar-user span { display: none; }
    .navbar-user svg { display: none; }
    .container { padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .filter-section { flex-wrap: wrap; }
    .filter-input { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    table { font-size: 12px; }
    th, td { padding: 10px 8px; }
    #toast-container { left: 16px; right: 16px; }
    .toast { min-width: auto; max-width: none; }
    .daily-todo-reminder { width: auto; }
    .daily-todo-reminder-inline {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .daily-todo-reminder-item { grid-template-columns: 56px minmax(0, 1fr); }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 12px; }
    .stat-hint { display: none; }
}

@media (max-width: 1200px) {
    .filter-section { flex-wrap: wrap; }
    table { font-size: 12px; }
    th, td { padding: 10px 8px; }
}

/* ==================== 页面级联入场动画 ==================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.container > * {
    animation: fadeInUp 0.5s ease backwards;
}
.container > *:nth-child(1) { animation-delay: 0.05s; }
.container > *:nth-child(2) { animation-delay: 0.1s; }
.container > *:nth-child(3) { animation-delay: 0.15s; }
.container > *:nth-child(4) { animation-delay: 0.2s; }
.container > *:nth-child(5) { animation-delay: 0.25s; }
.container > *:nth-child(6) { animation-delay: 0.3s; }

/* ==================== 表格行丝滑动画 ==================== */

/* 表格行依次淡入 */
#tableBody tr {
    animation: fadeInUp 0.25s ease forwards;
    animation-delay: calc(var(--row-index, 0) * 0.02s);
    opacity: 0; /* 初始隐藏，动画后显示 */
}

/* 为每行设置动画延迟索引 */
#tableBody tr:nth-child(1)  { --row-index: 0;  }
#tableBody tr:nth-child(2)  { --row-index: 1;  }
#tableBody tr:nth-child(3)  { --row-index: 2;  }
#tableBody tr:nth-child(4)  { --row-index: 3;  }
#tableBody tr:nth-child(5)  { --row-index: 4;  }
#tableBody tr:nth-child(6)  { --row-index: 5;  }
#tableBody tr:nth-child(7)  { --row-index: 6;  }
#tableBody tr:nth-child(8)  { --row-index: 7;  }
#tableBody tr:nth-child(9)  { --row-index: 8;  }
#tableBody tr:nth-child(10) { --row-index: 9;  }
#tableBody tr:nth-child(n+11) { --row-index: 10; } /* 超过10行统一延迟 */

/* 表格整体过渡 */
#tableBody {
    transition: opacity 0.15s ease;
}

/* 空状态行无动画 */
#tableBody tr .empty-state {
    animation: none;
    opacity: 1;
}

/* 尊重用户动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    #tableBody tr {
        animation: none;
        opacity: 1;
        transform: none;
    }
    #tableBody {
        transition: none;
    }
}

/* ==================== 移动端导航遮罩 ==================== */
.nav-overlay { display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; background: var(--bg-nav-overlay); z-index: 99; }
.nav-overlay.show { display: block; }

.shortcut-grid { display: grid; gap: 12px; }
.shortcut-item { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.shortcut-item kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; padding: 0 8px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 12px; font-weight: 600;
    color: var(--text-primary); font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-skeleton) 25%, var(--bg-skeleton-highlight) 50%, var(--bg-skeleton) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}
.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-card);
}
.skeleton-table-row td {
    background: none !important;
    border-bottom: 1px solid var(--border-light);
}
.skeleton-table-row td > .skeleton {
    height: 14px;
    width: 80%;
    margin: 0 auto;
}
[data-loading="false"] .skeleton-show { display: none; }
[data-loading="true"] .content-show { display: none; }

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-nav-item);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-nav-item-hover);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
}
