/* Shared reading and delivery details, layered over the retained Kimi design. */
:root { --muted:#59655c; }
.lt-topics { --lt-muted:#566358; }
.lt-source-label,.lt-version,.lt-reflection small { color:#566358; }
.pd-period { --pd-muted:#56635c; }
html { scroll-padding-top:96px; scroll-behavior:auto; }
.hero-copy,.birth-card,.form-grid>*,.card-heading>div,.section-heading>div { min-width:0; }
.hero h1,.hero h1 em { overflow-wrap:anywhere; white-space:normal; }
fieldset { min-inline-size:0; }
.input-wrap input { min-width:0; }
@media(max-width:820px) { .hero { grid-template-columns:minmax(0,1fr); } }
.main-nav a,.brand,.text-button,summary { min-height:44px; }
.main-nav a,.text-button,.source-link,.pr-source-link,.lt-source-link { display:inline-flex; align-items:center; }
.source-link,.pr-source-link,.lt-source-link { min-height:44px; }
.small-button,.text-button,.document-chip,.lt-source-block,.pr-source-block { min-height:44px; font-size:14px; }
.heading-action { min-height:44px; }
button,input[type="date"],input[type="time"],select { font-size:16px; min-height:44px; }
.reading-tools { padding:16px; border-bottom:1px solid var(--line); }
.reading-tools p { margin:0 0 8px; font-size:14px; color:var(--ink-soft); }
.reading-tools small { display:block; margin-top:8px; font-size:12px; color:var(--ink-soft); }
.reading-tools button:disabled { opacity:.55; cursor:not-allowed; }
#resultTabs { display:flex; overflow-x:auto; flex-wrap:nowrap; gap:6px; padding:6px 10px; scrollbar-width:thin; }
#resultTabs .tab-button { flex:0 0 auto; min-height:48px; min-width:96px; }
@media(max-width:640px) {
  #resultTabs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); overflow-x:visible; gap:6px; padding:8px; }
  #resultTabs .tab-button { min-width:0; min-height:44px; justify-content:center; padding:8px 4px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); font-size:13px; line-height:1.25; text-align:center; }
  #resultTabs .tab-button:nth-child(-n+3) { grid-column:span 2; }
  #resultTabs .tab-button:nth-child(n+4) { grid-column:span 3; }
  #resultTabs .tab-button[aria-selected="true"] { border-color:var(--pine-deep); color:#fffdf7; background:var(--pine-deep); }
  #resultTabs .tab-button[aria-selected="true"]::after { display:none; }
  #resultTabs .tab-button[aria-selected="true"] .tab-count { color:#fffdf7; background:rgba(255,255,255,.2); }
}
.lt-topic,.pr-disclosure,#localSourceReader,#periodSourceReview { scroll-margin-top:96px; }
#periodSourceReview { font-size:16px; line-height:1.85; }
#periodSourceReview .pd-evidence { font-size:inherit; }
.pr-disclosure { margin-top:24px; }
.pr-source-block,.lt-source-block { min-height:44px; font:inherit; color:var(--pine); background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; padding:8px 12px; cursor:pointer; }
.pr-source-actions,.lt-source-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.lt-topic .lt-conditions { grid-template-columns:1fr; }
.lt-editorial-warning { font-size:15px; line-height:1.8; }
.exact-source { margin-bottom:24px; padding:24px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.exact-source blockquote { margin:16px 0; padding:16px; background:var(--surface-soft); font:16px/1.9 var(--serif); white-space:pre-wrap; overflow-wrap:anywhere; }
.exact-source h3 { margin-top:0; }
.source-reader-toolbar { position:sticky; top:80px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; background:var(--surface); border-bottom:1px solid var(--line); z-index:2; }
.source-reader-toolbar h3 { margin:0; font-size:18px; }
.privacy-details { max-width:720px; font-size:14px; }
.privacy-details summary { cursor:pointer; }
.page-footer output { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--pine); outline-offset:3px; }
@media(max-width:600px) {
  .hero-description { font-size:16px; }
  .hero-copy { padding-bottom:0; }
  .foundation-stats { gap:6px 14px; font-size:12px; }
  .foundation-stats strong { font-size:17px; }
  .section-heading { gap:12px; }
  .reading-tools { padding:12px 16px; }
  .pr-hero { padding:20px; }
  .pr-hero h2 { font-size:24px; }
  .pr-identity { margin-top:12px; padding:8px 0; background:transparent; border:0; }
  .pr-summary { margin-top:12px; padding-top:12px; }
  .pr-summary-p { font:15px/1.8 var(--sans); }
  .lt-intro { padding-bottom:12px; }
  .lt-intro h2 { font-size:20px; }
  .lt-topic { padding:20px 16px; }
  .lt-topic-title h3 { font-size:24px; }
  .lt-lead { padding-top:16px; }
  .lt-headline { font:600 17px/1.8 var(--sans); }
  .lt-conditions { margin-top:12px; }
  .lt-reflection { margin-top:12px; }
  .exact-source { padding:20px 16px; }
}
@media print {
  .site-header,.hero,.page-footer,.reading-tools,.tabbar,.pd-switcher,.pd-topic-switch,.lt-nav,.guide-actions,.toast { display:none!important; }
  .tab-panel[hidden] { display:none!important; }
  details>*:not(summary) { display:block!important; }
  details::details-content { content-visibility:visible!important; }
  .wrap { width:100%; max-width:none; }
  .results-shell,.pr-hero,.lt-topic { box-shadow:none; }
}

/* Keep the selected reading close to its title; use the shared glossary in place. */
.pr-hero.pr-hero--compact { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 20px; padding:16px 20px; }
.pr-hero--compact::after { content:none; }
.pr-hero.pr-hero--compact h2 { margin:0; font:600 22px/1.4 var(--serif); }
.pr-compact-identity { min-width:0; font-size:13px; overflow-wrap:anywhere; }
.pr-compact-identity strong,.pr-compact-identity span { display:block; }
.pr-compact-identity span { color:var(--muted); }
.lt-reader-title { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.lt-nav-link { min-height:48px; }
.lt-position.lt-position--compact { display:block; margin:14px 0; padding:12px 0; border:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:transparent; }
.lt-position-line { font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
.lt-term-help { margin-top:4px; font-size:14px; line-height:1.8; }
.lt-term-help>summary { display:list-item; min-height:44px; padding:9px 0; color:var(--pine); font-weight:600; cursor:pointer; overflow-wrap:anywhere; }
.lt-term-help>div { display:grid; gap:8px; padding:4px 0 12px; color:var(--ink-soft); }
.lt-term-help>div p { margin:0; }

/* Why this source is shown: carried from the card that was clicked, cleared when the reading changes. */
.source-context { margin:16px 0; padding:14px 16px; border-left:3px solid var(--pine); border-radius:0 10px 10px 0; background:var(--pine-soft,#e7efea); font-size:14px; line-height:1.75; overflow-wrap:anywhere; }
.source-context p,.source-context ul,.source-context h4 { margin:0; }
.source-context h4 { margin-top:8px; font-size:13px; }
.source-context ul { padding-left:20px; }
.source-context-where strong { display:block; margin-top:2px; }
.source-context-role { display:inline-block; margin-right:8px; padding:1px 8px; border-radius:999px; color:#fff; background:var(--pine); font-size:12px; font-weight:700; }
.source-context-note { margin-top:8px!important; color:var(--ink-soft); }
.source-context-warning { margin-top:8px!important; padding:10px 12px; border-left:3px solid #9a4037; border-radius:0 8px 8px 0; background:#f8e9e6; color:#713c35; white-space:pre-line; }
.source-context-warning strong { display:block; margin-bottom:2px; }
.source-context details { margin-top:6px; }
.source-context summary { display:list-item; min-height:44px; padding:10px 0; cursor:pointer; font-weight:600; }
.source-context--modern,.source-context--limit { border-left-color:#42677a; background:#eaf1f3; }
.source-context--modern .source-context-role,.source-context--limit .source-context-role { background:#42677a; }
.source-context--candidate,.source-context--conflict,.source-context--not-adopted { border-left-color:#94621d; background:#f7efdc; }
.source-context--candidate .source-context-role,.source-context--conflict .source-context-role,.source-context--not-adopted .source-context-role { background:#8a5a16; }
.source-context--none { border-left-color:var(--line-strong,#c9c5b8); background:var(--surface-soft,#f8f5ed); }
.source-context--none strong { margin-right:8px; }
.source-link--external { border-style:dashed; }
.source-result h3[tabindex="-1"]:focus { outline:3px solid var(--pine); outline-offset:3px; }
.lt-scope-line { margin:18px 0 0; padding:10px 13px; border-radius:8px; background:#f1f1eb; color:#4d5a52; font-size:14px; line-height:1.75; }
.lt-scope-line + .lt-transformations { margin-top:14px; }
/* Converted-date notes and the plain historical-clock explanation. */
.pr-input-note,.pd-input-note { display:block; margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.pr-compact-identity small { display:block; }
.form-error > strong { display:block; margin-bottom:4px; }
.form-error > p { margin:0 0 8px; }
.form-error-steps { margin:0 0 8px; padding-left:20px; }
.form-error-steps li + li { margin-top:4px; }
.form-error .source-link { margin:2px 0 6px; }
.form-error-technical > summary { display:list-item; min-height:44px; padding:10px 0; cursor:pointer; font-weight:600; }
.form-error-technical p { margin:0 0 6px; overflow-wrap:anywhere; }

/* In-page large reading text. Default sizes are untouched; only html[data-text-size="large"] changes them. */
.text-size-toggle { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-width:52px; min-height:44px; padding:6px 10px; border:1px solid var(--line-strong,#c9c5b8); border-radius:10px; color:var(--pine-deep,#173f35); background:var(--surface,#fffdf8); font:600 15px/1 var(--sans,sans-serif); cursor:pointer; white-space:nowrap; }
.text-size-toggle .text-size-glyph { font-family:var(--serif,serif); font-size:18px; }
.text-size-toggle[aria-pressed="true"] { color:#fffdf7; background:var(--pine,#1d5647); border-color:var(--pine,#1d5647); }
.text-size-toggle[aria-pressed="true"]::after { content:"✓"; margin-left:2px; }
.text-size-toggle:disabled { opacity:.5; cursor:default; }
/* Phone header: two fixed 44px rows instead of squeezing brand, nav and toggle into one line.
   Row 1: brand (left) + text-size toggle (right). Row 2: nav links sharing the full width.
   Visual order = DOM order (brand, toggle, nav), so Tab and reading order follow what is seen.
   The 6px top padding equals the focus ring reach (3px outline + 3px offset), so a focused
   row-1 control keeps its whole outline below the top of the viewport.
   Header box = 6px padding + 44px row + 1px nav border-top + 44px row + 1px .site-header border-bottom
   = 96px, independent of large text or the 结果 link. */
@media(max-width:600px) {
  :root { --header-h:96px; }
  html { scroll-padding-top:calc(var(--header-h) + 12px); }
  .site-header .header-inner { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"brand size" "nav nav"; align-items:center; column-gap:8px; row-gap:0; min-height:0; padding-top:6px; }
  .site-header .brand { grid-area:brand; min-width:0; min-height:44px; margin-right:0; }
  .site-header .brand-name { white-space:nowrap; }
  .site-header .text-size-toggle { grid-area:size; }
  .site-header .main-nav { grid-area:nav; display:flex; gap:4px; min-width:0; border-top:1px solid rgba(201,197,184,.55); }
  .site-header .main-nav a { flex:1 1 0; justify-content:center; min-width:44px; min-height:44px; padding:0 6px; font-size:14px; white-space:nowrap; }
  .site-header .local-pill { display:none; }
  /* The local source toolbar sticks directly below the taller header instead of under it. */
  .source-reader-toolbar { top:var(--header-h); }
}

html[data-text-size="large"] main,html[data-text-size="large"] .page-footer { overflow-wrap:anywhere; }
/* Main reading prose and original text. */
html[data-text-size="large"] :is(.lt-reading-copy,.lt-transformation-copy,.lt-summary,.pr-prose,.pr-summary-p,.pd-reading-text,.pd-topic-summary,.pd-modern-item p,.pd-record-item p,.pd-takeaway,.source-text,.exact-source blockquote,.lt-quote,.pd-quote,.pr-source blockquote,.source-detail blockquote,.citation blockquote,.lesson-summary,.reading-value,.meaning-card p) { font-size:19px; line-height:1.95; }
/* Conditions, limits, source context, notes and errors. */
html[data-text-size="large"] :is(.lt-condition-list,.lt-reflection p,.lt-gap > p,.lt-editorial-warning,.lt-position-line,.lt-term-help,.lt-scope-line,.lt-unavailable p,.lt-status-note,.lt-citation,.lt-version,.lt-evidence,.pr-reflection p,.pr-conditions,.pr-unresolved,.pr-notice p,.pr-gap-grid p,.pr-section-note,.pr-source-meta,.pr-coverage > p,.pr-coverage dd,.pd-reflection,.pd-unresolved,.pd-record-group li,.pd-match li,.pd-match > p,.pd-pending li,.pd-conditions li,.pd-gap > p,.pd-alert p,.pd-notice-body > p,.pd-notice-required > p,.pd-age-math p,.pd-boundary p,.pd-palace-help,.pd-status p,.pd-hold-note p,.pd-inline-status p,.pd-age-note p,.pd-compare-topic p,.pd-compare-topic li,.pd-compare-summary,.pd-citation,.pd-source-facts,.pd-conflict-note,.pd-topic-empty,.source-context,.source-reading-summary,.source-detail p,.source-detail li,.source-detail dd,.exact-source p,.reading-details p,.reading-details li,.reading-details dd,.reading-facts p,.live-reading p,.notice p,.form-error,.action-feedback,.field-help,.source-status,.source-meta,.citation-meta,.pr-input-note,.pd-input-note) { font-size:17px; line-height:1.85; }
/* Small labels and disclosure rows that lead into the text above. */
html[data-text-size="large"] :is(.lt-source > summary,.lt-condition--unresolved > summary,.lt-term-help > summary,.pr-source summary,.pr-unresolved summary,.pd-evidence > summary,.pd-records > summary,.pd-unresolved > summary,.pd-boundary summary,.pd-age-note > summary,.pd-notice > summary,.pd-candidate-conditions > summary,.pd-candidate-source > summary,.source-context summary,.form-error-technical > summary,.reading-details summary,.lt-condition h6,.pd-candidate > summary small,.lt-section-heading > span,.pd-section-heading > span,.lt-reflection small,.lt-nav-link small,.pd-topic-button > small) { font-size:16px; line-height:1.6; }
html[data-text-size="large"] :is(.lt-reading h5,.lt-transformation h5,.lt-gap h5,.pd-reading h6,.pd-modern-item h6,.pd-record-item h6,.pd-gap h6,.pd-candidate > summary strong) { font-size:20px; line-height:1.5; }
html[data-text-size="large"] .pd-compare-grid { grid-template-columns:repeat(3,minmax(240px,1fr)); min-width:740px; }

@media(max-width:600px) { .source-context { padding:12px; } .citation-actions .source-link,.source-actions .source-link { white-space:normal; text-align:left; } }

/* Literature review prose uses the existing large-reading scale. */
html[data-text-size="large"] #periodSourceReview { font-size:19px; line-height:1.95; }
html[data-text-size="large"] #periodSourceReview h4 { font-size:20px; line-height:1.5; }

#periodSourceReview summary::after { content:"展开"; margin-left:auto; padding-left:8px; font-size:14px; white-space:nowrap; flex-shrink:0; }
#periodSourceReview[open] > summary::after,#periodSourceReview details[open] > summary::after { content:"收起"; }

/* Saving is a primary action here, rather than the small citation-link type. */
[data-reading-save] { display:block; min-width:0; }
[data-reading-save] .source-link { font-size:16px; line-height:1.6; white-space:normal; }
html[data-text-size="large"] [data-reading-save] .source-link { font-size:18px; }

/* Traditional 4x4 12-palace ring board + active palace inspector (三方四正). */
.zw-board { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:repeat(4,minmax(92px,auto)); gap:4px; padding:5px; border:1px solid var(--line-strong,#c9c5b8); border-radius:16px; background:var(--surface-soft,#f8f5ed); }
.zw-cell { min-width:0; min-height:92px; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:3px; padding:6px 5px; border:1px solid var(--line,#ddd9cc); border-radius:10px; color:var(--ink,#191d17); background:#fffefa; font:12px/1.35 var(--sans,sans-serif); text-align:left; cursor:pointer; transition:border-color .16s,background .16s,box-shadow .16s; }
.zw-cell:hover { border-color:var(--pine,#1d5647); background:#f6faf7; }
.zw-cell.is-opposite { border-color:rgba(163,75,56,.52); background:#fdf7f4; }
.zw-cell.is-trine { border-color:rgba(29,86,71,.42); background:#f4f8f5; }
.zw-cell.is-selected { border-color:var(--pine-deep,#173f35); background:#eaf3ee; box-shadow:inset 0 0 0 1.5px var(--pine-deep,#173f35); }
.zw-cell-top { display:flex; align-items:baseline; justify-content:space-between; gap:2px; min-width:0; padding-bottom:3px; border-bottom:1px dashed rgba(201,197,184,.72); }
.zw-cell-name { font-family:var(--serif,serif); font-size:13px; font-weight:700; color:var(--ink,#191d17); white-space:nowrap; }
.zw-cell.is-soul .zw-cell-name { color:var(--pine-deep,#173f35); }
.zw-cell-sb { font-size:10px; color:var(--muted,#59655c); white-space:nowrap; }
.zw-cell-badges { display:flex; flex-wrap:wrap; gap:2px; min-height:15px; }
.zw-tag { display:inline-block; padding:1px 4px; border-radius:4px; font-size:9.5px; font-style:normal; font-weight:700; line-height:1.25; white-space:nowrap; }
.zw-tag--soul,.zw-tag--self { color:#fffdf7; background:var(--pine-deep,#173f35); }
.zw-tag--body,.zw-tag--opposite { color:var(--cinnabar,#a34b38); background:var(--cinnabar-soft,#f6e9e4); }
.zw-tag--trine { color:var(--pine,#1d5647); background:var(--pine-soft,#e7efea); }
.zw-cell-stars { display:flex; flex-direction:column; gap:2px; margin-top:1px; min-width:0; }
.zw-star-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px; min-width:0; line-height:1.28; }
.zw-star-major { font-family:var(--serif,serif); font-size:13px; font-weight:700; color:var(--pine-deep,#173f35); }
.zw-star-line small { font-size:10px; color:var(--muted,#59655c); }
.zw-star-line--minor b { font-size:11px; font-weight:600; color:var(--ink-soft,#353c33); }
.zw-star-empty { font-size:11px; color:var(--muted,#59655c); }
.zw-star-sub { font-size:10px; color:var(--ink-soft,#353c33); overflow-wrap:anywhere; }
.zw-mutagen { display:inline-block; padding:0 3px; border-radius:3px; font-size:9.5px; font-style:normal; font-weight:700; line-height:1.35; }
.zw-mutagen--lu { color:#174f38; background:#dfeee5; }
.zw-mutagen--quan { color:#7f3b16; background:#f8e6d8; }
.zw-mutagen--ke { color:#234d68; background:#e2eef5; }
.zw-mutagen--ji { color:#8f2b22; background:#f9e2df; }
.zw-mutagen--other { color:var(--cinnabar,#a34b38); background:var(--cinnabar-soft,#f6e9e4); }
.zw-cell-extra { display:none; }
.zw-center { grid-row:2 / 4; grid-column:2 / 4; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:8px 6px; border:1px solid rgba(29,86,71,.24); border-radius:12px; background:linear-gradient(165deg,#183f35,#214d40); color:#f9f6eb; text-align:center; }
.zw-center-kicker { display:none; font-size:10px; letter-spacing:.14em; color:rgba(249,246,235,.72); }
.zw-center-class { font-family:var(--serif,serif); font-size:17px; font-weight:700; letter-spacing:.06em; color:#fffdf7; }
.zw-center-meta { display:flex; flex-wrap:wrap; justify-content:center; gap:2px 8px; margin:0; font-size:11px; color:rgba(249,246,235,.92); }
.zw-center-masters { margin:0; font-size:10.5px; color:rgba(249,246,235,.76); }
.zw-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:4px 7px; margin-top:2px; font-size:10px; color:rgba(249,246,235,.86); }
.zw-legend span { display:inline-flex; align-items:center; gap:3px; }
.zw-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.zw-dot--self { background:#8cd3b0; }
.zw-dot--opp { background:#f09c88; }
.zw-dot--trine { background:#dbe8df; }
.zw-center-hint { margin:1px 0 0; font-size:10px; line-height:1.35; text-wrap:balance; color:rgba(249,246,235,.68); }

@media(min-width:860px) {
  .zw-board { gap:8px; padding:10px; grid-template-rows:repeat(4,minmax(136px,auto)); }
  .zw-cell { padding:10px 12px; gap:5px; }
  .zw-cell-name { font-size:16px; }
  .zw-cell-sb { font-size:12px; }
  .zw-tag { font-size:10.5px; padding:1px 6px; }
  .zw-star-major { font-size:15px; }
  .zw-star-line small { font-size:11px; }
  .zw-star-sub { display:none; }
  .zw-mutagen { font-size:10.5px; padding:1px 5px; }
  .zw-cell-extra { display:flex; flex-direction:column; gap:3px; margin-top:auto; padding-top:6px; border-top:1px solid rgba(221,217,204,.65); font-size:11px; color:var(--muted,#59655c); }
  .zw-extra-minors { color:var(--ink-soft,#353c33); line-height:1.4; }
  .zw-extra-age { font-size:10.5px; color:var(--muted,#59655c); }
  .zw-center { gap:8px; padding:18px 16px; }
  .zw-center-kicker { display:block; }
  .zw-center-class { font-size:26px; }
  .zw-center-meta { font-size:14px; gap:4px 14px; }
  .zw-center-masters { font-size:13px; }
  .zw-legend { font-size:12px; gap:6px 14px; }
  .zw-center-hint { font-size:12px; }
}

.zw-inspector { margin-top:14px; padding:18px; border:1px solid rgba(29,86,71,.32); border-radius:16px; background:#fffefa; box-shadow:0 8px 24px rgba(23,63,53,.05); }
.zw-inspector-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:10px 16px; padding-bottom:12px; border-bottom:1px solid var(--line,#ddd9cc); }
.zw-inspector-kicker { display:block; margin-bottom:3px; font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--pine,#1d5647); }
.zw-inspector-head h4 { margin:0; font-family:var(--serif,serif); font-size:22px; line-height:1.35; color:var(--pine-deep,#173f35); }
.zw-inspector-sb { margin-left:6px; font-size:15px; font-weight:500; color:var(--muted,#59655c); }
.zw-inspector-pills { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.zw-pill { display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; border:1px solid var(--line,#ddd9cc); background:var(--surface-soft,#f8f5ed); font-size:12px; color:var(--ink-soft,#353c33); }
.zw-pill--soul { border-color:rgba(29,86,71,.35); color:var(--pine-deep,#173f35); background:var(--pine-soft,#e7efea); font-weight:700; }
.zw-pill--body { border-color:rgba(163,75,56,.35); color:var(--cinnabar,#a34b38); background:var(--cinnabar-soft,#f6e9e4); font-weight:700; }
.zw-inspector-stars { display:grid; gap:10px; padding:14px 0; border-bottom:1px dashed var(--line,#ddd9cc); }
.zw-star-row { display:grid; grid-template-columns:40px minmax(0,1fr); align-items:start; gap:8px; }
.zw-star-row-label { padding-top:4px; font-size:12px; font-weight:600; color:var(--muted,#59655c); }
.zw-star-none { padding-top:3px; font-size:13px; color:var(--muted,#59655c); }
.zw-relations { padding:14px 0; border-bottom:1px solid var(--line,#ddd9cc); }
.zw-relations-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 12px; margin-bottom:10px; }
.zw-relations-head h5 { margin:0; font-family:var(--serif,serif); font-size:16px; color:var(--ink,#191d17); }
.zw-relations-head span { font-size:12px; color:var(--muted,#59655c); }
.zw-relations-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.zw-rel-card { min-width:0; min-height:56px; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:10px 12px; border:1px solid var(--line,#ddd9cc); border-radius:11px; background:var(--surface-soft,#f8f5ed); color:var(--ink,#191d17); text-align:left; cursor:pointer; transition:border-color .16s,background .16s; }
.zw-rel-card:hover { border-color:var(--pine,#1d5647); background:#f1f7f3; }
.zw-rel-role { font-size:11px; font-weight:700; color:var(--pine,#1d5647); }
.zw-rel-card strong { font-family:var(--serif,serif); font-size:15px; color:var(--pine-deep,#173f35); }
.zw-rel-card small { font-size:12px; line-height:1.45; color:var(--ink-soft,#353c33); overflow-wrap:anywhere; }
.zw-inspector-foot { padding-top:12px; }
.zw-inspector-foot p { margin:0 0 12px; font-size:14px; line-height:1.8; color:var(--ink-soft,#353c33); }
.zw-jump-reading { border-color:var(--pine,#1d5647); color:#fffdf7; background:var(--pine-deep,#173f35); }
.zw-jump-reading:hover { background:var(--pine,#1d5647); color:#fffdf7; }

.palace-all-disclosure { margin-top:24px; border-top:1px solid var(--line,#ddd9cc); padding-top:12px; }
.palace-all-disclosure > summary { display:flex; align-items:center; justify-content:space-between; min-height:44px; padding:8px 12px; border:1px solid var(--line,#ddd9cc); border-radius:11px; background:var(--surface-soft,#f8f5ed); color:var(--pine-deep,#173f35); font-size:14px; font-weight:600; cursor:pointer; list-style:none; }
.palace-all-disclosure > summary::-webkit-details-marker { display:none; }
.palace-all-disclosure > summary::after { content:"展开 ▾"; font-size:12px; color:var(--pine,#1d5647); }
.palace-all-disclosure[open] > summary::after { content:"收起 ▴"; }
.palace-all-disclosure > .palace-grid { margin-top:14px; }

@media(max-width:680px) {
  .zw-inspector { padding:14px; }
  .zw-relations-grid { grid-template-columns:1fr; }
}

html[data-text-size="large"] .zw-inspector-foot p { font-size:17px; line-height:1.85; }
html[data-text-size="large"] :is(.zw-rel-card small,.zw-star-none,.palace-all-disclosure > summary) { font-size:16px; line-height:1.6; }

/* ==========================================================================
   v2 Collector's Edition · 故宫数字文物库 × 文墨天机专业盘面 × 诚品古籍校勘读本
   ========================================================================== */

/* 1. First-screen Desk (#top / #workspace — 左文右器·双栏书案) */
.seal-mark { display:inline-block; padding:2px 8px; border:1px solid rgba(166,61,47,.48); border-radius:4px; color:var(--cinnabar); background:var(--cinnabar-soft); font-family:var(--serif); font-size:11px; font-weight:700; letter-spacing:.12em; line-height:1.4; }
.kicker::before { display:none; }
.kicker { gap:9px; margin-bottom:14px; letter-spacing:.12em; color:var(--pine-deep); }
.hero { align-items:start; gap:clamp(24px,4vw,52px); padding-block:28px 34px; }
@media(min-width:980px) {
  .hero { grid-template-columns:minmax(0,.88fr) minmax(440px,1.02fr); }
}
@media(max-width:979px) {
  .hero { grid-template-columns:minmax(0,1fr); padding-block:22px 28px; }
  .birth-card { max-width:none; }
}
.hero h1 { margin-bottom:16px; font-size:clamp(33px,4.1vw,50px); line-height:1.24; color:var(--pine-deep); }
.hero h1 em { color:var(--cinnabar); }
.hero-description { margin-bottom:20px; font-size:15.5px; line-height:1.86; color:var(--ink-soft); }
.hero-description strong { color:var(--pine-deep); font-weight:700; }

/* Three-cell Colophon Seal Strip (三格校勘印记) */
.foundation-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; padding:0; border:1px solid var(--line-strong); border-radius:14px; background:linear-gradient(180deg,#fffefa,#f6f1e4); box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 6px 18px rgba(20,56,47,.045); overflow:hidden; }
.colophon-cell { min-width:0; display:flex; flex-direction:column; justify-content:center; gap:3px; padding:12px 14px; border-right:1px solid var(--line); }
.colophon-cell:last-child { border-right:0; }
.colophon-num { font-family:var(--serif); font-size:22px; font-weight:700; line-height:1.15; color:var(--pine-deep); }
.colophon-label { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; line-height:1.3; color:var(--muted); }
.colophon-cell--local .colophon-num { color:var(--cinnabar); }
.colophon-cell--local i { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:#2b7a5a; box-shadow:0 0 0 3px rgba(43,122,90,.15); }
@media(max-width:480px) {
  .colophon-cell { padding:10px 8px; }
  .colophon-num { font-size:18px; }
  .colophon-label { font-size:10.5px; gap:4px; }
}

.hero-notes { display:grid; gap:8px; margin-top:16px; }
.hero-notes .scope-note { margin:0; padding:0 14px; border:1px solid var(--line); border-radius:12px; background:rgba(255,254,250,.78); }
.hero-notes .scope-note summary { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; padding:8px 0; color:var(--pine-deep); font-size:13px; font-weight:600; list-style:none; }
.hero-notes .scope-note summary::-webkit-details-marker { display:none; }
.hero-notes .scope-note summary::after { content:"+"; color:var(--cinnabar); font-weight:700; font-size:15px; flex:0 0 auto; }
.hero-notes .scope-note[open] summary::after { content:"−"; }
.hero-notes #onboardingContent { padding-bottom:10px; font-size:13px; color:var(--ink-soft); }
.hero-notes #onboardingContent ol { margin:6px 0 0; padding-left:20px; }
.hero-notes #onboardingContent li + li { margin-top:6px; }

/* Jade Birth Input Box (玉版起盘匣) */
.birth-card { padding:22px 24px 20px; border:1px solid var(--line-strong); border-radius:20px; background:linear-gradient(180deg,#fffefb 0%,#fcf9f1 100%); box-shadow:inset 0 0 0 1px rgba(255,255,255,.94),0 22px 52px rgba(20,56,47,.09); }
.birth-card::before { left:0; right:0; height:4px; background:linear-gradient(90deg,var(--pine-deep) 0%,var(--pine) 56%,var(--bronze) 82%,var(--cinnabar) 100%); }
.birth-card .card-heading { margin-bottom:16px; padding-bottom:13px; border-bottom:1px solid var(--line); align-items:center; }
.birth-card .card-heading h2 { font-size:21px; color:var(--pine-deep); margin-bottom:2px; }
.sample-trigger { min-height:44px; padding:6px 13px; border:1px solid rgba(182,152,99,.62); border-radius:999px; color:var(--pine-deep); background:linear-gradient(180deg,#fffefa,#f4ede0); font-size:12.5px; font-weight:700; box-shadow:0 2px 6px rgba(20,56,47,.06); }
.sample-trigger:hover { border-color:var(--pine); background:var(--pine-soft); }
.form-row-top { display:grid; grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr); gap:12px; margin-bottom:13px; }
.form-row-top .calendar-fieldset,.form-row-top .gender-fieldset { margin-bottom:0; }
.birth-card .form-grid { margin-bottom:12px; }
.field-help--subtle { color:var(--muted); }
.shichen-badge { margin:0 0 14px; padding:9px 12px; border:1px solid rgba(27,77,64,.16); border-left:3px solid var(--bronze); border-radius:5px 10px 10px 5px; background:#f5f1e5; color:var(--pine-deep); font-size:12.5px; line-height:1.55; }
.birth-card .primary-button { min-height:50px; border:1px solid rgba(182,152,99,.42); background:linear-gradient(135deg,var(--pine-deep),#1e5345); font-family:var(--serif); font-size:17px; letter-spacing:.08em; box-shadow:0 10px 24px rgba(20,56,47,.2); }
.birth-card .primary-button:hover:not(:disabled) { background:linear-gradient(135deg,#184539,#235f4f); }
.birth-card-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; margin-top:10px; }
.birth-card-foot .action-feedback { margin:0; }
.birth-card .privacy-note { margin:10px 0 0; padding-top:8px; border-top:1px dashed var(--line); text-align:left; font-size:11.5px; color:var(--muted); }
@media(max-width:600px) {
  .birth-card { padding:18px 16px; }
  .birth-card .card-heading { flex-wrap:wrap; gap:8px 10px; }
  .birth-card .card-heading p { max-width:none; }
  .birth-card .card-heading .sample-trigger { margin:0 0 0 auto; }
  .form-row-top { grid-template-columns:1fr; gap:11px; }
  .birth-card .form-grid { grid-template-columns:1fr; gap:11px; }
}

/* 2. Result Workbench · Identity Ribbon (#identityRibbon) & Sticky View Tabs */
.results { padding-block:20px 44px; }
.identity-ribbon { margin-bottom:16px; padding:20px 22px; border:1px solid rgba(182,152,99,.48); border-radius:20px; background:linear-gradient(155deg,#12332b 0%,#1a473b 60%,#14382f 100%); color:#f8f5ec; box-shadow:inset 0 0 0 1px rgba(255,250,235,.08),0 16px 38px rgba(20,56,47,.14); }
.identity-ribbon-top { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:12px 20px; padding-bottom:14px; border-bottom:1px solid rgba(248,245,236,.14); }
.identity-ribbon .step-number { border-color:rgba(242,182,155,.55); color:#ffdcd0; background:rgba(166,61,47,.48); box-shadow:none; }
.identity-ribbon #resultTitle { color:#fffef9; font-size:clamp(21px,2.5vw,27px); margin-bottom:2px; }
.identity-ribbon #resultSubtitle { color:rgba(248,245,236,.74); font-size:12.5px; }
.identity-ribbon .reading-tools { padding:0; border:0; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px 10px; max-width:540px; }
.identity-ribbon .ribbon-download { min-height:44px; padding:8px 14px; border:1px solid rgba(218,192,137,.72); border-radius:10px; color:#14382f; background:linear-gradient(180deg,#fffef8,#efe4cc); font-weight:700; box-shadow:0 3px 10px rgba(0,0,0,.14); }
.identity-ribbon .ribbon-download:hover:not(:disabled) { background:#fffef9; }
.identity-ribbon .heading-action { min-height:44px; padding:8px 12px; margin:0; width:auto; border:1px solid rgba(248,245,236,.26); border-radius:10px; color:#f8f5ec; background:rgba(255,255,255,.07); font-size:13px; text-decoration:none; }
.identity-ribbon .heading-action:hover { background:rgba(255,255,255,.14); color:#fff; }
.identity-ribbon .reading-tools > small { flex-basis:100%; margin:0; text-align:right; color:rgba(248,245,236,.68); font-size:11.5px; }
.identity-ribbon [data-reading-save] { flex-basis:100%; margin-top:6px; padding:10px 12px; border:1px solid var(--line-strong); border-radius:10px; background:#fffefa; color:var(--ink); text-align:left; }
.identity-ribbon [data-reading-save] .source-meta { color:var(--ink-soft); font-size:12.5px; margin-bottom:4px; }

.identity-metrics { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1.05fr); gap:12px; padding-top:14px; align-items:stretch; }
.id-block { min-width:0; padding:11px 14px; border:1px solid rgba(248,245,236,.12); border-radius:13px; background:rgba(255,255,255,.055); }
.id-kicker { display:block; margin-bottom:2px; font-size:11px; font-weight:700; letter-spacing:.1em; color:#e2c68e; }
.id-solar { display:block; font-family:var(--serif); font-size:16.5px; line-height:1.4; color:#fffef9; }
.id-lunar { display:block; margin-top:3px; font-size:12.5px; color:rgba(248,245,236,.84); }
.id-origin-note { display:block; margin-top:4px; font-size:11.5px; color:#f5da9f; }
.id-block--pillars { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; align-items:center; }
.id-pillar { padding:6px 4px; border:1px solid rgba(248,245,236,.12); border-radius:9px; background:rgba(10,31,26,.4); text-align:center; }
.id-pillar span { display:block; font-size:10.5px; color:rgba(248,245,236,.64); }
.id-pillar strong { display:block; margin-top:2px; font-family:var(--serif); font-size:18.5px; font-weight:600; letter-spacing:.08em; color:#fffef9; }
.id-block--anchors { margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 12px; align-content:center; }
.id-block--anchors dt { font-size:10.5px; color:rgba(248,245,236,.62); }
.id-block--anchors dd { margin:1px 0 0; font-family:var(--serif); font-size:15px; font-weight:600; color:#fffef9; overflow-wrap:anywhere; }
@media(max-width:980px) {
  .identity-metrics { grid-template-columns:1fr; gap:10px; }
  .identity-ribbon .reading-tools { justify-content:flex-start; max-width:none; }
  .identity-ribbon .reading-tools > small { text-align:left; }
}
@media(max-width:600px) {
  .identity-ribbon { padding:14px 13px; border-radius:16px; margin-bottom:12px; }
  .identity-ribbon-top { gap:8px 12px; padding-bottom:10px; }
  .identity-ribbon #resultTitle { font-size:20px; }
  .identity-ribbon .reading-tools { gap:6px 8px; }
  .identity-metrics { gap:8px; padding-top:10px; }
  .id-block { padding:9px 11px; border-radius:11px; }
  .id-solar { font-size:15px; }
  .id-pillar { padding:5px 3px; }
  .id-pillar strong { font-size:16px; }
  .id-block--anchors { gap:5px 10px; }
  .id-block--anchors dd { font-size:14px; }
}

.results-shell { overflow:visible; border:1px solid var(--line-strong); border-radius:20px; background:var(--surface); box-shadow:var(--shadow); }
.tabs-sticky-bar { border-bottom:1px solid var(--line); background:rgba(255,254,250,.96); border-radius:20px 20px 0 0; }
.tabs-condensed-meta { display:none; }
@media(min-width:980px) {
  .tabs-sticky-bar { position:sticky; top:72px; z-index:28; display:flex; align-items:center; justify-content:space-between; gap:14px; padding-right:18px; backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); }
  .tabs-sticky-bar #resultTabs { border-bottom:0; background:transparent; }
  .tabs-condensed-meta:not([hidden]) { display:inline-flex; align-items:center; padding:4px 12px; border:1px solid rgba(182,152,99,.45); border-radius:999px; background:#f8f3e6; color:var(--pine-deep); font-family:var(--serif); font-size:13px; font-weight:600; white-space:nowrap; }
}

/* 3. 12-Palace Chart Left-Board Right-Inspector Workbench (#panelChart, >=1060px 60%/40%) */
.mini-heading--chart { margin-bottom:14px; }
.chart-provenance-bar { margin-bottom:16px; padding:10px 14px; border:1px solid var(--line); border-left:3px solid var(--bronze); border-radius:5px 12px 12px 5px; background:var(--surface-soft); font-size:13px; color:var(--ink-soft); }
.chart-prov-main { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; }
.chart-prov-main strong { font-family:var(--serif); font-size:14.5px; color:var(--pine-deep); }
.chart-prov-seal { display:inline-block; padding:2px 8px; border-radius:4px; color:#fffef9; background:var(--pine-deep); font-family:var(--serif); font-size:11px; font-weight:700; letter-spacing:.08em; }
.chart-prov-note { margin:6px 0 0; font-size:12px; color:var(--muted); }

.zw-center { border:1px solid rgba(182,152,99,.48); box-shadow:inset 0 0 0 1px rgba(255,250,235,.1); background:linear-gradient(160deg,#12342c 0%,#1c4a3e 65%,#153a30 100%); }
@media(min-width:1060px) {
  .chart-workbench { display:grid; grid-template-columns:minmax(0,1.46fr) minmax(360px,1fr); gap:22px; align-items:start; }
  .chart-workbench-aside { position:sticky; top:138px; }
  .chart-workbench-aside .zw-inspector { margin-top:0; border-color:var(--line-strong); border-top:3px solid var(--cinnabar); box-shadow:0 12px 30px rgba(20,56,47,.06); }
  .chart-workbench-aside .zw-relations-grid { grid-template-columns:1fr; gap:7px; }
  .chart-workbench-aside .zw-rel-card { min-height:50px; padding:9px 12px; }
}

/* 4. Cinnabar Bookmark Cards (朱砂书签式主题卡) & Xuan-Paper Quote Callout Boxes (宣纸引文匣) */
.pr-personal-reading,.pd-period { width:100%; max-width:1140px; }
.pd-period { background:transparent; padding-inline:4px; padding-top:8px; }
.lt-nav-link { position:relative; overflow:hidden; border:1px solid var(--line-strong); border-radius:13px; background:#fffefa; padding:14px 16px; transition:border-color .16s,box-shadow .16s,background .16s; }
.lt-nav-link::before { content:""; position:absolute; top:0; left:0; right:0; height:3px; background:transparent; transition:background .16s; }
.lt-nav-link[aria-pressed="true"] { border-color:rgba(166,61,47,.48); background:linear-gradient(180deg,#fdf6f3 0%,#fffefa 70%); box-shadow:0 8px 20px rgba(166,61,47,.07); }
.lt-nav-link[aria-pressed="true"]::before { background:var(--cinnabar); }
.lt-nav-link[aria-pressed="true"] strong::after { content:" · 当前校读"; color:var(--cinnabar); font-size:11px; font-weight:700; }
.lt-nav-link[aria-pressed="true"] small { color:var(--pine-deep); }

.pd-switcher { background:linear-gradient(155deg,#153930,#1e4b3f); border-color:rgba(182,152,99,.4); }
.pd-topic-switch { gap:8px; padding:12px 16px; background:var(--surface-soft); }
.pd-topic-button { position:relative; overflow:hidden; border:1px solid var(--line); background:#fffefa; }
.pd-topic-button.is-active { border-color:rgba(166,61,47,.48); background:linear-gradient(180deg,#fdf6f3,#fffefa); color:var(--pine-deep); box-shadow:inset 0 3px 0 var(--cinnabar),0 4px 12px rgba(166,61,47,.07); }

.lt-source,.pr-source,.pd-evidence-body,.citation { border:1px solid #dfd3ba; border-left:3px solid var(--cinnabar); border-radius:4px 11px 11px 4px; background:#f8f3e6; }
.pr-source { padding:0 14px 10px; }
.pr-source-body { background:transparent; padding:8px 2px 4px; }
.lt-quote,.pd-quote,.pr-source blockquote { border-left:2px solid var(--bronze); color:#27342d; font-size:14px; }
.exact-source { border:1px solid var(--line-strong); border-top:3px solid var(--cinnabar); background:#fffefa; box-shadow:var(--shadow-small); }
.exact-source blockquote,.source-detail blockquote { border-left:3px solid var(--cinnabar); border-radius:0 10px 10px 0; background:#f8f3e6; }
.source-context { border:1px solid #dcd5c2; border-left:3px solid var(--pine-deep); border-radius:4px 11px 11px 4px; background:#f6f3e8; }
.source-context-role { background:var(--pine-deep); }

/* 5. Classical Source Library 2-Column Workbench (#sources / #reader, >=1020px) */
.source-section { padding-block:28px 54px; }
.source-workbench { display:grid; grid-template-columns:minmax(0,1fr); gap:22px; }
@media(min-width:1020px) {
  .source-workbench { grid-template-columns:minmax(310px,.54fr) minmax(0,1fr); gap:28px; align-items:start; }
  .source-sidebar { position:sticky; top:90px; }
}
.source-sidebar { display:grid; gap:16px; min-width:0; }
.source-sidebar .reading-start { margin:0; padding:18px; border:1px solid var(--line-strong); border-radius:16px; background:linear-gradient(180deg,#fffefa,#f8f4e8); box-shadow:var(--shadow-small); }
.source-sidebar .reading-start h3 { font-family:var(--serif); font-size:17px; color:var(--pine-deep); margin-bottom:12px; }
.guide-actions--stacked { display:grid; grid-template-columns:1fr; gap:8px; }
.guide-actions--stacked .small-button { width:100%; justify-content:space-between; text-align:left; padding:10px 14px; border-color:var(--line-strong); background:#fffefa; font-weight:600; color:var(--pine-deep); }
.guide-actions--stacked .small-button::after { content:"→"; color:var(--cinnabar); margin-left:8px; }
.source-catalog-card { padding:16px 18px; border:1px solid var(--line); border-radius:16px; background:#fffefa; box-shadow:var(--shadow-small); display:grid; gap:12px; }
.source-catalog-card .document-chips { margin:0; }
.source-main { min-width:0; }
.source-main .source-form { margin-top:0; padding:8px; border:1px solid var(--line-strong); border-radius:16px; background:#fffefa; box-shadow:var(--shadow-small); }
.source-main .search-box input { border-color:var(--line); background:var(--surface-soft); }
.source-main .search-button { min-height:47px; padding-inline:22px; border:1px solid rgba(182,152,99,.42); border-radius:11px; background:linear-gradient(135deg,var(--pine-deep),var(--pine)); color:#fffef9; font-family:var(--serif); font-weight:700; letter-spacing:.06em; }
.source-intro { padding:34px 28px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(180deg,#fffefa,#f7f2e5); text-align:left; }
.source-intro-seal { display:inline-block; margin-bottom:10px; padding:2px 9px; border:1px solid rgba(166,61,47,.45); border-radius:4px; color:var(--cinnabar); background:var(--cinnabar-soft); font-family:var(--serif); font-size:11.5px; font-weight:700; letter-spacing:.12em; }
.source-intro h3 { font-family:var(--serif); font-size:21px; color:var(--pine-deep); margin-bottom:8px; }

.footer-inner { justify-content:space-between; flex-wrap:wrap; }
.footer-colophon p { margin:0 0 4px; text-align:right; }
@media(max-width:720px) {
  .footer-colophon p { text-align:left; }
}
@media print {
  .identity-ribbon { background:#fff!important; color:#111!important; border-color:#ccc!important; box-shadow:none!important; }
  .id-solar,.id-pillar strong,.id-block--anchors dd,.identity-ribbon #resultTitle { color:#111!important; }
  .id-lunar,.id-kicker,.id-pillar span,.id-block--anchors dt,.identity-ribbon #resultSubtitle { color:#444!important; }
  .tabs-sticky-bar { display:none!important; }
  .chart-workbench { display:block!important; }
}
