/**
 * TLBB 管理后台 - 现代化 UI 样式
 * 支持深色模式、玻璃拟态、微动画
 */

/* ========== CSS 变量 - 亮色主题 ========== */
:root {
    /* 主色调 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* 背景色 */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --bg-input: #ffffff;
    --bg-light: #f8fafc;
    
    /* 文字色 */
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* 边框 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* 玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(10px);
}

/* ========== 深色主题 ========== */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --primary-bg: rgba(129, 140, 248, 0.15);
    
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    --bg-input: #1e293b;
    --bg-light: #334155;
    
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border: #334155;
    --border-light: #1e293b;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(51, 65, 85, 0.5);
}

/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'TLBBFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-body);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ========== 玻璃拟态卡片 ========== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.panel:hover {
    box-shadow: var(--shadow);
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-title i {
    color: var(--primary);
    font-size: 18px;
}

/* ========== 渐变按钮 ========== */
.btn-fresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-fresh::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-fresh:hover::before {
    left: 100%;
}

.btn-fresh:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-fresh:active {
    transform: translateY(0);
}

.btn-fresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-fresh-block { width: 100%; }
.btn-fresh-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-fresh-lg { padding: 14px 28px; font-size: 16px; }

.btn-fresh-secondary {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-fresh-secondary:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow);
}

.btn-fresh-success { background: linear-gradient(135deg, var(--success) 0%, #059669 100%); }
.btn-fresh-warning { background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); }
.btn-fresh-danger { background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); }
.btn-fresh-rose { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }

/* ========== 输入框样式 ========== */
.input-fresh {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.3s;
}

.input-fresh:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.input-fresh::placeholder {
    color: var(--text-muted);
}

select.input-fresh {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ========== 统计卡片 ========== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card.blue::before { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.stat-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.rose::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.stat-card.cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.stat-card .icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card.blue .icon { background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #4f46e5; }
.stat-card.green .icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.stat-card.orange .icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.stat-card.rose .icon { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #e11d48; }
.stat-card.cyan .icon { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0891b2; }
.stat-card.purple .icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-card .label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-card .trend {
    font-size: 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ========== 表格样式 ========== */
.table-fresh {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-fresh th,
.table-fresh td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table-fresh th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-fresh tbody tr {
    transition: background-color 0.2s;
}

.table-fresh tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-fresh .text-center { text-align: center; }
.table-fresh .text-right { text-align: right; }
.table-fresh .text-muted { color: var(--text-muted); }

/* ========== 徽章样式 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.badge-secondary { background: var(--bg-light); color: var(--text-secondary); }
.badge-primary { background: var(--primary-bg); color: var(--primary); }

/* ========== 骨架屏加载 ========== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-card-hover) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 微动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-in { animation: slideIn 0.3s ease-out; }
.animate-scale-in { animation: scaleIn 0.2s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* 悬停动画 */
.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== 通知中心 ========== */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: var(--primary-bg);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.notification-desc {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.brand-text {
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
}

.brand-title { font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 11px; color: #94a3b8; }

/* 导航 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-group { margin-bottom: 8px; }

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar.collapsed .nav-group-title span { display: none; }

.nav-group-title:hover { color: #94a3b8; }
.nav-group-title i.fa-chevron-down { font-size: 10px; transition: transform 0.2s; }
.nav-group.open .nav-group-title i.fa-chevron-down { transform: rotate(180deg); }

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group.open .nav-group-items { max-height: 600px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 32px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.sidebar.collapsed .nav-item {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .nav-item span { display: none; }

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-left-color: var(--primary);
}

.nav-item i { width: 20px; text-align: center; font-size: 15px; }

.nav-item-single {
    padding-left: 20px;
    margin: 4px 12px;
    border-radius: 10px;
    border-left: none;
}

.nav-item-single.active {
    background: var(--primary);
    color: #fff;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-toggle {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}

.sidebar.collapsed .sidebar-toggle span { display: none; }

/* ========== 主内容区 ========== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-body);
    transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 72px;
}

/* 顶部栏 */
.top-bar {
    background: var(--bg-card);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--border); }

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    position: relative;
}

.top-bar-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

/* 页面内容 */
.page-content {
    padding: 24px;
}

/* ========== 快捷操作栏 ========== */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.quick-action-btn i {
    font-size: 14px;
}

/* ========== 进度条 ========== */
.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .sidebar { width: 72px; }
    .sidebar .brand-text,
    .sidebar .nav-group-title span,
    .sidebar .nav-item span,
    .sidebar .sidebar-toggle span { display: none; }
    .sidebar .nav-item { padding: 12px; justify-content: center; }
    .main-content { margin-left: 72px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stat-grid { grid-template-columns: 1fr; }
}

/* ========== 确认弹窗组件 ========== */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.confirm-dialog.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog-content {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.confirm-dialog.active .confirm-dialog-content {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
}

.confirm-icon.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.confirm-icon.danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
}

.confirm-icon.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}

.confirm-icon.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}

.confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons .btn-fresh {
    min-width: 100px;
}

/* ========== 数字滚动动画 ========== */
.count-up {
    display: inline-block;
}

/* ========== 加载按钮状态 ========== */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-fresh-secondary.btn-loading::after {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--text);
}

/* ========== 输入框焦点动画 ========== */
.input-fresh {
    position: relative;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ========== 卡片入场动画 ========== */
.panel, .stat-card, .chart-container {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 延迟动画 */
.panel:nth-child(2) { animation-delay: 0.1s; }
.panel:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ========== 表格行动画 ========== */
.table-fresh tbody tr {
    animation: fadeIn 0.3s ease-out;
}

.table-fresh tbody tr:nth-child(1) { animation-delay: 0s; }
.table-fresh tbody tr:nth-child(2) { animation-delay: 0.03s; }
.table-fresh tbody tr:nth-child(3) { animation-delay: 0.06s; }
.table-fresh tbody tr:nth-child(4) { animation-delay: 0.09s; }
.table-fresh tbody tr:nth-child(5) { animation-delay: 0.12s; }

/* ========== 工具提示 ========== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: var(--bg-sidebar);
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ========== 登录页样式 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 32px;
}

.login-input-group {
    margin-bottom: 20px;
}

.login-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 8px;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 15px;
    color: #fff;
    transition: all 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-input::placeholder {
    color: #64748b;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.login-alert.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--primary-light);
}

/* 登录页响应式 */
@media (max-width: 480px) {
    .login-card {
        margin: 20px;
        padding: 32px 24px;
    }
}
