/* 本文件由 scripts/split_css.py 从原 main.css 切分而来，级联顺序不变。 */
/* ---------- App Layout ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---------- Sidebar (Ultra Frosted Glass) ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: 
        var(--glass-reflection),
        linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.3) 100%);
    backdrop-filter: var(--glass-blur-ultra);
    -webkit-backdrop-filter: var(--glass-blur-ultra);
    border-right: 1px solid var(--glass-border);
    box-shadow: 
        1px 0 0 rgba(255, 255, 255, 0.6) inset,
        -1px 0 0 rgba(0, 0, 0, 0.03) inset,
        4px 0 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn span { display: none; }

/* 折叠时居中对齐 */
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: var(--space-5) 0; }
.sidebar.collapsed .sidebar-logo-img { margin: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: var(--space-3) 0; }
.sidebar.collapsed .nav-item i { margin: 0; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: var(--space-4) 0; }
.sidebar.collapsed .sidebar-footer-actions { justify-content: center; }
.sidebar.collapsed .shortcut-btn { justify-content: center; padding: var(--space-2) 0; }
.sidebar.collapsed .shortcut-btn i { margin: 0; }

.sidebar-logo {
    padding: var(--space-5) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-indigo));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.logo-subtitle { font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.5px; text-transform: uppercase; }

.sidebar-nav {
    flex: 1;
    padding: var(--space-3) var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.nav-item i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-item:hover {
    background: 
        linear-gradient(180deg, rgba(0,122,255,0.12) 0%, rgba(0,122,255,0.06) 100%);
    color: var(--apple-blue);
    border-color: rgba(0,122,255,0.15);
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.5) inset,
        0 2px 8px rgba(0,122,255,0.08);
}

.nav-item.active {
    background: 
        linear-gradient(180deg, rgba(0,122,255,0.18) 0%, rgba(0,122,255,0.1) 100%);
    color: var(--apple-blue);
    font-weight: 600;
    border-color: rgba(0,122,255,0.25);
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.6) inset,
        0 2px 12px rgba(0,122,255,0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, var(--apple-blue), var(--apple-indigo));
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(0,122,255,0.4);
}

.sidebar-footer {
    padding: 4px var(--space-3);
    border-top: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: 
        linear-gradient(135deg, var(--apple-blue), var(--apple-indigo));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.3) inset,
        0 2px 8px rgba(0,122,255,0.25);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    pointer-events: none;
}

.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-tertiary); text-transform: capitalize; }

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.logout-btn:hover { background: rgba(255, 59, 48, 0.08); color: var(--apple-red); }

.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

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

.shortcut-btn:hover {
    background: var(--bg-hover);
    color: var(--apple-blue);
    transform: scale(1.05);
}

.sidebar.collapsed .shortcut-btn span { display: none; }

/* ---------- Main Wrapper ---------- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-collapsed); }

/* ---------- Topbar (Ultra Frosted Glass) ---------- */
.topbar {
    height: var(--topbar-height);
    background: 
        var(--glass-highlight),
        linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.35) 100%);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 -1px 0 rgba(0, 0, 0, 0.03) inset,
        0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.topbar-left { display: flex; align-items: center; gap: var(--space-4); }

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }

.topbar-right { display: flex; align-items: center; gap: var(--space-4); }

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search i {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    font-size: 16px;
    pointer-events: none;
}

.header-search input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.header-search input:focus {
    width: 300px;
    border-color: var(--apple-blue);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg-heavy);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
}

.search-results.show { display: block; }
.search-result-item { padding: 10px 14px; cursor: pointer; transition: background var(--transition-fast); }
.search-result-item:hover { background: rgba(0, 122, 255, 0.08); }

.lang-switch { 
    display: flex; 
    gap: 2px; 
    background: 
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.25) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3px; 
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: 0 1px 2px rgba(255,255,255,0.4) inset;
}
.lang-btn {
    padding: 4px 10px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.lang-btn:hover { 
    color: var(--text-primary); 
    background: rgba(255,255,255,0.4);
}
.lang-btn.active { 
    background: 
        linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%);
    color: var(--apple-blue); 
    border-color: var(--glass-border);
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.6) inset,
        0 2px 6px rgba(0,0,0,0.06);
}

.notification-bell {
    position: relative;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition-fast);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.notification-bell:hover {
    background: rgba(255,255,255,0.4);
    border-color: var(--glass-border);
    color: var(--text-primary);
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.5) inset,
        0 2px 8px rgba(0,0,0,0.06);
}
.notification-bell:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    background: var(--apple-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: 
        var(--glass-reflection),
        linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.5) 100%);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-lg);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: 
        0 1px 2px rgba(255,255,255,0.8) inset,
        0 20px 60px rgba(0,0,0,0.15),
        0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
}
.notif-panel.show { display: block; animation: notifPanelIn 0.25s var(--ios27-spring, ease-out); }
@keyframes notifPanelIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(0,122,255,0.04) 0%, transparent 100%);
}
.notif-header-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.notif-header-actions { display: flex; align-items: center; gap: 6px; }
.notif-action-btn {
    font-size: 11px; padding: 4px 10px; border: none; border-radius: 8px;
    background: rgba(0,122,255,0.1); color: #007AFF; cursor: pointer;
    font-weight: 600; transition: all 0.15s ease;
}
.notif-action-btn:hover { background: rgba(0,122,255,0.18); }
.notif-action-btn:active { transform: scale(0.95); }
.notif-close-btn {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0; font-size: 14px;
    background: rgba(0,0,0,0.05); color: var(--text-secondary);
}
.notif-close-btn:hover { background: rgba(0,0,0,0.1); color: var(--text-primary); }
.notif-empty { text-align: center; padding: 32px 16px !important; }
.notif-empty .notif-message { color: var(--text-tertiary); font-size: 13px; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition-fast); }
.notif-item:hover { background: rgba(0, 122, 255, 0.05); }
.notif-item.unread { background: rgba(0, 122, 255, 0.04); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-message { font-size: 12px; color: var(--text-secondary); }
.notif-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ---------- Page Content ---------- */
.page-content {
    flex: 1;
    padding: var(--space-6);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

