/* ============================================================
   AI数字人视频创作平台 — 华天风格亮色主题设计系统
   ============================================================ */

/* ==========================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================== */
:root {
    /* 主色 - 珊瑚橙红 */
    --accent: #FF6B4A;
    --accent-hover: #E55A3A;
    --accent-light: #FFF0ED;
    --accent-gradient: linear-gradient(135deg, #FF6B4A, #FF8E6B);

    /* 背景色 */
    --bg-page: #F7F8FA;
    --bg-white: #FFFFFF;
    --bg-hover: #F2F3F5;
    --bg-active: #FFF0ED;

    /* 文字色 */
    --text-primary: #1F1F1F;
    --text-secondary: #4E5969;
    --text-muted: #86909C;
    --text-placeholder: #C9CDD4;

    /* 边框 */
    --border: #E5E6EB;
    --border-light: #F2F3F5;

    /* 语义色 */
    --color-success: #00B42A;
    --color-success-bg: #E8FFEA;
    --color-warning: #FF7D00;
    --color-warning-bg: #FFF7E8;
    --color-danger: #F53F3F;
    --color-danger-bg: #FFECE8;
    --color-info: #165DFF;
    --color-info-bg: #E8F3FF;

    /* 字体 */
    --font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

    /* 字号 */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 36px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(255,107,74,0.12);

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* 布局 */
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --topbar-height: 60px;
    --max-content: 1400px;

    /* 过渡 */
    --transition: all 0.2s ease;
}

/* ==========================================================
   2. Global Reset & Base
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ==========================================================
   3. Sidebar (华天风格左侧导航)
   ========================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s ease;
}

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

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.sidebar-logo .logo-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    text-decoration: none;
}

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

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

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

.nav-item .nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    border-radius: var(--radius-full);
}

.nav-section {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: 16px 16px 8px;
    font-weight: 500;
}

/* 可折叠菜单组 */
.nav-section-toggle {
    font-weight: 700 !important;
    color: var(--text-secondary, #4e5969) !important;
    transition: color 0.2s, background 0.2s;
}
.nav-section-toggle:hover {
    color: var(--accent, #FF6B4A) !important;
    background: var(--bg-hover, #f2f3f5);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

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

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ==========================================================
   4. Main Content Area
   ========================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.topbar-left > a {
    flex-shrink: 0;
}

.topbar-left h5 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.topbar-btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.topbar-btn-primary:hover {
    background: var(--accent-hover);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
}

.page-content {
    flex: 1;
    padding: 24px;
    max-width: var(--max-content);
    margin: 0 auto;
    width: 100%;
}

/* ==========================================================
   5. Buttons
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-hover);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--text-lg);
}

.btn-block {
    width: 100%;
}

.btn-gradient {
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
}

.btn-gradient:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-hover);
}

/* ==========================================================
   6. Cards
   ========================================================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* ==========================================================
   7. Forms
   ========================================================== */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,74,0.1);
}

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

.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--accent);
}

.sms-row {
    display: flex;
    gap: 10px;
}

.sms-row .form-control { flex: 1; }

.sms-btn {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.sms-btn:hover {
    background: var(--accent-light);
}

.sms-btn:disabled {
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.country-select {
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    outline: none;
    min-width: 120px;
    cursor: pointer;
}

/* ==========================================================
   8. Tabs
   ========================================================== */
.tab-switch {
    display: flex;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
}

.tab-switch button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.tab-switch button.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.tab-nav-item {
    padding: 12px 0;
    font-size: var(--text-base);
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-nav-item:hover { color: var(--text-primary); }

.tab-nav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}

/* Filter chips */
.filter-chips,
.duration-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.chip {
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--accent);
}

.chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .3s;
    border-radius: 50%;
}

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

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

/* ==========================================================
   9. Modal (华天风格登录弹窗)
   ========================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    display: flex;
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

/* Login modal split layout */
.modal-left {
    width: 400px;
    background: linear-gradient(135deg, #FFF5F3, #FFE8E3);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-left .avatar-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.modal-left .avatar-item {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.modal-left .avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-left .tagline {
    text-align: center;
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-left .sub-tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.modal-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-right h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-right .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: var(--text-base);
}

/* ==========================================================
   10. Status Badges
   ========================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.status-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.status-processing { background: var(--color-info-bg); color: var(--color-info); }
.status-completed { background: var(--color-success-bg); color: var(--color-success); }
.status-failed { background: var(--color-danger-bg); color: var(--color-danger); }

.status-0 { background: var(--color-warning-bg); color: var(--color-warning); }
.status-1 { background: var(--color-info-bg); color: var(--color-info); }
.status-2 { background: var(--color-success-bg); color: var(--color-success); }
.status-3 { background: var(--color-danger-bg); color: var(--color-danger); }

/* ==========================================================
   11. Progress Bar
   ========================================================== */
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================
   12. Grids
   ========================================================== */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.creations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ==========================================================
   13. Hero Section (Landing)
   ========================================================== */
.hero {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(180deg, #FFF5F3 0%, var(--bg-page) 100%);
}

.hero h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--accent-light);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--accent);
    margin-bottom: 20px;
}

/* ==========================================================
   14. Feature Cards
   ========================================================== */
.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================
   15. Price Cards
   ========================================================== */
.price-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}

.price-card.featured {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.price-card h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: 8px;
}

.price {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent);
}

.price span {
    font-size: var(--text-base);
    color: var(--text-muted);
    font-weight: normal;
}

.price-features {
    list-style: none;
    margin: 24px 0;
    text-align: left;
}

.price-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-features li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
}

/* ==========================================================
   16. Avatar Card
   ========================================================== */
.avatar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.avatar-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.avatar-card .avatar-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-card .avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-card .avatar-info {
    padding: 12px;
}

.avatar-card .avatar-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-card .avatar-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================
   17. Order/Creation Card
   ========================================================== */
.creation-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.creation-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.creation-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.creation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creation-info {
    padding: 12px 16px;
}

.creation-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.creation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ==========================================================
   18. Toast Notifications
   ========================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast-item.success { background: var(--color-success); }
.toast-item.error { background: var(--color-danger); }
.toast-item.warning { background: var(--color-warning); }
.toast-item.info { background: var(--color-info); }

/* ==========================================================
   19. Empty State
   ========================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: var(--text-base);
}

/* ==========================================================
   20. Spinner
   ========================================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
   21. Landing Page (Pre-login)
   ========================================================== */
.landing { display: block; }
.landing.hidden { display: none; }
.dashboard { display: none; }
.dashboard.active { display: block; }

/* Landing navbar */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

.landing-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.landing-nav .brand .brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.landing-nav .nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.landing-nav .nav-links a {
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
}

.landing-nav .nav-links a:hover { color: var(--text-primary); }

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

/* ==========================================================
   22. Section
   ========================================================== */
.section {
    padding: 60px 24px;
}

.section-title {
    text-align: center;
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ==========================================================
   23. Footer
   ========================================================== */
.footer {
    border-top: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
    background: var(--bg-white);
}

/* ==========================================================
   24. Animations
   ========================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ==========================================================
   25. Utilities
   ========================================================== */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ==========================================================
   26. Responsive
   ========================================================== */
@media (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .nav-section,
    .sidebar .user-info,
    .sidebar .nav-badge { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 12px; }
    .sidebar .sidebar-logo { justify-content: center; padding: 16px; }
    .sidebar .sidebar-user { justify-content: center; }
    .main-wrapper { margin-left: var(--sidebar-collapsed); }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-wrapper { margin-left: 0; }

    .topbar { padding: 0 10px; height: 48px; gap: 4px; }
    .topbar-left { gap: 4px; overflow: hidden; }
    .topbar-left > a { padding: 4px; }
    .topbar-left h5 { font-size: 14px; }
    .topbar-right { gap: 6px; }
    .topbar-right .topbar-btn { padding: 5px 8px; font-size: 12px; }

    .modal {
        flex-direction: column;
        max-width: 100%;
        margin: 16px;
        max-height: 90vh;
    }

    .modal-left { width: 100%; padding: 24px; }
    .modal-left .avatar-wall { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .modal-left .avatar-item { width: 60px; height: 60px; }
    .modal-right { padding: 24px; }

    .hero h1 { font-size: var(--text-2xl); }

    .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--bg-white);
        border-top: 1px solid var(--border-light);
        padding: 8px 0;
        z-index: 100;
    }

    .page-content { padding-bottom: 80px; }
}

.mobile-nav {
    display: none;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item i { font-size: 18px; }

/* ==========================================================
   27. Dropdown
   ========================================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 200;
    display: none;
}

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

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: var(--transition);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

/* ==========================================================
   28. Language Switch
   ========================================================== */
.lang-switch {
    padding: 6px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--transition);
}

.lang-switch:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================
   29. Table
   ========================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.data-table tr:hover td {
    background: var(--bg-page);
}

/* ==========================================================
   30. Video Player
   ========================================================== */
.video-player {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

.video-player video {
    width: 100%;
    display: block;
}

/* ==========================================================
   31. Audio Player
   ========================================================== */
.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-page);
    border-radius: var(--radius-lg);
}

.audio-player .play-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.audio-player .play-btn:hover {
    background: var(--accent-hover);
}

/* ==========================================================
   32. Tag
   ========================================================== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.tag-blue { background: var(--color-info-bg); color: var(--color-info); }
.tag-green { background: var(--color-success-bg); color: var(--color-success); }
.tag-orange { background: var(--color-warning-bg); color: var(--color-warning); }
.tag-red { background: var(--color-danger-bg); color: var(--color-danger); }
.tag-gray { background: var(--bg-page); color: var(--text-muted); }
