/* ==========================================================================
   学霸修炼手册 xueba.css — 移动端优先 · 金色殿堂 · 2026
   ========================================================================== */

/* ===== CSS 变量 ===== */
:root {
    --xb-gold: #d97706;          --xb-gold-light: #fbbf24;
    --xb-gold-dark: #92400e;     --xb-gold-bg: #fffbeb;
    --xb-amber: #f59e0b;         --xb-amber-light: #fde68a;
    --xb-emerald: #059669;       --xb-emerald-light: #d1fae5;
    --xb-royal: #6d28d9;         --xb-royal-light: #ede9fe;
    --xb-coral: #e11d48;         --xb-coral-light: #ffe4e6;
    --xb-ocean: #0284c7;         --xb-ocean-light: #e0f2fe;
    --xb-navy: #1e3a5f;

    --xb-bg: #faf8f5;
    --xb-surface: #ffffff;
    --xb-surface-alt: #fef9f0;
    --xb-border: #e8e0d5;
    --xb-border-light: #f0ebe0;
    --xb-text: #1c1917;
    --xb-text-secondary: #57534e;
    --xb-text-muted: #a8a29e;
    --xb-radius: 14px;
    --xb-radius-lg: 20px;
    --xb-radius-xl: 26px;
    --xb-shadow-xs: 0 1px 2px rgba(0,0,0,.03);
    --xb-shadow-sm: 0 1px 4px rgba(0,0,0,.05);
    --xb-shadow: 0 2px 8px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.03);
    --xb-shadow-md: 0 6px 18px rgba(0,0,0,.06);
    --xb-shadow-lg: 0 16px 40px rgba(0,0,0,.08);
    --xb-transition: .28s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

/* ===== 基础布局 ===== */
.xb-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 12px 80px;
    background: var(--xb-bg);
    min-height: 100vh;
}

/* ===== 顶部进度条 ===== */
.xb-progress-bar-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 3px;
    background: transparent;
    margin: 0 -12px;
}
.xb-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706, #fbbf24);
    width: 0%;
    transition: width .35s ease;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(245,158,11,.5);
}

/* ===== Hero ===== */
.xb-hero {
    background: linear-gradient(160deg, #0f0a02 0%, #1c1306 15%, #2d1a06 30%, #451a03 50%, #5c2a08 70%, #1c1306 100%);
    border-radius: var(--xb-radius-xl);
    padding: 32px 20px 28px;
    margin: 12px 0 16px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(217,119,6,.2);
}
.xb-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -25%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(251,191,36,.18) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    animation: xb-float 7s ease-in-out infinite;
}
.xb-hero::after {
    content: '';
    position: absolute;
    bottom: -45%; left: -20%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(245,158,11,.1) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    animation: xb-float 9s ease-in-out infinite reverse;
}
@keyframes xb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -12px) scale(1.04); }
    66% { transform: translate(-12px, 10px) scale(.96); }
}
.xb-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(251,191,36,.15);
    backdrop-filter: blur(8px);
    padding: 6px 20px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(251,191,36,.25);
    animation: xb-glow 2.5s ease-in-out infinite;
    color: #fcd34d;
}
@keyframes xb-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,.2); }
    50% { box-shadow: 0 0 0 10px rgba(251,191,36,0); }
}
.xb-hero-badge-dot {
    width: 7px; height: 7px;
    background: #fbbf24;
    border-radius: 50%;
    animation: xb-blink 1.5s ease-in-out infinite;
}
@keyframes xb-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}
.xb-hero-title {
    font-size: 26px;
    font-weight: 900;
    margin: 0 0 8px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fef3c7, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.xb-hero-sub {
    font-size: 13px;
    opacity: .8;
    margin: 0 0 16px;
    position: relative;
    z-index: 1;
}
.xb-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    font-size: 11px;
    opacity: .6;
    position: relative;
    z-index: 1;
}
.xb-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}
.xb-hero-stat {
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    padding: 14px 8px;
    border: 1px solid rgba(255,255,255,.1);
    transition: transform var(--xb-transition);
}
.xb-hero-stat:active { transform: scale(.95); }
.xb-hero-stat-num {
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.xb-hero-stat-label {
    font-size: 10px;
    opacity: .65;
    margin-top: 4px;
}

/* ===== 快速导航 ===== */
.xb-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    position: sticky;
    top: 3px;
    z-index: 90;
    background: var(--xb-bg);
    padding: 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.xb-nav::-webkit-scrollbar { display: none; }
.xb-nav-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    background: var(--xb-surface);
    box-shadow: var(--xb-shadow-xs);
    border: 1.5px solid var(--xb-border-light);
    color: var(--xb-text-secondary);
    transition: var(--xb-transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.xb-nav-item:active { transform: scale(.94); }
.xb-nav-item.active-scroll {
    background: var(--xb-gold-bg);
    border-color: var(--xb-amber-light);
    color: var(--xb-gold-dark);
    box-shadow: 0 2px 8px rgba(217,119,6,.15);
}

/* ===== Section ===== */
.xb-section {
    margin-bottom: 14px;
    border-radius: var(--xb-radius-lg);
    overflow: hidden;
    box-shadow: var(--xb-shadow-sm);
}
.xb-section-header {
    padding: 18px 16px 14px;
    position: relative;
    overflow: hidden;
}
.xb-section-header::after {
    content: '';
    position: absolute;
    top: -25px; right: -18px;
    width: 110px; height: 110px;
    border-radius: 50%;
    opacity: .06;
    pointer-events: none;
}

/* Header variants */
.xb-sect-mindset .xb-section-header { background: linear-gradient(150deg, #fef3c7 0%, #fde68a 30%, #fcd34d 100%); }
.xb-sect-method .xb-section-header { background: linear-gradient(150deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%); }
.xb-sect-time .xb-section-header { background: linear-gradient(150deg, #f3e8ff 0%, #e9d5ff 50%, #d8b4fe 100%); }
.xb-sect-note .xb-section-header { background: linear-gradient(150deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%); }
.xb-sect-wrong .xb-section-header { background: linear-gradient(150deg, #ffe4e6 0%, #fecdd3 50%, #fda4af 100%); }
.xb-sect-listen .xb-section-header { background: linear-gradient(150deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%); }
.xb-sect-practice .xb-section-header { background: linear-gradient(150deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%); }
.xb-sect-review .xb-section-header { background: linear-gradient(150deg, #ede9fe 0%, #ddd6fe 50%, #c4b5fd 100%); }
.xb-sect-habit .xb-section-header { background: linear-gradient(150deg, #ccfbf1 0%, #99f6e4 50%, #5eead4 100%); }
.xb-sect-schedule .xb-section-header { background: linear-gradient(150deg, #fff7ed 0%, #fed7aa 50%, #fdba74 100%); }
.xb-sect-exam .xb-section-header { background: linear-gradient(150deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%); }
.xb-sect-mind .xb-section-header { background: linear-gradient(150deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%); }
.xb-sect-subject .xb-section-header { background: linear-gradient(150deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%); }
.xb-sect-roadmap .xb-section-header { background: linear-gradient(150deg, #fef2f2 0%, #fecaca 50%, #fca5a5 100%); }
.xb-sect-tools .xb-section-header { background: linear-gradient(150deg, #faf5ff 0%, #f3e8ff 50%, #e9d5ff 100%); }

.xb-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    color: #fff;
}
.xb-badge-mindset { background: #d97706; }
.xb-badge-method { background: #0284c7; }
.xb-badge-time { background: #7c3aed; }
.xb-badge-note { background: #059669; }
.xb-badge-wrong { background: #e11d48; }
.xb-badge-listen { background: #d97706; }
.xb-badge-practice { background: #4f46e5; }
.xb-badge-review { background: #6d28d9; }
.xb-badge-habit { background: #0d9488; }
.xb-badge-schedule { background: #ea580c; }
.xb-badge-exam { background: #db2777; }
.xb-badge-mind { background: #059669; }
.xb-badge-subject { background: #2563eb; }
.xb-badge-roadmap { background: #dc2626; }
.xb-badge-tools { background: #7c3aed; }

.xb-section-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 5px;
    color: var(--xb-text);
}
.xb-section-desc {
    font-size: 12px;
    color: var(--xb-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== Section Body ===== */
.xb-section-body {
    background: var(--xb-surface);
    padding: 12px;
}

/* ===== Collapsible Part ===== */
.xb-part {
    background: var(--xb-surface);
    border-bottom: 1px solid var(--xb-border-light);
    overflow: hidden;
}
.xb-part:last-child { border-bottom: none; border-radius: 0 0 var(--xb-radius-lg) var(--xb-radius-lg); }
.xb-part-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    min-height: 50px;
    transition: background var(--xb-transition);
    user-select: none;
}
.xb-part-header:active { background: rgba(0,0,0,.015); }
.xb-part-label {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.xb-part-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--xb-text);
    flex: 1;
}
.xb-part-arrow {
    font-size: 12px;
    color: var(--xb-text-secondary);
    transition: transform var(--xb-transition);
    flex-shrink: 0;
    width: 20px; text-align: center;
}
.xb-part.open .xb-part-arrow { transform: rotate(180deg); }
.xb-part-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s ease, padding .3s ease;
}
.xb-part-body { padding: 0 14px; }
.xb-part.open .xb-part-body {
    max-height: 6000px;
    padding: 0 14px 12px;
}

/* Solitary open (first child in section always open) */
.xb-section-body > .xb-part:first-child.open ~ .xb-part .xb-part-body,
.xb-section-body > .xb-part:first-child:not(.open) .xb-part-body {  }

/* ===== Card ===== */
.xb-card {
    background: var(--xb-surface-alt);
    border: 1px solid var(--xb-border-light);
    border-radius: var(--xb-radius);
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: var(--xb-shadow-xs);
    transition: box-shadow var(--xb-transition), border-color var(--xb-transition);
    position: relative;
}
.xb-card:last-child { margin-bottom: 0; }
.xb-card:hover { box-shadow: var(--xb-shadow); }
.xb-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--xb-text);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 32px;
}
.xb-card-icon { font-size: 22px; flex-shrink: 0; }

/* Card check */
.xb-card-check {
    position: absolute;
    top: 12px; right: 12px;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--xb-transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.xb-card-check:hover { border-color: var(--xb-gold); }
.xb-card-check.checked {
    background: var(--xb-emerald);
    border-color: var(--xb-emerald);
}
.xb-card-check.checked::after {
    content: '✓';
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.xb-card.checked {
    border-color: #bbf7d0;
    background: #f9fefb;
}

/* ===== Highlight Card (金色底色) ===== */
.xb-card-highlight {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}
.xb-card-highlight .xb-card-title { color: #92400e; }

/* ===== Tag List ===== */
.xb-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.xb-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    background: #f5f5f4;
    color: #44403c;
    line-height: 1.5;
    border: 1px solid #e8e0d5;
    transition: var(--xb-transition);
}
.xb-tag:hover { border-color: #d6d0c8; }
.xb-tag-lg { font-size: 13px; padding: 8px 15px; font-weight: 600; }
.xb-tag-gold { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.xb-tag-emerald { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.xb-tag-royal { background: #f5f3ff; color: #6d28d9; border-color: #c4b5fd; }
.xb-tag-coral { background: #ffe4e6; color: #9f1239; border-color: #fda4af; }
.xb-tag-ocean { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }

/* ===== Quote Box ===== */
.xb-quote {
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.7;
    font-style: italic;
    background: #fef9f0;
    border-left: 4px solid #fbbf24;
    color: #78350f;
    position: relative;
}
.xb-quote::before {
    content: '"';
    position: absolute;
    top: -4px; left: 10px;
    font-size: 40px;
    color: #fde68a;
    font-style: normal;
    line-height: 1;
    pointer-events: none;
}
.xb-quote strong { color: #92400e; }

/* ===== Tip Box ===== */
.xb-tip {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.55;
    color: #6d28d9;
    background: #f5f3ff;
    border-left: 3px solid #a78bfa;
}

/* ===== Modal/Step Flow ===== */
.xb-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.xb-step {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--xb-radius);
    background: var(--xb-surface);
    border: 1px solid var(--xb-border-light);
    box-shadow: var(--xb-shadow-xs);
    transition: var(--xb-transition);
}
.xb-step:hover { box-shadow: var(--xb-shadow); }
.xb-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.xb-step-num-gold { background: linear-gradient(135deg, #fbbf24, #d97706); }
.xb-step-num-ocean { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.xb-step-num-royal { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.xb-step-num-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.xb-step-num-coral { background: linear-gradient(135deg, #fb7185, #e11d48); }
.xb-step-content { flex: 1; }
.xb-step-content h4 {
    font-size: 13px; font-weight: 700;
    margin: 0 0 3px; color: var(--xb-text);
}
.xb-step-content p {
    font-size: 11.5px; color: var(--xb-text-secondary);
    margin: 0; line-height: 1.6;
}

/* ===== Grid ===== */
.xb-grid { display: grid; gap: 8px; }
.xb-grid-2 { grid-template-columns: 1fr; }
.xb-grid-3 { grid-template-columns: 1fr; }
.xb-grid-4 { grid-template-columns: 1fr; }

.xb-grid-item {
    padding: 16px;
    border-radius: var(--xb-radius);
    background: var(--xb-surface-alt);
    border: 1px solid var(--xb-border-light);
    box-shadow: var(--xb-shadow-xs);
    transition: var(--xb-transition);
}
.xb-grid-item:hover { box-shadow: var(--xb-shadow); transform: translateY(-2px); }
.xb-grid-item-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.xb-grid-item h4 {
    font-size: 14px; font-weight: 700;
    margin: 0 0 6px; color: var(--xb-text);
}
.xb-grid-item p {
    font-size: 11.5px; color: var(--xb-text-secondary);
    margin: 0; line-height: 1.65;
}

/* ===== Daily Schedule ===== */
.xb-schedule {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.xb-schedule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
    transition: var(--xb-transition);
}
.xb-schedule-item:hover { background: rgba(0,0,0,.01); }
.xb-schedule-time {
    font-weight: 700;
    font-size: 13px;
    color: var(--xb-text);
    flex-shrink: 0;
    min-width: 72px;
}
.xb-schedule-emoji { font-size: 20px; flex-shrink: 0; }
.xb-schedule-info { flex: 1; }
.xb-schedule-info strong { color: var(--xb-text); display: block; font-size: 12px; }
.xb-schedule-info span { color: var(--xb-text-secondary); font-size: 11px; }
.xb-schedule-tag {
    font-size: 10px; font-weight: 600;
    padding: 3px 9px; border-radius: 8px;
    flex-shrink: 0;
}
.xb-schedule-tag-study { background: #dbeafe; color: #1e40af; }
.xb-schedule-tag-break { background: #e8f5e9; color: #2e7d32; }
.xb-schedule-tag-eat { background: #fff3e0; color: #e65100; }
.xb-schedule-tag-sport { background: #fce4ec; color: #c62828; }
.xb-schedule-tag-sleep { background: #e8eaf6; color: #283593; }

/* ===== Roadmap Timeline ===== */
.xb-timeline {
    position: relative;
    padding-left: 28px;
}
.xb-timeline::before {
    content: '';
    position: absolute;
    left: 12px; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #fbbf24, #f59e0b, #d97706, #b45309);
    border-radius: 2px;
}
.xb-timeline-item {
    position: relative;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--xb-surface);
    border-radius: var(--xb-radius);
    border: 1px solid var(--xb-border-light);
    box-shadow: var(--xb-shadow-xs);
}
.xb-timeline-item::before {
    content: '';
    position: absolute;
    left: -22px; top: 20px;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: #fbbf24;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(251,191,36,.25);
    z-index: 1;
}
.xb-timeline-item:last-child { margin-bottom: 0; }
.xb-timeline-stage {
    font-size: 10px; font-weight: 800;
    padding: 3px 10px; border-radius: 8px;
    margin-bottom: 6px; display: inline-block;
    letter-spacing: 1px;
}
.xb-timeline-stage.s1 { background: #dbeafe; color: #1e40af; }
.xb-timeline-stage.s2 { background: #d1fae5; color: #065f46; }
.xb-timeline-stage.s3 { background: #fef3c7; color: #92400e; }
.xb-timeline-stage.s4 { background: #fce7f3; color: #9f1239; }
.xb-timeline-stage.s5 { background: #e9d5ff; color: #6d28d9; }
.xb-timeline-stage.s6 { background: #fde68a; color: #78350f; }
.xb-timeline-item h4 {
    font-size: 14px; font-weight: 700;
    margin: 0 0 4px; color: var(--xb-text);
}
.xb-timeline-item p {
    font-size: 11.5px; color: var(--xb-text-secondary);
    margin: 0; line-height: 1.6;
}

/* ===== Comparison Table ===== */
.xb-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
}
.xb-compare-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
}
.xb-compare-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--xb-border-light);
    color: var(--xb-text-secondary);
    line-height: 1.5;
    background: var(--xb-surface);
}
.xb-compare-table tr:last-child td { border-bottom: none; }
.xb-compare-table th:first-child { background: #78716c; border-radius: 8px 0 0 0; }
.xb-compare-table th:last-child { background: #d97706; border-radius: 0 8px 0 0; }

/* ===== Subject Cards ===== */
.xb-subject-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.xb-subject-card {
    padding: 16px;
    border-radius: var(--xb-radius);
    border: 1.5px solid var(--xb-border-light);
    background: var(--xb-surface);
    box-shadow: var(--xb-shadow-xs);
    transition: var(--xb-transition);
}
.xb-subject-card:hover { box-shadow: var(--xb-shadow); }
.xb-subject-card-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px;
}
.xb-subject-card-emoji { font-size: 36px; }
.xb-subject-card-head h4 { font-size: 15px; font-weight: 700; margin: 0; }
.xb-subject-card ul {
    margin: 0; padding: 0 0 0 18px;
    font-size: 11px; color: var(--xb-text-secondary);
    line-height: 1.8;
}

/* ===== Formula Card (for Pomodoro etc.) ===== */
.xb-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 16px 12px;
    background: #fef9f0;
    border-radius: 14px;
    margin: 10px 0 0;
    border: 2px dashed #fde68a;
}
.xb-formula-item {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.xb-formula-plus { font-size: 18px; color: #d97706; }
.xb-formula-eq { font-size: 18px; color: #059669; font-weight: 900; }

/* ===== Strategy Box ===== */
.xb-strategy-box {
    padding: 14px;
    border-radius: var(--xb-radius);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fde68a;
    margin-bottom: 8px;
}
.xb-strategy-box h4 {
    font-size: 13px; font-weight: 700;
    margin: 0 0 6px; color: #92400e;
    display: flex; align-items: center; gap: 6px;
}
.xb-strategy-box p {
    font-size: 11.5px; color: #78350f;
    margin: 0; line-height: 1.6;
}

/* ===== Book List ===== */
.xb-book-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.xb-book-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: var(--xb-surface-alt);
    border: 1px solid var(--xb-border-light);
    transition: var(--xb-transition);
}
.xb-book-item:hover { box-shadow: var(--xb-shadow-sm); }
.xb-book-emoji { font-size: 24px; flex-shrink: 0; }
.xb-book-info { flex: 1; }
.xb-book-info strong { display: block; font-size: 12px; color: var(--xb-text); }
.xb-book-info span { font-size: 10px; color: var(--xb-text-muted); }

/* ===== Footer ===== */
.xb-footer {
    text-align: center;
    padding: 32px 16px 24px;
    color: var(--xb-text-secondary);
    font-size: 12px;
}
.xb-footer p { margin: 5px 0; }
.xb-footer-note {
    font-size: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #d97706, #b45309, #92400e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 12px 0 4px;
}
.xb-footer-stats { font-size: 11px; color: var(--xb-text-muted); margin-top: 8px; }

/* ===== Floating Tools ===== */
.xb-float-tools {
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xb-float-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--xb-border-light);
    background: var(--xb-surface);
    box-shadow: var(--xb-shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--xb-transition);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.xb-float-btn:active { transform: scale(.9); }
.xb-float-btn:hover { box-shadow: var(--xb-shadow-lg); }
.xb-float-btn-back { opacity: 0; pointer-events: none; transition: opacity .3s, transform var(--xb-transition); }
.xb-float-btn-back.visible { opacity: 1; pointer-events: auto; }
.xb-float-progress {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 22px; height: 22px;
    border-radius: 11px;
    background: var(--xb-emerald);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(5,150,105,.35);
}

/* Toast */
.xb-toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: #292524;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
}
.xb-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.xb-toast.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(24px);
}

/* ===== Divider ===== */
.xb-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 6px;
    opacity: .4;
}
.xb-divider::before,
.xb-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--xb-border);
}
.xb-divider span {
    font-size: 10px;
    color: var(--xb-text-muted);
    letter-spacing: 1px;
}

/* ===== Empty check for first open ===== */
.xb-section-body > .xb-part:first-child.open .xb-part-body {
    padding: 0 14px 12px;
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 600px) {
    .xb-main { padding: 0 16px 80px; }
    .xb-hero { padding: 40px 36px 34px; border-radius: var(--xb-radius-xl); }
    .xb-hero-title { font-size: 32px; }
    .xb-hero-sub { font-size: 14px; }
    .xb-nav { gap: 8px; position: static; background: transparent; padding: 0; justify-content: center; }
    .xb-section-title { font-size: 20px; }
    .xb-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .xb-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .xb-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .xb-subject-grid { grid-template-columns: repeat(3, 1fr); }
    .xb-book-list { grid-template-columns: repeat(2, 1fr); }
    .xb-hero-stats { gap: 12px; }
    .xb-hero-stat { padding: 18px 12px; }
    .xb-hero-stat-num { font-size: 30px; }
    .xb-card-check { width: 28px; height: 28px; }
    .xb-float-btn { width: 50px; height: 50px; font-size: 22px; }
}

/* ===== Responsive: Desktop ===== */
@media (min-width: 768px) {
    .xb-main { padding: 0 24px 100px; }
    .xb-hero { padding: 50px 48px 42px; }
    .xb-hero-title { font-size: 38px; }
    .xb-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .xb-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .xb-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .xb-float-tools { right: calc(50% - 430px - 64px); bottom: 32px; }
}

/* Desktop hover */
@media (hover: hover) {
    .xb-nav-item:hover {
        transform: translateY(-2px);
        background: var(--xb-gold-bg);
        color: var(--xb-gold-dark);
    }
    .xb-card:hover { border-color: #d6d0c8; }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --xb-bg: #0c0a09;
        --xb-surface: #1c1917;
        --xb-surface-alt: #24211e;
        --xb-border: #38312b;
        --xb-border-light: #2d2722;
        --xb-text: #e7e5e4;
        --xb-text-secondary: #a8a29e;
        --xb-text-muted: #78716c;
        --xb-shadow-xs: 0 1px 2px rgba(0,0,0,.3);
        --xb-shadow-sm: 0 1px 4px rgba(0,0,0,.35);
        --xb-shadow: 0 2px 8px rgba(0,0,0,.4);
        --xb-shadow-md: 0 6px 18px rgba(0,0,0,.45);
        --xb-shadow-lg: 0 16px 40px rgba(0,0,0,.5);
    }
    .xb-section-header { color: var(--xb-text); }
    .xb-sect-mindset .xb-section-header { background: linear-gradient(150deg, #2d1a06, #451a03, #5c2a08); }
    .xb-sect-method .xb-section-header { background: linear-gradient(150deg, #0c1929, #102a44, #1e3a5f); }
    .xb-sect-time .xb-section-header { background: linear-gradient(150deg, #1e1b4b, #312e81, #3730a3); }
    .xb-sect-note .xb-section-header { background: linear-gradient(150deg, #022c22, #064e3b, #065f46); }
    .xb-sect-wrong .xb-section-header { background: linear-gradient(150deg, #450a0a, #7f1d1d, #991b1b); }
    .xb-sect-listen .xb-section-header { background: linear-gradient(150deg, #1c1306, #2d1a06, #451a03); }
    .xb-sect-practice .xb-section-header { background: linear-gradient(150deg, #172554, #1e3a5f, #1e40af); }
    .xb-sect-review .xb-section-header { background: linear-gradient(150deg, #2e1065, #4c1d95, #5b21b6); }
    .xb-sect-habit .xb-section-header { background: linear-gradient(150deg, #042f2e, #134e4a, #115e59); }
    .xb-sect-schedule .xb-section-header { background: linear-gradient(150deg, #431407, #7c2d12, #9a3412); }
    .xb-sect-exam .xb-section-header { background: linear-gradient(150deg, #4a101a, #831843, #9d174d); }
    .xb-sect-mind .xb-section-header { background: linear-gradient(150deg, #022c22, #064e3b, #065f46); }
    .xb-sect-subject .xb-section-header { background: linear-gradient(150deg, #172554, #1e3a5f, #1e40af); }
    .xb-sect-roadmap .xb-section-header { background: linear-gradient(150deg, #450a0a, #7f1d1d, #991b1b); }
    .xb-sect-tools .xb-section-header { background: linear-gradient(150deg, #1e1b4b, #312e81, #3730a3); }
    .xb-section-title { color: #e0e7ff; }
    .xb-section-desc { color: rgba(255,255,255,.55); }
    .xb-part-title { color: var(--xb-text); }
    .xb-card { background: var(--xb-surface-alt); }
    .xb-tag { background: #292524; color: #d6d3d1; border-color: #44403c; }
    .xb-tag-gold { background: #451a03; color: #fcd34d; border-color: #78350f; }
    .xb-tag-emerald { background: #022c22; color: #6ee7b7; border-color: #064e3b; }
    .xb-tag-royal { background: #1e1b4b; color: #c4b5fd; border-color: #4c1d95; }
    .xb-tag-coral { background: #450a0a; color: #fda4af; border-color: #7f1d1d; }
    .xb-tag-ocean { background: #172554; color: #7dd3fc; border-color: #1e3a5f; }
    .xb-card-highlight { background: #451a03; border-color: #78350f; }
    .xb-card-highlight .xb-card-title { color: #fcd34d; }
    .xb-quote { background: #292524; color: #d6d3d1; }
    .xb-tip { background: #1e1b4b; color: #c4b5fd; }
    .xb-formula { background: #292524; border-color: #52525b; }
    .xb-formula-plus { color: var(--xb-gold-light); }
    .xb-formula-eq { color: var(--xb-emerald); }
    .xb-compare-table td { background: var(--xb-surface); }
    .xb-schedule-item:hover { background: rgba(255,255,255,.02); }
    .xb-book-item { background: var(--xb-surface-alt); }
    .xb-strategy-box { background: #451a03; border-color: #78350f; color: #fcd34d; }
    .xb-strategy-box h4 { color: #fbbf24; }
    .xb-strategy-box p { color: #fed7aa; }
    .xb-grid-item { background: var(--xb-surface-alt); }
    .xb-step { background: var(--xb-surface); }
    .xb-nav-item { background: var(--xb-surface); }
    .xb-float-btn { background: var(--xb-surface); border-color: var(--xb-border); }
    .xb-nav-item.active-scroll {
        background: #451a03;
        border-color: #b45309;
        color: #fcd34d;
    }
}

/* ===== Animations ===== */
@keyframes xb-fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.xb-animate-in {
    animation: xb-fadeInUp .5s ease forwards;
}
