:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --text: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-soft: #eff6ff;
    --success: #059669;
    --success-bg: #ecfdf5;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--surface-alt);
    padding: 0.15em 0.4em;
    border-radius: 5px;
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.brand-mark { color: var(--text); }
.brand-sub { color: var(--primary); font-weight: 700; }

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav a:hover { color: var(--primary); }

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: 5px 12px;
    border-radius: 999px;
}

.header-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

/* Hero */
.hero {
    padding: 64px 0 48px;
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 36px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 2.85rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

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

.lead {
    margin: 0 0 26px;
    font-size: 1.06rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--text-muted); }

.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
    text-align: center;
}

.stat {
    background: var(--bg);
    padding: 12px 8px;
    border-radius: 8px;
}

.stat-num {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hero-note {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* Filter Bar */
.filter-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.filter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.pill:hover { border-color: var(--primary); color: var(--primary); }

.pill.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.result-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sections & Cards */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); }

.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 6px; font-size: 1.65rem; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--text-muted); }

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.tag-cat {
    background: var(--accent-soft);
    color: var(--primary);
}

.meta-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card h3 {
    margin: 0 0 10px;
    font-size: 1.12rem;
    line-height: 1.35;
}

.card p {
    margin: 0 0 18px;
    font-size: 0.92rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

/* Q&A */
.qna-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qna-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.qna-item summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-weight: 600;
}

.qna-item summary::-webkit-details-marker { display: none; }

.qna-q-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-muted);
}

.badge-status.is-answered {
    background: var(--success-bg);
    color: var(--success);
}

.qna-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.qna-answer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.qna-answer p { margin: 0 0 8px; }
.qna-author { font-size: 0.8rem; color: var(--text-muted); }

.notice-banner {
    background: var(--accent-soft);
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.92rem;
}

.notice-sub { display: block; font-size: 0.82rem; margin-top: 4px; opacity: 0.85; }

/* Ask Box */
.ask-box {
    margin-top: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.ask-box h3 { margin: 0 0 4px; }
.ask-box p { margin: 0 0 16px; color: var(--text-muted); font-size: 0.92rem; }

.ask-form {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 10px;
}

.ask-form select,
.ask-form input {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.94rem;
    background: var(--surface);
}

/* Footer & Modal */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 480px;
    width: calc(100% - 32px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.modal::backdrop { background: rgba(15, 23, 42, 0.5); }

.modal-inner { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.close-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
.modal-inner h3 { margin: 0 0 10px; }
.modal-desc { color: var(--text-muted); font-size: 0.94rem; margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; }

@media (max-width: 820px) {
    .hero-grid { grid-template-columns: 1fr; }
    .ask-form { grid-template-columns: 1fr; }
    .main-nav { display: none; }
}