:root {
    --primary: #145ca8;
    --primary-dark: #0d447e;
    --primary-soft: #eaf3fc;
    --cyan: #2894cc;
    --accent: #e66e00;
    --accent-dark: #c95d00;
    --accent-soft: #fff4e8;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --border: #dfe7f1;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --container: 1200px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

a:hover {
    color: var(--accent);
}

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

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

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand img {
    height: 46px;
    width: auto;
}

.brand-sub {
    display: none;
    font-size: 12px;
    color: var(--text-light);
    border-left: 1px solid var(--border);
    padding-left: 10px;
    line-height: 1.3;
}

@media (min-width: 1180px) {
    .brand-sub {
        display: inline-block;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.main-nav a {
    color: var(--text);
    font-size: 14.5px;
    font-weight: 500;
    padding: 8px 11px;
    border-radius: 7px;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mini-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 6px 3px 12px;
}

.mini-search input {
    border: 0;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 145px;
    color: var(--text);
}

.mini-search button {
    border: 0;
    background: var(--primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* Announcement Banner (verbatim below nav on home) */
.announce-bar {
    background: linear-gradient(90deg, #0f4c81 0%, #145ca8 60%, #1d70b8 100%);
    color: #fff;
    border-bottom: 2px solid var(--accent);
}

.announce-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
    flex-wrap: wrap;
}

.announce-badge {
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.announce-text {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-right: auto;
}

.announce-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.announce-links a {
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.45);
}

.announce-links a:hover {
    color: #ffd39b;
    border-bottom-color: #ffd39b;
}

/* Hero Section */
.hero {
    background-color: #0e3561;
    background-image:
        radial-gradient(circle at 82% 18%, rgba(40, 148, 204, 0.34), transparent 45%),
        radial-gradient(circle at 12% 90%, rgba(230, 110, 0, 0.22), transparent 42%),
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    color: #fff;
    padding: 46px 0 48px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
    gap: 32px;
    align-items: center;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffd5a6;
    background: rgba(230, 110, 0, 0.2);
    border: 1px solid rgba(255, 185, 115, 0.35);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.hero-lead {
    margin: 0 0 22px;
    color: rgba(236, 245, 255, 0.88);
    font-size: 15px;
    line-height: 1.72;
}

.hero-search {
    display: flex;
    background: #fff;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    max-width: 600px;
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    padding: 10px 14px;
    font-size: 14.5px;
    color: var(--text);
}

.hero-search button {
    border: 0;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 14.5px;
    padding: 10px 22px;
    border-radius: 7px;
    cursor: pointer;
    flex-shrink: 0;
}

.hero-search button:hover {
    background: var(--accent-dark);
}

.hero-quick {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.hero-quick a {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
}

.hero-quick a:hover {
    background: var(--accent);
    color: #fff;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.stat-num em {
    font-style: normal;
    color: #ffae5c;
    font-size: 20px;
}

.stat-label {
    font-size: 12.5px;
    color: rgba(235, 245, 255, 0.85);
    margin-top: 4px;
}

.hero-tool-promo {
    background: rgba(15, 23, 42, 0.34);
    border-radius: 10px;
    padding: 13px 14px;
}

.promo-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffd5a6;
    margin-bottom: 8px;
}

.promo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.promo-links a {
    font-size: 12.5px;
    color: #fff;
    background: rgba(40, 148, 204, 0.35);
    padding: 4px 10px;
    border-radius: 6px;
}

.promo-links a:hover {
    background: var(--accent);
}

/* Sections */
.section {
    padding: 42px 0;
}

.section-alt {
    background: #eef3f9;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-head h2 {
    margin: 0 0 4px;
    font-size: 23px;
    font-weight: 700;
    color: var(--text);
}

.section-head p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

.section-head.compact {
    margin-bottom: 18px;
}

.section-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* Discipline Grid */
.disc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.disc-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.disc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--cyan);
    color: var(--text);
}

.disc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.disc-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.4px;
}

.disc-group {
    font-size: 11.5px;
    color: var(--text-light);
}

.disc-card h3 {
    margin: 0 0 6px;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text);
}

.disc-card p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
}

.disc-meta {
    font-size: 12px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    padding: 4px 8px;
    border-radius: 5px;
}

/* Featured Grid & Article Cards */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.article-card h3 {
    margin: 10px 0 8px;
    font-size: 17px;
    line-height: 1.42;
}

.article-card h3 a {
    color: var(--text);
}

.article-card h3 a:hover {
    color: var(--primary);
}

.article-card p {
    margin: 0 0 14px;
    font-size: 13.8px;
    color: var(--text-muted);
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-light);
}

.badge-cat {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.badge-disc {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
}

.card-tags {
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.read-link {
    font-weight: 600;
    white-space: nowrap;
}

/* Two Column Layout */
.two-col-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.list-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.list-item h2,
.list-item h3 {
    margin: 8px 0 6px;
    font-size: 18px;
    line-height: 1.4;
}

.list-item h2 a,
.list-item h3 a {
    color: var(--text);
}

.list-item h2 a:hover,
.list-item h3 a:hover {
    color: var(--primary);
}

.list-item p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Sidebar */
.col-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.side-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.side-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.side-box-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.side-box-head a {
    font-size: 12.5px;
    font-weight: 600;
}

.q-mini-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-mini-list li {
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

.q-mini-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.q-mini-meta {
    display: flex;
    gap: 8px;
    font-size: 11.5px;
    margin-bottom: 4px;
}

.q-disc {
    color: var(--primary);
    font-weight: 600;
}

.q-diff {
    color: var(--accent-dark);
    background: var(--accent-soft);
    padding: 0 6px;
    border-radius: 4px;
}

.q-mini-list a {
    font-size: 13.8px;
    color: var(--text);
    line-height: 1.45;
    display: block;
}

.q-mini-list a:hover {
    color: var(--primary);
}

.cat-pill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-pill {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid transparent;
    color: var(--text);
}

.cat-pill strong {
    font-size: 14px;
    color: var(--text);
}

.cat-pill span {
    font-size: 12px;
    color: var(--text-light);
}

.cat-pill:hover,
.cat-pill.active {
    background: var(--primary-soft);
    border-color: #b7d4f2;
}

.accent-box {
    background: linear-gradient(145deg, #0f4c81, #145ca8);
    color: #fff;
    border-color: transparent;
}

.accent-box h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.accent-box p {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.88);
}

.side-disc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.side-disc-links a {
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.side-disc-links a:hover,
.side-disc-links a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.books-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.book-spine {
    display: inline-block;
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-dark);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.book-card h2,
.book-card h3 {
    margin: 0 0 5px;
    font-size: 16.5px;
    color: var(--text);
}

.book-author {
    font-size: 12.5px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.book-card p {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: var(--text-muted);
    flex: 1;
}

.book-tip {
    font-size: 12.8px;
    background: var(--bg);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.book-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.book-level {
    color: var(--primary);
    font-weight: 600;
}

/* Page Banner & Breadcrumb */
.page-banner {
    background: linear-gradient(120deg, #0f3d6e 0%, #155ea8 100%);
    color: #fff;
    padding: 30px 0;
}

.page-banner.compact-banner {
    padding: 14px 0;
}

.page-banner h1 {
    margin: 8px 0 8px;
    font-size: 28px;
    line-height: 1.3;
}

.page-banner p {
    margin: 0;
    max-width: 780px;
    color: rgba(240, 248, 255, 0.9);
    font-size: 14.5px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.92);
}

.breadcrumb a:hover {
    color: #ffd5a6;
}

.disc-badge-lg {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Subjects Overview */
.disc-group-block {
    margin-bottom: 36px;
}

.group-heading {
    margin: 0 0 16px;
    font-size: 20px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
}

.disc-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.disc-wide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.disc-wide-card .disc-top {
    justify-content: flex-start;
    gap: 10px;
}

.disc-wide-card h3 {
    margin: 0;
    font-size: 18px;
}

.disc-wide-card h3 a {
    color: var(--text);
}

.disc-overview {
    margin: 6px 0 12px;
    font-size: 13.8px;
    color: var(--text-muted);
}

.disc-kv {
    margin: 0 0 14px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 6px 10px;
    font-size: 13px;
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    flex: 1;
}

.disc-kv dt {
    font-weight: 700;
    color: var(--primary-dark);
}

.disc-kv dd {
    margin: 0;
    color: var(--text-muted);
}

.disc-wide-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Info Card & Subject Specs */
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.info-card h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.spec-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.spec-item.spec-full {
    grid-column: 1 / -1;
}

.spec-item h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--primary);
}

.spec-item p {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-muted);
}

.block-spacer {
    margin-top: 28px;
}

.block-spacer-sm {
    margin-top: 20px;
}

/* Article Detail */
.article-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.article-header h1 {
    margin: 12px 0 12px;
    font-size: 26px;
    line-height: 1.35;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: var(--text-light);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.article-summary-box {
    margin-top: 16px;
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    padding: 13px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 14.5px;
    color: var(--text);
}

.article-content {
    margin-top: 22px;
    font-size: 15.5px;
    line-height: 1.82;
    color: #1e293b;
    overflow-wrap: break-word;
}

.article-content h2 {
    margin: 28px 0 12px;
    font-size: 20px;
    color: var(--primary-dark);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.article-content h3 {
    margin: 20px 0 10px;
    font-size: 17px;
    color: var(--text);
}

.article-content p {
    margin: 0 0 14px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}

.article-content th,
.article-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.article-content th {
    background: var(--bg);
    font-weight: 700;
}

.article-content pre,
.article-content code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13.5px;
}

.article-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.article-tags {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.article-tags a {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--text-muted);
}

.article-tags a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.article-prev-next {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pn-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pn-item.pn-next {
    text-align: right;
}

.pn-label {
    font-size: 12px;
    color: var(--text-light);
}

.pn-item a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.sticky-toc {
    position: sticky;
    top: 86px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13.5px;
}

.toc-l3 {
    padding-left: 14px;
    font-size: 13px;
}

.toc-list a {
    color: var(--text-muted);
}

.toc-list a:hover {
    color: var(--primary);
}

.rel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rel-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 8px;
}

.rel-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.rel-list a {
    font-size: 13.8px;
    color: var(--text);
}

.rel-list span {
    font-size: 12px;
    color: var(--text-light);
}

/* Question Bank */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.filter-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
}

.filter-chip.active,
.filter-chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.quiz-score-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.question-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.q-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12.5px;
}

.q-num {
    font-weight: 700;
    color: var(--text);
}

.q-disc-link {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
}

.q-type {
    background: var(--bg);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 5px;
}

.q-title {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--text);
}

.q-body {
    font-size: 14.5px;
    color: #1e293b;
    margin-bottom: 14px;
}

.q-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.q-opt-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.q-opt-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.opt-key {
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}

.q-opt-btn.is-correct {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.q-opt-btn.is-wrong {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.q-feedback {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.q-feedback.ok {
    color: #059669;
}

.q-feedback.err {
    color: #dc2626;
}

.q-answer {
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.q-answer summary {
    cursor: pointer;
    font-size: 13.8px;
    font-weight: 600;
    color: var(--primary);
    user-select: none;
}

.q-ans-inner {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
}

.q-ans-key {
    margin-bottom: 6px;
    color: #0f5132;
}

/* Tools Page */
.tools-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.tool-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.tool-head h2 {
    margin: 0 0 6px;
    font-size: 21px;
}

.tool-head p {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--text-muted);
}

.tool-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tool-form-grid.single {
    grid-template-columns: 1fr;
}

.tool-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.tool-form-grid input,
.tool-form-grid select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

.tool-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.sub-tool {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.sub-tool h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.tool-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-output {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-output.mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13.5px;
}

/* Buttons & Pagination */
.btn-primary,
.btn-outline,
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

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

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

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

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

.accent-box .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.accent-box .btn-outline:hover {
    background: #fff;
    color: var(--primary-dark);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.side-btn-group {
    display: flex;
    gap: 10px;
}

.side-btn-group a {
    flex: 1;
}

.pagination {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination a {
    padding: 7px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 14px;
}

.pagination a.active,
.pagination a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.empty-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
}

.page-search {
    margin-top: 14px;
}

.search-summary {
    margin-top: 0;
    color: var(--text-muted);
}

.clean-list {
    padding-left: 20px;
}

.clean-list li {
    margin-bottom: 8px;
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    background: var(--bg);
    padding: 16px 20px;
    border-radius: 10px;
    margin: 14px 0 20px;
}

.sitemap-grid h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.sitemap-grid ul {
    margin: 0;
    padding-left: 18px;
}

.sitemap-grid li {
    margin-bottom: 5px;
}

.not-found-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    max-width: 680px;
}

.nf-code {
    font-size: 64px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}

.nf-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Footer */
.site-footer {
    background: #0f1d33;
    color: rgba(226, 232, 240, 0.85);
    margin-top: 32px;
    padding-top: 42px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.85fr 0.85fr 1.1fr;
    gap: 28px;
    padding-bottom: 32px;
}

.footer-logo-wrap {
    display: inline-block;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.footer-desc {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(203, 213, 225, 0.85);
}

.footer-col h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #fff;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
}

.footer-col a {
    color: rgba(203, 213, 225, 0.85);
}

.footer-col a:hover {
    color: #ffae5c;
}

.footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.footer-tags a {
    font-size: 12.5px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 9px;
    border-radius: 5px;
}

.footer-tags a:hover {
    background: var(--accent);
    color: #fff;
}

.footer-bottom {
    background: #091324;
    padding: 16px 0;
    font-size: 13px;
    color: rgba(148, 163, 184, 0.9);
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    text-align: center;
}

.footer-bottom a {
    color: rgba(226, 232, 240, 0.92);
}

.footer-bottom a:hover {
    color: #ffae5c;
}

/* Responsive Breakpoints (375px verified zero overflow) */
@media (max-width: 1024px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px;
        gap: 4px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .hero-grid,
    .two-col-layout {
        grid-template-columns: 1fr;
    }

    .disc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .featured-grid,
    .books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .container {
        padding: 0 14px;
    }

    .mini-search {
        display: none;
    }

    .brand img {
        height: 40px;
    }

    .hero {
        padding: 28px 0 32px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero-search {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
    }

    .hero-search button {
        width: 100%;
    }

    .section {
        padding: 28px 0;
    }

    .disc-grid,
    .featured-grid,
    .books-grid,
    .books-grid.two-up,
    .disc-detail-grid,
    .spec-grid,
    .q-options,
    .tool-form-grid,
    .tool-two-col,
    .article-prev-next,
    .sitemap-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .article-shell,
    .info-card,
    .tool-card {
        padding: 18px 16px;
    }

    .article-header h1,
    .page-banner h1 {
        font-size: 22px;
    }

    .pn-item.pn-next {
        text-align: left;
    }
}
