:root {
    --primary: #6366F1;
    --primary-light: #E0E7FF;
    --primary-dark: #4F46E5;
    --secondary: #EC4899;
    --accent: #F59E0B;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --star: #FBBF24;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-rgb: 255, 255, 255;
    --surface-2: #F1F5F9;
    --surface-3: #E2E8F0;
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --border: #E2E8F0;

    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
    --gradient-success: linear-gradient(135deg, #22C55E 0%, #10B981 100%);
    --gradient-warm: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    --gradient-cool: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);

    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-glow: 0 0 20px rgba(99,102,241,0.25);

    --radius: 20px;
    --radius-lg: 24px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tab-height: 64px;
}

[data-theme="dark"] {
    --primary: #818CF8;
    --primary-light: #312E81;
    --primary-dark: #A5B4FC;
    --secondary: #F472B6;
    --accent: #FBBF24;
    --success: #4ADE80;
    --warning: #FBBF24;
    --danger: #F87171;
    --star: #FCD34D;

    --bg: #0F172A;
    --surface: #1E293B;
    --surface-rgb: 30, 41, 59;
    --surface-2: #334155;
    --surface-3: #475569;
    --text: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --border: #334155;

    --gradient-primary: linear-gradient(135deg, #818CF8 0%, #A78BFA 50%, #F472B6 100%);
    --gradient-success: linear-gradient(135deg, #4ADE80 0%, #34D399 100%);
    --gradient-warm: linear-gradient(135deg, #FBBF24 0%, #FB923C 100%);
    --gradient-cool: linear-gradient(135deg, #22D3EE 0%, #60A5FA 100%);

    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 25px rgba(129,140,248,0.25);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    transition: background 0.3s, color 0.3s;
}

/* ===== Icons ===== */
.ph {
    font-size: 1.25em;
    vertical-align: middle;
    line-height: 1;
}

/* ===== Status Bar ===== */
.status-bar {
    height: 22px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s;
}

/* ===== Top Bar ===== */
.top-bar {
    background: var(--surface);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s, border 0.3s;
}
.top-bar-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}
.top-bar-back,
.top-bar-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--surface-2);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}
.top-bar-back:hover,
.top-bar-action:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}
.top-bar-back:active,
.top-bar-action:active { transform: scale(0.95); }

/* ===== Content ===== */
.content {
    padding: 20px 18px 28px;
}

/* ===== Loading Bar ===== */
.loading-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 3px;
    background: var(--surface-2);
    z-index: 999;
    display: none;
}
.loading-bar.active { display: block; }
.loading-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: 35%;
    background: var(--gradient-primary);
    animation: loadingSlide 0.9s infinite ease-in-out;
}
@keyframes loadingSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* ===== Bottom Tab Bar ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(var(--surface-rgb, 255,255,255), 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 6px 4px calc(6px + var(--safe-bottom));
    z-index: 100;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
    transition: background 0.3s, border 0.3s;
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    position: relative;
    border-radius: 14px;
    margin: 0 2px;
}
.tab-item .ph {
    font-size: 20px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-item:hover {
    background: var(--surface-2);
    color: var(--text-secondary);
}
.tab-item.active {
    color: var(--primary);
    transform: translateY(-3px);
    background: var(--primary-light);
}
.tab-item.active .ph { transform: scale(1.15); }
.tab-item.active::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 5px;
    height: 5px;
    background: var(--gradient-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    border: 1px solid var(--border);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-body { padding: 18px; }
.card-header {
    padding: 16px 18px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
}
.card-accent-top { border-top: 4px solid var(--primary); }
.card-gradient-top {
    border-top: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
    border-image-slice: 4 0 0 0;
}

/* ===== Project Cards ===== */
.project-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--border);
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.project-card:active { transform: scale(0.98); }
.project-card .card-body { padding: 16px; }
.project-card-cover {
    height: 120px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}
.project-card-cover .cover-icon {
    position: absolute;
    bottom: -10px;
    right: 10px;
    font-size: 80px;
    opacity: 0.25;
    color: #fff;
}
.project-card-cover .cover-type {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.project-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}
.project-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.project-card-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ===== Community ===== */
.community-header {
    text-align: center;
    padding: 8px 0 20px;
}
.community-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text);
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .community-title {
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
    }
}
.community-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
}
.filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 16px;
    margin-bottom: 8px;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.filter-pill.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    font-weight: 800;
    font-size: 15px;
    color: var(--text);
}
.section-header i { color: var(--primary); }
.section-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.my-posts-list { padding: 0 18px 18px; }
.my-post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.my-post-item:last-child { border-bottom: none; }
.my-post-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
}
.my-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.community-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: pointer;
    border: 1px solid var(--border);
}
.community-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.community-card:active { transform: scale(0.98); }
.community-card-cover {
    height: 170px;
    position: relative;
    overflow: hidden;
}
.community-card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.25) 0%, transparent 50%);
}
.community-card-cover .cover-icon {
    position: absolute;
    bottom: -15px;
    right: 15px;
    font-size: 100px;
    opacity: 0.3;
    color: #fff;
    z-index: 1;
}
.cover-type-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: white;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}
.community-card-body { padding: 18px; }
.community-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}
.author-avatar-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.author-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.author-meta {
    font-size: 11px;
    color: var(--text-tertiary);
}
.community-card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}
.community-card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}
.community-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.rating-block {
    display: flex;
    align-items: center;
    gap: 8px;
}
.score-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--star);
}
.rating-count {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
}
.stars-inline {
    display: inline-flex;
    gap: 1px;
    font-size: 14px;
}
.comment-block {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
}
.badge-cyan { background: rgba(6,182,212,0.12); color: #06B6D4; }
[data-theme="dark"] .badge-cyan { background: rgba(34,211,238,0.15); color: #22D3EE; }

/* ===== Empty States ===== */
.empty-state-card {
    text-align: center;
    padding: 48px 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.empty-illustration {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.illustration-frame {
    width: 100px;
    height: 100px;
    border-radius: 28px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 44px;
    position: relative;
    z-index: 1;
}
.illustration-sparkle {
    position: absolute;
    color: var(--accent);
    font-size: 18px;
    animation: sparkle 2s ease-in-out infinite;
}
.sparkle-1 { top: 0; right: -8px; animation-delay: 0s; }
.sparkle-2 { bottom: 8px; left: -6px; animation-delay: 1s; }
@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.3) rotate(15deg); opacity: 1; }
}
.empty-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== Home ===== */
.home-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    padding: 28px 20px;
    text-align: center;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    box-shadow: var(--shadow-md);
}
.home-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 40%);
    animation: waveMove 6s ease-in-out infinite;
}
.home-hero-bg::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
    animation: ripple 4s ease-out infinite;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes waveMove {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-10px) translateY(-5px); }
    50% { transform: translateX(10px) translateY(5px); }
    75% { transform: translateX(-5px) translateY(10px); }
}
@keyframes ripple {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}
.home-hero-content {
    position: relative;
    z-index: 1;
}
.home-avatar-wrap {
    position: relative;
    display: inline-flex;
    margin-bottom: 16px;
}
.home-avatar {
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-radius: 50%;
    overflow: hidden;
}
.home-avatar.avatar-img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 50%;
}
.home-streak-ring {
    position: absolute;
    bottom: -4px;
    right: -8px;
    background: var(--gradient-warm);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(245,158,11,0.35);
    animation: firePulse 2s ease-in-out infinite;
}
@keyframes firePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.home-user-info { color: white; }
.home-username {
    font-size: 22px;
    font-weight: 800;
    margin-top: 4px;
}
.badge-white {
    background: rgba(255,255,255,0.25);
    color: white;
    backdrop-filter: blur(4px);
}
.xp-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.xp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.xp-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 2px;
}
.xp-level {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}
.xp-tier {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}
.xp-value-wrap { text-align: right; }
.xp-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.xp-progress-wrap { margin-top: 10px; }
.xp-progress {
    height: 10px;
    background: var(--surface-2);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.xp-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 5px;
    transition: width 0.6s ease;
    position: relative;
}
.xp-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmer 2s infinite;
}
.xp-progress-text {
    text-align: right;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-weight: 600;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 8px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
}
.stat-card-icon.icon-xp { background: rgba(245,158,11,0.12); color: var(--accent); }
.stat-card-icon.icon-streak { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-card-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-card-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
}
.current-project-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
}
.current-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.current-project-tag {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.current-project-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}
.achievements-section {
    margin-bottom: 16px;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.achievement-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 6px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.2s;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.achievement-card:hover { transform: translateY(-3px); }
.achievement-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.achievement-card.locked { opacity: 0.7; }
.achievement-card.locked .achievement-card-icon {
    background: var(--surface-3);
    box-shadow: none;
}
.achievement-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}
.radar-section { margin-bottom: 16px; }
.radar-card-main {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}
.radar-card-main:hover { transform: translateY(-2px); }
.radar-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
}
.radar-summary-item {
    text-align: center;
    padding: 12px 6px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.radar-summary-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}
.radar-summary-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-top: 2px;
}

/* ===== Workspace ===== */
.workspace-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    padding: 24px 20px;
    text-align: center;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
}
.workspace-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 40%);
}
.workspace-hero-content {
    position: relative;
    z-index: 1;
}
.workspace-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}
.workspace-title {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    line-height: 1.4;
}
.workspace-progress-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.workspace-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.workspace-progress-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 4px;
}
.workspace-progress-count {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.workspace-progress-total {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 600;
}
.workspace-progress-score { text-align: right; }
.workspace-progress-bar { height: 12px; }
.workspace-progress-bar .progress-fill { background: var(--gradient-warm); }
.workspace-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.workspace-section-header {
    padding: 16px 18px;
    font-weight: 800;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.workspace-section-header i { color: var(--primary); }
.workspace-section-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 700;
    background: var(--surface-2);
    padding: 3px 10px;
    border-radius: 12px;
}
.workspace-section-body { padding: 8px 18px 18px; }
.workspace-criteria-group { margin-bottom: 18px; }
.workspace-criteria-group:last-child { margin-bottom: 0; }
.workspace-criteria-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.workspace-task {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}
.workspace-task:last-child { border-bottom: none; }
.workspace-task:hover { background: var(--surface-2); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.workspace-task-checkbox {
    position: relative;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}
.workspace-task-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}
.workspace-task-checkmark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: all 0.2s;
}
.workspace-task-checkmark i { opacity: 0; transform: scale(0.5); transition: all 0.2s; }
.workspace-task.checked .workspace-task-checkmark {
    background: var(--gradient-success);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(34,197,94,0.3);
}
.workspace-task.checked .workspace-task-checkmark i { opacity: 1; transform: scale(1); }
.workspace-task-content { flex: 1; }
.workspace-task-desc {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    transition: color 0.2s;
}
.workspace-task.checked .workspace-task-desc {
    color: var(--text-tertiary);
    text-decoration: line-through;
}
.workspace-task-flag {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.task-complete-pop {
    animation: taskPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes taskPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.02); background: rgba(34,197,94,0.08); }
    100% { transform: scale(1); }
}
.file-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}
.file-preview-remove {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--surface-3);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.file-preview-remove:hover { background: var(--danger); color: white; }
.submit-project-btn {
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}
.submit-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99,102,241,0.4);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover { box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}
.btn-ghost {
    background: var(--primary-light);
    color: var(--primary);
}
.btn-warm {
    background: var(--gradient-warm);
    color: white;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 14px; min-height: 40px; }
.btn-lg { padding: 16px 28px; font-size: 17px; min-height: 54px; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--accent); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-purple { background: rgba(236,72,153,0.12); color: var(--secondary); }
.badge-gray { background: var(--surface-2); color: var(--text-secondary); }
.badge-gradient {
    background: var(--gradient-primary);
    color: white;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-static {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 16px;
    background: var(--surface-2);
    color: var(--text);
}
.form-error {
    color: var(--danger);
    font-size: 14px;
    text-align: center;
    margin: 10px 0;
    padding: 10px 14px;
    background: rgba(239,68,68,0.08);
    border-radius: var(--radius-xs);
    font-weight: 600;
}

/* ===== Progress ===== */
.progress-bar {
    height: 10px;
    background: var(--surface-2);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}
.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.progress-bar-success .progress-fill { background: var(--gradient-success); }
.progress-bar-warm .progress-fill { background: var(--gradient-warm); }

/* ===== Stars ===== */
.stars { display: inline-flex; gap: 2px; align-items: center; }
.star { font-size: 20px; color: var(--star); }
.star-empty { color: var(--surface-3); }

/* ===== Comments ===== */
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.comment-author { font-weight: 700; color: var(--text); }
.comment-time { color: var(--text-tertiary); font-size: 12px; }
.comment-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}
.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: inline-flex;
    width: 90px;
    height: 90px;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: 50%;
    color: var(--primary);
}
.empty-state p { font-size: 15px; margin-bottom: 6px; font-weight: 500; }
.empty-state .text-secondary { font-size: 13px; }
.empty-state .btn { margin-top: 20px; }

/* ===== Avatar ===== */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: var(--shadow-md);
}
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }
.avatar-xl { width: 88px; height: 88px; font-size: 36px; } .avatar-img { border-radius: 50%; object-fit: cover; }

/* ===== Skill Tags ===== */
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    margin: 3px;
}

/* ===== Divider ===== */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ===== Page Transitions ===== */
.page-enter { animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.pop-in { animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}
.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.modal-content h3 { font-size: 18px; font-weight: 800; margin-bottom: 16px; text-align: center; }
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-2);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.modal-stat {
    text-align: center;
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.modal-stat .value { font-size: 22px; font-weight: 800; color: var(--primary); }
.modal-stat .label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Responsive ===== */
@media (min-width: 481px) {
    body { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ===== Checkbox Items ===== */
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.check-item:last-child { border-bottom: none; }
.check-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-top: 1px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.check-item .check-label { font-size: 15px; line-height: 1.5; flex: 1; color: var(--text); font-weight: 500; }
.check-item.checked .check-label { color: var(--text-tertiary); text-decoration: line-through; }

/* ===== Rating ===== */
.rating-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0;
}
.rating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.rating-btn:hover { border-color: var(--star); color: var(--star); transform: translateY(-2px); }
.rating-btn.active { border-color: var(--star); background: rgba(251,191,36,0.12); color: var(--star); }
.rating-btn:active { transform: scale(0.92); }

/* ===== Tag Row ===== */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }

/* ===== Stat Row ===== */
.stat-row { display: flex; gap: 10px; }
.stat-item {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    transition: background 0.3s;
}
.stat-value { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; font-weight: 600; }

/* ===== Radar Chart ===== */
.radar-card { cursor: pointer; transition: transform 0.2s; }
.radar-card:hover { transform: translateY(-2px); }
.radar-container { text-align: center; padding: 8px 0; }
.radar-container canvas { max-width: 100%; height: auto; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 12px; font-size: 12px; }
.radar-legend span { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.radar-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ===== Gamification ===== */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient-warm);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}
.xp-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.xp-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.achievement {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    min-width: 80px;
    text-align: center;
    transition: transform 0.2s;
}
.achievement:hover { transform: translateY(-3px); }
.achievement-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--gradient-primary);
    color: white;
}
.achievement.locked { opacity: 0.5; }
.achievement.locked .achievement-icon { background: var(--surface-3); }
.achievement-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }

/* ===== File Upload ===== */
.file-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 28px 20px;
    text-align: center;
    background: var(--surface-2);
    transition: all 0.2s;
    cursor: pointer;
}
.file-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-dropzone .ph { font-size: 40px; color: var(--primary); margin-bottom: 10px; }
.file-dropzone-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.file-dropzone-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.file-input { display: none; }
.file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--primary-light);
    border-radius: var(--radius-xs);
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* ===== Cover Images ===== */
.cover-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.cover-gradient {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.cover-gradient .ph {
    font-size: 80px;
    opacity: 0.25;
    color: white;
    position: absolute;
    right: 20px;
    bottom: -10px;
}
.cover-gradient-text {
    color: white;
    font-size: 22px;
    font-weight: 800;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: calc(var(--tab-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 440px;
    pointer-events: none;
}
.toast {
    background: var(--surface);
    color: var(--text);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1), toastOut 0.3s ease 2.7s forwards;
    border: 1px solid var(--border);
    pointer-events: auto;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(20px); }
}

/* ===== Details / Collapse ===== */
details {
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
details summary {
    padding: 16px 18px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    transition: color 0.2s;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
details[open] summary { color: var(--primary); }
details[open] summary::after { transform: rotate(-135deg); }
details .card-body { border-top: 1px solid var(--border); }

/* ===== Theme Toggle ===== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--primary); transform: rotate(15deg); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }
.text-4xl { font-size: 32px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mx-auto { margin-left: auto; margin-right: auto; }
.ml-4 { margin-left: 4px; }
.ml-8 { margin-left: 8px; }
.mr-4 { margin-right: 4px; }
.mr-8 { margin-right: 8px; }

.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ===== Auth Header ===== */
.auth-header { padding: 48px 24px 36px; text-align: center; }
.auth-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 44px;
    box-shadow: var(--shadow-glow);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.auth-subtitle { color: var(--text-secondary); font-size: 15px; margin-top: 10px; font-weight: 500; }

/* ===== Section Title ===== */
.section-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.section-title::before {
    content: "";
    width: 4px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ===== Page Header ===== */
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

/* ===== Score Card ===== */
.score-card .score-value { font-size: 36px; font-weight: 800; line-height: 1; }
.score-card .score-max { font-size: 13px; color: var(--text-tertiary); font-weight: 600; }

/* ===== Result Hero ===== */
.result-hero { text-align: center; padding: 32px 0 24px; }
.result-hero .hero-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.result-hero .hero-title { font-size: 24px; font-weight: 800; }
.result-hero .hero-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 8px; }

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
}
.filter-bar .badge { white-space: nowrap; text-decoration: none; transition: all 0.2s; }
.filter-bar .badge:hover { transform: translateY(-1px); }
.filter-bar .badge.active { background: var(--gradient-primary); color: white; }

/* ===== HTMX Indicator ===== */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }
