/* 随附字体（web/assets/fonts/README.md）：三个文件同属「Zhouyi Serif」一族，后两个按 unicode-range 只在需要时加载。
   正文与经文用 Noto Serif SC 子集（含 撝 勑 煇 纆 餗 繻 輮 等底本字形）；八卦、六十四卦符号用 Noto Sans Symbols 子集；
   改字注记里的两个扩展区旧字形用花园明朝子集。子集字表由 tools/build_font_subset.py 生成，tests/test_glyph_font.py 核对覆盖。 */
@font-face { font-family: 'Zhouyi Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/zhouyi-serif-sc.woff2') format('woff2'); }
@font-face { font-family: 'Zhouyi Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/zhouyi-symbols.woff2') format('woff2'); unicode-range: U+2630-2637, U+2699, U+4DC0-4DFF, U+1F5C2; }
@font-face { font-family: 'Zhouyi Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/zhouyi-ext.woff2') format('woff2'); unicode-range: U+20860, U+2AE29; }
/* 按钮、输入框默认不继承页面字体：一并改用随附字体 */
button, input, select, textarea { font-family: inherit; }
:root {
  --bg: #14181a; --bg2: #24302f; --surface: rgba(255,255,255,0.06);
  --accent: #d9a441; --accent2: #c7462f; --text: #f1ebdd; --muted: #a8b0a6; --glow: #d9a441;
  --font: 'Zhouyi Serif', 'Noto Serif SC', 'Songti SC', serif; --radius: 16px;
}
* { box-sizing: border-box; }
/* hidden 属性总是生效：.field、.cast-area、.manual-grid 等组件样式的 display 不得盖过它 */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--text); background: radial-gradient(120% 70% at 50% 0%, var(--bg2), var(--bg) 70%); -webkit-font-smoothing: antialiased; }
.app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.screen { animation: fade .3s ease; padding-top: env(safe-area-inset-top); }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.topbar h1, .topbar h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 2px; }
.brand-glyph { color: var(--accent); }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn { background: var(--surface); border: 1px solid rgba(255,255,255,0.12); color: var(--text); width: 38px; height: 38px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.eyebrow { margin: 18px 0 4px; font-size: 12px; letter-spacing: 3px; color: var(--accent); }
.hero { margin: 0 0 16px; font-size: 22px; font-weight: 500; line-height: 1.5; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.small { font-size: 12px; }
.fineprint { color: var(--muted); opacity: .7; font-size: 12px; margin-top: 24px; text-align: center; line-height: 1.6; }
.section-title { font-size: 14px; letter-spacing: 2px; color: var(--accent); margin: 24px 0 10px; font-weight: 500; }
.btn { appearance: none; border: 1px solid rgba(255,255,255,0.18); background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 999px; font-family: inherit; font-size: 14px; cursor: pointer; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #f0cf7a); color: #2a1e08; border: none; font-weight: 600; box-shadow: 0 6px 24px -6px var(--glow); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { background: none; border: none; color: var(--accent); font-family: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.info-row { text-align: center; margin-top: 14px; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field textarea, .field input, .field select { width: 100%; background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 12px; font-family: inherit; font-size: 15px; resize: vertical; }
.chip { border: 1px solid rgba(255,255,255,0.18); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 14px; font-family: inherit; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--accent); color: #2a1e08; border-color: transparent; font-weight: 600; }
.method-toggle { display: flex; gap: 8px; margin-top: 4px; }

/* 投掷 */
.cast-area { display: flex; gap: 18px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 18px; min-height: 300px; }
.coins { display: flex; flex-direction: column; gap: 14px; }
.coin { width: 64px; height: 64px; perspective: 600px; }
.coin-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.coin.spin .coin-inner { animation: spin 1s ease-in-out; }
@keyframes spin { 0% { transform: rotateY(0) translateY(0);} 50% { transform: rotateY(720deg) translateY(-22px);} 100% { transform: rotateY(1440deg) translateY(0);} }
.coin .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 22px; text-shadow: 0 1px 0 rgba(255,255,255,0.4); font-weight: 600; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid #b7852a; }
.coin .f-back { background: radial-gradient(circle at 35% 35%, #f4d27a, #b7852a); color: #4a3006; }
.coin .f-front { background: radial-gradient(circle at 35% 35%, #e8c56a, #9c6d1c); color: #4a3006; transform: rotateY(180deg); }
.coin.show-front .coin-inner { transform: rotateY(180deg); }
.coin .f-back::after { content: ''; position: absolute; width: 16px; height: 16px; background: rgba(90,60,10,0.35); z-index: 0; }
.coin .f-back, .coin .f-front { z-index: 1; }
.coin .face > * { position: relative; }
.lines-stack { flex: 1; display: flex; flex-direction: column-reverse; gap: 10px; }
.yao { display: flex; align-items: center; gap: 10px; opacity: .25; transition: opacity .4s; }
.yao.filled { opacity: 1; }
.yao .bar { flex: 1; height: 14px; display: flex; gap: 12px; }
.yao .bar i { flex: 1; background: var(--text); border-radius: 3px; display: block; }
.yao.yin .bar { justify-content: space-between; }
.yao.yin .bar i { flex: 0 0 42%; }
.yao.moving .bar i { background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.yao .label { width: 108px; font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
.yao .label b { color: var(--text); display: block; font-size: 13px; }
.yao.moving .label b { color: var(--accent); }
.ritual-hint { text-align: center; color: var(--muted); margin: 12px 0 0; min-height: 22px; }
.manual-grid { display: grid; gap: 8px; margin-top: 12px; }
.manual-row { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 8px 10px; }
.manual-row span { width: 60px; font-size: 13px; color: var(--muted); }
.manual-row .sel { display: flex; gap: 6px; flex: 1; }
.manual-row .sel button { flex: 1; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: transparent; color: var(--muted); font-family: inherit; padding: 6px 0; cursor: pointer; }
.manual-row .sel button.on { background: var(--accent); color: #2a1e08; border-color: transparent; }
.manual-row em { width: 70px; font-style: normal; font-size: 12px; color: var(--accent); text-align: right; }

/* 结果 */
.hex-pair { display: flex; gap: 14px; justify-content: center; align-items: stretch; margin: 10px 0; }
.hex-card { flex: 1; max-width: 220px; background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 14px; text-align: center; }
.hex-card .glyph { font-size: 44px; line-height: 1; margin: 4px 0; }
.hex-card h3 { margin: 4px 0 2px; font-size: 20px; }
.hex-card p { margin: 0; font-size: 12px; color: var(--muted); }
.hex-card .yaos { display: flex; flex-direction: column-reverse; gap: 6px; margin: 10px auto 0; width: 110px; }
.hex-card .yaos .bar { height: 10px; display: flex; gap: 8px; justify-content: space-between; }
.hex-card .yaos .bar i { flex: 1; background: var(--text); border-radius: 2px; display: block; }
.hex-card .yaos .yin .bar i { flex: 0 0 42%; }
.hex-card .yaos .moving .bar i { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.arrow { align-self: center; font-size: 22px; color: var(--accent); }
.derived { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 12px; }
.derived span { font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 4px 10px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; }
.tab { flex: none; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 12px; font-family: inherit; font-size: 13px; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); border-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 16px; margin-top: 10px; line-height: 1.8; font-size: 14px; }
.panel h4 { margin: 12px 0 4px; font-size: 14px; color: var(--accent); }
.panel h4:first-child { margin-top: 0; }
.panel .quote { font-size: 15px; color: var(--text); }
.panel .note { color: var(--muted); font-size: 13px; }
.panel .item { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.12); }
.panel .item:last-child { border-bottom: none; }
.panel .item.main { border-left: 3px solid var(--accent); padding-left: 10px; }
.panel .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.12); color: var(--accent); margin-right: 6px; }
.panel .yao-row { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.12); }
.panel .yao-row.moving { background: rgba(217,164,65,0.08); margin: 0 -8px; padding: 8px; border-radius: 8px; }
.panel .yao-row b { color: var(--accent); }
.interpretation { background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 18px; line-height: 1.9; font-size: 15px; white-space: pre-wrap; min-height: 100px; }
.interpretation.loading { color: var(--muted); }
.source-tag { display: block; margin-top: 12px; font-size: 11px; color: var(--muted); opacity: .7; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions-row .btn { flex: 1 1 45%; }
.history-list { display: grid; gap: 10px; }
.history-item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 12px; cursor: pointer; color: inherit; font-family: inherit; text-align: left; width: 100%; }
.history-item .sym { font-size: 30px; flex: none; color: var(--accent); }
.history-item h4 { margin: 0 0 2px; font-size: 14px; }
.history-item p { margin: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .del { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.about { font-size: 14px; line-height: 1.8; }
.about h3 { color: var(--accent); font-size: 15px; margin: 18px 0 6px; }
.about .src { color: var(--muted); font-size: 12px; }
.about ul { padding-left: 18px; margin: 4px 0; }
.form .row { display: flex; gap: 10px; }
code { font-family: monospace; font-size: 12px; opacity: .8; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(0,0,0,0.85); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 14px; line-height: 1.6; text-align: center; z-index: 10; width: max-content; max-width: 90vw; pointer-events: none; }
@media (max-width: 380px) { .coin { width: 54px; height: 54px; } .yao .label { width: 96px; font-size: 10px; } }

/* 起卦方式与梅花、小六壬 */
.kind-list { display: grid; gap: 8px; margin-bottom: 6px; }
.kind-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 10px 12px; cursor: pointer; text-align: left; color: inherit; font-family: inherit; width: 100%; }
.kind-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.kind-item .glyph { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: rgba(0,0,0,0.25); color: var(--accent); flex: none; }
.kind-item h4 { margin: 0 0 2px; font-size: 15px; }
.kind-item p { margin: 0; font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 10px 0; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }
.palace-card { background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 18px; text-align: center; margin: 10px 0; }
.palace-card .big { font-size: 46px; font-weight: 600; color: var(--accent); letter-spacing: 6px; }
.palace-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.palace-card .findable { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.1); color: var(--text); font-size: 14px; }
.palace-ring { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.palace-ring span { font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.15); color: var(--muted); }
.palace-ring span.hit { background: var(--accent); color: #2a1e08; border-color: transparent; font-weight: 600; }
.panel .missing { border: 1px dashed var(--accent2); border-radius: 8px; padding: 8px 10px; color: var(--muted); font-size: 13px; }
.derived span.stale, .tag.stale { border: 1px solid var(--accent2); color: var(--accent2); }
details.wenyan { margin-top: 12px; } details.wenyan summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.interpretation .btn { margin-left: 8px; padding: 4px 12px; font-size: 12px; }
table.najia { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
table.najia th, table.najia td { padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; white-space: nowrap; }
table.najia tr.moving td { background: rgba(217,164,65,0.1); }
table.najia small { color: var(--accent2); margin-left: 2px; }

/* 动态表单：所问类别、梅花起卦法字段、外应、小六壬报数 */
.method-toggle.wrap { flex-wrap: wrap; }
.row.three .field input { padding: 12px 8px; text-align: center; }
.help { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.method-fields { background: var(--surface); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 12px; margin: 10px 0; }
.method-fields .field { margin: 10px 0; }
.mf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.mf-head b { color: var(--accent); margin-right: 4px; }
.list-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.list-inputs input, .tone select { width: 100%; background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 10px; font-family: inherit; font-size: 15px; }
.tone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.tone { display: flex; flex-direction: column; gap: 2px; }
.tone em { font-style: normal; font-size: 11px; color: var(--muted); }
.tone select { padding: 8px 4px; font-size: 14px; }
details.fold { margin: 10px 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 8px 12px; background: rgba(0,0,0,0.12); }
details.fold > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
details.fold[open] > summary { margin-bottom: 6px; }
ul.notes, ol.notes { padding-left: 18px; margin: 6px 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 6px; align-items: center; margin: 8px 0; }
.sign-row select { width: 100%; min-width: 0; background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 9px 6px; font-family: inherit; font-size: 14px; }
.sign-row .help { grid-column: 1 / -1; margin-top: 0; }
.btn.small-btn { padding: 7px 14px; font-size: 13px; }
.btn.small-btn[disabled] { opacity: .4; }

/* 引文与规则出处 */
.cite { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; border: 1px dashed rgba(217,164,65,0.6); background: transparent; color: var(--accent); font-family: inherit; font-size: 11px; line-height: 1.6; cursor: pointer; vertical-align: middle; }
.cite.flag { border-style: solid; border-color: rgba(255,255,255,0.18); color: var(--text); background: rgba(255,255,255,0.06); font-size: 12px; }
.cite:active { transform: scale(.96); }
.cite .rule-id { margin-left: 5px; font-size: 9px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; letter-spacing: 0; }
.src-quote { margin: 6px 0; padding-left: 10px; border-left: 2px solid rgba(217,164,65,0.45); }
.src-quote .quote { display: block; font-size: 14px; }
.src, .src-quote .src { display: block; font-size: 11px; color: var(--muted); line-height: 1.6; }
.notice { border: 1px solid rgba(217,164,65,0.5); background: rgba(217,164,65,0.08); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.7; margin: 8px 0; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.badge.warn { background: rgba(199,70,47,0.18); color: #f0a08f; border: 1px solid rgba(199,70,47,0.6); }
.panel h5 { margin: 12px 0 4px; font-size: 13px; color: var(--text); font-weight: 600; }
.panel .quote.verse { margin: 8px 0; line-height: 2; letter-spacing: 1px; }
.panel .chosen { margin-top: 4px; }
.panel .chosen b { color: var(--accent); }
ul.factors { list-style: none; padding: 0; margin: 4px 0; }
ul.factors li { padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); font-size: 13px; }
ul.factors li:last-child { border-bottom: none; }
ul.factors .subject { display: block; font-size: 11px; color: var(--muted); }
h5.pol-favourable { color: #9fcf8a; } h5.pol-unfavourable { color: #f0a08f; } h5.pol-neutral { color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.najia.liuyao td { white-space: normal; vertical-align: top; line-height: 1.4; }
table.najia.liuyao td small { color: var(--muted); margin: 0; }
table.najia.liuyao td b { color: var(--accent); margin-left: 2px; }
table.najia.liuyao tr.flags-row td { text-align: left; border-bottom: 1px solid rgba(255,255,255,0.14); padding: 2px 4px 8px; }
table.najia.liuyao tr:not(.flags-row) td { border-bottom: none; padding-top: 8px; }
table.clauses, table.rules-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.clauses th, table.clauses td, table.rules-table th, table.rules-table td { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; vertical-align: top; }
table.clauses th { white-space: nowrap; color: var(--accent); font-weight: 500; width: 5em; }
table.rules-table code { word-break: break-all; }
.coll-rec { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.12); color: var(--text); }
.coll-rec:last-child { border-bottom: none; }
.coll-read { font-size: 14px; }
.coll-read span { display: inline-block; min-width: 6.5em; font-size: 11px; color: var(--muted); }
.coll-rec mark { background: rgba(217,164,65,0.35); color: var(--text); border-radius: 3px; padding: 0 2px; }
.coll-rec mark.gap { background: rgba(199,70,47,0.25); font-size: 11px; }
details.collation { margin-top: 12px; border-top: 1px dashed rgba(255,255,255,0.14); padding-top: 8px; }
details.collation summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.rule-meta { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.rule-statement { font-size: 14px; line-height: 1.8; }
.tag.nature-product_defined, .tag.nature-mixed, .tag.nature-module { color: #9ec3e6; }
/* 梅花体用：原文引文、传统倾向、本模块概括、异说 */
.tiyong-main > b { font-size: 16px; }
.rel-tendency-line { margin: 4px 0; font-size: 14px; }
.rel-tendency { color: var(--muted); font-size: 12px; }
.rel-variants { margin-top: 6px; padding-top: 4px; border-top: 1px dashed rgba(255,255,255,0.12); }
.derived span.stale-data, .tag.stale-data { white-space: normal; border-radius: 12px; }

/* 规则出处底部面板 */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 520px; max-height: 82vh; background: var(--bg2); border-radius: 18px 18px 0 0; border: 1px solid rgba(255,255,255,0.12); display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(30px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 6px; }
.sheet-head h3 { margin: 0; font-size: 15px; color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 0 16px 18px; font-size: 14px; line-height: 1.8; }
.sheet-body h4 { margin: 6px 0; font-size: 15px; }
.sheet-body h5 { margin: 12px 0 4px; font-size: 13px; color: var(--accent); font-weight: 500; }
.sheet-body .note { color: var(--muted); font-size: 13px; }
.sheet-body .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.12); color: var(--accent); margin-right: 6px; }
.panel, .about, .sheet-body, .interpretation { overflow-wrap: anywhere; }
.history-item > div { min-width: 0; flex: 1; }
.history-item h4 { overflow-wrap: anywhere; }
.history-list { grid-template-columns: minmax(0, 1fr); }
.sign-row .sign-more { grid-column: 1 / -1; margin: 0; padding: 4px 10px; }
.sign-more .sign-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.sign-more .sign-extra label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.interpretation .offline-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
details.raw-input { margin-top: 6px; } details.raw-input summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.raw-input pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; color: var(--muted); margin: 4px 0 0; }

/* 六爻 liuyao-v3：为何命中、还缺什么条件（可展开）、候选取舍、并列说明、逐条条件 */
details.why { margin: 4px 0 2px; font-size: 12px; }
details.why > summary { cursor: pointer; color: #9ec3e6; font-size: 12px; list-style-position: inside; }
details.why > summary .why-flag { margin-left: 6px; color: #f0a08f; font-size: 11px; }
details.why[open] > summary { margin-bottom: 4px; }
.why-body { border-left: 2px solid rgba(158,195,230,0.4); padding: 4px 0 4px 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.why-body.inline { margin: 4px 0; }
.why-body b { color: var(--text); font-weight: 500; }
.why-row { margin: 2px 0; overflow-wrap: anywhere; }
ul.why-missing { margin: 2px 0 2px 1.2em; padding: 0; }
.why-item { padding: 4px 0; border-bottom: 1px dotted rgba(255,255,255,0.1); }
.why-item:last-child { border-bottom: none; }
.flags-row details.why { display: block; }
ul.cand-list, ul.conds, ul.decided { list-style: none; padding: 0; margin: 4px 0; }
ul.cand-list li { padding: 6px 0 6px 10px; border-left: 3px solid rgba(255,255,255,0.15); margin: 4px 0; font-size: 13px; }
ul.cand-list li.cand-kept { border-left-color: var(--accent); }
ul.cand-list li.cand-tie { border-left-color: #9ec3e6; }
ul.cand-list li.cand-drop { opacity: .8; }
.tag.kept { color: #9fcf8a !important; } .tag.drop { color: #f0a08f !important; } .tag.tie { color: #9ec3e6 !important; }
.tag.step-hit { color: var(--accent) !important; } .tag.step-none { color: var(--muted) !important; }
ol.steps > li { margin: 6px 0; font-size: 13px; line-height: 1.7; }
ul.decided li { font-size: 12px; color: var(--muted); padding: 2px 0; }
.notice.tie { border-color: rgba(158,195,230,0.5); background: rgba(158,195,230,0.08); }
.tag.found-yes { color: #9fcf8a !important; } .tag.found-no { color: var(--muted) !important; } .tag.found-unknown { color: #f0a08f !important; }
ul.conds li.cond { padding: 5px 0; border-bottom: 1px dotted rgba(255,255,255,0.1); font-size: 12px; }
ul.conds li.cond:last-child { border-bottom: none; }
li.cond.st-hit .tag.st { color: #9fcf8a; } li.cond.st-miss .tag.st { color: var(--muted); }
li.cond.st-unknown .tag.st { color: #f0a08f; } li.cond.st-skip .tag.st { color: #9ec3e6; }
li.cond .why-row { color: var(--muted); }
h5.parallel-title { color: var(--accent); }
.parallel { border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 8px 10px; margin: 8px 0; background: rgba(0,0,0,0.12); }
.parallel-head { font-size: 13px; margin-bottom: 6px; }
.parallel-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.parallel .psubj { color: var(--muted); font-size: 12px; }
.pcol { min-width: 0; border-radius: 8px; padding: 6px 8px; background: rgba(255,255,255,0.04); }
.pcol h6 { margin: 0 0 4px; font-size: 12px; font-weight: 500; }
.pcol-favourable h6 { color: #9fcf8a; } .pcol-unfavourable h6 { color: #f0a08f; } .pcol-neutral h6 { color: var(--muted); }
.pcol ul { margin: 0; padding-left: 1.1em; font-size: 12px; line-height: 1.6; }
.pcol li { overflow-wrap: anywhere; }
.item.subject-basis { border-left: 3px solid #9ec3e6; padding-left: 10px; }
.item.not-judged .tag { color: #f0a08f; }
.attached-note { border-left: 2px solid var(--accent2); padding-left: 8px; }

/* 机器对校：五类初步分拣、影响、处理 */
.coll-triage, .coll-impact, .coll-resolution { margin-top: 6px; font-size: 13px; }
.coll-triage .note, .coll-impact .note, .coll-resolution .note { font-size: 12px; }
.tag.bucket { color: #2a1e08 !important; background: var(--accent) !important; }
.tag.bucket-转录错误 { background: #f0a08f !important; }
.tag.bucket-版本异文 { background: #9ec3e6 !important; }
.tag.corrected { color: #2a1e08 !important; background: #9fcf8a !important; }
.coll-resolution.corrected { border-left: 3px solid #9fcf8a; padding-left: 8px; }
.note.side { color: #9ec3e6; }
.hex-note .coll-read span { min-width: 3em; }
.triage-summary { font-size: 13px; }
.interp-stale { display: block; margin-top: 8px; font-size: 12px; color: var(--accent2); line-height: 1.6; }
/* 校核标注：默认只显示小 ※（悬停见说明）；设置里打开「专业标注」显示「待核」「待校对」原样徽标 */
html:not([data-pro="1"]) .vmp { font-size: 0; padding: 0; margin: 0 1px; border: 0; background: none; vertical-align: super; cursor: help; }
html:not([data-pro="1"]) .vmp::after { content: '※'; font-size: 11px; color: var(--accent); }
html[data-pro="1"] .vm-note { display: none; }
