:root {
    --bg: #0C0B0A;
    --bg-deep: #161311;
    --bg-content: #1C1916;
    --bg-soft: #26221D;
    --paper: #F3E6D2;
    --title: #FFF8F0;
    --text: #EDE4D8;
    --muted: #B7A898;
    --soft: #8A7B6C;
    --red: #E11D2E;
    --red-bright: #FF4A4F;
    --wine: #8B1E2D;
    --rust: #E25A2A;
    --amber: #E2B14A;
    --border: rgba(226, 177, 74, 0.16);
    --border-strong: rgba(225, 29, 46, 0.40);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
    --footer: #080706;
    --footer-text: #D8CBBA;
    --max: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--paper); }
button, input, summary { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: rgba(225, 29, 46, 0.18); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 20;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--paper);
    color: #231a14;
}
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--bg-deep); }
.header-inner, .tools-inner, .content-shell, .footer-inner {
    width: min(calc(100% - 32px), var(--max));
    margin: 0 auto;
}
.header-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: auto; height: 34px; max-width: 180px; object-fit: contain; object-position: center; }
.brand-text { color: var(--title); font-size: 25px; font-weight: 800; letter-spacing: .08em; }
.brand-en { color: var(--muted); font-size: 12px; letter-spacing: .16em; white-space: nowrap; }
.header-shortcuts { display: flex; align-items: center; gap: 8px; }
.header-shortcuts a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--paper);
}
.header-shortcuts a:hover { border-color: var(--border-strong); background: rgba(225, 29, 46, .08); }

.site-tools { background: #100e0d; border-bottom: 1px solid var(--border); }
.tools-inner { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.tool-details { flex: 1 1 0; min-width: 0; }
.tool-details summary {
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--paper);
    background: var(--bg-content);
}
.tool-details summary::-webkit-details-marker { display: none; }
.summary-mark { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s ease; pointer-events: none; }
.tool-details[open] .summary-mark { transform: rotate(225deg); }
.tool-panel { margin-top: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-content); box-shadow: var(--shadow); }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.directory-group { min-width: 0; }
.directory-group h2 { margin: 0 0 8px; color: var(--title); font-size: 15px; border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.directory-group ul, .search-results { list-style: none; margin: 0; padding: 0; }
.directory-group li { padding: 8px 0; border-bottom: 1px solid rgba(226, 177, 74, .08); }
.directory-group a, .search-results a { color: var(--paper); font-weight: 700; }
.directory-group a[aria-current="page"], .search-results a[aria-current="page"] { color: var(--red-bright); }
.directory-group p, .search-results p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.tool-close {
    min-height: 44px;
    margin-top: 16px;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: transparent;
    color: var(--paper);
    cursor: pointer;
}
.site-search label { display: block; margin-bottom: 8px; color: var(--paper); font-weight: 700; }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-controls input {
    width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 6px; background: #0f0d0c; color: var(--text);
}
.search-controls button {
    min-width: 72px; min-height: 46px; padding: 8px 14px; border: 0; border-radius: 6px;
    background: var(--paper); color: #2a211a; cursor: pointer; font-weight: 700;
}
.search-status, .search-empty { color: var(--muted); font-size: 13px; }
.search-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.search-results li { min-width: 0; padding: 10px 0; border-bottom: 1px solid rgba(226,177,74,.09); }

.site-main { padding: 34px 0 64px; }
.content-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.desktop-sidebar { display: none; min-width: 0; }
.sidebar-inner { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-deep); }
.sidebar-group + .sidebar-group { margin-top: 18px; }
.sidebar-group h2 { margin: 0 0 7px; color: var(--soft); font-size: 12px; letter-spacing: .14em; }
.sidebar-group nav { display: grid; gap: 4px; }
.sidebar-link { min-height: 40px; display: flex; align-items: center; position: relative; padding: 6px 9px 6px 14px; border-radius: 5px; color: var(--muted); }
.sidebar-link::before { content: ""; position: absolute; left: 4px; width: 3px; height: 0; border-radius: 2px; background: var(--red); transition: height .18s ease; pointer-events: none; }
.sidebar-link:hover, .sidebar-link.is-current { background: rgba(225,29,46,.08); color: var(--title); }
.sidebar-link.is-current::before { height: 20px; }
.sidebar-directory { min-height: 44px; display: flex; align-items: center; justify-content: center; margin-top: 18px; border-top: 1px solid var(--border); color: var(--paper); }
.content-area { min-width: 0; }

.breadcrumbs { margin-bottom: 14px; color: var(--soft); font-size: 13px; }
.breadcrumbs a { color: var(--muted); }
.article-page, .home-page { min-width: 0; }
.article-header { max-width: 800px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--red-bright); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3 { color: var(--title); line-height: 1.34; }
h1 { margin: 0 0 14px; font-size: clamp(28px, 3vw, 32px); letter-spacing: -.02em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { overflow-wrap: anywhere; }
.lead { margin: 0; color: var(--paper); font-size: 17px; line-height: 1.85; }
.article-section { max-width: 800px; margin-top: 44px; }
.article-section.wide { max-width: none; }
.article-section h2 { margin: 0 0 13px; padding-left: 13px; border-left: 3px solid var(--red); }
.article-section h3 { margin: 22px 0 8px; }
.article-section p { margin: 0 0 16px; color: var(--text); }
.article-section .muted { color: var(--muted); }
.article-toc { max-width: 800px; margin: 26px 0 34px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-deep); }
.article-toc strong { display: block; margin-bottom: 8px; color: var(--paper); }
.article-toc div { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.article-toc a { color: var(--muted); text-decoration: underline; text-decoration-color: rgba(226,177,74,.3); text-underline-offset: 4px; }
.related-links { max-width: 800px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); }
.related-links h2 { margin: 0 0 12px; font-size: 18px; }
.related-links div { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links a, .text-link, .secondary-link, .primary-link {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 8px 14px; font-weight: 700;
}
.primary-link { background: linear-gradient(135deg,#FF4A4F 0%,#E11D2E 46%,#E25A2A 100%); color: #fffaf3; }
.primary-link:hover { color: white; filter: brightness(1.06); }
.secondary-link { background: var(--paper); color: #2a211a; }
.secondary-link:hover { color: #130f0c; }
.text-link, .related-links a { border: 1px solid var(--border); color: var(--paper); }

.media-frame { margin: 24px 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #100e0d; overflow: hidden; }
.media-frame img { max-width: 100%; width: auto; height: auto; object-fit: contain; object-position: center; }
.media-fallback { width: 100%; min-height: 130px; max-height: 180px; display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 5px; background: linear-gradient(135deg, #161311 0%, #281517 58%, #3b171b 100%); color: var(--paper); text-align: center; font-weight: 800; letter-spacing: .06em; }
.cover-media { margin: 0; }
.cover-media img { max-height: 300px; }
.horizontal-media img { max-height: 240px; }
.vertical-media img { max-height: 420px; }
.icon-media { width: fit-content; padding: 8px; }
.icon-media img { max-height: 72px; max-width: 72px; }

.hero-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: center; padding: 26px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-content); }
.hero-copy { min-width: 0; }
.hero-copy h1 { margin-bottom: 14px; }
.hero-copy .hero-line { color: var(--paper); font-size: 23px; font-weight: 800; line-height: 1.5; }
.hero-copy p { color: var(--muted); }
.hero-actions, .section-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.home-section { margin-top: 50px; min-width: 0; }
.home-section > header { max-width: 800px; margin-bottom: 18px; }
.home-section > header h2 { margin: 0 0 8px; }
.home-section > header p { margin: 0; color: var(--muted); }
.path-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.path-card { min-width: 0; padding: 16px; border-top: 2px solid var(--red); background: var(--bg-deep); }
.path-card h3 { margin: 0 0 6px; }
.path-card p { margin: 0; color: var(--muted); font-size: 14px; }
.path-card a { display: block; min-height: 44px; }

.digest-layout, .split-layout, .mobile-reading, .platform-layout { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr); gap: 26px; align-items: center; }
.digest-list { display: grid; gap: 18px; }
.digest-item { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.digest-item h3 { margin: 0 0 6px; }
.digest-item p { margin: 0; color: var(--muted); }
.editorial-image-top .media-frame { max-width: 860px; }
.editorial-main { max-width: 800px; }
.short-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.short-note { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-deep); }
.short-note h3 { margin: 0 0 5px; font-size: 15px; }
.short-note p { margin: 0; color: var(--muted); font-size: 14px; }
.two-editorial { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 20px; align-items: start; }
.editorial-unit { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-content); }
.editorial-unit h3 { font-size: 20px; margin: 12px 0 8px; }
.editorial-unit > p { color: var(--muted); }
.reading-points { display: grid; gap: 8px; margin-top: 14px; }
.reading-point { padding-top: 8px; border-top: 1px solid rgba(226,177,74,.1); color: var(--muted); font-size: 14px; }
.analysis-list, .state-grid, .compare-grid, .theme-list, .rule-grid { display: grid; gap: 12px; }
.analysis-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analysis-item, .state-card, .compare-card, .theme-item, .rule-card { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-deep); }
.analysis-item h3, .state-card h3, .compare-card h3, .theme-item h3, .rule-card h3 { margin: 0 0 6px; }
.analysis-item p, .state-card p, .compare-card p, .theme-item p, .rule-card p { margin: 0; color: var(--muted); font-size: 14px; }
.reading-bands { display: grid; gap: 18px; }
.reading-band { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); gap: 22px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-content); }
.reading-band h3 { margin: 0 0 8px; font-size: 20px; }
.reading-band p { color: var(--muted); }
.check-points { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.check-point { padding: 12px; border-left: 2px solid var(--rust); background: rgba(226,90,42,.05); }
.check-point strong { display: block; color: var(--paper); }
.check-point span { color: var(--muted); font-size: 13px; }
.compare-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.state-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.state-card { border-top: 2px solid var(--amber); }
.topic-depth { display: grid; gap: 22px; }
.topic-index { padding: 20px; border: 1px solid var(--border); background: var(--bg-deep); }
.theme-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
.observation-list { display: grid; gap: 14px; }
.observation-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.observation-item .label { color: var(--red-bright); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.clue-section { padding: 22px 0 22px 18px; border-left: 2px solid var(--red); }
.final-text-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.final-text-card { padding: 18px; border-top: 1px solid var(--border-strong); background: var(--bg-deep); }
.final-text-card h3 { margin: 0 0 8px; }
.final-text-card p { color: var(--muted); }

.fact-opinion { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact-opinion > div { padding: 16px; border: 1px solid var(--border); border-radius: 6px; }
.fact-opinion strong { display: block; color: var(--paper); margin-bottom: 6px; }
.stage-flow { display: grid; gap: 0; border-top: 1px solid var(--border); }
.stage-flow section { padding: 24px 0; border-bottom: 1px solid var(--border); }
.stage-flow h2 { border-left: 0; padding-left: 0; }
.timeline-method { display: grid; gap: 14px; }
.timeline-step { position: relative; padding: 0 0 18px 24px; border-left: 1px solid var(--border-strong); }
.timeline-step::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); pointer-events: none; }
.timeline-step h3 { margin: 0 0 6px; }
.timeline-step p { margin: 0; }
.method-box { margin: 20px 0; padding: 16px; border-left: 3px solid var(--amber); background: rgba(226,177,74,.06); }
.method-box strong { color: var(--paper); }
.status-definition { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.status-definition article { padding: 15px; border: 1px solid var(--border); background: var(--bg-deep); }
.status-definition h3 { margin: 0 0 6px; }
.status-definition p { margin: 0; color: var(--muted); }

.responsive-table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.responsive-table th, .responsive-table td { padding: 12px 14px; border: 1px solid var(--border); vertical-align: top; text-align: left; }
.responsive-table th { width: 23%; background: var(--bg-soft); color: var(--paper); }
.responsive-table td { background: var(--bg-deep); }

.faq-list { max-width: 850px; display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--border); border-radius: 6px; background: var(--bg-deep); }
.faq-list summary { min-height: 50px; cursor: pointer; padding: 12px 16px; color: var(--paper); font-weight: 800; }
.faq-answer { padding: 0 16px 16px; color: var(--text); }
.faq-answer p { margin: 0; }

.site-footer { background: var(--footer); border-top: 1px solid var(--red); color: var(--footer-text); }
.footer-inner { padding: 38px 0 34px; }
.footer-brand { max-width: 800px; }
.footer-brand-link { margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: 14px; }
.footer-directory { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 18px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.footer-group { min-width: 0; display: grid; align-content: start; gap: 5px; }
.footer-group h2 { margin: 0 0 6px; color: var(--soft); font-size: 12px; letter-spacing: .1em; }
.footer-group a { min-height: 32px; color: var(--footer-text); font-size: 13px; }
.footer-group a[aria-current="page"] { color: var(--red-bright); }
.copyright { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--soft); font-size: 13px; }
.mobile-bottom-nav { display: none; }

@media (min-width: 1100px) {
    .content-shell { grid-template-columns: 196px minmax(0, 1fr); }
    .desktop-sidebar { display: block; }
    .directory-tool { display: none; }
    .search-tool { max-width: 760px; }
    @media (min-height: 780px) {
        .sidebar-inner { position: sticky; top: 18px; }
    }
}

@media (max-width: 1099px) {
    .directory-grid, .search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-directory { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 767px) {
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .header-inner, .tools-inner, .content-shell, .footer-inner { width: min(calc(100% - 32px), var(--max)); }
    .header-inner { min-height: 64px; gap: 10px; }
    .brand { gap: 8px; }
    .brand img { height: 30px; max-width: 136px; }
    .brand-text { font-size: 22px; }
    .brand-en { display: none; }
    .header-shortcuts { gap: 4px; }
    .header-shortcuts a { padding: 0 9px; font-size: 13px; }
    .faq-shortcut { display: none !important; }
    .tools-inner { display: grid; grid-template-columns: 1fr 1fr; }
    .tool-details[open] { grid-column: 1 / -1; }
    .tool-details[open] summary { margin-bottom: 0; }
    .tool-panel { padding: 15px; }
    .directory-grid, .search-results { grid-template-columns: 1fr; }
    .site-main { padding-top: 26px; padding-bottom: 46px; }
    h1 { font-size: clamp(24px, 8vw, 28px); }
    h2 { font-size: 20px; }
    .lead { font-size: 16px; }
    .article-section { margin-top: 34px; }
    .hero-feature { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
    .hero-copy { order: 1; }
    .hero-feature .cover-media { order: 2; }
    .cover-media img { max-height: 260px; }
    .horizontal-media img { max-height: none; }
    .vertical-media img { max-height: 360px; }
    .media-fallback { min-height: 110px; max-height: 140px; }
    .home-section { margin-top: 36px; }
    .path-grid { grid-template-columns: 1fr 1fr; }
    .digest-layout, .split-layout, .platform-layout, .reading-band { grid-template-columns: 1fr; }
    .mobile-reading { grid-template-columns: 1fr; }
    .mobile-reading .mobile-copy { order: 1; }
    .mobile-reading .mobile-images { order: 2; }
    .short-grid, .analysis-list, .compare-grid, .state-grid, .check-points, .final-text-grid { grid-template-columns: 1fr; }
    .two-editorial { grid-template-columns: 1fr; }
    .theme-list { grid-template-columns: 1fr; }
    .fact-opinion, .status-definition { grid-template-columns: 1fr; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; width: 100%; }
    .responsive-table tr { margin-bottom: 12px; border: 1px solid var(--border); }
    .responsive-table th, .responsive-table td { border: 0; border-bottom: 1px solid var(--border); }
    .responsive-table th { padding-bottom: 5px; }
    .responsive-table td { padding-top: 7px; }
    .footer-directory { grid-template-columns: 1fr 1fr; }
    .mobile-bottom-nav {
        position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
        display: grid; grid-template-columns: repeat(5, minmax(0,1fr));
        min-height: calc(56px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(8,7,6,.98); border-top: 1px solid var(--border-strong);
    }
    .mobile-bottom-nav a { min-width: 0; min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 7px 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
    .mobile-bottom-nav a.is-current { color: var(--red-bright); background: rgba(225,29,46,.08); }
}

@media (max-width: 374px) {
    .tools-inner { grid-template-columns: 1fr; }
    .tool-details[open] { grid-column: auto; }
    .path-grid { grid-template-columns: 1fr; }
    .footer-directory { grid-template-columns: 1fr; }
    .header-shortcuts a { padding: 0 7px; }
}
