:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --secondary: #10B981;
    --accent: #F59E0B;
    --highlight: #3B82F6;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --warning: #F59E0B;
    --success: #10B981;
    --info: #0EA5E9;

    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-section: #F1F5F9;
    --bg-hover: #F1F5F9;
    --bg-input: #FFFFFF;
    --bg-sidebar: #FFFFFF;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #CBD5E1;
    --text-white: #FFFFFF;

    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-input: #CBD5E1;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;

    --transition: all 0.15s ease;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-main: 'PingFang SC', -apple-system, 'MiSans', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-code: 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============ Sidebar ============ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar.collapsed .sidebar-brand h5 span,
.sidebar.collapsed .sidebar-brand small,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer .storage-info,
.sidebar.collapsed .sidebar-footer .overflow-hidden {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-brand { padding: 1.5rem 0.75rem; text-align: center; }
.sidebar.collapsed .sidebar-brand h5 { font-size: 0; }
.sidebar.collapsed .sidebar-brand h5 i { font-size: 1.25rem; margin: 0; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 0.75rem; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 1.1rem; }
.sidebar.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

.sidebar-brand h5 i { color: var(--primary); }

.sidebar-brand small { color: var(--text-muted); font-size: 0.75rem; }

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.sidebar-collapse-btn i { transition: var(--transition-smooth); font-size: 0.75rem; }

.sidebar .nav { flex: 1; padding: 0.75rem; overflow-y: auto; }

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius);
    margin-bottom: 2px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    position: relative;
}

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

.sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.sidebar .nav-link:hover i { color: var(--text-secondary); }
.sidebar .nav-link.active i { color: var(--primary); }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition-smooth);
}

/* ============ Main Content ============ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background: var(--bg-page);
    transition: var(--transition-smooth);
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(248, 250, 252, 0.92);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    backdrop-filter: blur(12px);
}

.content { padding: 1rem 1.25rem; min-height: calc(100vh - 60px); }

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

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

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-body { padding: 1rem; }

/* ============ Buttons ============ */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

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

.btn-outline-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-input);
    color: var(--text-primary);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.btn-outline-warning { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-warning:hover { background: #FFFBEB; border-color: #FCD34D; color: #B45309; }
.btn-outline-success { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-success:hover { background: #ECFDF5; border-color: #6EE7B7; color: #047857; }
.btn-outline-danger { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-danger:hover { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }
.btn-outline-info { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-info:hover { background: #F0F9FF; border-color: #7DD3FC; color: #0369A1; }

.btn-light { background: var(--bg-section); border-color: transparent; color: var(--text-secondary); }
.btn-light:hover { background: var(--border); color: var(--text-primary); }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ============ Forms ============ */
.form-control, .form-select {
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    padding: 0.5rem 0.875rem;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-label { font-weight: 500; color: var(--text-secondary); margin-bottom: 0.375rem; font-size: 0.875rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

.input-group-text {
    background: var(--bg-section);
    border: 1px solid var(--border-input);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============ Tables ============ */
.table { margin: 0; color: var(--text-primary); font-size: 0.875rem; }

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table-hover tbody tr { transition: var(--transition); }
.table-hover tbody tr:hover { background: var(--bg-section); }

/* ============ Badges ============ */
.badge { font-weight: 500; padding: 0.3em 0.6em; border-radius: var(--radius-sm); font-size: 0.75rem; }

/* ============ Progress ============ */
.progress {
    border-radius: 100px;
    height: 6px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar { border-radius: 100px; background: var(--primary); }

/* ============ Alerts ============ */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border-left: 3px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.alert-danger { border-left-color: var(--danger); background: var(--danger-light); }
.alert-success { border-left-color: var(--success); background: #ECFDF5; }
.alert-warning { border-left-color: var(--warning); background: #FFFBEB; }
.alert-info { border-left-color: var(--info); background: #F0F9FF; }

/* ============ Modals ============ */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.modal-body { padding: 1.5rem; color: var(--text-primary); }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

/* ============ Dropdown ============ */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    z-index: 1050;
    background: var(--bg-card);
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dropdown-item:hover { background: var(--bg-section); color: var(--text-primary); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { border-color: var(--border-light); }

/* ============ Breadcrumb ============ */
.breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 0.875rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============ Search ============ */
.search-form .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
    background: var(--bg-card);
}

.search-form .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-color: var(--border-input);
}

/* ============ Storage Info ============ */
.storage-info .progress { margin: 0.5rem 0; }

/* ============ Avatar ============ */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
}

/* ============ Stat Card ============ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.125rem;
    transition: var(--transition);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-card p { color: var(--text-muted); font-size: 0.8rem; margin: 0; }

.stat-card.border-primary::before { background: #3B82F6; }
.stat-card.border-success::before { background: #10B981; }
.stat-card.border-warning::before { background: #F59E0B; }
.stat-card.border-info::before { background: #0EA5E9; }

/* ============ File Item ============ */
.file-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-item:hover {
    border-color: var(--border-input);
    box-shadow: var(--shadow);
}

/* ============ Category Card ============ */
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
}

.category-card i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-bounce);
}

.category-card:hover i { transform: scale(1.1); }
.category-card h6 { font-weight: 600; margin: 0; color: var(--text-primary); font-size: 0.875rem; }
.category-card small { color: var(--text-muted); font-size: 0.75rem; }

/* ============ Empty State ============ */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 0.75rem; color: var(--border); }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ============ Preview ============ */
.preview-container {
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img { max-width: 100%; max-height: 500px; border-radius: var(--radius); }
.preview-container video, .preview-container audio { max-width: 100%; }

.preview-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* ============ Code Block ============ */
pre {
    background: #F8FAFC;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

pre code {
    color: inherit;
    font-family: var(--font-code);
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

code {
    background: var(--bg-section);
    color: var(--primary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.8125em;
}

/* ============ Word Content ============ */
.word-content p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.word-content h1, .word-content h2, .word-content h3,
.word-content h4, .word-content h5, .word-content h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.word-content h1 { font-size: 1.5rem; }
.word-content h2 { font-size: 1.3rem; }
.word-content h3 { font-size: 1.15rem; }

/* ============ Auth Pages ============ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-header {
    padding: 2rem;
    text-align: center;
    background: var(--primary);
    color: var(--text-white);
}

.auth-header i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

.auth-header h4 { font-weight: 700; margin: 0; font-size: 1.125rem; }
.auth-header small { opacity: 0.75; font-size: 0.8125rem; }

.auth-body { padding: 1.5rem; }

.auth-body .input-group:focus-within .input-group-text {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transition: var(--transition);
}

.auth-body .input-group:focus-within .form-control { border-color: var(--primary); }

/* ============ Landing Page ============ */
.landing-nav {
    background: var(--bg-card);
    padding: 0.75rem 0;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.landing-nav .navbar-brand { color: var(--text-primary) !important; font-weight: 700; }
.landing-nav .navbar-brand i { color: var(--primary); }
.landing-nav .nav-link { color: var(--text-secondary) !important; font-weight: 500; font-size: 0.9rem; }
.landing-nav .nav-link:hover { color: var(--primary) !important; }

.hero-section {
    padding: 72px 0 56px;
    background: var(--bg-card);
    position: relative;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 480px;
    line-height: 1.7;
}

.feature-section { padding: 72px 0; background: var(--bg-card); }

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
}

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

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.feature-card h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; font-size: 1rem; }
.feature-card p { color: var(--text-muted); margin: 0; line-height: 1.65; font-size: 0.875rem; }

.stats-section { padding: 72px 0; background: var(--bg-section); }
.stats-section h3 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.375rem; color: var(--text-primary); }
.stats-section p { color: var(--text-muted); margin: 0; }

.cta-section { padding: 72px 0; background: var(--bg-card); }
.footer { padding: 1.5rem 0; background: var(--bg-section); color: var(--text-muted); font-size: 0.8125rem; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: none;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 0 100vmax rgba(0,0,0,0.4);
    }
    .main-content { margin-left: 0; }
    .content { padding: 0.875rem; }
    .top-bar { padding: 0.625rem 0.875rem; }

    .card { border-radius: var(--radius); }
    .card-body { padding: 0.875rem; }
    .card-header { padding: 0.75rem 0.875rem; }

    .btn { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
    .btn-sm { padding: 0.375rem 0.625rem; font-size: 0.75rem; }

    .table td, .table th { padding: 0.625rem 0.75rem; font-size: 0.8125rem; }
    .table { font-size: 0.8125rem; }

    .stat-card { padding: 0.875rem; }
    .stat-card h3 { font-size: 1.25rem; }
    .stat-card p { font-size: 0.75rem; }
    .stat-card .stat-icon { width: 36px; height: 36px; font-size: 0.9rem; }

    .category-card { padding: 1rem; }
    .category-card i { font-size: 1.5rem; }

    .breadcrumb { font-size: 0.8125rem; }

    .modal-content { border-radius: var(--radius-lg); }
    .modal-body { padding: 1rem; }
    .modal-header { padding: 0.875rem 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }

    .dropdown-menu { font-size: 0.8125rem; }

    .form-control, .form-select { padding: 0.5rem 0.75rem; font-size: 0.875rem; }

    .hero-content h1 { font-size: 1.75rem; }
    .hero-content p { font-size: 0.9375rem; }
    .hero-section { padding: 48px 0 40px; }
    .feature-section, .stats-section, .cta-section { padding: 48px 0; }
    .feature-card { padding: 1.25rem; }
    .feature-card h5 { font-size: 0.9375rem; }
    .feature-card p { font-size: 0.8125rem; }
    .feature-icon { width: 40px; height: 40px; font-size: 1rem; }
    .stats-section h3 { font-size: 1.75rem; }

    .auth-card { max-width: 100%; border-radius: var(--radius-lg); }
    .auth-header { padding: 1.5rem; }
    .auth-header i { font-size: 2rem; }
    .auth-body { padding: 1.25rem; }

    .preview-container { min-height: 250px; }

    .album-card:hover { transform: none; }

    .toast-container { left: 1rem; right: 1rem; max-width: none; }
}

@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.25rem; }
}

/* ============ Animations ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ============ Scroll Animation Classes ============ */
.anim-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-on-scroll.anim-visible { opacity: 1; transform: translateY(0); }
.anim-on-scroll.anim-fade-up { transform: translateY(24px); }
.anim-on-scroll.anim-fade-down { transform: translateY(-24px); }
.anim-on-scroll.anim-fade-left { transform: translateX(-24px); }
.anim-on-scroll.anim-fade-right { transform: translateX(24px); }
.anim-on-scroll.anim-scale-in { transform: scale(0.95); }

.anim-on-scroll.anim-visible.anim-fade-up,
.anim-on-scroll.anim-visible.anim-fade-down,
.anim-on-scroll.anim-visible.anim-fade-left,
.anim-on-scroll.anim-visible.anim-fade-right,
.anim-on-scroll.anim-visible.anim-scale-in { transform: none; }

.anim-delay-1 { transition-delay: 0.08s; }
.anim-delay-2 { transition-delay: 0.16s; }
.anim-delay-3 { transition-delay: 0.24s; }
.anim-delay-4 { transition-delay: 0.32s; }
.anim-delay-5 { transition-delay: 0.4s; }
.anim-delay-6 { transition-delay: 0.48s; }

/* ============ Skeleton Loading ============ */
.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #CBD5E1 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-card { height: 100px; border-radius: var(--radius-lg); }

/* ============ Toast Notification System ============ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

.toast-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid;
    animation: slideInRight 0.25s ease forwards;
    transform: translateX(120%);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-item.toast-out { animation: slideOutRight 0.25s ease forwards; }
.toast-item.toast-success { border-left-color: var(--success); }
.toast-item.toast-success i { color: var(--success); }
.toast-item.toast-error { border-left-color: var(--danger); }
.toast-item.toast-error i { color: var(--danger); }
.toast-item.toast-info { border-left-color: var(--info); }
.toast-item.toast-info i { color: var(--info); }
.toast-item.toast-warning { border-left-color: var(--warning); }
.toast-item.toast-warning i { color: var(--warning); }
.toast-item .btn-close { margin-left: auto; padding: 0.25rem; }

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .anim-on-scroll { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ============ Drag Active State ============ */
#dropZone.drag-active {
    border-color: var(--primary);
    background: var(--primary-light) !important;
    transform: scale(1.005);
    transition: var(--transition-smooth);
}

#dropZone.drag-active i { animation: pulse 1s ease infinite; }

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ============ Nav Pills ============ */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
}

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

.nav-pills .nav-link.active {
    background: var(--primary);
    color: var(--text-white);
}

/* ============ List Group ============ */
.list-group-item {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.list-group-item:hover { background: var(--bg-section); }

/* ============ Tabs ============ */
.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border: none; border-bottom: 2px solid transparent; font-size: 0.875rem; }
.nav-tabs .nav-link:hover { color: var(--text-primary); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--primary); background: transparent; border-bottom-color: var(--primary); }

/* ============ Album Card ============ */
.album-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.album-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.album-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-section);
}

.album-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .album-img-wrapper img { transform: scale(1.03); }
