:root {
    --font-body: "SimSun", "宋体", "STSong", serif;
    --font-display: "FZDaBiaoSongSubset", "SimSun", "宋体", "STSong", serif;
    --bg-page: #f6f3ee;
    --bg-surface: #ffffff;
    --bg-subtle: #fbfaf7;
    --text-primary: #22313f;
    --text-secondary: #61707d;
    --border-soft: #d9e0e6;
    --accent: #214a67;
    --accent-strong: #17384f;
    --accent-soft: #8fb8cf;
    --accent-faint: #e8f1f6;
    --highlight: #ead06d;
    --shadow-soft: 0 18px 42px rgba(27, 48, 69, 0.08);
    --shadow-light: 0 8px 24px rgba(27, 48, 69, 0.06);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --content-width: 1180px;
    --reading-width: 820px;
    --transition: 180ms ease;

    --tier-1-bg: #dcecf4;
    --tier-1-bg-strong: #c6dde9;
    --tier-1-accent: #6f9ab7;
    --tier-2-bg: #f5e6d1;
    --tier-2-bg-strong: #edd8bd;
    --tier-2-accent: #b48a52;
    --tier-2-5-bg: #ece4f6;
    --tier-2-5-bg-strong: #ddd0ef;
    --tier-2-5-accent: #8d7db0;
    --tier-daquan-bg: #efe7c8;
    --tier-daquan-bg-strong: #e3d8b0;
    --tier-daquan-accent: #a9894d;
    --tier-3-bg: #e0eee4;
    --tier-3-bg-strong: #cfe1d5;
    --tier-3-accent: #7da58d;
    --tier-4-bg: #edf0f2;
    --tier-4-bg-strong: #dde3e7;
    --tier-4-accent: #94a2ae;
}

@font-face {
    font-family: "FZDaBiaoSongSubset";
    src:
        url("../fonts/fzdbsj-subset.woff2?v=20260620-title") format("woff2"),
        url("../fonts/fzdbsj-subset.woff?v=20260620-title") format("woff");
    font-display: swap;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(143, 184, 207, 0.16), transparent 32%),
        radial-gradient(circle at top right, rgba(33, 74, 103, 0.1), transparent 28%),
        var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.8;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition), transform var(--transition);
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.level-1 {
    --tier-surface: var(--tier-1-bg);
    --tier-surface-strong: var(--tier-1-bg-strong);
    --tier-accent: var(--tier-1-accent);
}

.level-2 {
    --tier-surface: var(--tier-2-bg);
    --tier-surface-strong: var(--tier-2-bg-strong);
    --tier-accent: var(--tier-2-accent);
}

.level-2-5 {
    --tier-surface: var(--tier-2-5-bg);
    --tier-surface-strong: var(--tier-2-5-bg-strong);
    --tier-accent: var(--tier-2-5-accent);
}

.level-daquan {
    --tier-surface: var(--tier-daquan-bg);
    --tier-surface-strong: var(--tier-daquan-bg-strong);
    --tier-accent: var(--tier-daquan-accent);
}

.level-3 {
    --tier-surface: var(--tier-3-bg);
    --tier-surface-strong: var(--tier-3-bg-strong);
    --tier-accent: var(--tier-3-accent);
}

.level-4 {
    --tier-surface: var(--tier-4-bg);
    --tier-surface-strong: var(--tier-4-bg-strong);
    --tier-accent: var(--tier-4-accent);
}

.page-shell {
    min-height: 100vh;
    padding: 22px 24px 32px;
}

.site-header {
    width: min(100%, var(--content-width));
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.site-brand__logo {
    width: 52px;
    flex: none;
    filter: drop-shadow(0 10px 18px rgba(22, 46, 69, 0.15));
}

.site-brand__meta {
    min-width: 0;
}

.site-brand__eyebrow {
    margin: 0 0 4px;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.site-brand__title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.page-hero {
    width: min(100%, 880px);
    margin: 0 auto 24px;
}

.page-title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.95rem, 2.1vw + 1rem, 2.35rem);
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: 0.02em;
}

.page-subtitle {
    margin: 12px 0 0;
    max-width: 60ch;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.9;
}

.landing-page {
    display: flex;
    flex-direction: column;
}

.landing-main {
    width: min(100%, 1080px);
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.landing-logo {
    width: min(30vw, 195px);
    filter: drop-shadow(0 16px 26px rgba(22, 46, 69, 0.15));
}

.landing-kicker {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.landing-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.45rem, 2.8vw + 1rem, 3.55rem);
    font-weight: 600;
    line-height: 1.22;
    color: var(--text-primary);
}

.landing-subtitle {
    margin: 0;
    max-width: 58ch;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.9;
}

.landing-legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.landing-legend__label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-legend__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.landing-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58)), var(--tier-surface, var(--bg-surface));
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-light);
}

.landing-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--tier-accent, var(--accent-soft));
}

.system-grid {
    width: min(100%, 1080px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.system-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 86px;
    padding: 18px 26px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(33, 74, 103, 0.14);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
    text-align: center;
}

.system-card:hover {
    transform: translateY(-2px);
    border-color: rgba(33, 74, 103, 0.24);
    box-shadow: 0 20px 36px rgba(27, 48, 69, 0.12);
}

.system-card__meta {
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.system-card__title {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 0.95vw + 1.1rem, 2rem);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.system-card__desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.85;
}

.site-footer {
    width: min(100%, 1080px);
    margin: 26px auto 0;
    padding-top: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

.site-footer a {
    color: inherit;
}

.site-footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.site-footer__separator {
    color: rgba(97, 112, 125, 0.5);
}

.search-main {
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

.search-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.search-shell > .page-hero {
    width: min(100%, 880px);
    margin: 0 auto;
}

.search-shell > .search-panel,
.search-shell > .search-sidebar,
.search-shell > .search-results,
.search-shell > .help-panel {
    grid-column: 1;
    width: min(100%, 880px);
    margin: 0 auto;
}

.search-shell--split {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.search-shell--split > .page-hero {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
}

.search-shell--split > .search-panel {
    grid-column: 1 / 2;
    width: 100%;
    margin: 0;
}

.search-shell--split > .search-sidebar {
    grid-column: 2 / 3;
    grid-row: 2 / 5;
    width: 100%;
    margin: 0;
}

.search-shell--split > .search-results {
    grid-column: 1 / 2;
    width: 100%;
    margin: 0;
}

.search-shell--split > .help-panel {
    grid-column: 1 / 2;
    width: 100%;
    margin: 0;
}

.search-panel {
    width: 100%;
    margin: 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

#searchInput {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

#searchInput::placeholder {
    color: #8e98a3;
}

#searchInput:focus {
    border-color: rgba(33, 74, 103, 0.35);
    box-shadow: 0 0 0 4px rgba(143, 184, 207, 0.18);
}

#searchButton,
.secondary-button,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 22px rgba(33, 74, 103, 0.15);
}

#searchButton:hover,
.secondary-button:hover,
.back-link:hover {
    background: var(--accent-strong);
    color: #fff;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(33, 74, 103, 0.18);
    color: var(--accent-strong);
    box-shadow: none;
}

.secondary-button:hover {
    border-color: rgba(33, 74, 103, 0.28);
}

#searchButton:disabled {
    opacity: 0.65;
    cursor: wait;
}

.secondary-button:disabled {
    opacity: 0.55;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.search-hint {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.search-results,
.search-sidebar {
    min-width: 0;
}

.search-results {
    display: flex;
    flex-direction: column;
}

#results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 0;
}

#results:empty {
    display: none;
}

.results-notice {
    padding: 14px 16px;
    background: rgba(255, 250, 232, 0.92);
    border: 1px solid rgba(180, 138, 82, 0.22);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.75;
    box-shadow: 0 8px 18px rgba(27, 48, 69, 0.04);
}

#summary {
    position: static;
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    display: none;
    overflow: hidden;
}

#summary.summary-floating {
    position: fixed;
    top: 24px;
    z-index: 20;
}

#summary.summary-scrollable {
    overflow-y: auto;
}

.summary-title {
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.summary-total {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.summary-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(33, 74, 103, 0.08);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32)), var(--tier-surface, var(--bg-surface));
    color: var(--text-primary);
    text-align: left;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.summary-item:hover {
    transform: translateY(-1px);
    border-color: rgba(33, 74, 103, 0.16);
    box-shadow: 0 10px 20px rgba(27, 48, 69, 0.08);
}

.summary-item + .summary-item {
    margin-top: 8px;
}

.summary-item__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-tier-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.86);
    color: var(--tier-accent, var(--accent));
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.summary-item__label {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.summary-item__subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.summary-item__count {
    flex: none;
    min-width: 48px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--tier-accent, var(--text-secondary));
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tier-section {
    position: relative;
    overflow: hidden;
    padding: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.35)), var(--tier-surface, var(--bg-surface));
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.tier-section::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, var(--tier-accent, var(--accent-soft)), rgba(255, 255, 255, 0.6));
}

.tier-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-left: 14px;
}

.tier-header__main {
    min-width: 0;
}

.tier-header__title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(1.25rem, 1.1vw + 1rem, 1.65rem);
    font-weight: 600;
    line-height: 1.35;
}

.tier-header__subtitle {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.tier-count {
    flex: none;
    min-width: 94px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.82);
    color: var(--tier-accent, var(--accent));
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.tier-items,
.tier-subgroup__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-subgroup {
    padding-top: 14px;
}

.tier-subgroup + .tier-subgroup {
    border-top: 1px dashed rgba(33, 74, 103, 0.18);
}

.tier-subgroup__title {
    margin: 0 0 12px;
    padding-left: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.result-item {
    margin: 0;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(33, 74, 103, 0.09);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 15.5px;
    line-height: 1.9;
    box-shadow: 0 8px 18px rgba(27, 48, 69, 0.04);
}

.result-item--return-target {
    border-color: rgba(33, 74, 103, 0.28);
    background: rgba(232, 241, 246, 0.94);
    box-shadow: 0 0 0 4px rgba(143, 184, 207, 0.2), 0 16px 30px rgba(27, 48, 69, 0.08);
}

.result-heading {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-right: 8px;
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.result-heading a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.28em;
    padding: 1px 0;
    border-bottom: 1px solid currentColor;
    text-decoration: none;
}

.result-heading a::after {
    content: "↗";
    font-size: 0.82em;
    opacity: 0.7;
}

.result-heading a:hover {
    border-color: currentColor;
    background: rgba(33, 74, 103, 0.08);
}

.result-inline-group {
    display: inline;
}

.text-segment {
    display: inline;
}

.text-segment + .text-segment {
    margin-left: 0.45em;
}

.text-segment--jing,
.jing-text {
    color: var(--accent-strong);
}

.text-segment--zhu,
.zhu-text {
    color: #4e7263;
}

.text-segment--shu {
    color: #475764;
}

.highlight {
    background: var(--highlight);
    border-radius: 2px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: inherit;
    font-weight: 700;
}

.help-panel {
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(33, 74, 103, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.help-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.help-panel summary::-webkit-details-marker {
    display: none;
}

.help-panel summary::after {
    content: "＋";
    color: var(--text-secondary);
    font-size: 16px;
}

.help-panel[open] summary::after {
    content: "－";
}

.help-panel__body {
    padding: 0 20px 20px;
    border-top: 1px solid rgba(33, 74, 103, 0.08);
    color: var(--text-secondary);
    font-size: 13px;
}

.help-panel__body h2 {
    margin: 18px 0 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.help-panel__body ul {
    margin: 0;
    padding-left: 20px;
}

.help-panel__body li + li {
    margin-top: 8px;
}

.detail-page .site-header {
    margin-bottom: 18px;
}

.detail-topbar {
    width: min(100%, var(--reading-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.detail-topbar .back-link {
    min-height: 42px;
    padding: 0 16px;
    box-shadow: none;
}

.reading-shell {
    width: min(100%, var(--reading-width));
    margin: 0 auto;
}

.detail-kicker {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

.detail-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(33, 74, 103, 0.12);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.reading-card {
    position: relative;
    padding: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.reading-card.level-1,
.reading-card.level-2,
.reading-card.level-2-5,
.reading-card.level-daquan,
.reading-card.level-3,
.reading-card.level-4 {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.94)), var(--tier-surface);
}

.reading-card.level-1::before,
.reading-card.level-2::before,
.reading-card.level-2-5::before,
.reading-card.level-daquan::before,
.reading-card.level-3::before,
.reading-card.level-4::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    border-radius: 26px 26px 0 0;
    background: var(--tier-accent);
    opacity: 0.92;
}

.detail-title {
    margin: 0 0 18px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(2rem, 1.8vw + 1.1rem, 2.35rem);
    font-weight: 600;
    line-height: 1.35;
}

.simple-page .site-header {
    margin-bottom: 18px;
}

.simple-shell {
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 28px 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.simple-page__title {
    margin: 0 0 20px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.8vw + 1rem, 2.6rem);
    font-weight: 600;
    line-height: 1.3;
}

.simple-page__section-title {
    margin: 28px 0 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.simple-page__text {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.95;
}

.simple-page__text + .simple-page__text {
    margin-top: 10px;
}

.chapter-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chapter-content p {
    margin: 0;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(33, 74, 103, 0.07);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.95;
}

.chapter-content p.level-1,
.chapter-content p.level-2,
.chapter-content p.level-2-5,
.chapter-content p.level-daquan,
.chapter-content p.level-3,
.chapter-content p.level-4 {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)), var(--tier-surface);
    border-color: rgba(33, 74, 103, 0.09);
}

.inline-note {
    display: inline;
    padding: 0 0.18em;
    border-radius: 0.36em;
}

.inline-note--level-2-5 {
    background: rgba(141, 125, 176, 0.2);
    box-shadow: inset 0 -0.56em 0 rgba(141, 125, 176, 0.18);
    color: #5d4f7e;
    font-weight: 700;
}

.inline-note--active {
    background: rgba(141, 125, 176, 0.34);
    box-shadow: inset 0 -0.68em 0 rgba(141, 125, 176, 0.26);
}

.chapter-content .highlighted,
.chapter-content p.highlighted {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.16)), var(--tier-surface-strong, var(--highlight));
    border-color: var(--tier-accent, rgba(180, 138, 82, 0.35));
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72), 0 18px 32px rgba(27, 48, 69, 0.08);
    font-weight: 700;
}

.source-label {
    display: inline-block;
    margin-right: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.detail-actions {
    margin-top: 18px;
}

.detail-layout {
    width: min(100%, var(--reading-width));
    margin: 0 auto;
}

.detail-layout--outline {
    width: min(100%, calc(var(--reading-width) + 320px));
    display: grid;
    grid-template-columns: minmax(0, var(--reading-width)) 260px;
    gap: 28px;
    align-items: start;
}

.detail-outline,
.detail-outline-mobile {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 74, 103, 0.12);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
}

.detail-outline {
    position: sticky;
    top: 24px;
    padding: 16px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.detail-outline__title {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.detail-outline__list,
.detail-outline-mobile__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-outline__item {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(33, 74, 103, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent-strong);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.detail-outline__item:hover {
    border-color: rgba(33, 74, 103, 0.2);
    background: rgba(232, 241, 246, 0.72);
    color: var(--accent-strong);
}

.detail-outline-mobile {
    display: none;
    margin-top: 18px;
    overflow: hidden;
}

.detail-outline-mobile summary {
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.detail-outline-mobile__body {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(33, 74, 103, 0.08);
}

@media (max-width: 1024px) {
    .landing-main {
        width: min(100%, 820px);
    }

    .landing-logo {
        width: min(32vw, 170px);
    }

    .system-grid {
        width: min(100%, 720px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-shell,
    .search-shell--split {
        grid-template-columns: 1fr;
    }

    .search-shell > .page-hero,
    .search-shell > .search-panel,
    .search-shell > .search-sidebar,
    .search-shell > .search-results,
    .search-shell > .help-panel {
        grid-column: 1;
        grid-row: auto;
    }

    #summary {
        position: static;
    }

    #summary.summary-floating {
        position: static;
    }

    .detail-layout--outline {
        width: min(100%, var(--reading-width));
        grid-template-columns: 1fr;
    }

    .detail-outline {
        display: none;
    }

    .detail-outline-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 22px 16px 36px;
    }

    .site-header,
    .detail-topbar,
    .tier-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    #searchButton,
    .secondary-button,
    .back-link {
        width: 100%;
    }

    .landing-main {
        justify-content: flex-start;
        gap: 18px;
        padding-top: 16px;
    }

    .landing-logo {
        width: min(42vw, 150px);
    }

    .landing-title {
        font-size: clamp(2rem, 6vw, 2.65rem);
    }

    .system-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .system-card {
        min-height: 70px;
        padding: 14px 18px;
        border-radius: var(--radius-md);
    }

    .system-card__title {
        font-size: clamp(1.45rem, 5vw, 1.8rem);
    }

    .landing-legend__list {
        gap: 8px;
    }

    .reading-card {
        padding: 20px 16px;
    }

    .chapter-content p,
    .result-item {
        padding: 14px 14px;
        font-size: 16px;
    }

    .tier-section {
        padding: 18px 16px;
    }

    .tier-count {
        min-width: 0;
    }
}
