@font-face {
  font-family:"QimenBoardSC";
  src:url("./fonts/qimen-board-sc.woff2?v=0.8.5-preview.34") format("woff2");
  font-style:normal;
  font-weight:400;
  font-display:block;
}

:root {
  --ink: #241a17;
  --muted: #766963;
  --paper: #fffdf7;
  --paper-2: #f8f1e5;
  --red: #9b2f2f;
  --red-dark: #702020;
  --gold: #c6a65b;
  --line: #d8cbbb;
  --shadow: 0 18px 50px rgba(58, 34, 23, .12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { margin: 0; color: var(--ink); font-family: "Noto Serif SC", "Songti SC", SimSun, serif; background:
  radial-gradient(circle at 15% 0, rgba(198,166,91,.16), transparent 28rem),
  linear-gradient(135deg, #efe7da, #faf7ef 50%, #eee4d6); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1180px; margin: auto; padding: 28px 22px 48px; }
.account-menu[hidden],
.help-panel[hidden],
.app-view[hidden] { display:none !important; }
.input-view { max-width:760px; margin:0 auto; }
.input-masthead { justify-content:center; padding-top:7vh; text-align:left; }
.input-view .controls { grid-template-columns:repeat(4,minmax(0,1fr)); }
.input-view .datetime-field { grid-column:1 / 3; }
.input-view .chart-type-field { grid-column:3; }
.input-view .gender-field { grid-column:4; }
.input-view .name-field { grid-column:1 / 3; }
.input-view .sample-field { grid-column:3 / 5; }
.input-view .start-chart { grid-column:1 / 4; }
.input-view .reset-chart { grid-column:4; }


/* 鍏巻锛忓啘鍘嗭紡鍥涙煴鏃堕棿褰曞叆 */
.input-view .datetime-field { grid-column:1 / -1; }
.input-view .chart-type-field { grid-column:1; }
.input-view .gender-field { grid-column:2; }
.input-view .name-field { grid-column:3 / 5; }
.input-view .sample-field { grid-column:1 / 3; }
.input-view .start-chart { grid-column:3; }
.input-view .reset-chart { grid-column:4; }
.datetime-field { min-width:0; margin:0; padding:0; border:0; }
.datetime-field > legend { margin:0 0 7px; padding:0; color:var(--muted); font-size:13px; }
.datetime-mode-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:12px; padding:3px; background:#f1e7d7; border:1px solid var(--line); border-radius:7px; }
.datetime-mode-tab { min-height:42px; padding:8px 12px; color:var(--red-dark); background:transparent; border:0; border-radius:5px; font-weight:800; letter-spacing:.08em; }
.datetime-mode-tab.active { color:#fff; background:var(--red); box-shadow:0 3px 10px rgba(112,32,32,.2); }
.datetime-mode-tab:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.datetime-mode-panel[hidden] { display:none !important; }
.date-select-grid { display:grid; grid-template-columns:1.25fr repeat(4,minmax(0,1fr)); gap:8px; }
.bazi-select-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.date-select-grid label, .bazi-select-grid label { color:var(--muted); font-size:12px; text-align:center; }
.date-select-grid select, .bazi-select-grid select { min-height:46px; padding:9px 7px; color:var(--ink); background:#fffefa; font-size:16px; font-weight:700; text-align:center; text-align-last:center; }
.datetime-help { margin:9px 2px 0; color:var(--muted); font-size:12px; line-height:1.55; }
.bazi-search { width:100%; min-height:44px; margin-top:10px; }
.datetime-feedback { display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 10px; align-items:center; margin-top:12px; padding:10px 12px; background:#fff8e9; border-left:4px solid var(--gold); }
.datetime-feedback small { grid-row:1 / 3; color:var(--muted); white-space:nowrap; }
.datetime-feedback strong { color:var(--red-dark); font-size:16px; line-height:1.35; }
.datetime-feedback span { color:var(--muted); font-size:12px; line-height:1.45; }
.datetime-feedback.error { background:#fff0ed; border-left-color:#c1392b; }
.datetime-feedback.error span { color:#a1241c; }
.datetime-feedback.pending { background:#f6f0e3; }
.bazi-candidates { margin-top:10px; }
.candidate-summary, .candidate-empty { margin:0 0 7px; color:var(--muted); font-size:12px; }
.candidate-empty { padding:10px; color:#a1241c; background:#fff0ed; border:1px solid rgba(193,57,43,.25); }
.candidate-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; max-height:210px; overflow:auto; }
.candidate-button { display:grid; grid-template-columns:24px minmax(0,1fr); gap:7px; align-items:center; min-height:46px; padding:8px; text-align:left; color:var(--ink); background:#fffefa; border:1px solid var(--line); border-radius:4px; }
.candidate-button small { display:grid; place-items:center; width:22px; height:22px; color:var(--red-dark); background:#f1e7d7; border-radius:50%; }
.candidate-button strong { min-width:0; font-size:13px; }
.candidate-button.selected { color:var(--red-dark); background:#fff4df; border-color:var(--red); box-shadow:inset 0 0 0 1px var(--red); }

.result-header { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:13px 16px; }
.result-heading { display:flex; align-items:center; gap:14px; min-width:0; }
.result-heading > div { min-width:0; }
.result-heading small { display:block; color:var(--muted); font-size:11px; letter-spacing:.08em; }
.result-heading h2 { margin:2px 0 0; color:var(--red-dark); font-size:22px; line-height:1.1; }
.back-to-input { white-space:nowrap; }
.result-toolbar { flex-wrap:wrap; justify-content:flex-end; }
.masthead { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:22px; }
.brand { display:flex; align-items:center; gap:15px; }
.brand-logo { width:58px; height:58px; flex:0 0 auto; display:block; object-fit:contain; }
h1 { margin:0; font-size:clamp(25px,4vw,42px); letter-spacing:.12em; }
.subtitle { margin:.3rem 0 0; color:var(--muted); letter-spacing:.18em; }
.toolbar { display:flex; gap:10px; }
.primary, .ghost { border-radius:4px; padding:11px 18px; border:1px solid var(--red); }
.primary { color:white; background:var(--red); }
.ghost { color:var(--red); background:transparent; }
.panel { background:rgba(255,253,247,.9); border:1px solid rgba(155,47,47,.18); box-shadow:var(--shadow); }
.controls { padding:18px; display:grid; grid-template-columns:1.15fr .8fr .65fr .55fr 1.25fr auto auto; gap:12px; align-items:end; }
label { display:grid; gap:6px; color:var(--muted); font-size:13px; }
input, select { min-width:0; width:100%; color:var(--ink); background:#fffefa; border:1px solid var(--line); padding:11px 12px; border-radius:3px; }
.chart-navigation { margin-top:12px; padding:10px 12px; display:grid; grid-template-columns:auto auto minmax(180px,1fr) auto auto; gap:9px; align-items:center; }
.chart-navigation button { min-width:102px; padding:9px 12px; }
.chart-navigation button small { display:block; margin-top:2px; font-size:10px; opacity:.72; }
.navigation-current { min-width:0; text-align:center; }
.navigation-current small { display:block; color:var(--muted); font-size:11px; }
.navigation-current strong { display:block; margin-top:3px; color:var(--red-dark); font-size:18px; letter-spacing:.04em; }
.chart { margin-top:18px; padding:22px; }
.chart-meta { display:grid; grid-template-columns:1.35fr .65fr; gap:18px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.chart-summary { grid-column:1 / -1; display:grid; gap:8px; }
.chart-summary-main { display:flex; flex-wrap:nowrap; align-items:center; gap:0; width:100%; color:var(--ink); font-size:14px; line-height:1.55; white-space:nowrap; }
.chart-summary-main span { display:inline-flex; align-items:baseline; min-width:0; white-space:nowrap; }
.chart-summary-main span:not(:last-child)::after { content:"｜"; margin:0 5px; color:var(--line-strong); font-weight:400; }
.chart-summary-main small { margin-right:4px; color:var(--muted); font-size:inherit; }
.chart-summary-main strong { color:var(--red-dark); font-size:inherit; line-height:inherit; }
.chart-basis-toggle { border:1px solid var(--line); border-radius:4px; background:#fffdf7; }
.chart-basis-toggle > summary { padding:8px 10px; color:var(--red-dark); font-size:12px; font-weight:800; cursor:pointer; list-style-position:inside; }
.chart-basis-content { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(220px,.65fr); gap:12px; padding:0 10px 10px; border-top:1px solid var(--line); }
.compact-ju-basis { padding-top:8px; }
.compact-ju-basis p { margin:0 0 6px; color:var(--muted); font-size:12px; line-height:1.55; }
.compact-ju-basis strong, .compact-ju-basis small { display:block; line-height:1.55; }
.compact-ju-basis small { margin-top:4px; color:var(--muted); }
.compact-facts { grid-column:1 / -1; grid-template-columns:repeat(4,minmax(0,1fr)); }
.detail-panel-compat[hidden], #status[hidden] { display:none !important; }
.calendar h2 { margin:0 0 8px; font-size:24px; }
.calendar p { margin:6px 0; color:var(--muted); }
.pillars { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid var(--line); }
.pillars div { padding:9px; text-align:center; border-right:1px solid var(--line); }
.pillars div:last-child { border-right:0; }
.pillars small { display:block; color:var(--muted); margin-bottom:5px; }
.pillars strong { color:var(--red-dark); font-size:18px; }
.tags { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.tags span { padding:5px 9px; background:var(--paper-2); border-left:3px solid var(--gold); font-size:14px; }
.main-grid { display:grid; grid-template-columns:minmax(520px, 1fr) 280px; gap:22px; margin-top:22px; align-items:start; min-width:0; }
.board-column { min-width:0; }
.board-wrap {
  position:relative;
  display:grid;
  grid-template-columns:96px minmax(0, 1fr) 96px;
  grid-template-rows:82px minmax(0, 1fr) 82px;
  grid-template-areas:
    ". top ."
    "left board right"
    ". bottom .";
  align-items:stretch;
  width:100%;
  min-width:0;
  align-self:start;
}
.board { grid-area:board; width:100%; min-width:0; aspect-ratio:1; display:grid; grid-template-columns:repeat(3,1fr); border:2px solid var(--ink); background:#fffef9; }
.board-horse { z-index:4; display:grid; place-items:center; width:22px; height:22px; color:var(--red); font-size:16px; font-style:normal; font-weight:900; line-height:1; text-shadow:0 0 4px var(--paper), 0 0 4px var(--paper); pointer-events:none; }
.board-horse[hidden] { display:none; }
.board-horse.horse-top-left { grid-column:1; grid-row:1; align-self:end; justify-self:end; margin:0 5px 5px 0; }
.board-horse.horse-top-right { grid-column:3; grid-row:1; align-self:end; justify-self:start; margin:0 0 5px 5px; }
.board-horse.horse-bottom-left { grid-column:1; grid-row:3; align-self:start; justify-self:end; margin:5px 5px 0 0; }
.board-horse.horse-bottom-right { grid-column:3; grid-row:3; align-self:start; justify-self:start; margin:5px 0 0 5px; }
.direction-label { position:absolute; z-index:3; display:grid; place-items:center; width:28px; height:28px; color:var(--red-dark); background:var(--paper); border:1px solid rgba(155,47,47,.28); border-radius:50%; font-size:16px; font-weight:800; line-height:1; box-shadow:0 2px 8px rgba(58,34,23,.08); pointer-events:none; }
.direction-south { top:0; left:50%; transform:translateX(-50%); }
.direction-north { bottom:0; left:50%; transform:translateX(-50%); }
.direction-east { top:50%; left:0; transform:translateY(-50%); }
.direction-west { top:50%; right:0; transform:translateY(-50%); }
.outer-ring { color:var(--ink); min-width:0; min-height:0; }
.outer-top, .outer-bottom { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.outer-top { grid-area:top; padding-top:30px; }
.outer-bottom { grid-area:bottom; padding-bottom:30px; }
.outer-left, .outer-right { display:grid; grid-template-rows:repeat(3,minmax(0,1fr)); }
.outer-left { grid-area:left; padding-left:32px; }
.outer-right { grid-area:right; padding-right:32px; }
.outer-slot { display:flex; align-items:center; justify-content:center; gap:7px; min-width:0; min-height:0; }
.outer-top .outer-slot, .outer-bottom .outer-slot { flex-direction:column; gap:3px; }
.outer-left .outer-slot { flex-direction:row-reverse; }
.outer-right .outer-slot { flex-direction:row; }
.outer-branch { flex:0 0 auto; color:#bd2d2d; font-size:18px; font-weight:800; line-height:1; }
.outer-hidden { min-width:0; font-size:21px; font-weight:700; letter-spacing:.03em; line-height:1; white-space:nowrap; }
.outer-hidden.empty { color:#c9bfb1; font-size:17px; }
.palace { position:relative; display:grid; grid-template-rows:auto minmax(0,1fr); min-width:0; width:100%; text-align:left; color:var(--ink); background:transparent; border:0; border-right:1px solid var(--ink); border-bottom:1px solid var(--ink); padding:10px 10px 16px; min-height:155px; transition:.18s ease; overflow:hidden; }
.palace:nth-child(3n) { border-right:0; }
.palace:nth-child(n+7) { border-bottom:0; }
.palace:hover, .palace:focus-visible { z-index:2; background:#f9efdd; outline:2px solid var(--gold); }
.palace-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:start; min-height:34px; }
.palace-head,
.palace-core { transform:translateY(5px); }
.palace-god, .star-door { font-size:20px; line-height:1.2; }
.palace-god { align-self:start; font-weight:600; white-space:nowrap; }
.palace-core { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; min-width:0; min-height:0; }
.stems, .star-door { display:grid; grid-template-rows:repeat(2,minmax(0,1fr)); min-width:0; min-height:0; }
.stems { font-size:23px; line-height:1.08; }
.stem-layer { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:end; gap:4px; min-width:0; min-height:0; }
.stem-layer:empty { min-height:1em; }
.stem-stack { display:grid; grid-template-rows:13px auto; align-content:end; justify-items:start; min-width:0; min-height:0; }
.changsheng-state { display:none; grid-row:1; align-self:end; color:var(--red); font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif; font-size:10px; font-weight:600; line-height:16px; letter-spacing:0; white-space:nowrap; font-synthesis:none; }
.show-changsheng .changsheng-state { display:block; }
.stem { grid-row:2; display:block; min-width:0; line-height:1.08; white-space:nowrap; }
.stem-char { display:inline-block; }
.stem.s1 { color:#3153a6; }
.stem.s2 { color:#7d281f; }
.star-door { justify-items:end; align-items:stretch; flex:0 0 auto; }
.star-door strong, .star-door span { display:flex; align-items:flex-end; justify-content:flex-end; min-height:0; white-space:nowrap; }
.star-door strong { font-weight:600; }
.star-door span { color:var(--ink); font-weight:700; }
.palace-name { position:absolute; left:50%; bottom:3px; transform:translateX(-50%); color:var(--muted); font-size:10px; font-weight:400; line-height:1; text-align:center; white-space:nowrap; pointer-events:none; }
.marks { position:static; display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-end; gap:5px; min-width:0; min-height:16px; }
.mark { display:inline-grid; place-items:center; flex:0 0 auto; min-width:14px; min-height:14px; padding:0; color:var(--red-dark); background:transparent; border-radius:0; font-style:normal; font-size:13px; font-weight:800; line-height:1; white-space:nowrap; }
.mark.void { color:var(--ink); background:transparent; transform:translate(-8px, 4px); }
.void-rings { position:relative; display:inline-block; width:18px; height:18px; border:1.6px solid currentColor; border-radius:50%; box-sizing:border-box; }
.void-rings::after { content:""; position:absolute; inset:3.5px; border:1.4px solid currentColor; border-radius:50%; box-sizing:border-box; }
.mark.horse { color:var(--red); background:transparent; }
.center { display:flex; flex-direction:column; justify-content:center; align-items:center; background:radial-gradient(circle, #fff 0, #f7efdf 75%); }
.taiji-scene { position:relative; display:grid; place-items:center; width:74px; height:74px; transform:none; perspective:260px; pointer-events:none; }
.taiji-scene::after { content:""; position:absolute; left:16%; right:16%; bottom:-5px; height:10px; border-radius:50%; background:rgba(35,27,19,.24); filter:blur(5px); animation:taiji-shadow 8s ease-in-out infinite; }
.taiji-disc { position:relative; z-index:1; display:block; width:100%; height:100%; border-radius:50%; transform-style:preserve-3d; animation:taiji-spin-3d 8s linear infinite; box-shadow:inset -4px -5px 8px rgba(0,0,0,.24), inset 3px 3px 5px rgba(255,255,255,.58), 0 4px 7px rgba(38,28,18,.3); }
.taiji-disc::after { content:""; position:absolute; inset:2px; border-radius:50%; border:1px solid rgba(255,255,255,.34); box-shadow:inset 0 0 0 1px rgba(0,0,0,.2); pointer-events:none; }
.taiji-svg { display:block; width:100%; height:100%; border-radius:50%; overflow:visible; }
.center-host { transform:translateY(5px); }
@keyframes taiji-spin-3d {
  0% { transform:rotateX(12deg) rotateY(-8deg) rotateZ(0deg); }
  25% { transform:rotateX(5deg) rotateY(10deg) rotateZ(90deg); }
  50% { transform:rotateX(-12deg) rotateY(7deg) rotateZ(180deg); }
  75% { transform:rotateX(-4deg) rotateY(-10deg) rotateZ(270deg); }
  100% { transform:rotateX(12deg) rotateY(-8deg) rotateZ(360deg); }
}
@keyframes taiji-shadow {
  0%, 100% { opacity:.62; transform:scaleX(.9); }
  50% { opacity:.35; transform:scaleX(.72); }
}
@media (prefers-reduced-motion:reduce) {
  .taiji-disc, .taiji-scene::after { animation:none; }
}
.center small { color:var(--muted); margin-top:8px; }
.sidebar { display:grid; min-width:0; align-content:start; gap:14px; }
.side-card { border-top:4px solid var(--red); background:var(--paper-2); padding:16px; }
.side-card h3 { margin:0 0 12px; }
.facts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.facts div { background:#fffdf7; border:1px solid var(--line); padding:9px; }
.facts small { display:block; color:var(--muted); }
.facts strong { font-size:18px; color:var(--red-dark); }
dl { margin:0; } dl div { display:flex; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px dashed var(--line); } dt { color:var(--muted); } dd { margin:0; text-align:right; }
.status { margin-top:18px; padding:12px 14px; border-left:4px solid; }
.status.success { background:#edf5eb; border-color:#53854a; }
.status.warning { background:#fff1d9; border-color:#c07a15; }
.notes { margin-top:18px; padding:18px 22px; }
.notes h3 { margin-top:0; } .notes li { margin:8px 0; color:var(--muted); }
@media (max-width: 850px) {
  .masthead { align-items:flex-start; } .toolbar { flex-direction:column; }
  .controls { grid-template-columns:1fr 1fr; } .controls label:first-child, .controls .datetime-field { grid-column:1/-1; }
}
@media (max-width: 590px) {
  .app-shell { padding:14px 8px 30px; } .masthead { flex-direction:column; }
  .toolbar { width:100%; flex-direction:row; } .toolbar button { flex:1; }
  .controls { grid-template-columns:1fr 1fr; } .controls label:first-child, .controls .datetime-field { grid-column:1/-1; }
}
@media print {
  body { background:white; } .app-shell { padding:0; } .controls, .toolbar, .chart-navigation, .notes { display:none; } .panel { box-shadow:none; } .chart { border:0; margin:0; }
}

/* 闂冨娲忛崚鎴濐暩鏉╊偊顤侀懝鑼额潐閸?*/
.effect-tomb { color:#16883b !important; }
.effect-strike { color:#1857d8 !important; }
.effect-both { color:#d51fb8 !important; }
.effect-pressure { color:#d01818 !important; }
.stem-char { display:inline; }
.door { font-weight:700; }
.center-host { margin-top:6px; color:#78552b; font-size:14px; }
.color-legend { display:flex; flex-wrap:wrap; gap:8px; list-style:none; margin-left:-20px !important; }
.legend { padding:5px 9px; background:#fffdf7; border:1px solid var(--line); font-weight:700; }
.legend.tomb { color:#16883b; }
.legend.strike { color:#1857d8; }
.legend.both { color:#d51fb8; }
.legend.pressure { color:#d01818; }
.ju-card p { margin:0 0 9px; color:var(--muted); line-height:1.6; }
.ju-card > strong { display:block; color:var(--red-dark); background:#fffdf7; border:1px solid var(--line); padding:10px; font-size:16px; }
.ju-card > small { display:block; margin-top:9px; color:var(--muted); line-height:1.55; }









/* 缁堣韩鐩樺ぇ杩?*/
.dayun-section { margin-top:20px; border-top:1px solid var(--line); padding-top:18px; }
.dayun-section[hidden] { display:none; }
.dayun-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:12px; }
.dayun-heading h3 { margin:2px 0 0; font-size:22px; color:var(--red-dark); }
.dayun-heading small { color:var(--muted); letter-spacing:.12em; }
.dayun-heading p { margin:0; color:var(--muted); text-align:right; line-height:1.55; }
.fortune-inline { width:100%; min-width:0; }
.dayun-table-wrap { width:100%; max-width:100%; overflow:hidden; border:1px solid var(--line); background:#fffdf7; }
.dayun-table { width:100%; min-width:0; border-collapse:collapse; table-layout:fixed; text-align:center; }
.dayun-table th, .dayun-table td { border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:12px 9px; white-space:nowrap; }
.dayun-table tr:last-child th, .dayun-table tr:last-child td { border-bottom:0; }
.dayun-table th { width:66px; color:var(--red-dark); background:#f5e8cf; font-size:14px; }
.dayun-table .fortune-table-title,
.liunian-table .fortune-table-title { width:42px; padding:8px 4px; vertical-align:middle; writing-mode:horizontal-tb; text-align:center; letter-spacing:0; white-space:nowrap; }
.fortune-table-label { display:block; width:max-content; margin:0 auto 8px; writing-mode:vertical-rl; text-orientation:upright; letter-spacing:.6em; line-height:1.1; }
.fortune-liunian-toggle { display:grid; place-items:center; width:34px; height:21px; margin:0 auto; padding:2px; border:1px solid #d3b07e; border-radius:999px; color:#6f2020; background:linear-gradient(180deg,#fffdf7 0%,#f8ead7 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 1px 4px rgba(89,51,32,.12); cursor:pointer; transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease; }
.fortune-liunian-toggle:active { transform:scale(.96); }
.fortune-liunian-toggle:focus-visible { outline:2px solid rgba(155,47,47,.35); outline-offset:2px; }
.fortune-liunian-toggle .result-toggle-track { position:relative; display:block; width:28px; height:16px; border:1px solid rgba(111,82,65,.18); border-radius:999px; background:#ded1c6; box-shadow:inset 0 1px 3px rgba(75,51,38,.16); }
.fortune-liunian-toggle .result-toggle-track::after { content:""; position:absolute; left:2px; top:2px; width:10px; height:10px; border:1px solid rgba(148,106,67,.2); border-radius:50%; background:#fffdf8; box-shadow:0 1px 4px rgba(59,36,24,.28); transition:transform .18s ease; }
.fortune-liunian-toggle[aria-pressed="true"] { border-color:#9b2f2f; background:linear-gradient(180deg,#fff8f2 0%,#f4dfd7 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 2px 6px rgba(111,32,32,.16); }
.fortune-liunian-toggle[aria-pressed="true"] .result-toggle-track { background:linear-gradient(180deg,#b84040 0%,#8f2424 100%); border-color:#7d1f1f; }
.fortune-liunian-toggle[aria-pressed="true"] .result-toggle-track::after { transform:translateX(12px); }
.fortune-entry-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:4px; margin-top:8px; }
.fortune-entry-actions[data-visible-count="1"] { grid-template-columns:minmax(0,1fr); }
.fortune-entry-actions[data-visible-count="2"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.fortune-entry-actions[data-visible-count="3"] { grid-template-columns:repeat(3,minmax(0,1fr)); }
.fortune-entry-actions[data-visible-count="4"] { grid-template-columns:repeat(4,minmax(0,1fr)); }
.fortune-entry-button { display:inline-flex; align-items:center; justify-content:center; gap:4px; width:100%; min-width:0; height:36px; padding:0 10px; border:1px solid #d3b07e; border-radius:999px; color:#6f2020; background:#fffdf8; box-shadow:0 1px 3px rgba(89,51,32,.1); font-size:13px; font-weight:800; white-space:nowrap; cursor:pointer; }
.fortune-entry-button[hidden] { display:none !important; }
.fortune-entry-icon { display:inline-grid; place-items:center; width:15px; height:15px; font-size:14px; line-height:1; }
.fortune-entry-icon-number { font-family:Arial,sans-serif; font-size:15px; font-weight:900; }
.fortune-entry-actions .odo-effect-btn { border:1px solid #d3b07e; border-radius:999px; color:#6f2020; background:#fffdf8; box-shadow:0 1px 3px rgba(89,51,32,.1); }
.fortune-entry-actions .odo-effect-btn.active { color:#fff; background:#9b2f2f; }
.fortune-entry-button:active { transform:scale(.98); }
.fortune-entry-button:disabled { color:#aaa19a; border-color:#ddd3ca; background:#f2eee7; box-shadow:none; cursor:default; }
.dayun-table td { min-width:0; font-size:16px; font-weight:700; }
.dayun-table #dayun-ganzhi td { color:var(--red-dark); font-size:19px; }
.dayun-table td.current-dayun { background:#fff0c7; box-shadow:inset 0 -4px 0 #c07a15; }
.dayun-table td[data-dayun-index] { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.dayun-table td[data-dayun-index]:hover { background:#fff7df; }
.dayun-table td.selected-dayun { background:#f8e5bc; box-shadow:none; }
.dayun-table td.current-dayun.selected-dayun { background:#ffe3a2; box-shadow:inset 0 -4px 0 #c07a15; }
.liunian-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin:20px 0 10px; }
.liunian-heading h4 { margin:2px 0 0; font-size:19px; color:var(--red-dark); }
.liunian-heading small, .liunian-heading p { color:var(--muted); }
.liunian-heading p { margin:0; text-align:right; line-height:1.55; }
.liunian-table-wrap { width:100%; max-width:100%; overflow:hidden; border:1px solid var(--line); background:#fffdf7; }
.liunian-table { width:100%; min-width:0; border-collapse:collapse; table-layout:fixed; text-align:center; }
.liunian-table th, .liunian-table td { border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:10px 7px; white-space:nowrap; }
.liunian-table tr:last-child th, .liunian-table tr:last-child td { border-bottom:0; }
.liunian-table th { width:66px; color:var(--red-dark); background:#f5e8cf; font-size:14px; }
.liunian-table td { min-width:0; font-size:16px; font-weight:700; }
.liunian-table #liunian-ganzhi td { color:var(--red-dark); font-size:19px; }
.liunian-table td.current-liunian { background:#fff0c7; box-shadow:inset 0 -4px 0 #c07a15; }
@media (max-width:590px) {
  .dayun-heading, .liunian-heading { align-items:flex-start; flex-direction:column; gap:6px; }
  .dayun-heading p, .liunian-heading p { text-align:left; font-size:13px; }
  .dayun-table, .liunian-table { width:100%; min-width:0; }
  .dayun-table th, .dayun-table td, .liunian-table th, .liunian-table td { padding:8px 2px; }
}


/* 鍙姌鍙犱俊鎭崱 */
.mobile-detail { overflow:hidden; }
.mobile-detail > summary, .notes > summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--red-dark);
  font-weight:800;
  cursor:pointer;
  list-style:none;
}
.mobile-detail > summary::-webkit-details-marker, .notes > summary::-webkit-details-marker { display:none; }
.mobile-detail > summary::after, .notes > summary::after {
  content:"＋";
  flex:0 0 auto;
  font-size:20px;
  font-weight:400;
  line-height:1;
}
.mobile-detail[open] > summary::after, .notes[open] > summary::after { content:"－"; }
.mobile-detail[open] > summary { margin-bottom:12px; }
.detail-content h3 { margin:0 0 12px; }
.notes > summary { font-size:18px; }
.notes[open] > summary { margin-bottom:10px; }

/* 鎵嬫満浼樺厛甯冨眬锛氭牳蹇冩帓鐩樺崰婊″睆骞曪紝娆¤淇℃伅鎶樺彔 */
@media screen and (max-width:700px) {
  body { background:#f3ede3; }
  .app-shell { width:100%; max-width:none; padding:10px 6px 28px; overflow:hidden; }
  .panel { box-shadow:0 8px 24px rgba(58,34,23,.08); }
  .app-view { width:100%; }
  .input-view { min-height:calc(100vh - 38px); display:flex; flex-direction:column; justify-content:center; }
  .input-masthead { justify-content:flex-start; padding:0 6px; }
  .input-view .controls { width:100%; }
  .input-view .notes { margin-top:10px; }
  .masthead { flex-direction:column; gap:10px; margin-bottom:12px; }
  .brand { width:100%; gap:10px; }
  .brand-logo { width:44px; height:44px; }
  h1 { font-size:clamp(18px,5.8vw,22px); letter-spacing:.04em; white-space:nowrap; }
  .subtitle { margin-top:2px; font-size:11px; letter-spacing:.1em; }
  .toolbar { width:100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .toolbar button { min-width:0; min-height:44px; padding:8px 4px; font-size:12px; line-height:1.2; }

  .controls, .input-view .controls { padding:12px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 8px; align-items:end; }
  .datetime-field > legend { font-size:12px; }
  .datetime-mode-tabs { position:sticky; top:8px; z-index:4; margin-bottom:10px; }
  .datetime-mode-tab { min-height:44px; padding:8px 4px; font-size:15px; }
  .date-select-grid { grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px 5px; }
  .date-select-grid label:nth-child(1) { grid-column:span 2; }
  .date-select-grid label:nth-child(2), .date-select-grid label:nth-child(3) { grid-column:span 2; }
  .date-select-grid label:nth-child(4), .date-select-grid label:nth-child(5) { grid-column:span 3; }
  .bazi-select-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .date-select-grid select, .bazi-select-grid select { min-height:48px; padding:8px 3px; font-size:16px; }
  .datetime-feedback { grid-template-columns:1fr; gap:3px; padding:9px 10px; }
  .datetime-feedback small { grid-row:auto; }
  .datetime-feedback strong { font-size:15px; }
  .candidate-list { grid-template-columns:1fr; max-height:240px; }
  .candidate-button { min-height:48px; }
  .controls .datetime-field, .controls .name-field, .controls .sample-field,
  .input-view .datetime-field, .input-view .name-field, .input-view .sample-field { grid-column:1/-1; }
  .controls .datetime-field { grid-row:1; }
  .controls .chart-type-field { grid-row:2; grid-column:1; }
  .controls .gender-field { grid-row:2; grid-column:2; }
  .controls .name-field { grid-row:3; }
  .controls .sample-field { grid-row:4; }
  .controls .start-chart, .input-view .start-chart { grid-row:5; grid-column:1; }
  .controls .reset-chart { grid-row:5; grid-column:2; }
  label { gap:5px; font-size:12px; }
  input, select, .controls button { min-height:46px; padding:10px 11px; font-size:16px; }
  .controls .start-chart { font-size:17px; font-weight:800; }

}

@media screen and (max-width:360px) {
  .app-shell { padding-left:4px; padding-right:4px; }
}

@media print {
  .dayun-table-wrap, .liunian-table-wrap { overflow:visible; }
  .dayun-table, .liunian-table { min-width:0; }
  .dayun-table th, .dayun-table td, .liunian-table th, .liunian-table td { padding:8px 4px; font-size:12px; }
  .dayun-table #dayun-ganzhi td, .liunian-table #liunian-ganzhi td { font-size:14px; }
}


/* 鎵嬫満浼樺厛鏃堕棿閫夋嫨鍣細涓婚〉闈繚鎸佺畝娲侊紝鐐瑰嚮鍚庝粠搴曢儴寮瑰嚭婊氳疆 */
.datetime-trigger {
  width:100%; min-height:82px; display:grid; grid-template-columns:44px minmax(0,1fr) 20px;
  align-items:center; gap:12px; padding:13px 14px; color:var(--ink); text-align:left;
  background:linear-gradient(135deg,#fffefa,#fff8ec); border:1px solid #d9c8b3; border-radius:14px;
  box-shadow:0 7px 18px rgba(82,48,31,.08); -webkit-tap-highlight-color:transparent;
}
.datetime-trigger:active { transform:scale(.995); background:#fff7e8; }
.datetime-trigger:focus-visible { outline:3px solid rgba(155,47,47,.2); outline-offset:2px; }
.datetime-trigger-icon { display:grid; place-items:center; width:44px; height:44px; color:#fff; background:var(--red); border-radius:13px; font-size:19px; font-weight:900; box-shadow:inset 0 0 0 2px rgba(255,255,255,.2); }
.datetime-trigger-copy { display:grid; min-width:0; gap:3px; }
.datetime-trigger-copy small { color:var(--red); font-size:12px; font-weight:800; letter-spacing:.05em; }
.datetime-trigger-copy strong { overflow:hidden; color:var(--ink); font-size:18px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.datetime-trigger-copy > span { overflow:hidden; color:var(--muted); font-size:12px; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
.datetime-trigger-arrow { color:#b49b83; font-family:Arial,sans-serif; font-size:31px; font-weight:300; }
.datetime-feedback { display:none; margin:7px 2px 0; padding:8px 10px; border:0; border-radius:8px; font-size:12px; line-height:1.45; }
.datetime-feedback.error, .datetime-feedback.pending { display:block; }
.datetime-feedback.error { color:#a1241c; background:#fff0ed; }
.datetime-feedback.pending { color:#78552b; background:#fff7df; }

.datetime-sheet[hidden] { display:none !important; }
.datetime-sheet { position:fixed; inset:0; z-index:1000; display:flex; align-items:flex-end; justify-content:center; font-family:"Noto Sans SC","Microsoft YaHei",sans-serif; }
.datetime-backdrop { position:absolute; inset:0; width:100%; height:100%; padding:0; background:rgba(25,18,15,.48); border:0; opacity:0; transition:opacity .22s ease; -webkit-tap-highlight-color:transparent; }
.datetime-sheet-panel { position:relative; width:min(100%,560px); max-height:min(88vh,720px); padding:0 14px calc(14px + env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; color:#26201d; background:#fff; border-radius:22px 22px 0 0; box-shadow:0 -16px 45px rgba(31,20,15,.22); transform:translateY(102%); transition:transform .24s cubic-bezier(.2,.75,.25,1); }
.datetime-sheet.open .datetime-backdrop { opacity:1; }
.datetime-sheet.open .datetime-sheet-panel { transform:translateY(0); }
.datetime-sheet-open { overflow:hidden; touch-action:none; }
.sheet-grabber { width:38px; height:4px; margin:8px auto 3px; background:#d8d3cf; border-radius:999px; }
.datetime-sheet-header { display:grid; grid-template-columns:64px minmax(0,1fr) 64px; align-items:center; min-height:48px; border-bottom:1px solid #eee9e5; }
.datetime-sheet-header h2 { margin:0; font-size:16px; text-align:center; letter-spacing:.03em; }
.sheet-action { min-height:44px; padding:5px 4px; background:transparent; border:0; font-size:15px; }
.sheet-cancel { color:#777; text-align:left; }
.sheet-confirm { color:var(--red); text-align:right; font-weight:800; }
.datetime-sheet .datetime-mode-tabs { width:min(100%,270px); margin:12px auto 4px; padding:2px; background:#fff; border:1px solid #d9b2b2; border-radius:999px; }
.datetime-sheet .datetime-mode-tab { min-height:34px; padding:5px 12px; color:#554b47; border-radius:999px; font-size:14px; letter-spacing:.03em; }
.datetime-sheet .datetime-mode-tab.active { color:#fff; background:#d73535; box-shadow:none; }
.picker-preview { display:grid; gap:2px; min-height:54px; padding:8px 4px 4px; text-align:center; }
.picker-preview strong { color:#2e2825; font-size:15px; line-height:1.4; }
.picker-preview span { color:#9a8f89; font-size:11px; line-height:1.35; }
.datetime-sheet .datetime-mode-panel { padding-top:2px; }
.wheel-picker { --wheel-row:46px; position:relative; display:grid; height:calc(var(--wheel-row) * 5); overflow:hidden; border-top:1px solid #f0ece9; border-bottom:1px solid #f0ece9; }
.wheel-picker-five { grid-template-columns:minmax(0,1.18fr) repeat(4,minmax(0,.82fr)); }
.wheel-picker-bazi { grid-template-columns:repeat(4,minmax(0,1fr)); }
.wheel-picker::before { content:""; position:absolute; z-index:0; left:0; right:0; top:calc(var(--wheel-row) * 2); height:var(--wheel-row); background:linear-gradient(90deg,rgba(155,47,47,.06),rgba(155,47,47,.105),rgba(155,47,47,.06)); border-top:1px solid rgba(155,47,47,.17); border-bottom:1px solid rgba(155,47,47,.17); pointer-events:none; }
.wheel-picker::after { content:""; position:absolute; z-index:3; inset:0; background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,.82) 15%,transparent 39%,transparent 61%,rgba(255,255,255,.82) 85%,#fff 100%); pointer-events:none; }
.wheel-column { position:relative; z-index:1; min-width:0; }
.wheel-heading { position:absolute; z-index:4; top:50%; right:2px; transform:translateY(-50%); color:#9f948d; font-size:10px; pointer-events:none; }
.wheel-scroll { height:100%; overflow-y:auto; overscroll-behavior:contain; scroll-snap-type:y mandatory; scrollbar-width:none; -webkit-overflow-scrolling:touch; touch-action:pan-y; }
.wheel-scroll::-webkit-scrollbar { display:none; }
.wheel-spacer { height:calc(var(--wheel-row) * 2); }
.wheel-option { display:block; width:100%; height:var(--wheel-row); min-width:0; padding:0 2px; overflow:hidden; color:#aaa09b; background:transparent; border:0; scroll-snap-align:center; scroll-snap-stop:always; font-size:15px; text-align:center; text-overflow:clip; white-space:nowrap; }
.wheel-option.selected { color:#241f1c; font-size:18px; font-weight:800; }
.wheel-picker-bazi .wheel-option { padding-right:2px; font-size:18px; }
.wheel-picker-bazi .wheel-option.selected { color:var(--red); font-size:22px; }
.datetime-sheet .datetime-help { margin:9px 4px 0; text-align:center; font-size:11px; }
.datetime-sheet .bazi-search { min-height:46px; margin-top:12px; color:#fff; background:var(--red); border:0; border-radius:999px; font-size:15px; font-weight:800; }
.datetime-sheet .bazi-candidates { margin:10px 0 2px; }
.datetime-sheet .candidate-list { max-height:150px; }
.datetime-sheet .candidate-button { min-height:48px; border-radius:10px; }
.datetime-state-controls { position:absolute !important; width:1px !important; height:1px !important; overflow:hidden !important; clip-path:inset(50%) !important; white-space:nowrap !important; }

@media screen and (max-width:700px) {
  .input-masthead { padding-top:12px; }
  .input-view .controls { padding:12px; border-radius:14px; }
  .datetime-field > legend { margin-bottom:7px; }
  .datetime-trigger { min-height:84px; padding:13px 12px; border-radius:13px; }
  .datetime-trigger-copy strong { font-size:17px; }
  .datetime-sheet-panel { width:100%; max-height:91dvh; border-radius:20px 20px 0 0; }
  .wheel-picker { --wheel-row:44px; }
  .wheel-option { font-size:13px; }
  .wheel-option.selected { font-size:16px; }
  .candidate-list { grid-template-columns:1fr; }
}

@media screen and (min-width:701px) {
  .datetime-sheet { align-items:center; padding:24px; }
  .datetime-sheet-panel { border-radius:22px; transform:translateY(30px) scale(.98); opacity:0; transition:transform .22s ease,opacity .22s ease; }
  .datetime-sheet.open .datetime-sheet-panel { transform:translateY(0) scale(1); opacity:1; }
}

/* 婊氳疆蹇呴』鍦ㄥ浐瀹氶珮搴﹀唴婊氬姩锛屼笉鑳借闀垮勾浠藉垪琛ㄦ拺楂?*/
.wheel-picker { min-height:calc(var(--wheel-row) * 5); }
.wheel-column { min-height:0; height:100%; overflow:hidden; }
.wheel-scroll { position:absolute; inset:0; height:auto; }

/* 鎵嬫満绔洓鏌憋細姣忔鍙搷浣滀竴鏌憋紝澶╁共涓庡湴鏀垎鍒粴鍔ㄩ€夋嫨 */
.bazi-mode-panel { padding-top:8px !important; }
.bazi-pillar-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0 2px 10px; }
.bazi-pillar-tab { min-width:0; min-height:50px; padding:7px 2px 6px; color:#756a64; background:#f7f3f0; border:1px solid #e8dfda; border-radius:12px; text-align:center; }
.bazi-pillar-tab small { display:block; margin-bottom:3px; color:#9b8e87; font-size:11px; line-height:1.2; }
.bazi-pillar-tab strong { display:block; color:#332b27; font-family:"Noto Serif SC","Songti SC",serif; font-size:15px; line-height:1.15; letter-spacing:.08em; }
.bazi-pillar-tab.active { background:#fff8f5; border-color:rgba(155,47,47,.52); box-shadow:0 3px 12px rgba(115,42,42,.09); }
.bazi-pillar-tab.active small,.bazi-pillar-tab.active strong { color:var(--red); }
.bazi-current-label { display:flex; align-items:center; justify-content:space-between; min-height:34px; padding:0 7px; }
.bazi-current-label span { color:var(--red); font-size:14px; font-weight:800; }
.bazi-current-label strong { color:#9b8e87; font-size:12px; font-weight:600; }
.bazi-pillar-wheel[hidden] { display:none !important; }
.wheel-picker-bazi-pair { grid-template-columns:repeat(2,minmax(0,1fr)); border-radius:12px; }
.wheel-picker-bazi-pair .wheel-column:first-child { border-right:1px solid #eee8e4; }
.wheel-picker-bazi-pair .wheel-heading { right:10px; color:#9f948d; font-size:11px; }
.wheel-picker-bazi-pair .wheel-option { padding:0 32px 0 10px; font-family:"Noto Serif SC","Songti SC",serif; font-size:15px; }
.wheel-picker-bazi-pair .wheel-option.selected { color:var(--red); font-size:18px; font-weight:900; }
.bazi-parity-note { display:flex; justify-content:center; gap:22px; margin:8px 0 0; color:#9b8e87; font-size:11px; }
.bazi-parity-note span::before { content:""; display:inline-block; width:5px; height:5px; margin:0 5px 2px 0; background:var(--red); border-radius:50%; opacity:.55; }

@media screen and (max-width:700px) {
  .datetime-sheet-header { position:sticky; top:0; z-index:20; background:#fff; }
  #bazi-picker .bazi-pillar-tabs { margin-bottom:5px; }
  #bazi-picker .bazi-current-label { min-height:28px; }
  #bazi-picker .wheel-picker-bazi-pair { --wheel-row:40px; height:calc(var(--wheel-row) * 3); min-height:calc(var(--wheel-row) * 3); }
  #bazi-picker .wheel-picker-bazi-pair::before { top:var(--wheel-row); }
  #bazi-picker .wheel-picker-bazi-pair::after { background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,.72) 20%,transparent 36%,transparent 64%,rgba(255,255,255,.72) 80%,#fff 100%); }
  #bazi-picker .wheel-picker-bazi-pair .wheel-spacer { height:var(--wheel-row); }
  #bazi-picker .bazi-parity-note { margin-top:5px; }
  #bazi-picker .bazi-search { min-height:44px; margin-top:6px; }
  .bazi-pillar-tab { min-height:46px; }
  .bazi-pillar-tab strong { font-size:14px; }
  .wheel-picker-bazi-pair .wheel-option { font-size:14px; }
  .wheel-picker-bazi-pair .wheel-option.selected { font-size:17px; }
}

@media screen and (max-width:380px) {
  .wheel-picker-five { grid-template-columns:minmax(0,1.12fr) repeat(4,minmax(0,.88fr)); }
  .wheel-option { padding-left:0; padding-right:0; font-size:12px; }
  .wheel-option.selected { font-size:15px; }
  .bazi-pillar-tabs { gap:5px; }
  .bazi-pillar-tab { min-height:44px; border-radius:10px; }
  .bazi-pillar-tab strong { font-size:13px; }
  .wheel-picker-bazi-pair .wheel-option.selected { font-size:16px; }
}
/* PWA installation and standalone-mode polish */
.pwa-install-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 42px 10px 10px;
  border: 1px solid rgba(155, 47, 47, .22);
  background: linear-gradient(135deg, rgba(255, 250, 240, .98), rgba(252, 238, 222, .96));
}
.pwa-install-card[hidden] { display: none !important; }
.pwa-install-icon {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}
.pwa-install-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pwa-install-copy strong { color: var(--ink); font-size: 15px; }
.pwa-install-copy span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.pwa-install-button { min-width: 68px; min-height: 40px; padding: 7px 12px; }
.pwa-install-dismiss {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
html.pwa-standalone body { padding-top: env(safe-area-inset-top); }
html.pwa-standalone .result-header { top: env(safe-area-inset-top); }

@media screen and (max-width: 700px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .pwa-install-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 10px 42px 10px 10px;
  }
  .pwa-install-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
  }
}

@media print {
  .pwa-install-card { display: none !important; }
}


/* Case library, chart basis, and mobile case editor */
button, input, select, textarea { font: inherit; }
.case-center { margin-top:14px; overflow:hidden; }
.case-center > summary {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:52px; padding:12px 16px; color:var(--red-dark); cursor:pointer;
  font-weight:800; list-style:none; -webkit-tap-highlight-color:transparent;
}
.case-center > summary::-webkit-details-marker { display:none; }
.case-center > summary::after { content:"＋"; flex:0 0 auto; font-size:20px; font-weight:400; line-height:1; }
.case-center[open] > summary::after { content:"－"; }
.case-center > summary small { margin-left:auto; color:var(--muted); font-size:12px; font-weight:400; }
.case-center-body { padding:0 16px 16px; border-top:1px solid rgba(155,47,47,.12); }
.case-search-row { display:grid; gap:6px; padding-top:14px; }
.case-search-row > label { color:var(--muted); font-size:12px; }
.case-search-row > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.case-search-row input { min-height:46px; }
.case-search-row button { min-width:72px; min-height:46px; padding:8px 12px; }
.case-list { display:grid; gap:10px; max-height:430px; margin-top:12px; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.case-empty { padding:24px 14px; color:var(--muted); background:rgba(248,241,229,.72); border:1px dashed var(--line); border-radius:9px; font-size:13px; line-height:1.65; text-align:center; }
.case-item { padding:10px; background:#fffefa; border:1px solid var(--line); border-radius:10px; box-shadow:0 4px 12px rgba(58,34,23,.05); }
.case-item.active { background:#fff7e8; border-color:var(--red); box-shadow:inset 3px 0 0 var(--red),0 4px 12px rgba(58,34,23,.06); }
.case-open { width:100%; min-height:48px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:5px 4px; color:var(--ink); text-align:left; background:transparent; border:0; }
.case-open span { min-width:0; display:grid; gap:4px; }
.case-open strong { overflow:hidden; color:var(--red-dark); font-size:15px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.case-open small { overflow:hidden; color:var(--muted); font-size:11px; line-height:1.45; text-overflow:ellipsis; white-space:nowrap; }
.case-open em { color:var(--red); font-size:12px; font-style:normal; font-weight:800; white-space:nowrap; }
.case-item > p { max-height:4.6em; margin:7px 4px 9px; overflow:hidden; color:#5f534d; font-size:12px; line-height:1.55; white-space:pre-wrap; }
.case-item-actions { display:grid; grid-template-columns:minmax(0,1fr) 74px; gap:8px; padding-top:8px; border-top:1px solid rgba(216,203,187,.72); }
.case-item-actions button { min-height:44px; padding:7px 10px; border-radius:5px; font-size:12px; }
.danger-link { color:#a1241c; background:#fff; border:1px solid rgba(193,57,43,.35); }
.backup-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
.backup-actions button { min-height:46px; padding:9px 8px; }
.case-storage-status { margin:10px 2px 0; color:var(--muted); font-size:12px; line-height:1.55; }
.case-storage-status.success { color:#176b35; }
.case-storage-status.error { color:#a1241c; }

.basis-card { border-left:3px solid var(--gold); }
.chart-basis { display:grid; gap:0; }
.chart-basis div { display:grid; grid-template-columns:76px minmax(0,1fr); gap:8px; padding:8px 0; border-bottom:1px solid rgba(216,203,187,.72); }
.chart-basis div:last-child { border-bottom:0; }
.chart-basis small { color:var(--muted); font-size:11px; line-height:1.45; }
.chart-basis strong { min-width:0; color:var(--ink); font-size:12px; line-height:1.55; overflow-wrap:anywhere; }

.case-sheet[hidden] { display:none !important; }
.case-sheet { position:fixed; inset:0; z-index:1100; display:flex; align-items:flex-end; justify-content:center; font-family:"Noto Sans SC","Microsoft YaHei",sans-serif; }
.case-sheet-backdrop { position:absolute; inset:0; width:100%; height:100%; padding:0; background:rgba(25,18,15,.5); border:0; opacity:0; transition:opacity .2s ease; -webkit-tap-highlight-color:transparent; }
.case-sheet-panel { position:relative; width:min(100%,600px); max-height:min(88dvh,760px); padding:0 14px calc(16px + env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; color:var(--ink); background:#fff; border-radius:22px 22px 0 0; box-shadow:0 -16px 45px rgba(31,20,15,.24); transform:translateY(102%); transition:transform .22s cubic-bezier(.2,.75,.25,1); }
.case-sheet.open .case-sheet-backdrop { opacity:1; }
.case-sheet.open .case-sheet-panel { transform:translateY(0); }
.case-sheet-open { overflow:hidden; touch-action:none; }
.case-sheet-header { position:sticky; top:0; z-index:2; display:grid; grid-template-columns:64px minmax(0,1fr) 64px; align-items:center; min-height:50px; background:#fff; border-bottom:1px solid #eee9e5; }
.case-sheet-header h2 { margin:0; font-size:16px; text-align:center; letter-spacing:.03em; }
.case-editor { display:grid; gap:15px; padding:14px 0 2px; }
.case-editor-meta { margin:0; padding:9px 11px; color:var(--muted); background:#f8f1e5; border-radius:8px; font-size:12px; line-height:1.55; }
.case-editor-history { margin:-8px 0 0; color:var(--muted); font-size:11px; line-height:1.45; }
.case-editor label { display:grid; gap:7px; color:var(--red-dark); font-size:13px; font-weight:800; }
.case-editor input, .case-editor textarea { width:100%; min-width:0; padding:11px 12px; color:var(--ink); background:#fffefa; border:1px solid var(--line); border-radius:8px; font-size:16px; font-weight:400; line-height:1.55; }
.case-editor input { min-height:48px; }
.case-editor textarea { min-height:190px; resize:vertical; }
.case-editor-consultation { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--red-dark); font-size:13px; font-weight:800; }
.case-editor-consultation-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; width:min(100%,220px); }
.case-editor-consultation-buttons button { min-height:42px; padding:7px 12px; color:var(--muted); background:#fffefa; border:1px solid var(--line); border-radius:7px; font-size:14px; }
.case-editor-consultation-buttons button[aria-pressed="true"] { color:#fff; background:var(--red); border-color:var(--red); }
.case-editor-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.case-editor-actions small { color:var(--muted); font-size:11px; line-height:1.45; text-align:right; }
.danger { min-height:44px; padding:8px 14px; color:#a1241c; background:#fff2ef; border:1px solid rgba(193,57,43,.4); border-radius:6px; white-space:nowrap; }

@media screen and (max-width:700px) {
  .result-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .case-center { margin:10px 0 0; }
  .case-center > summary { min-height:50px; padding:11px 13px; }
  .case-center-body { padding:0 10px 12px; }
  .case-search-row { padding-top:10px; }
  .case-search-row > div { gap:6px; }
  .case-search-row button { min-width:64px; }
  .case-list { max-height:48dvh; margin-top:10px; padding-right:1px; }
  .case-item { padding:8px; border-radius:9px; }
  .case-open { min-height:50px; }
  .case-open strong { font-size:14px; }
  .case-item-actions { grid-template-columns:minmax(0,1fr) 68px; gap:6px; }
  .backup-actions { gap:6px; }
  .backup-actions button { min-width:0; font-size:12px; }
  .chart-basis div { grid-template-columns:84px minmax(0,1fr); padding:7px 0; }
  .chart-basis small { font-size:10px; }
  .chart-basis strong { font-size:11px; }
  .case-sheet-panel { max-height:88dvh; padding-left:12px; padding-right:12px; }
  .case-editor { padding-top:11px; }
  .case-editor textarea { min-height:210px; }
  .case-editor-actions { align-items:flex-end; }
}

@media screen and (max-width:360px) {
  .case-open small { white-space:normal; }
  .case-editor-actions { align-items:stretch; flex-direction:column-reverse; }
  .case-editor-actions small { text-align:left; }
  .danger { width:100%; }
}

@media print {
  .case-center, .case-sheet, #save-case { display:none !important; }
}

/* 缁撴灉椤垫爣绛俱€佹ā寮忎笌鍒嗕韩 */
.view-mode { display:flex; align-items:center; gap:4px; padding:4px; color:var(--muted); background:#f6efe4; border:1px solid var(--line); border-radius:5px; white-space:nowrap; }
.view-mode > span { padding:0 4px; font-size:11px; }
.view-mode-button { min-height:32px; padding:5px 9px; color:var(--muted); background:transparent; border:0; border-radius:3px; font-size:12px; font-weight:800; }
.view-mode-button.active { color:var(--red-dark); background:#fffdf7; box-shadow:0 1px 4px rgba(70,40,20,.12); }
.result-panel { min-width:0; }
.result-panel > .chart-meta { margin-bottom:20px; }
.details-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.details-grid .facts-card { grid-column:1 / -1; }
.basis-grid { grid-template-columns:minmax(0,1.4fr) minmax(260px,.6fr); }
.fortune-empty { padding:30px 18px; color:var(--muted); text-align:center; background:#fffdf7; border:1px dashed var(--line); border-radius:6px; }
.fortune-link-summary { margin:10px 0 12px; padding:10px 12px; color:var(--red-dark); background:#fff4de; border-left:3px solid var(--gold); line-height:1.5; }
.fortune-link-summary strong { margin-right:5px; }
.dayun-table td.selected-dayun, .liunian-table td.selected-liunian { position:relative; z-index:1; }
.selected-palace { background:#fff4d7 !important; outline:2px solid var(--red) !important; outline-offset:-2px; }
body[data-display-mode="simple"] .technical-tag,
body[data-display-mode="simple"] .outer-hidden,
body[data-display-mode="simple"] .marks,
body[data-display-mode="simple"] .changsheng-state,
body[data-display-mode="simple"] .pro-only { display:none !important; }
@media screen and (min-width:701px) { body[data-display-mode="simple"] .board-wrap { grid-template-rows:56px minmax(0,1fr) 56px; grid-template-columns:58px minmax(0,1fr) 58px; } }
body[data-display-mode="simple"] .calendar h2 { font-size:21px; }
body[data-display-mode="simple"] .pillars strong { font-size:18px; }
.palace-sheet[hidden] { display:none !important; }
.palace-sheet {
  position:fixed; inset:0; z-index:1200; display:flex; align-items:flex-end; justify-content:center;
  pointer-events:none;
}
.palace-sheet-panel {
  position:relative; display:flex; flex-direction:column; width:min(100%,600px); height:min(80dvh,720px); max-height:92dvh;
  padding:0 0 env(safe-area-inset-bottom); overflow:hidden; pointer-events:auto; color:var(--ink); background:#fffdf9;
  border:1px solid rgba(109,67,34,.2); border-bottom:0; border-radius:22px 22px 0 0;
  box-shadow:0 -14px 40px rgba(31,20,15,.24); transition:height .28s cubic-bezier(.2,.8,.2,1);
}
.palace-sheet-panel[data-sheet-size="expanded"] { height:92dvh; }
.palace-sheet-panel.dragging { transition:none; }
.palace-sheet-chrome { flex:0 0 auto; min-width:0; padding:0 14px; background:rgba(255,253,249,.98); border-bottom:1px solid var(--line); }
.palace-sheet-grabber {
  display:grid; place-items:center; width:100%; height:27px; padding:0; background:transparent; border:0; touch-action:none; cursor:grab;
}
.palace-sheet-grabber:active { cursor:grabbing; }
.palace-sheet-grabber span { width:44px; height:5px; background:#c8b8aa; border-radius:99px; }
.palace-sheet-header { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:50px; padding-bottom:8px; }
.palace-sheet-header > div { min-width:0; }
.palace-sheet-header h2 { margin:0; color:var(--red-dark); font-size:21px; line-height:1.25; }
.palace-sheet-header p { margin:3px 0 0; overflow:hidden; color:var(--muted); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.palace-sheet-close { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; padding:0; color:#68564b; background:#f3eadf; border:0; border-radius:50%; font-size:25px; line-height:1; }
.palace-sheet-close:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
.palace-detail-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; padding:4px; background:#f5ede2; border-radius:11px; }
.palace-detail-tab { min-width:0; min-height:39px; padding:6px 2px; color:var(--muted); background:transparent; border:0; border-radius:8px; font-size:16px; font-weight:800; white-space:nowrap; }
.palace-detail-tab.active { color:#fff; background:var(--red); box-shadow:0 3px 9px rgba(133,34,31,.18); }
.palace-detail-tab:disabled { color:#b4a79d; cursor:not-allowed; opacity:.58; box-shadow:none; }
.palace-element-nav { display:flex; gap:7px; margin:9px -14px 0; padding:0 14px 10px; overflow-x:auto; scrollbar-width:none; touch-action:pan-x; }
.palace-element-nav::-webkit-scrollbar { display:none; }
.palace-element-chip { flex:0 0 auto; min-height:35px; padding:6px 11px; color:#6b5141; background:#fff; border:1px solid #dac8b5; border-radius:99px; font-size:14px; font-weight:700; white-space:nowrap; }
.palace-element-chip.active { color:#fff; background:#a3342f; border-color:#a3342f; }
.palace-sheet-content { min-height:0; padding:14px 14px calc(22px + env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; scroll-behavior:smooth; }
.detail-hero { display:grid; gap:8px; margin-bottom:12px; padding:14px; background:linear-gradient(145deg,#fff4dc,#fffaf2); border:1px solid #ead4b7; border-radius:14px; }
.detail-hero-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.detail-hero h3 { margin:0; color:var(--red-dark); font-size:22px; }
.detail-hero p { margin:0; color:#66564c; font-size:15px; line-height:1.65; }
.detail-mode-badge { flex:0 0 auto; padding:4px 8px; color:#8a5c18; background:#fff; border:1px solid #e3c994; border-radius:99px; font-size:10px; font-weight:800; }
.detail-keywords { display:flex; flex-wrap:wrap; gap:6px; }
.detail-keywords span { padding:4px 8px; color:#7b4f20; background:#fff9ed; border:1px solid #ead8bb; border-radius:99px; font-size:11px; }
.detail-section { margin-top:12px; }
.detail-section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 8px; color:#51392c; font-size:14px; }
.detail-section-title small { color:var(--muted); font-size:10px; font-weight:500; }
.detail-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
.detail-facts > div { min-width:0; padding:10px; background:#fff; border:1px solid #e5d8ca; border-radius:10px; }
.detail-facts dt { margin-bottom:4px; color:var(--muted); font-size:10px; }
.detail-facts dd { margin:0; color:#392b24; font-size:13px; font-weight:800; line-height:1.45; overflow-wrap:anywhere; }
.overview-plate { display:grid; gap:6px; padding:7px; background:#f8f1e8; border:1px solid #e1d2c1; border-radius:11px; }
.overview-plate-row { min-width:0; padding:5px 7px; background:#fff; border:1px solid #eadfd3; border-radius:8px; }
.overview-plate-main, .overview-plate-stems { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 9px; }
.overview-plate-item { display:flex; min-width:0; align-items:center; gap:5px; }
.overview-plate-label { flex:0 0 auto; color:#8a776a; font-size:10px; font-weight:700; white-space:nowrap; }
.overview-plate-values, .overview-value-pair { display:flex; min-width:0; flex-wrap:wrap; align-items:center; gap:3px; }
.overview-meaning-chip { min-height:27px; padding:3px 8px; color:#68493a; background:#fffaf4; border:1px solid #dbc7b3; border-radius:99px; font-size:12px; font-weight:800; line-height:1.2; white-space:nowrap; }
.overview-meaning-chip:hover { border-color:#b98a67; background:#fff5e9; }
.overview-meaning-chip:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
.overview-status-badge { display:inline-flex; min-height:20px; align-items:center; padding:1px 4px; border-radius:5px; font-size:10px; font-weight:800; line-height:1.25; white-space:nowrap; }
.overview-status-badge.caution { color:#a13d37; background:#fff0ed; }
.overview-status-badge.positive { color:#34724d; background:#eef8f1; }
.overview-status-badge.neutral { color:#74665d; background:#f2eee9; }
.overview-plate-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; }
.overview-response-list, .overview-palace-status { display:flex; min-width:0; flex-wrap:wrap; align-items:center; gap:4px; }
.overview-empty { color:#9b8d83; font-size:11px; font-weight:600; }
@media screen and (max-width:420px) {
  .overview-plate { padding:6px; }
  .overview-plate-main, .overview-plate-stems { gap:5px; }
  .overview-plate-item { align-items:flex-start; flex-direction:column; gap:2px; }
  .overview-meaning-chip { min-height:25px; padding:3px 7px; font-size:11px; }
  .overview-status-badge { font-size:9px; }
}

.factor-list { display:grid; gap:8px; }
.factor-card { display:grid; grid-template-columns:34px minmax(0,1fr); gap:9px; align-items:start; padding:10px 11px; background:#fff; border:1px solid #e5d8ca; border-radius:10px; }
.factor-icon { display:grid; place-items:center; width:34px; height:34px; color:#fff; background:#9b7a4c; border-radius:10px; font-size:14px; font-weight:900; }
.factor-card.positive .factor-icon { background:#41855b; }
.factor-card.caution .factor-icon { background:#ae4c43; }
.factor-card strong { display:block; color:#4e392e; font-size:13px; }
.factor-card p { margin:3px 0 0; color:#6e5d53; font-size:12px; line-height:1.55; }
.interpretation-hero { background:linear-gradient(145deg,#fff1d6,#fffaf2 62%,#f6eee3); }
.interpretation-priority { margin:0 0 12px; padding:12px; background:#fffdf8; border:1px solid #decdb8; border-left:4px solid #9a7540; border-radius:12px; }
.interpretation-priority.caution { border-left-color:#ae4c43; background:#fff8f6; }
.interpretation-priority.positive { border-left-color:#41855b; background:#f6fbf7; }
.interpretation-priority.special { border-left-color:#6d628f; background:#faf8ff; }
.interpretation-priority.balanced { border-left-color:#9a7540; background:linear-gradient(135deg,#fff8f5,#f6fbf7); }
.interpretation-priority-heading { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.interpretation-priority-heading > span { flex:0 0 auto; padding:3px 7px; color:#fff; background:#9a7540; border-radius:99px; font-size:9px; font-weight:900; }
.interpretation-priority-heading strong { min-width:0; color:#4e392e; font-size:14px; }
.interpretation-priority > p { margin:0 0 9px; color:#6c5a50; font-size:11px; line-height:1.55; }
.interpretation-priority-list { display:grid; gap:6px; }
.interpretation-priority-item { display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:8px; align-items:center; padding:8px 9px; background:rgba(255,255,255,.84); border:1px solid #e5d8ca; border-radius:9px; }
.interpretation-priority-index { display:grid; place-items:center; width:24px; height:24px; color:#fff; background:#8c6e56; border-radius:50%; font-size:11px; font-weight:900; }
.interpretation-priority-item.caution .interpretation-priority-index { background:#ae4c43; }
.interpretation-priority-item.positive .interpretation-priority-index { background:#41855b; }
.interpretation-priority-item.special .interpretation-priority-index { background:#6d628f; }
.interpretation-priority-item > div { min-width:0; }
.interpretation-priority-item strong { display:block; color:#4e392e; font-size:12px; }
.interpretation-priority-item small { display:block; margin-top:2px; color:#75655b; font-size:10px; line-height:1.45; overflow-wrap:anywhere; }
.interpretation-priority-item em { align-self:start; padding:3px 6px; color:#765b36; background:#f5ead8; border-radius:99px; font-size:9px; font-style:normal; font-weight:900; white-space:nowrap; }
.interpretation-priority-item em.primary { color:#8f2d29; background:#ffeceb; }
.interpretation-priority-item em.important { color:#7d4d18; background:#fff0d7; }
.interpretation-priority-item em.secondary { color:#267147; background:#edf8f0; }
.interpretation-priority-note { display:block; margin-top:8px; color:#8a7a70; font-size:9px; line-height:1.45; }
.interpretation-counts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0 0 12px; }
.interpretation-count { display:grid; place-items:center; gap:2px; min-width:0; padding:9px 4px; background:#fff; border:1px solid #e4d6c8; border-radius:11px; }
.interpretation-count strong { color:#4f392e; font-size:19px; line-height:1; }
.interpretation-count span { color:var(--muted); font-size:10px; font-weight:800; }
.interpretation-count.positive { border-color:#bdd9c6; background:#f4fbf6; }
.interpretation-count.caution { border-color:#e2bbb6; background:#fff7f5; }
.interpretation-count.special { border-color:#decba8; background:#fffaf0; }
.interpretation-count.reference { border-color:#cfd8e3; background:#f7f9fc; }
.interpretation-section-list { display:grid; gap:9px; }
.interpretation-section-card { display:grid; grid-template-columns:36px minmax(0,1fr); gap:10px; align-items:start; padding:12px; background:#fff; border:1px solid #e5d8ca; border-radius:12px; }
.interpretation-section-card.positive { border-left:3px solid #4c8d62; }
.interpretation-section-card.caution { border-left:3px solid #b14f47; }
.interpretation-section-card.action { border-left:3px solid #9d762e; }
.interpretation-section-icon { display:grid; place-items:center; width:36px; height:36px; color:#fff; background:#8c6e56; border-radius:11px; font-size:14px; font-weight:900; }
.interpretation-section-card.positive .interpretation-section-icon { background:#41855b; }
.interpretation-section-card.caution .interpretation-section-icon { background:#ae4c43; }
.interpretation-section-card.action .interpretation-section-icon { background:#9d762e; }
.interpretation-section-card h4 { margin:0 0 4px; color:#4e392e; font-size:16px; }
.interpretation-section-card p { margin:0; color:#66564d; font-size:14px; line-height:1.7; overflow-wrap:anywhere; }
.interpretation-professional { padding-top:2px; }
.interpretation-source { margin:0 0 9px; padding:10px 11px; color:#604e44; background:#f7f1e8; border-radius:10px; font-size:11px; line-height:1.6; }
.interpretation-evidence { display:grid; gap:7px; }
.interpretation-evidence-item { overflow:hidden; background:#fff; border:1px solid #e3d5c8; border-radius:10px; }
.interpretation-evidence-item summary { display:flex; align-items:center; justify-content:space-between; gap:9px; min-height:42px; padding:9px 11px; color:#523c31; cursor:pointer; font-size:12px; font-weight:800; list-style:none; }
.interpretation-evidence-item summary::-webkit-details-marker { display:none; }
.interpretation-evidence-item summary::after { content:"＋"; flex:0 0 auto; color:#9b5a34; font-size:16px; }
.interpretation-evidence-item[open] summary::after { content:"－"; }
.interpretation-evidence-item summary span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.interpretation-evidence-item summary small { margin-left:auto; color:var(--muted); font-size:9px; white-space:nowrap; }
.interpretation-evidence-item dl { display:grid; gap:7px; margin:0; padding:0 11px 11px; }
.interpretation-evidence-item dl div { display:grid; grid-template-columns:58px minmax(0,1fr); gap:7px; }
.interpretation-evidence-item dt { color:var(--muted); font-size:10px; }
.interpretation-evidence-item dd { margin:0; color:#5f5048; font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.merged-meaning-hero { margin-bottom:10px; }
.merged-meaning-card { overflow:hidden; background:#fff; border:1px solid #e4d6c8; border-radius:13px; }
.merged-meaning-row { padding:11px 13px; scroll-margin-top:6px; }
.merged-meaning-row + .merged-meaning-row { border-top:1px dashed #e5d8cc; }
.merged-meaning-row p { margin:0; color:#554943; font-size:15px; line-height:1.75; overflow-wrap:anywhere; }
.merged-meaning-row strong { margin-right:3px; color:var(--red-dark); font-size:15px; }
.meaning-experience-card { margin-top:11px; scroll-margin-top:6px; padding:12px 13px; color:#5c482d; background:linear-gradient(145deg,#fff5d9,#fffaf0); border:1px solid #e6cf9f; border-left:3px solid var(--gold); border-radius:5px 12px 12px 5px; }
.meaning-experience-card h4 { margin:0 0 5px; color:#8a5b16; font-size:16px; }
.meaning-experience-card p { margin:0; font-size:14px; line-height:1.7; }
.merged-current-context { margin-top:11px; margin-bottom:0; }
.meaning-card { margin-bottom:10px; padding:12px; background:#fff; border:1px solid #e5d8ca; border-radius:12px; }
.meaning-card h4 { margin:0 0 5px; color:var(--red-dark); font-size:16px; }
.meaning-card p { margin:0; color:#62534b; font-size:14px; line-height:1.7; }
.current-context { margin:12px 0; padding:11px 12px; color:#654a24; background:#fff4d9; border-left:3px solid var(--gold); border-radius:4px 10px 10px 4px; font-size:12px; line-height:1.65; }
.pattern-list { display:grid; gap:10px; }
.pattern-card { padding:12px; background:#fff; border:1px solid #e2d3c4; border-radius:12px; }
.pattern-card.emphasis { border-color:#d8a5a1; box-shadow:inset 3px 0 #a3342f; }
.pattern-card h4 { margin:0 0 7px; color:var(--red-dark); font-size:15px; }
.pattern-card dl { display:grid; gap:6px; margin:0; }
.pattern-card dl div { display:grid; grid-template-columns:62px minmax(0,1fr); gap:7px; }
.pattern-card dt { color:var(--muted); font-size:11px; }
.pattern-card dd { margin:0; color:#53443c; font-size:12px; line-height:1.55; }
.pattern-group {
  display:grid;
  gap:8px;
  margin-bottom:16px;
}
.pattern-group > h3 {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:0;
  color:#51392c;
  font-size:14px;
}
.pattern-group > h3 small { color:var(--muted); font-size:10px; }
.pattern-card-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.pattern-card-heading h4 { margin:0; }
.pattern-category {
  flex:0 0 auto;
  padding:3px 7px;
  border-radius:99px;
  font-size:10px;
  font-weight:800;
}
.pattern-card.positive { border-color:#afd0b9; box-shadow:inset 3px 0 #42865d; }
.pattern-card.caution { border-color:#d8a5a1; box-shadow:inset 3px 0 #a3342f; }
.pattern-card.special { border-color:#b8b1d3; box-shadow:inset 3px 0 #6d628f; }
.pattern-card.reference { border-color:#ddccb5; box-shadow:inset 3px 0 #b58948; }
.pattern-card.positive .pattern-category { color:#267147; background:#edf8f0; }
.pattern-card.caution .pattern-category { color:#8f2d29; background:#fff0ef; }
.pattern-card.special .pattern-category { color:#5b517e; background:#f2effb; }
.pattern-card.reference .pattern-category { color:#75501f; background:#fff7e8; }
.pattern-evidence { padding-top:6px; border-top:1px dashed #e1d5ca; }
.detail-empty { padding:22px 16px; color:var(--muted); text-align:center; background:#fff; border:1px dashed #d8c8b8; border-radius:12px; font-size:12px; line-height:1.65; }
.palace-note-box { display:grid; gap:10px; }
.palace-note-box textarea { width:100%; min-height:180px; resize:vertical; padding:12px; color:var(--ink); background:#fff; border:1px solid #d7c5b4; border-radius:11px; font:inherit; font-size:14px; line-height:1.65; }
.palace-note-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.palace-note-actions small { color:var(--muted); font-size:10px; line-height:1.45; }
.palace-note-save { flex:0 0 auto; min-height:44px; padding:9px 18px; color:#fff; background:var(--red); border:0; border-radius:9px; font-weight:800; }
.palace-note-feedback { min-height:18px; margin:0; color:#267147; font-size:11px; }
.detail-disclaimer { margin:16px 2px 2px; padding-top:10px; color:#8a7a70; border-top:1px dashed #ded1c5; font-size:10px; line-height:1.55; }
body[data-display-mode="simple"] .detail-mode-badge::after { content:"简洁"; }
body[data-display-mode="professional"] .detail-mode-badge::after { content:"专业"; }

@media screen and (max-width:700px) {
  body.palace-sheet-open { padding-bottom:80dvh; }
  .palace-sheet-panel { width:100%; height:80dvh; border-left:0; border-right:0; }
  .palace-sheet-panel[data-sheet-size="expanded"] { height:92dvh; }
  .palace-sheet-content { padding-left:12px; padding-right:12px; }
  .palace-sheet-chrome { padding-left:12px; padding-right:12px; }
  .palace-element-nav { margin-left:-12px; margin-right:-12px; padding-left:12px; padding-right:12px; }
}
@media screen and (max-width:360px) {
  .palace-sheet-header h2 { font-size:19px; }
  .palace-detail-tabs { gap:2px; }
  .palace-detail-tab { padding-inline:1px; font-size:15px; }
  .interpretation-section-card { grid-template-columns:32px minmax(0,1fr); padding:10px; }
  .interpretation-section-icon { width:32px; height:32px; }
  .detail-facts { grid-template-columns:1fr 1fr; gap:6px; }
  .detail-facts > div { padding:8px; }
}
.share-stage .result-panel[hidden] { display:block !important; }
.share-stage .chart { margin:0; box-shadow:none; }
.share-stage .result-panel { padding:0; }
.share-stage .dayun-section { display:block !important; }
.share-image-root { width:390px !important; padding:16px !important; background:#fffdf7 !important; }
.share-image-root .board-wrap { margin-top:14px; }
.share-image-root .details-grid { grid-template-columns:1fr; }
.share-image-root .facts-card { grid-column:auto; }
.share-image-root .palace-sheet, .share-image-root .share-stage { display:none !important; }
.share-image-root .share-privacy-pillars { opacity:.72; }

@media screen and (max-width:850px) {
  .result-header { gap:7px; }
  .view-mode { align-self:flex-start; }
  .chart { padding:14px; }
  .details-grid, .basis-grid { grid-template-columns:1fr; gap:10px; }
  .details-grid .facts-card { grid-column:auto; }
}
@media screen and (max-width:590px) {
  .chart { padding-left:6px; padding-right:6px; }
  .view-mode { width:max-content; }
  .view-mode-button { min-height:30px; }
  .result-toolbar { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
  .result-toolbar button { font-size:11px; }
  .fortune-link-summary { font-size:12px; }
  .palace-sheet-panel { width:100%; }
}
@media screen and (max-width:360px) {
  .chart { padding-left:2px; padding-right:2px; }
}
@media print {
  .view-mode, #save-long-image, #privacy-share, .palace-sheet { display:none !important; }
  #share-capture { margin:0; padding:0; border:0; box-shadow:none; }
}

/* Stable 900px long-image layout: independent from the device viewport. */
.share-stage { width:900px !important; }
.share-image-root { width:900px !important; max-width:none !important; overflow:visible !important; }
.share-image-root .chart-meta { grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr) !important; }
.share-image-root .board-wrap {
  grid-template-columns:84px minmax(0,1fr) 84px !important;
  grid-template-rows:76px minmax(0,1fr) 76px !important;
}
.share-image-root .board { min-width:0 !important; }
.share-image-root .details-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.share-image-root .details-grid .facts-card { grid-column:1 / -1 !important; }
.share-image-root .basis-grid { grid-template-columns:minmax(0,1.4fr) minmax(260px,.6fr) !important; }
.share-image-root .dayun-heading,
.share-image-root .liunian-heading { flex-direction:row !important; align-items:flex-end !important; }
.share-image-root .dayun-table-wrap,
.share-image-root .liunian-table-wrap { overflow:visible !important; scrollbar-gutter:auto !important; }
.share-image-root .dayun-table,
.share-image-root .liunian-table { width:100% !important; min-width:0 !important; table-layout:fixed !important; }
.share-image-root .dayun-table th,
.share-image-root .liunian-table th { position:static !important; width:68px !important; }
.share-image-root .dayun-table th,
.share-image-root .dayun-table td,
.share-image-root .liunian-table th,
.share-image-root .liunian-table td { min-width:0 !important; padding:8px 4px !important; font-size:14px !important; }
.share-image-root .dayun-table #dayun-ganzhi td,
.share-image-root .liunian-table #liunian-ganzhi td { font-size:17px !important; }
/* Cloud case synchronization */
.cloud-sync-card {
  display:grid; gap:10px; margin:12px 0 2px; padding:12px;
  background:linear-gradient(145deg,#fff8e9,#fffdf8); border:1px solid rgba(176,126,56,.28); border-radius:11px;
}
.cloud-sync-heading { display:flex; align-items:center; gap:10px; }
.cloud-sync-icon { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; color:#fff; background:var(--red); border-radius:12px; font-size:16px; font-weight:900; box-shadow:0 5px 12px rgba(126,33,29,.2); }
.cloud-sync-heading > div { min-width:0; display:grid; gap:2px; }
.cloud-sync-heading strong { color:var(--red-dark); font-size:14px; }
.cloud-sync-heading small { color:var(--muted); font-size:11px; }
.cloud-sync-heading small.syncing { color:#8b5e18; }
.cloud-sync-heading small.success { color:#176b35; }
.cloud-sync-heading small.error { color:#a1241c; }
.cloud-sync-card > p { margin:0; color:#665851; font-size:12px; line-height:1.55; }
.cloud-sync-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.cloud-sync-actions button:only-child { grid-column:1 / -1; }
.cloud-sync-actions button { min-height:44px; padding:8px 10px; }
.cloud-sync-editor { display:grid; gap:15px; padding:14px 0 4px; }
.cloud-sync-intro { padding:12px; background:#f8f1e5; border-radius:10px; }
.cloud-sync-intro strong { display:block; color:var(--red-dark); font-size:14px; }
.cloud-sync-intro p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.cloud-sync-editor > label { display:grid; gap:7px; color:var(--red-dark); font-size:13px; font-weight:800; }
.cloud-sync-editor input { width:100%; min-height:50px; padding:11px 12px; color:var(--ink); background:#fffefa; border:1px solid var(--line); border-radius:8px; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:16px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.cloud-sync-code-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.cloud-sync-code-actions button { min-height:46px; }
.cloud-sync-code-feedback { min-height:18px; margin:-5px 2px 0; color:var(--muted); font-size:12px; line-height:1.5; }
.cloud-sync-code-feedback.success { color:#176b35; }
.cloud-sync-code-feedback.error { color:#a1241c; }
.cloud-sync-warning { display:grid; gap:4px; padding:11px 12px; color:#744b18; background:#fff5d8; border:1px solid rgba(183,125,35,.28); border-radius:9px; }
.cloud-sync-warning strong { font-size:13px; }
.cloud-sync-warning span { font-size:11px; line-height:1.55; }
.cloud-sync-editor > .danger { justify-self:start; }

@media screen and (max-width:700px) {
  .cloud-sync-card { margin-top:10px; padding:11px; }
  .cloud-sync-actions, .cloud-sync-code-actions { gap:6px; }
  .cloud-sync-actions button, .cloud-sync-code-actions button { min-width:0; font-size:12px; }
}

@media print {
  .cloud-sync-card, .cloud-sync-sheet { display:none !important; }
}



/* PWA update and startup health */
.app-health-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(177, 80, 29, .3);
  background: #fff8e8;
}
.app-health-card[hidden], .pwa-update-card[hidden], .pwa-update-success[hidden] { display: none !important; }
.app-health-copy, .pwa-update-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.app-health-copy strong, .pwa-update-copy strong { color: var(--ink); font-size: 15px; }
.app-health-copy span, .pwa-update-copy span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.app-health-actions, .pwa-update-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.app-health-actions button, .pwa-update-actions button { min-height: 42px; }
.pwa-version-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 4px 16px 0;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(155, 47, 47, .12);
  color: var(--muted);
  font-size: 12px;
}
.pwa-version-row strong { color: var(--ink); }
.pwa-version-state { min-width: 0; text-align: right; }
.pwa-version-state[data-state="update"], .pwa-version-state[data-state="error"] { color: #a43b24; }
.pwa-version-state[data-state="current"] { color: #397052; }
.pwa-update-card {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 560px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(155, 47, 47, .3);
  border-radius: 16px;
  background: rgba(255, 250, 240, .98);
  box-shadow: 0 12px 36px rgba(68, 35, 21, .2);
  backdrop-filter: blur(12px);
}
.pwa-update-success {
  position: fixed;
  z-index: 1201;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid rgba(57, 112, 82, .28);
  border-radius: 10px;
  background: rgba(247, 255, 247, .98);
  box-shadow: 0 8px 22px rgba(41, 82, 57, .16);
  color: #2d6649;
  font-size: 14px;
  line-height: 1.4;
}

@media screen and (max-width: 700px) {
  .app-health-card { align-items: stretch; flex-direction: column; }
  .app-health-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .app-health-actions button { min-height: 44px; padding: 8px 10px; }
  .pwa-version-row { grid-template-columns: 1fr auto; }
  .pwa-version-state { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .pwa-update-card { grid-template-columns: 1fr; }
  .pwa-update-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pwa-update-actions button { min-height: 44px; }
}

@media print {
  .app-health-card, .pwa-update-card, .pwa-update-success, .pwa-version-row { display: none !important; }
}
/* 手机录入首页紧凑化：只影响录入页 */
.input-view .sample-field { display:none !important; }
.input-view .start-chart { grid-column:1 / 4; }
.input-view .reset-chart { grid-column:4; }

@media screen and (max-width:700px) {
  .input-view { justify-content:flex-start; }
  .input-view .input-masthead { padding:4px 6px 0; }
  .input-view .masthead { gap:8px; margin-bottom:9px; }
  .input-view .brand { gap:8px; }
  .input-view .brand-logo { width:38px; height:38px; }
  .input-view h1 { font-size:clamp(17px,5.2vw,20px); }
  .input-view .subtitle { margin-top:1px; font-size:10px; }

  .input-view .controls {
    padding:10px;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
  }
  .input-view .controls .datetime-field { grid-row:1; grid-column:1 / -1; }
  .input-view .controls .chart-type-field { grid-row:2; grid-column:1 / 3; }
  .input-view .controls .gender-field { grid-row:2; grid-column:3 / 5; }
  .input-view .controls .name-field { grid-row:3; grid-column:1 / -1; }
  .input-view .controls .start-chart { grid-row:4; grid-column:1 / 4; }
  .input-view .controls .reset-chart { grid-row:4; grid-column:4; }
  .input-view .datetime-trigger { min-height:78px; padding:10px; }

  .input-view .case-center { margin:8px 0 0; }
  .input-view .case-center > summary { min-height:44px; padding:8px 11px; }
  .input-view .notes { margin-top:8px; padding:0 11px; }
  .input-view .notes > summary { min-height:44px; font-size:15px; }
  .input-view .case-center > summary::after,
  .input-view .notes > summary::after {
    content:"›";
    transform:rotate(90deg);
    transition:transform .18s ease;
  }
  .input-view .case-center[open] > summary::after,
  .input-view .notes[open] > summary::after {
    content:"›";
    transform:rotate(-90deg);
  }
}


/* 奇门万年历：手机竖屏优先，限定作用域避免影响排盘页 */
.home-shortcuts {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  padding:4px;
  margin:0 0 10px;
}
.home-shortcut {
  min-height:38px;
  border:0;
  border-radius:6px;
  color:var(--muted);
  background:transparent;
}
.home-shortcut.active {
  color:#fff;
  background:var(--accent);
}
.almanac-view { max-width:760px; margin:0 auto; }
.almanac-header {
  position:sticky;
  top:0;
  z-index:4;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
  padding:8px;
  margin-bottom:8px;
}
.almanac-title-group { min-width:0; text-align:center; }
.almanac-header h2 { margin:0; text-align:center; font-size:18px; }
.almanac-offline-state { margin:2px 0 0; color:var(--muted); font-size:10px; line-height:1.2; white-space:nowrap; }
.almanac-offline-state[data-state="offline"] { color:#8b3a32; }
.almanac-offline-state[data-state="ready"] { color:#4b7f52; }
.almanac-header button { min-height:40px; padding:7px 10px; }
.almanac-calendar { padding:10px 8px 8px; }
.almanac-month-nav {
  display:grid;
  grid-template-columns:44px 1fr 44px;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
}
.almanac-month-nav strong { text-align:center; font-size:18px; letter-spacing:.06em; }
.almanac-month-nav button { min-height:40px; padding:4px; font-size:24px; line-height:1; }
.almanac-weekdays,
.almanac-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.almanac-weekdays span {
  padding:4px 0 6px;
  color:var(--muted);
  text-align:center;
  font-size:12px;
}
.almanac-weekdays span:first-child,
.almanac-weekdays span:last-child { color:var(--accent); }
.almanac-day {
  position:relative;
  min-width:0;
  min-height:54px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding:4px 1px;
  border:1px solid transparent;
  border-radius:8px;
  color:var(--ink);
  background:transparent;
  -webkit-tap-highlight-color:transparent;
}
.almanac-day-top {
  width:100%;
  min-height:17px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:0 2px;
}
.almanac-day strong { font-size:15px; line-height:1.05; font-weight:650; }
.almanac-holiday-state {
  min-width:15px;
  height:15px;
  display:inline-grid;
  place-items:center;
  border-radius:4px;
  font-size:9px;
  font-weight:800;
  line-height:1;
}
.almanac-holiday-state.rest { color:#fff; background:var(--red); }
.almanac-holiday-state.work { color:#72512f; background:#eadcc8; }
.almanac-day-ganzhi {
  width:100%;
  overflow:hidden;
  color:#6f4935;
  font-size:10px;
  font-weight:650;
  line-height:1.05;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.almanac-day small {
  width:100%;
  overflow:hidden;
  color:var(--muted);
  font-size:9px;
  line-height:1.05;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.almanac-day.is-holiday .almanac-day-label { color:var(--red); font-weight:700; }
.almanac-day.is-workday .almanac-day-label { color:#72512f; font-weight:650; }
.almanac-day.outside { opacity:.34; }
.almanac-day.today::after {
  content:"";
  position:absolute;
  bottom:3px;
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--accent);
}
.almanac-day.has-term small { color:var(--accent); font-weight:700; }
.almanac-day.selected {
  color:var(--red-dark);
  border-color:var(--red);
  background:#fff1ed;
  box-shadow:inset 0 0 0 1px rgba(155,47,47,.18), 0 3px 10px rgba(155,47,47,.14);
}
.almanac-day.selected strong { color:var(--red-dark); }
.almanac-day.selected small { color:#66504a; }
.almanac-day.selected.has-term small { color:var(--red); }
.almanac-day.selected.today::after { background:var(--red); }
.almanac-case-badge {
  position:absolute;
  left:3px;
  bottom:3px;
  min-width:15px;
  height:15px;
  display:grid;
  place-items:center;
  padding:0 3px;
  border:1px solid rgba(255,255,255,.9);
  border-radius:999px;
  color:#fff;
  background:#9a713f;
  font-size:9px;
  font-weight:700;
  line-height:1;
  box-shadow:0 1px 3px rgba(74,45,18,.2);
}
.almanac-case-badge.single {
  left:4px;
  bottom:4px;
  min-width:7px;
  width:7px;
  height:7px;
  padding:0;
  border:0;
}
.almanac-day.selected .almanac-case-badge {
  color:#7a5127;
  border-color:#fff;
  background:#fff1d8;
}
.almanac-loading {
  grid-column:1 / -1;
  min-height:320px;
  display:grid;
  place-items:center;
  margin:0;
  color:var(--muted);
}
.almanac-loading.error { color:var(--accent); }
.almanac-detail { margin-top:8px; padding:14px; }
.almanac-detail-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.almanac-detail-heading small { color:var(--muted); }
.almanac-detail-heading h3 { margin:2px 0 0; font-size:20px; }
.almanac-term {
  align-self:center;
  padding:4px 9px;
  border-radius:999px;
  color:#fff;
  background:var(--accent);
  font-size:12px;
  font-weight:700;
}
.almanac-facts { margin:12px 0; border-top:1px solid var(--line); }
.almanac-facts div { display:grid; grid-template-columns:76px 1fr; gap:8px; padding:9px 0; border-bottom:1px solid var(--line); }
.almanac-facts dt { color:var(--muted); font-size:13px; }
.almanac-facts dd { margin:0; text-align:right; }
.almanac-case-summary {
  margin:10px 0;
  border:1px solid #d9c6ad;
  border-radius:9px;
  background:#fffaf2;
  overflow:hidden;
}
.almanac-case-summary summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  cursor:pointer;
  list-style:none;
}
.almanac-case-summary summary::-webkit-details-marker { display:none; }
.almanac-case-summary summary::after {
  content:"⌄";
  margin-left:auto;
  color:#8d6841;
  font-size:15px;
  line-height:1;
  transform:translateY(-1px);
}
.almanac-case-summary[open] summary::after { content:"⌃"; }
.almanac-case-summary summary strong { flex:0 0 auto; }
.almanac-case-summary summary span { margin-left:auto; }
.almanac-case-summary summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:8px 10px;
  color:#6f4d2b;
  font-size:12px;
}
.almanac-case-list { border-top:1px solid #eadcca; }
.almanac-case-item {
  width:100%;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 10px;
  border:0;
  border-top:1px dashed #eadcca;
  color:var(--ink);
  background:transparent;
  text-align:left;
}
.almanac-case-item:first-child { border-top:0; }
.almanac-case-item > span { min-width:0; }
.almanac-case-item strong,
.almanac-case-item em,
.almanac-case-item small { display:block; }
.almanac-case-item strong { font-size:13px; }
.almanac-case-item em {
  margin-top:2px;
  color:var(--muted);
  font-size:10px;
  font-style:normal;
}
.almanac-case-item small {
  margin-top:2px;
  overflow:hidden;
  color:var(--muted);
  font-size:10px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.almanac-case-item > b {
  flex:0 0 auto;
  color:#8a6238;
  font-size:11px;
}
.almanac-traditional {
  margin:10px 0 0;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fffefa;
  overflow:hidden;
}
.almanac-traditional summary {
  min-height:42px;
  display:flex;
  align-items:center;
  padding:8px 12px;
  color:var(--ink);
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  list-style:none;
  -webkit-tap-highlight-color:transparent;
}
.almanac-traditional summary::-webkit-details-marker { display:none; }
.almanac-traditional summary::after { content:"展开"; margin-left:auto; color:var(--muted); font-size:11px; font-weight:400; }
.almanac-traditional[open] summary { border-bottom:1px solid var(--line); }
.almanac-traditional[open] summary::after { content:"收起"; }
.almanac-yiji { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px; }
.almanac-yiji > div { display:grid; grid-template-columns:28px 1fr; align-items:start; gap:6px; min-width:0; }
.almanac-yiji strong { width:26px; height:26px; display:grid; place-items:center; border-radius:50%; color:#fff; font-size:13px; }
.almanac-yiji .recommend strong { background:#4b7f52; }
.almanac-yiji .avoid strong { background:var(--red); }
.almanac-yiji p { margin:2px 0 0; font-size:12px; line-height:1.65; }
.almanac-traditional-facts { display:grid; grid-template-columns:1fr 1fr; margin:0; padding:0 10px 10px; }
.almanac-traditional-facts div { min-width:0; padding:7px 4px; border-top:1px solid var(--line); }
.almanac-traditional-facts div:nth-child(odd):not(.wide) { padding-right:9px; border-right:1px solid var(--line); }
.almanac-traditional-facts div:nth-child(even):not(.wide) { padding-left:9px; }
.almanac-traditional-facts .wide { grid-column:1 / -1; display:grid; grid-template-columns:72px 1fr; gap:6px; }
.almanac-traditional-facts dt { color:var(--muted); font-size:11px; }
.almanac-traditional-facts dd { margin:3px 0 0; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.almanac-traditional-facts .wide dd { margin:0; }
.almanac-hour-field { margin-top:10px; }
.almanac-hour-field select { min-height:44px; }
.almanac-pillars { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:12px; }
.almanac-pillars span { padding:8px 3px; border:1px solid var(--line); border-radius:7px; text-align:center; background:#fffefa; }
.almanac-pillars small { display:block; margin-bottom:3px; color:var(--muted); font-size:10px; }
.almanac-pillars strong { font-size:18px; }
.almanac-boundary { margin:10px 0; color:var(--muted); font-size:12px; text-align:center; }
.almanac-use-time { width:100%; min-height:48px; }

@media (max-width:600px) {
  .home-shortcuts { margin-top:-2px; }
  .almanac-view { width:100%; }
  .almanac-calendar { padding:8px 4px 6px; }
  .almanac-day { min-height:50px; }
  .almanac-detail { padding:12px 10px calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width:370px) {
  .almanac-day { min-height:46px; }
  .almanac-day strong { font-size:15px; }
  .almanac-day small { font-size:9px; }
}


/* Almanac phase 3: compact date jump and twelve double-hour fortune cards */
.almanac-month-title {
  min-height:40px;
  padding:4px 12px;
  border:0;
  color:var(--ink);
  background:transparent;
  text-align:center;
  font-size:18px;
  font-weight:700;
  letter-spacing:.06em;
}
.almanac-month-title::after { content:"⌄"; margin-left:5px; color:var(--muted); font-size:12px; }
.almanac-month-title[aria-expanded="true"]::after { content:"⌃"; }
.almanac-date-jump { margin:0 2px 8px; padding:9px; border:1px solid var(--line); border-radius:9px; background:#fffefa; }
.almanac-year-nav { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:6px; }
.almanac-year-nav button { min-height:36px; padding:5px 7px; font-size:12px; }
.almanac-year-nav button:last-child { justify-self:stretch; }
.almanac-year-nav strong { min-width:68px; text-align:center; }
.almanac-jump-fields { display:grid; grid-template-columns:1.15fr .85fr auto; align-items:end; gap:7px; margin-top:8px; }
.almanac-jump-fields label { min-width:0; color:var(--muted); font-size:11px; }
.almanac-jump-fields select { width:100%; min-height:38px; margin-top:3px; padding:5px; }
.almanac-jump-fields button { min-height:38px; padding:6px 13px; }
.almanac-hour-fortunes { margin:10px 0 0; border:1px solid var(--line); border-radius:9px; background:#fffefa; overflow:hidden; }
.almanac-hour-fortunes summary { min-height:42px; display:flex; align-items:center; padding:8px 12px; font-size:14px; font-weight:700; cursor:pointer; list-style:none; -webkit-tap-highlight-color:transparent; }
.almanac-hour-fortunes summary::-webkit-details-marker { display:none; }
.almanac-hour-fortunes summary::after { content:"展开"; margin-left:auto; color:var(--muted); font-size:11px; font-weight:400; }
.almanac-hour-fortunes[open] summary { border-bottom:1px solid var(--line); }
.almanac-hour-fortunes[open] summary::after { content:"收起"; }
.almanac-hour-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:9px; }
.almanac-hour-card { position:relative; min-width:0; min-height:56px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; grid-template-rows:auto auto; align-items:center; gap:1px 6px; padding:7px 8px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:#fff; text-align:left; -webkit-tap-highlight-color:transparent; }
.almanac-hour-card > span { min-width:0; grid-row:1 / 3; }
.almanac-hour-card > span strong { display:block; font-size:14px; }
.almanac-hour-card > span small { display:block; margin-top:2px; color:var(--muted); font-size:9px; white-space:nowrap; }
.almanac-hour-card > b { font-size:13px; font-weight:650; }
.almanac-hour-card > em { min-width:21px; padding:1px 4px; border-radius:999px; font-size:10px; font-style:normal; text-align:center; }
.almanac-hour-card > small { grid-column:2 / 4; color:var(--muted); font-size:10px; text-align:right; }
.almanac-hour-card.selected { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:#fff9f7; }
.almanac-hour-card.current::after { content:"当前"; position:absolute; top:-5px; right:5px; padding:1px 4px; border-radius:999px; color:#fff; background:#4b7f52; font-size:8px; }
.luck-good { color:#35653c; background:#e8f3e8; }
.luck-bad { color:#9b2f2f; background:#f8e7e4; }
.almanac-hour-detail { margin:0 9px 9px; padding:9px; border-top:1px solid var(--line); background:#fff; }
.almanac-hour-detail header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.almanac-hour-detail header strong { font-size:14px; }
.almanac-hour-detail header span { padding:3px 7px; border-radius:999px; font-size:11px; white-space:nowrap; }
.almanac-hour-detail dl { margin:7px 0 0; }
.almanac-hour-detail dl div { display:grid; grid-template-columns:38px 1fr; gap:6px; padding:5px 0; border-top:1px dashed var(--line); }
.almanac-hour-detail dt { color:var(--muted); font-size:11px; }
.almanac-hour-detail dd { margin:0; font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
@media (max-width:370px) {
  .almanac-jump-fields { grid-template-columns:1fr 1fr; }
  .almanac-jump-fields button { grid-column:1 / -1; }
  .almanac-hour-card { padding:6px; gap:1px 4px; }
  .almanac-hour-card > span small { font-size:8px; }
}


/* Result actions: compact two-row phone layout. */
.result-header {
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr);
  align-items:center;
}
.result-toolbar {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  width:100%;
}
.result-toolbar button { min-width:0; padding:9px 7px; white-space:nowrap; }
.result-header > .chart-navigation {
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  width:100%;
  margin-top:0;
  padding:0;
}
.result-header > .chart-navigation button {
  grid-area:auto;
  min-width:0;
  padding:8px 5px;
}
#previous-day, #previous-ju, #next-ju, #next-day { grid-area:auto; }


/* Fortune and annual palace linkage. */
.outer-slot { position:relative; }
.outer-top .outer-slot { flex-direction:column-reverse; }
.outer-year-marker { position:absolute; z-index:5; display:grid; place-items:center; min-width:25px; padding:2px 3px; color:#9f2626; background:rgba(255,250,239,.94); border:1px solid rgba(159,38,38,.32); border-radius:6px; line-height:1; box-shadow:0 1px 4px rgba(70,35,20,.12); pointer-events:none; }
.outer-year-marker b { font-size:11px; white-space:nowrap; }
.outer-year-marker small { margin-top:2px; color:#8a6659; font-size:8px; font-weight:700; }
.outer-top .outer-year-marker { left:0; top:50%; transform:translateY(-50%); }
.outer-bottom .outer-year-marker { left:0; top:50%; transform:translateY(-50%); }
.outer-left .outer-year-marker { bottom:0; left:50%; transform:translateX(-50%); }
.outer-right .outer-year-marker { bottom:0; left:50%; transform:translateX(-50%); }
.active-liunian-branch .outer-branch { color:#9d1f1f; text-shadow:0 0 6px rgba(198,92,50,.3); transform:scale(1.08); }
.palace.fortune-dayun-palace { z-index:1; box-shadow:inset 0 0 0 3px #c58a24; }
.palace.fortune-liunian-palace { z-index:1; background:rgba(189,45,45,.10); }
.palace.fortune-liunian-palace::after { display:none; }
.palace.fortune-same-palace { background:linear-gradient(145deg,rgba(255,222,153,.44),rgba(189,45,45,.12)); box-shadow:inset 0 0 0 3px #bd6f16, inset 0 0 0 5px rgba(255,255,255,.7); }
.palace.fortune-same-palace::after { display:none; }
.liunian-table td[data-liunian-index] { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.liunian-table td[data-liunian-index]:hover { background:#fff7df; }
.liunian-table td.selected-liunian { background:#f9e1d6; box-shadow:none; }
@media screen and (max-width:700px) {
  .outer-year-marker { min-width:21px; padding:1px 2px; }
  .outer-year-marker b { font-size:9px; }
  .outer-year-marker small { font-size:7px; }
  .outer-top .outer-year-marker { left:0; top:50%; transform:translateY(-50%); }
  .outer-bottom .outer-year-marker { left:0; top:50%; transform:translateY(-50%); }
  .outer-left .outer-year-marker { bottom:0; left:50%; transform:translateX(-50%); }
  .outer-right .outer-year-marker { bottom:0; left:50%; transform:translateX(-50%); }
  .palace.fortune-dayun-palace { box-shadow:inset 0 0 0 2px #c58a24; }
}


/* Phase 1: login and account roles */
body.auth-locked { overflow:hidden; }
body.auth-locked > .app-shell,
body.auth-locked > .palace-sheet,
body.auth-locked > .datetime-sheet,
body.auth-locked > .case-sheet,
body.auth-locked > .cloud-sync-sheet,
body.auth-locked > .pwa-update-card { visibility:hidden; pointer-events:none; }
.auth-view { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; min-height:100dvh; padding:24px 16px; overflow:auto; background:radial-gradient(circle at 50% 10%,rgba(218,179,101,.22),transparent 36%),linear-gradient(160deg,#fffaf0 0%,#f4e8d3 55%,#ead4b4 100%); }
.auth-view[hidden] { display:none; }
.auth-card { width:min(100%,390px); padding:30px 28px 22px; border:1px solid rgba(143,42,42,.28); border-radius:18px; background:rgba(255,253,247,.96); box-shadow:0 18px 50px rgba(83,38,25,.16); }
.auth-brand { text-align:center; }
.auth-brand img { width:56px; height:56px; object-fit:contain; }
.auth-brand h1 { margin:10px 0 5px; color:#7f2020; font-size:25px; letter-spacing:2px; }
.auth-brand p { margin:0 0 24px; color:#8a6d54; font-size:14px; letter-spacing:3px; }
.auth-form { display:grid; gap:15px; }
.auth-form > label:not(.auth-remember) { display:grid; gap:7px; color:#5d4032; font-size:14px; font-weight:700; }
.auth-form input[type="text"], .auth-form input[type="password"], .auth-form input:not([type]) { box-sizing:border-box; width:100%; height:46px; padding:0 13px; border:1px solid #d6c1a5; border-radius:9px; background:#fffefa; color:#30231d; font:inherit; outline:none; }
.auth-form input:focus { border-color:#9b2f2f; box-shadow:0 0 0 3px rgba(155,47,47,.1); }
.auth-remember { display:flex; align-items:center; gap:7px; color:#745e4e; font-size:13px; font-weight:400; }
.auth-remember input { width:16px; height:16px; accent-color:#9b2f2f; }
.auth-submit { width:100%; min-height:46px; font-size:16px; }
.auth-feedback { min-height:20px; margin:0; color:#a02c2c; font-size:13px; text-align:center; }
.auth-version { margin:6px 0 0; color:#a18a76; font-size:11px; text-align:center; }
.account-bar { display:flex; justify-content:flex-end; align-items:center; gap:8px; min-height:30px; padding:0 4px 7px; color:#765b48; font-size:12px; }
.account-link { padding:3px 7px; border:0; background:transparent; color:#8c2929; font:inherit; cursor:pointer; }
.account-link + .account-link { border-left:1px solid #d4c0a8; }
.admin-panel { position:fixed; inset:0; z-index:10020; display:grid; place-items:center; padding:18px; }
.admin-panel[hidden] { display:none; }
.admin-backdrop { position:absolute; inset:0; border:0; background:rgba(38,24,18,.5); }
.admin-card { position:relative; width:min(100%,520px); max-height:85dvh; overflow:auto; border-radius:14px; background:#fffdf7; box-shadow:0 22px 60px rgba(0,0,0,.25); }
.admin-card header { display:flex; justify-content:space-between; align-items:flex-start; padding:18px 20px 13px; border-bottom:1px solid #eadcc9; }
.admin-card h2 { margin:0; color:#7f2020; font-size:20px; }
.admin-card header p { margin:4px 0 0; color:#8b7462; font-size:12px; }
.admin-close { width:32px; height:32px; border:0; border-radius:50%; background:#f4e8d8; color:#7f2020; font-size:22px; cursor:pointer; }
.admin-user-list { display:grid; gap:10px; padding:16px 20px; }
.admin-user-list article { display:grid; grid-template-columns:1fr auto; gap:4px 12px; padding:12px 14px; border:1px solid #ead9c2; border-radius:9px; background:#fffaf1; }
.admin-user-list strong { color:#6f2828; }
.admin-user-list span { color:#3d3029; font-family:ui-monospace,monospace; }
.admin-user-list small { grid-column:1/-1; color:#8c7664; }
.admin-note { margin:0; padding:0 20px 20px; color:#876e5b; font-size:12px; line-height:1.6; }
@media (max-width:520px) { .auth-card { padding:25px 20px 18px; } .auth-brand img { width:52px; height:52px; } .auth-brand h1 { font-size:22px; } .account-bar { justify-content:center; flex-wrap:wrap; } }

/* 第二阶段：正式账号管理 */
.admin-create-form { display:grid; grid-template-columns:1fr 1fr; gap:9px; padding:16px 20px 4px; }
.admin-create-form input { min-width:0; width:100%; box-sizing:border-box; padding:9px 10px; border:1px solid #d9c7b1; border-radius:7px; background:#fff; color:#382c25; font:inherit; }
.admin-create-form label { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:8px; color:#705c4d; font-size:12px; }
.admin-create-form button { grid-column:1/-1; min-height:36px; }
.admin-feedback { min-height:18px; margin:6px 20px 0; color:#8c2929; font-size:12px; }
.admin-user-list article { grid-template-columns:1fr; }
.admin-user-title { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.admin-user-title span { font-family:ui-monospace,monospace; }
.admin-user-edit { display:grid; grid-template-columns:1fr auto; gap:7px; }
.admin-user-edit input { min-width:0; padding:7px 8px; border:1px solid #d9c7b1; border-radius:6px; background:#fff; }
.admin-user-edit button, .admin-user-actions button { padding:6px 9px; border:1px solid #d8c4aa; border-radius:6px; background:#f9efe1; color:#6f2828; cursor:pointer; }
.admin-user-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.admin-user-actions .danger { color:#a12020; }
.admin-user-actions button:disabled { opacity:.45; cursor:not-allowed; }
@media (max-width:520px) {
  .admin-card { max-height:92dvh; }
  .admin-create-form { grid-template-columns:1fr; }
  .admin-create-form button { grid-column:auto; }
}


/* Input home redesign v12 */
.app-shell {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.app-topbar {
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 14px;
  padding: 10px 4px 4px;
}

.app-brand {
  min-width: 0;
}

.app-brand .brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.app-brand h1 {
  margin: 0;
  font-size: clamp(1.08rem, 4.6vw, 1.46rem);
  line-height: 1.18;
}

.app-brand .subtitle {
  margin-top: 3px;
  font-size: .78rem;
  color: var(--muted, #766b65);
}

.account-bar {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.account-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(112, 54, 45, .18);
  border-radius: 999px;
  background: rgba(255, 252, 247, .94);
  color: #6f2d2d;
  font: inherit;
  font-size: .83rem;
  font-weight: 600;
  white-space: nowrap;
}

.account-menu-arrow {
  font-size: .72rem;
  transition: transform .18s ease;
}

.account-menu-toggle[aria-expanded="true"] .account-menu-arrow {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: min(278px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(112, 54, 45, .16);
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 14px 40px rgba(61, 31, 26, .18);
}

.account-menu-profile {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
  padding: 10px 11px 12px;
  border-bottom: 1px solid rgba(112, 54, 45, .1);
  color: #6f625c;
  font-size: .8rem;
}

.account-menu-profile strong {
  margin-bottom: 2px;
  color: #3f2924;
  font-size: 1rem;
}

.account-menu-profile b { color: #4d3934; font-weight: 600; }

.account-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #493630;
  font: inherit;
  text-align: left;
}

.account-menu-item:hover,
.account-menu-item:focus-visible { background: #f8efea; }
.account-menu-logout { color: #9b2f2f; }

.app-navigation {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid rgba(112, 54, 45, .13);
  background: rgba(255, 253, 249, .97);
  box-shadow: 0 -8px 24px rgba(61, 31, 26, .08);
  backdrop-filter: blur(14px);
}

.app-nav-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 53px;
  padding: 5px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8a817c;
  font: inherit;
  font-size: .75rem;
}

.app-nav-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: #f3efec;
  font-size: .85rem;
  font-weight: 700;
}

.app-nav-item.active { color: #8f2929; font-weight: 700; }
.app-nav-item.active .app-nav-icon { background: #8f2929; color: #fff; }

.profile-view { max-width: 640px; margin: 0 auto; padding-bottom: 84px; }
.profile-heading { display:flex; align-items:center; gap:12px; min-height:82px; padding:14px; }
.profile-avatar { display:grid; place-items:center; flex:0 0 50px; width:50px; height:50px; border-radius:50%; color:#fff; background:var(--red); font-family:"STKaiti","KaiTi",serif; font-size:23px; font-weight:800; }
.profile-heading h2 { margin:0; color:var(--red-dark); font-size:19px; }
.profile-heading p { margin:4px 0 0; color:var(--muted); font-size:13px; }
.profile-list { display:grid; gap:9px; margin-top:12px; }
.profile-section { margin:0; padding:0; overflow:hidden; }
.profile-section > summary { display:flex; align-items:center; justify-content:space-between; min-height:56px; padding:0 14px; color:var(--red-dark); cursor:pointer; font-size:15px; font-weight:700; list-style:none; }
.profile-section > summary::-webkit-details-marker { display:none; }
.profile-section > summary::after { content:"›"; color:var(--muted); font-size:24px; font-weight:400; line-height:1; transform:rotate(0deg); transition:transform .18s ease; }
.profile-section[open] > summary { border-bottom:1px solid rgba(112,54,45,.1); }
.profile-section[open] > summary::after { transform:rotate(90deg); }
.profile-section-body { display:grid; gap:0; padding:0; }
.profile-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; padding:0 14px; border-top:1px solid rgba(112,54,45,.1); color:var(--muted); font-size:13px; }
.profile-row strong { min-width:0; color:var(--ink); font-size:13px; font-weight:600; text-align:right; overflow-wrap:anywhere; }
.profile-version-row { align-items:center; }
.profile-version-meta { display:flex; align-items:center; justify-content:flex-end; gap:8px; min-width:0; }
.profile-check-update { min-height:32px; padding:5px 9px; border-radius:8px; font-size:12px; white-space:nowrap; }
.profile-version-state { margin:0; padding:0 14px 12px; color:var(--muted); font-size:11px; line-height:1.45; text-align:right; }
.profile-action, .profile-actions button, .profile-help, .profile-logout { width:100%; min-height:52px; margin:0; padding:0 14px; border:0; border-top:1px solid rgba(112,54,45,.1); border-radius:0; color:var(--ink); background:transparent; font:inherit; font-size:14px; font-weight:500; text-align:left; }
.profile-action, .profile-actions button, .profile-help { display:flex; align-items:center; justify-content:space-between; }
.profile-action::after, .profile-actions button::after, .profile-help::after { content:"›"; color:var(--muted); font-size:23px; font-weight:400; line-height:1; }
.profile-action.primary { color:var(--red-dark); background:transparent; }
.profile-actions { display:grid; grid-template-columns:1fr; gap:0; }
.profile-note { margin:0; padding:11px 14px 13px; border-top:1px solid rgba(112,54,45,.1); color:var(--muted); font-size:11px; line-height:1.55; }
.profile-logout { color:#a1241c; font-weight:650; }
.profile-action:active, .profile-actions button:active, .profile-help:active, .profile-logout:active { background:#faf3ed; }

.quick-chart-card {
  display: block;
  overflow: hidden;
  padding: 0 15px 16px;
}

.quick-chart-heading {
  margin: 0 -15px 4px;
  padding: 17px 16px 14px;
  border-bottom: 1px solid rgba(112, 54, 45, .1);
  background: linear-gradient(135deg, #fffaf5, #f9eee7);
}

.quick-chart-heading h2,
.cases-view-heading h2 { margin: 0; color: #472d28; font-size: 1.18rem; }
.quick-chart-heading p,
.cases-view-heading p { margin: 4px 0 0; color: #81736c; font-size: .82rem; }

.chart-type-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.chart-type-switch button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(112, 54, 45, .18);
  border-radius: 11px;
  background: #faf6f2;
  color: #6f5a53;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}

.chart-type-switch button[aria-pressed="true"] {
  border-color: #8f2929;
  background: #8f2929;
  color: #fff;
  box-shadow: 0 5px 12px rgba(111, 31, 31, .16);
}

.chart-type-switch button:focus-visible {
  outline: 2px solid rgba(143, 41, 41, .38);
  outline-offset: 2px;
}

#chart-entry-content[hidden] {
  display: none !important;
}

.name-label-lifetime,
.start-chart-label-lifetime { display: none; }

#chart-entry-content[data-chart-type="终身盘"],
#chart-entry-content[data-chart-type="时盘"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  padding-top: 15px;
}

#chart-entry-content[data-chart-type="终身盘"] > .chart-case-section,
#chart-entry-content[data-chart-type="终身盘"] > .chart-time-section,
#chart-entry-content[data-chart-type="时盘"] > .chart-case-section,
#chart-entry-content[data-chart-type="时盘"] > .chart-time-section {
  padding: 0;
  border: 0;
}

#chart-entry-content[data-chart-type="终身盘"] .chart-case-section > h3,
#chart-entry-content[data-chart-type="终身盘"] .chart-time-section > h3,
#chart-entry-content[data-chart-type="终身盘"] .category-field,
#chart-entry-content[data-chart-type="终身盘"] .question-field,
#chart-entry-content[data-chart-type="终身盘"] .more-case-info,
#chart-entry-content[data-chart-type="终身盘"] .reset-chart,
#chart-entry-content[data-chart-type="时盘"] .chart-case-section > h3,
#chart-entry-content[data-chart-type="时盘"] .chart-time-section > h3,
#chart-entry-content[data-chart-type="时盘"] .question-field,
#chart-entry-content[data-chart-type="时盘"] .more-case-info,
#chart-entry-content[data-chart-type="时盘"] .reset-chart {
  display: none;
}

#chart-entry-content[data-chart-type="终身盘"] .chart-case-grid,
#chart-entry-content[data-chart-type="时盘"] .chart-case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, .72fr);
  gap: 11px 9px;
}

#chart-entry-content[data-chart-type="终身盘"] .chart-case-grid {
  grid-template-areas: "name gender";
}

#chart-entry-content[data-chart-type="时盘"] .chart-case-grid {
  grid-template-areas:
    "name gender"
    "category category";
}

#chart-entry-content[data-chart-type="终身盘"] .name-field,
#chart-entry-content[data-chart-type="时盘"] .name-field {
  grid-area: name;
  grid-row: auto;
  grid-column: auto;
  order: initial;
  min-width: 0;
}

#chart-entry-content[data-chart-type="终身盘"] .gender-field,
#chart-entry-content[data-chart-type="时盘"] .gender-field {
  grid-area: gender;
  grid-row: auto;
  grid-column: auto;
  order: initial;
  min-width: 0;
}

#chart-entry-content[data-chart-type="时盘"] .category-field {
  grid-area: category;
  grid-row: auto;
  grid-column: auto;
  order: initial;
  min-width: 0;
}

#chart-entry-content[data-chart-type="终身盘"] .chart-time-section,
#chart-entry-content[data-chart-type="时盘"] .chart-time-section,
#chart-entry-content[data-chart-type="终身盘"] .start-chart,
#chart-entry-content[data-chart-type="时盘"] .start-chart {
  grid-row: auto;
  grid-column: auto;
  order: initial;
}

#chart-entry-content[data-chart-type="终身盘"] .start-chart,
#chart-entry-content[data-chart-type="时盘"] .start-chart {
  margin-top: 2px;
}

#chart-entry-content[data-chart-type="终身盘"] .name-label-default,
#chart-entry-content[data-chart-type="终身盘"] .start-chart-label-default,
#chart-entry-content[data-chart-type="时盘"] .name-label-default,
#chart-entry-content[data-chart-type="时盘"] .start-chart-label-default { display: none; }

#chart-entry-content[data-chart-type="终身盘"] .name-label-lifetime,
#chart-entry-content[data-chart-type="终身盘"] .start-chart-label-lifetime,
#chart-entry-content[data-chart-type="时盘"] .name-label-lifetime,
#chart-entry-content[data-chart-type="时盘"] .start-chart-label-lifetime { display: inline; }
.chart-form-section {
  padding: 15px 0 14px;
  border-bottom: 1px solid rgba(112, 54, 45, .09);
}

.chart-form-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #4d3731;
  font-size: .95rem;
}

.chart-form-section h3 > span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #f2dfd4;
  color: #8f2929;
  font-size: .75rem;
}

.chart-form-section h3 small {
  color: #998c85;
  font-size: .72rem;
  font-weight: 400;
}

.chart-form-section .datetime-field {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}
.chart-form-section .datetime-field > legend { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); }
.chart-setting-grid,
.chart-case-grid,
.more-case-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.chart-setting-grid-single { grid-template-columns: minmax(0, 1fr); }

.gender-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.gender-field > legend { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.gender-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gender-switch button {
  min-height: 42px;
  border: 1px solid rgba(112, 54, 45, .18);
  border-radius: 11px;
  background: #faf6f2;
  color: #6f5a53;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}
.gender-switch button[aria-pressed="true"] {
  border-color: #8f2929;
  background: #8f2929;
  color: #fff;
  box-shadow: 0 5px 12px rgba(111, 31, 31, .14);
}
.gender-switch button:focus-visible { outline: 2px solid rgba(143, 41, 41, .38); outline-offset: 2px; }
.chart-case-grid .question-field { grid-column: 1 / -1; }
.chart-case-grid textarea { min-height: 82px; resize: vertical; }

.more-case-info {
  margin-top: 11px;
  border: 1px dashed rgba(112, 54, 45, .18);
  border-radius: 12px;
  background: #fcfaf7;
}
.more-case-info summary { padding: 11px 12px; color: #76544b; font-size: .84rem; cursor: pointer; }
.more-case-info[open] summary { border-bottom: 1px solid rgba(112, 54, 45, .08); }
.more-case-info-grid { padding: 12px 12px 5px; }
.more-case-info > p { margin: 5px 12px 12px; color: #978b84; font-size: .72rem; line-height: 1.5; }
#year-destiny { color: #8f2929; font-weight: 700; background: #f8f3ef; }

.quick-chart-card .start-chart {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border-radius: 13px;
  font-size: 1rem;
}

.quick-chart-card .reset-chart {
  display: block;
  min-height: 38px;
  margin: 5px auto -4px;
  padding: 5px 12px;
  border: 0;
  background: transparent;
  color: #8a7770;
  font: inherit;
  font-size: .82rem;
}

.cases-view-heading { padding: 15px 16px; }
.cases-view .case-center { margin-top: 12px; }
.cases-view .case-center > summary { display: none; }
.cases-view .case-center-body { padding-top: 14px; }

.help-panel {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  align-items: end;
}
.help-backdrop { position: absolute; inset: 0; border: 0; background: rgba(35, 24, 21, .48); }
.help-dialog {
  position: relative;
  z-index: 1;
  max-height: min(82vh, 760px);
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #fffdf9;
  box-shadow: 0 -18px 50px rgba(30, 18, 16, .22);
}
.help-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(112, 54, 45, .1);
}
.help-dialog-header h2 { margin: 0; font-size: 1.08rem; }
.help-dialog-header button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f3ece7; color: #6f5148; font-size: 1.3rem; }
.help-dialog-body { max-height: calc(min(82vh, 760px) - 65px); overflow: auto; padding: 15px 17px calc(20px + env(safe-area-inset-bottom)); }
.help-dialog-body ul { padding-left: 1.15rem; color: #62534d; line-height: 1.72; }

@media (max-width: 520px) {
  .app-topbar { align-items: flex-start; }
  .app-brand .brand-logo { width: 40px; height: 40px; flex-basis: 40px; }
  .account-menu-toggle { max-width: 98px; }
  #account-summary { overflow: hidden; text-overflow: ellipsis; }
  .chart-setting-grid,
  .chart-case-grid,
  .more-case-info-grid { grid-template-columns: 1fr; }
  .chart-case-grid .question-field { grid-column: auto; }
}

@media (min-width: 760px) {
  .app-shell { padding-bottom: 32px; }
  .app-topbar { padding-top: 14px; }
  .app-navigation {
    position: static;
    max-width: 560px;
    margin: 0 auto 16px;
    padding: 5px;
    border: 1px solid rgba(112, 54, 45, .13);
    border-radius: 16px;
    box-shadow: none;
    background: rgba(255, 253, 249, .9);
  }
  .app-nav-item { grid-template-columns: auto auto; justify-content: center; align-items: center; min-height: 42px; font-size: .86rem; }
  .app-nav-icon { width: 25px; height: 25px; }
  .quick-chart-card { max-width: 720px; margin-right: auto; margin-left: auto; }
  .cases-view { max-width: 820px; margin-right: auto; margin-left: auto; }
  .profile-view { padding-bottom: 20px; }
  .help-panel { align-items: center; justify-items: center; padding: 24px; }
  .help-dialog { width: min(720px, 100%); border-radius: 20px; }
}


/* Current time, five-element pillars and effect-image alignment v20 */
.input-view { max-width: 560px; }

.app-topbar {
  min-height: 68px;
  width: calc(100% + 12px);
  margin: -10px -6px 13px;
  padding: 10px 15px;
  align-items: center;
  border-bottom: 1px solid rgba(112, 54, 45, .12);
  background: rgba(255, 253, 249, .98);
}
.app-brand { display: flex; align-items: center; gap: 13px; }
.app-brand-seal {
  display: grid;
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  place-items: center;
  border-radius: 12px;
  background: #9a3030;
  color: #fff8ed;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(112, 32, 32, .18);
}
.app-brand h1 {
  margin: 0;
  color: #33211d;
  font-size: clamp(1.18rem, 5.2vw, 1.42rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: .12em;
}
.account-menu-toggle {
  gap: 7px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #725b53;
  box-shadow: none;
  font-size: .86rem;
  font-weight: 500;
}
.account-menu-label { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.account-menu-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 50%;
  background: #eee1d9;
  color: #8f2929;
  font-weight: 800;
}

.quick-chart-card {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.current-time-card {
  overflow: hidden;
  border: 1px solid rgba(143, 41, 41, .14);
  border-radius: 17px;
  background: linear-gradient(145deg, #fffdf9 0%, #fbf3ed 100%);
  box-shadow: 0 8px 22px rgba(93, 53, 42, .07);
}
.current-time-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 12px;
}
.current-date-copy { min-width: 0; }
.current-date-copy small {
  display: block;
  margin-bottom: 4px;
  color: #907f78;
  font-size: 11px;
  letter-spacing: .08em;
}
.current-date-copy strong {
  display: block;
  overflow: hidden;
  color: #49352f;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.current-beijing-clock {
  flex: 0 0 auto;
  color: #8f2929;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.03em;
}
.current-four-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(112, 54, 45, .12);
  background: rgba(112, 54, 45, .12);
}
.current-pillar {
  min-width: 0;
  padding: 10px 4px 11px;
  text-align: center;
  background: rgba(255, 253, 249, .96);
}
.current-pillar small {
  display: block;
  margin-bottom: 3px;
  color: #9a8880;
  font-size: 10px;
}
.current-pillar strong {
  display: inline-flex;
  justify-content: center;
  color: #71413a;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .08em;
}
.current-pillar strong span { display: inline-block; }
.five-element-wood { color: #36834b; }
.five-element-fire { color: #c43a32; }
.five-element-earth { color: #8a5a3b; }
.five-element-metal { color: #d29b16; }
.five-element-water { color: #2f6fbd; }
.five-element-default { color: #71413a; }

.chart-type-switch { gap: 7px; margin-top: 12px; }
.chart-type-switch button {
  min-height: 43px;
  border-radius: 11px;
  background: #fbf7f3;
  color: #77635c;
  font-size: 13px;
  font-weight: 650;
}
.chart-type-switch button[aria-pressed="true"] {
  border-color: #8f2929;
  background: #f2e2dc;
  color: #8f2929;
  box-shadow: none;
}
#chart-entry-content[data-chart-type="终身盘"],
#chart-entry-content[data-chart-type="时盘"] { gap: 10px; padding-top: 13px; }
#chart-entry-content[data-chart-type="终身盘"] .chart-case-grid,
#chart-entry-content[data-chart-type="时盘"] .chart-case-grid {
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px 8px;
}#chart-entry-content[data-chart-type="时盘"] .category-field {
  grid-column: 1 / -1;
  width: 100%;
}
.quick-chart-card label,
.gender-field > legend { gap: 5px; margin-bottom: 0; color: #88756e; font-size: 11px; }
.quick-chart-card input,
.quick-chart-card select {
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid rgba(112, 54, 45, .16);
  border-radius: 11px;
  background: #fffdfb;
  color: #493b36;
  font-size: 13px;
}
.quick-chart-card .name-label,
.quick-chart-card .category-label,
.quick-chart-card .gender-field > legend {
  color: #684c44;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.quick-chart-card .category-label { display: block; }

.quick-chart-card input::placeholder { color: #a69791; }
.gender-switch { gap: 6px; }
.gender-switch button {
  min-height: 43px;
  border-radius: 11px;
  background: #fbf7f3;
  color: #77635c;
  font-size: 13px;
  font-weight: 650;
}
.gender-switch button[aria-pressed="true"] {
  border-color: #8f2929;
  background: #f2e2dc;
  color: #8f2929;
  box-shadow: none;
}
.datetime-trigger {
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid rgba(112, 54, 45, .16);
  border-radius: 11px;
  background: #fffdfb;
}
.datetime-trigger-icon {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
  border-radius: 10px;
  background: #f1e3dc;
  color: #8f2929;
  font-size: 18px;
}
.datetime-trigger-copy small { color: #9a8a83; font-size: 10px; }
.datetime-trigger-copy strong { margin-top: 3px; color: #523f39; font-size: 13px; }
.datetime-trigger-arrow { color: #a48f87; font-size: 21px; }
.quick-chart-card .start-chart {
  min-height: 47px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #96302f, #78201f);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .12em;
  box-shadow: 0 8px 18px rgba(113, 31, 31, .19);
}

@media (max-width: 390px) {
  .app-brand h1 { font-size: 1.12rem; }
  .account-menu-label { max-width: 58px; }
  .current-date-copy strong { font-size: 14px; }
  .current-beijing-clock { font-size: 25px; }
  #chart-entry-content[data-chart-type="终身盘"] .chart-case-grid,
  #chart-entry-content[data-chart-type="时盘"] .chart-case-grid { grid-template-columns: minmax(0, 1fr) 116px; }
}
@media (min-width: 760px) {
  .app-topbar {
    width: 100%;
    margin: 0 auto 16px;
    border: 1px solid rgba(112, 54, 45, .12);
    border-radius: 15px;
  }
}

/* Compact result page redesign v23: scoped outside the nine-palace board. */
.result-view {
  width: min(100%, 980px);
  margin-right: auto;
  margin-left: auto;
}
.result-view .result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  padding: 9px 10px;
  border-color: rgba(112, 54, 45, .13);
  border-radius: 16px;
  background: rgba(255, 253, 249, .97);
  box-shadow: 0 7px 20px rgba(70, 42, 34, .07);
}
.result-view .result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.result-view .result-heading > div { min-width: 0; }
.result-view .result-heading small { color: #a18d85; font-size: 9px; letter-spacing: .13em; }
.result-view .result-heading h2 {
  margin-top: 1px;
  color: #412a25;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: .04em;
}
.result-view .back-to-input {
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(112, 54, 45, .14);
  border-radius: 10px;
  background: #fbf7f3;
  color: #765d55;
  font-size: 11px;
}
.result-view .view-mode {
  min-height: 34px;
  margin: 0;
  padding: 3px;
  gap: 2px;
  border: 1px solid rgba(112, 54, 45, .13);
  border-radius: 10px;
  background: #f7f1ed;
}
.result-view .view-mode > span { display: none; }
.result-view .view-mode-button {
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #826d65;
  background: transparent;
  font-size: 11px;
}
.result-view .view-mode-button.active,
.result-view .view-mode-button[aria-pressed="true"] {
  color: #8f2929;
  background: #fffdf9;
  box-shadow: 0 2px 7px rgba(67, 36, 29, .08);
}
.result-view .result-toolbar,
.result-view .result-header > .chart-navigation {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.result-view .result-toolbar button,
.result-view .result-header > .chart-navigation button {
  min-width: 0;
  min-height: 36px;
  padding: 6px 4px;
  border-color: rgba(112, 54, 45, .14);
  border-radius: 10px;
  color: #765d55;
  background: #fbf7f3;
  font-size: 11px;
  line-height: 1.15;
  box-shadow: none;
}
.result-view .result-toolbar #save-case {
  border-color: #8f2929;
  color: #fff;
  background: linear-gradient(135deg, #96302f, #78201f);
  box-shadow: 0 5px 12px rgba(113, 31, 31, .14);
}
.result-view .result-header > .chart-navigation button small {
  display: inline;
  margin: 0 0 0 2px;
  font-size: 8px;
  opacity: .68;
}
.result-view .chart {
  margin-top: 8px;
  padding: 9px 9px 12px;
  border-color: rgba(112, 54, 45, .13);
  border-radius: 16px;
  background: rgba(255, 253, 249, .97);
  box-shadow: 0 7px 20px rgba(70, 42, 34, .07);
}
.result-view .chart-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 1px 1px 8px;
  border-bottom: 1px solid rgba(112, 54, 45, .11);
}
.result-view .calendar { display: grid; gap: 5px; min-width: 0; }
.result-view .calendar-date-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-width: 0;
}
.result-view .calendar h2 {
  margin: 0;
  color: #422b26;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: .01em;
}
.result-view .calendar p { margin: 0; color: #9a8880; font-size: 11px; line-height: 1.35; }
.result-view .tags {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  color: #765f57;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
  scrollbar-width: none;
}
.result-view .tags::-webkit-scrollbar { display: none; }
.result-view .tags span {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  white-space: nowrap;
}
.result-view .tags span:not([hidden]):not(:last-child)::after {
  content: "｜";
  margin: 0 4px;
  color: rgba(112, 54, 45, .28);
}
.result-view .chart-summary { grid-column: auto; display: block; min-width: 0; }
.result-view .chart-summary-main {
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid rgba(112, 54, 45, .1);
  border-radius: 9px;
  background: #fbf7f3;
  font-size: 11px;
  line-height: 1.35;
  overflow-x: auto;
  scrollbar-width: none;
}
.result-view .chart-summary-main::-webkit-scrollbar { display: none; }
.result-view .chart-summary-main span:not(:last-child)::after { margin: 0 4px; color: rgba(112, 54, 45, .27); }
.result-view .chart-summary-main small { color: #9a8880; font-size: 9px; }
.result-view .chart-summary-main strong { margin-left: 2px; color: #6e3a34; font-size: 11px; }
.result-view .pillars {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(112, 54, 45, .1);
  border-radius: 9px;
  background: rgba(112, 54, 45, .1);
}
.result-view .pillars div {
  min-width: 0;
  padding: 5px 3px 6px;
  border: 0;
  border-radius: 0;
  background: #fffdf9;
  text-align: center;
}
.result-view .pillars small { display: block; margin-bottom: 1px; color: #9a8880; font-size: 9px; line-height: 1.2; }
.result-view .pillars strong {
  display: block;
  color: #71413a;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .06em;
}
/* Mobile-first case center: title, search, grouped cards and long-press editing. */
.cases-view .cases-view-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 50px; margin: 0; padding: 6px 12px; border-radius: 12px; background: #fffdf9; }
.cases-view .cases-view-title { min-width: 0; }
.cases-view .cases-view-heading h2 { margin: 0; color: var(--red-dark); font-size: 19px; line-height: 1.2; }
.cases-view .case-count { margin-left: 3px; color: var(--muted); font-size: 14px; font-weight: 500; }
.cases-view .cases-view-heading p, .cases-view .cloud-sync-card > p, .cases-view .cloud-sync-icon { display: none; }
.cases-view .cloud-sync-card, .cases-view .cloud-sync-heading, .cases-view .cloud-sync-heading > div, .cases-view .cloud-sync-actions { display: flex; align-items: center; }
.cases-view .cloud-sync-card { min-width: 0; gap: 7px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.cases-view .cloud-sync-heading > div { gap: 3px; }
.cases-view .cloud-sync-heading strong { flex: 0 0 auto; color: var(--red); font-size: 13px; line-height: 1.2; }
.cases-view .cloud-sync-heading small { flex: 0 1 auto; min-width: 0; max-width: none; color: var(--muted); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.cases-view .cloud-sync-heading small::before { content: "："; }
.cases-view .cloud-sync-actions { flex: 0 0 auto; gap: 5px; }
.cases-view .cloud-sync-actions[hidden] { display: none !important; }
.cases-view .cloud-sync-actions button, .cases-view .cloud-sync-actions button:only-child { min-width: 82px; min-height: 32px; padding: 4px 9px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.cases-view .case-center { margin-top: 0; overflow: visible; border-radius: 14px; background: #fffdf9; box-shadow: 0 4px 14px rgba(61, 37, 31, .05); }
.cases-view .case-center > summary { display: none; }
.cases-view .case-center-body { padding: 12px; border-top: 0; }
.cases-view .case-search-row { display: block; padding-top: 0; }
.cases-view .case-search-row > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cases-view .case-search-row > div { display: block; }
.cases-view .case-search-row input { width: 100%; min-height: 46px; padding-inline: 13px; border-color: rgba(157, 55, 42, .28); border-radius: 10px; background: #fffefa; font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 16px; }
.cases-view #case-search-clear { display: none; }
.cases-view .case-list { display: grid; gap: 14px; max-height: none; margin-top: 14px; overflow: visible; }
.cases-view .case-group { display: grid; gap: 8px; }
.cases-view .case-group-title { display: flex; align-items: baseline; gap: 4px; padding-inline: 3px; color: var(--red-dark); }
.cases-view .case-group-title strong { font-size: 15px; line-height: 1.25; }
.cases-view .case-group-title span { color: var(--muted); font-size: 12px; line-height: 1.25; }
.cases-view .case-group-items { display: grid; gap: 7px; }
.cases-view .case-empty { padding: 20px 13px; }
.cases-view .case-item { min-height: 76px; padding: 0; overflow: hidden; border: 2px solid rgba(157, 55, 42, .24); border-radius: 10px; background: #fffefa; box-shadow: 0 2px 7px rgba(61, 37, 31, .04); }
.cases-view .case-item.active { border-color: rgba(157, 55, 42, .42); box-shadow: 0 0 0 2px rgba(157, 55, 42, .08); }
.cases-view .case-card-actions { position:relative; display:block; min-height:76px; }
.cases-view .case-open { display:block; min-width:0; width:100%; min-height:76px; padding:9px 10px 7px; text-align:left; touch-action:pan-y; font-family:"QimenBoardSC",sans-serif; font-synthesis:none; }
.cases-view .case-open-main { display: grid; min-width: 0; gap: 3px; }
.cases-view .case-item-head { display: flex; min-width: 0; align-items: baseline; gap: 5px; color: var(--red-dark); font-family:"QimenBoardSC",sans-serif; font-size: 15px; font-weight: 400; line-height: 1.25; font-synthesis:none; }
.cases-view .case-open strong { min-width: 0; overflow: hidden; color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; font-weight: inherit; text-overflow: ellipsis; white-space: nowrap; }
.cases-view .case-item-subline { min-width: 0; overflow: hidden; color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; font-weight: inherit; text-overflow: ellipsis; white-space: nowrap; }
.cases-view .case-item-meta { display:grid; grid-template-columns:minmax(0,1fr); gap:2px; padding-right:52px; overflow:visible; color:#71665d; font-family:"QimenBoardSC",sans-serif; font-size:15px; font-weight:400; line-height:1.25; white-space:normal; font-synthesis:none; }
.cases-view .case-item-meta span { white-space: nowrap; }
.cases-view .case-edit { position:absolute; right:7px; bottom:7px; min-width:42px; min-height:38px; margin:0; padding:6px 5px; color:var(--red-dark); background:transparent; border:1px solid rgba(157,55,42,.24); border-radius:6px; font-size:12px; white-space:nowrap; }
.cases-view .case-edit:active { background:#fff0e8; }
.cases-view .backup-actions { gap: 7px; margin-top: 14px; }
.cases-view .backup-actions button { min-height: 40px; padding: 7px; font-size: 12px; }
.cases-view .case-storage-status { margin: 8px 2px 0; font-size: 11px; line-height: 1.45; }
@media screen and (max-width: 759px) {
  .cases-view .case-center-body { padding-bottom: 76px; }
  .cases-view .backup-actions {
    position: fixed;
    right: 6px;
    bottom: calc(67px + env(safe-area-inset-bottom));
    left: 6px;
    z-index: 80;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(157, 55, 42, .14);
    border-radius: 10px;
    background: rgba(255, 253, 249, .98);
    box-shadow: 0 -5px 16px rgba(61, 37, 31, .10);
    backdrop-filter: blur(10px);
  }
  .cases-view .backup-actions button { min-height: 40px; }
}
@media screen and (max-width: 390px) {
  .cases-view .cases-view-heading { gap: 7px; padding-inline: 11px; flex-wrap: nowrap; }
  .cases-view .cases-view-title { flex: 1 1 auto; }
  .cases-view .cloud-sync-card { flex: 0 0 auto; gap: 5px; justify-content: space-between; min-width: 0; }
  .cases-view .cloud-sync-heading { min-width: 0; flex: 1 1 auto; }
  .cases-view .cloud-sync-heading > div { min-width: 0; flex-wrap: nowrap; row-gap: 0; }
  .cases-view .cloud-sync-heading small { font-size: 11px; white-space: nowrap; }
  .cases-view .cloud-sync-actions button { min-width: 78px; padding-inline: 7px; }
  .cases-view .case-center-body { padding-inline: 10px; }
}
@media screen and (max-width: 350px) { .cases-view .cases-view-heading { padding-inline: 9px; } .cases-view .cloud-sync-heading small { font-size: 10px; } .cases-view .cloud-sync-actions button { min-width: 72px; padding-inline: 6px; font-size: 11px; } .cases-view .cases-view-heading h2 { font-size: 18px; } }

/* Case center: compact mobile header and search area. */
@media screen and (max-width: 700px) {
  .cases-view .cases-view-heading {
    min-height: 44px;
    padding: 5px 10px;
    border-radius: 10px;
  }
  .cases-view .cases-view-heading h2 { font-size: 18px; }
  .cases-view .case-count { font-size: 12px; }
  .cases-view .cloud-sync-heading strong { font-size: 12px; }
  .cases-view .cloud-sync-heading small { font-size: 11px; }
  .cases-view .case-center-body { padding: 8px 10px 12px; }
  .cases-view .case-search-row input {
    min-height: 40px;
    padding-inline: 11px;
    border-radius: 8px;
    background: #fffdf9;
    font-size: 14px;
  }
  .cases-view .case-list { gap: 10px; margin-top: 9px; }
  .cases-view .case-group { gap: 5px; }
  .cases-view .case-group-title strong { font-size: 14px; }
  .cases-view .case-group-title span { font-size: 11px; }
}

/* Almanac visual harmony: compact header, month controls and calendar cells */
.almanac-view {
  --almanac-paper:#fffaf4;
  --almanac-paper-strong:#fffdf9;
  --almanac-soft:#f6eee6;
  --almanac-border:rgba(112,54,45,.14);
}
.almanac-view .almanac-header {
  top:0;
  gap:7px;
  min-height:52px;
  margin-bottom:6px;
  padding:6px 7px;
  border-color:var(--almanac-border);
  border-radius:14px;
  background:rgba(255,250,244,.96);
  box-shadow:0 5px 18px rgba(75,44,35,.07);
}
.almanac-view .almanac-title-group { display:grid; gap:1px; }
.almanac-view .almanac-header h2 {
  color:#3f2924;
  font-size:17px;
  font-weight:750;
  letter-spacing:.08em;
  line-height:1.15;
}
.almanac-view .almanac-offline-state {
  margin:0;
  font-size:9px;
  line-height:1.1;
  opacity:.82;
}
.almanac-view .almanac-header button {
  min-width:58px;
  min-height:36px;
  padding:6px 9px;
  border-color:rgba(155,47,47,.34);
  border-radius:10px;
  background:rgba(255,253,249,.72);
  font-size:13px;
}
.almanac-view #almanac-back {
  color:#765c55;
  border-color:rgba(112,54,45,.18);
}
.almanac-view #almanac-today {
  color:var(--red);
  background:#fff8f4;
}
.almanac-view .almanac-calendar {
  padding:6px 6px 7px;
  border-color:var(--almanac-border);
  border-radius:16px;
  background:var(--almanac-paper-strong);
  box-shadow:0 7px 24px rgba(75,44,35,.07);
  overflow:hidden;
}
.almanac-view .almanac-month-nav {
  grid-template-columns:38px minmax(0,1fr) 38px;
  gap:5px;
  margin:0 0 2px;
  padding:1px 0 4px;
  border-bottom:1px solid rgba(112,54,45,.08);
}
.almanac-view .almanac-month-nav > .ghost {
  width:36px;
  min-width:36px;
  min-height:36px;
  justify-self:center;
  padding:0;
  border-color:rgba(112,54,45,.15);
  border-radius:10px;
  color:var(--red);
  background:#fffaf6;
  font-size:22px;
  box-shadow:none;
}
.almanac-view .almanac-month-title {
  min-height:36px;
  padding:2px 8px;
  color:#33231f;
  font-size:20px;
  font-weight:750;
  letter-spacing:.06em;
}
.almanac-view .almanac-month-title::after {
  margin-left:4px;
  color:#8a756e;
  font-size:10px;
}
.almanac-view .almanac-date-jump {
  margin:2px 1px 6px;
  border-color:rgba(112,54,45,.12);
  border-radius:12px;
  background:#fffaf5;
  box-shadow:none;
}
.almanac-view .almanac-weekdays { padding:1px 0 2px; }
.almanac-view .almanac-weekdays span {
  padding:3px 0 4px;
  color:#786963;
  font-size:12px;
  font-weight:600;
}
.almanac-view .almanac-days { row-gap:1px; }
.almanac-view .almanac-day {
  min-height:54px;
  gap:2px;
  padding:4px 1px 5px;
  border-radius:10px;
}
.almanac-view .almanac-day-top {
  position:relative;
  min-height:16px;
  padding:0 14px;
}
.almanac-view .almanac-day strong {
  color:#352723;
  font-size:16px;
  line-height:1;
}
.almanac-view .almanac-day-ganzhi {
  color:#704334;
  font-size:10px;
  font-weight:700;
  line-height:1.05;
}
.almanac-view .almanac-day-label {
  color:#8a7a73;
  font-size:10px;
  line-height:1.05;
}
.almanac-view .almanac-holiday-state {
  position:absolute;
  top:50%;
  right:0;
  min-width:14px;
  height:14px;
  transform:translateY(-50%);
  border-radius:4px;
  font-size:8px;
}
.almanac-view .almanac-case-badge,
.almanac-view .almanac-case-badge.single {
  position:absolute;
  top:50%;
  left:0;
  bottom:auto;
  right:auto;
  min-width:13px;
  width:auto;
  height:13px;
  padding:0 3px;
  transform:translateY(-50%);
  border:0;
  border-radius:999px;
  color:#fff;
  background:#9a713f;
  font-size:8px;
  box-shadow:none;
}
.almanac-view .almanac-case-badge.single {
  left:3px;
  min-width:6px;
  width:6px;
  height:6px;
  padding:0;
}
.almanac-view .almanac-day.selected {
  border-color:rgba(155,47,47,.72);
  background:#fff0ea;
  box-shadow:inset 0 0 0 1px rgba(155,47,47,.12);
}
.almanac-view .almanac-day.selected strong { color:#8f2828; }
.almanac-view .almanac-day.selected .almanac-day-ganzhi { color:#81332d; }
.almanac-view .almanac-day.outside { opacity:.38; }

@media (max-width:370px) {
  .almanac-view .almanac-header button { min-width:52px; padding-inline:6px; }
  .almanac-view .almanac-calendar { padding-inline:3px; }
  .almanac-view .almanac-day { min-height:52px; }
  .almanac-view .almanac-day-top { padding-inline:12px; }
  .almanac-view .almanac-day-ganzhi,
  .almanac-view .almanac-day-label { font-size:10px; }
}

/* Almanac compact lower controls: date facts, hour selector and chart action */
.almanac-view .almanac-detail {
  margin-top:6px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  border-radius:14px;
}
.almanac-view .almanac-detail-heading {
  align-items:center;
  gap:8px;
}
.almanac-view .almanac-detail-heading small {
  font-size:11px;
  line-height:1.2;
}
.almanac-view .almanac-detail-heading h3 {
  margin:1px 0 0;
  font-size:19px;
  line-height:1.2;
}
.almanac-view .almanac-term {
  padding:3px 7px;
  font-size:11px;
}
.almanac-view .almanac-facts {
  margin:7px 0 8px;
}
.almanac-view .almanac-facts div {
  grid-template-columns:64px minmax(0,1fr);
  gap:6px;
  padding:6px 0;
}
.almanac-view .almanac-facts dt {
  font-size:12px;
}
.almanac-view .almanac-facts dd {
  min-width:0;
  font-size:14px;
  line-height:1.35;
}
.almanac-view .almanac-hour-field {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:8px;
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.almanac-view .almanac-hour-field select {
  min-width:0;
  width:100%;
  min-height:38px;
  padding-block:5px;
  font-size:13px;
}
.almanac-view .almanac-pillars {
  gap:5px;
  margin-top:8px;
}
.almanac-view .almanac-pillars span {
  padding:5px 2px;
  border-radius:8px;
}
.almanac-view .almanac-pillars small {
  margin-bottom:2px;
  font-size:10px;
}
.almanac-view .almanac-pillars strong {
  font-size:17px;
  line-height:1.15;
}
.almanac-view .almanac-boundary {
  margin:6px 0 7px;
  font-size:10px;
  line-height:1.3;
}
.almanac-view .almanac-use-time {
  min-height:42px;
  padding:8px 12px;
  border-radius:10px;
  font-size:14px;
}
@media (max-width:370px) {
  .almanac-view .almanac-detail { padding-inline:8px; }
  .almanac-view .almanac-facts div { grid-template-columns:58px minmax(0,1fr); }
  .almanac-view .almanac-pillars { gap:4px; }
  .almanac-view .almanac-pillars strong { font-size:15px; }
}
/* Almanac compact secondary panels: saved cases and collapsible details */
.almanac-view .almanac-case-summary {
  margin:7px 0;
  border-color:rgba(154,113,63,.28);
  border-radius:10px;
  box-shadow:none;
}
.almanac-view .almanac-case-summary[hidden] {
  display:none !important;
}
.almanac-view .almanac-case-summary summary {
  min-height:34px;
  padding:5px 9px;
  font-size:11px;
}
.almanac-view .almanac-case-list {
  border-top-color:rgba(154,113,63,.18);
}
.almanac-view .almanac-case-item {
  min-height:42px;
  gap:6px;
  padding:5px 9px;
}
.almanac-view .almanac-case-item strong {
  font-size:12px;
  line-height:1.25;
}
.almanac-view .almanac-case-item em,
.almanac-view .almanac-case-item small {
  margin-top:1px;
  font-size:9px;
  line-height:1.25;
}
.almanac-view .almanac-case-item > b {
  font-size:10px;
}
.almanac-view .almanac-traditional,
.almanac-view .almanac-hour-fortunes {
  margin:7px 0 0;
  border-color:rgba(112,54,45,.14);
  border-radius:10px;
  background:#fffaf6;
  box-shadow:none;
}
.almanac-view .almanac-traditional summary,
.almanac-view .almanac-hour-fortunes summary {
  min-height:40px;
  padding:6px 10px;
  font-size:14px;
}
.almanac-view .almanac-traditional summary::after,
.almanac-view .almanac-hour-fortunes summary::after {
  font-size:10px;
}
.almanac-view .almanac-yiji {
  gap:6px;
  padding:8px;
}
.almanac-view .almanac-yiji > div {
  grid-template-columns:25px minmax(0,1fr);
  gap:5px;
}
.almanac-view .almanac-yiji strong {
  width:24px;
  height:24px;
  font-size:12px;
}
.almanac-view .almanac-yiji p {
  margin-top:1px;
  font-size:12px;
  line-height:1.45;
}
.almanac-view .almanac-traditional-facts {
  padding:0 8px 8px;
}
.almanac-view .almanac-traditional-facts div {
  padding:5px 3px;
}
.almanac-view .almanac-traditional-facts dt {
  font-size:11px;
}
.almanac-view .almanac-traditional-facts dd {
  margin-top:2px;
  font-size:13px;
  line-height:1.4;
}
.almanac-view .almanac-hour-list {
  gap:5px;
  padding:7px;
}
.almanac-view .almanac-hour-card {
  min-height:52px;
  gap:1px 5px;
  padding:6px 7px;
  border-radius:7px;
}
.almanac-view .almanac-hour-card > span strong {
  font-size:14px;
}
.almanac-view .almanac-hour-card > span small {
  margin-top:1px;
  font-size:10px;
}
.almanac-view .almanac-hour-card > b {
  font-size:13px;
}
.almanac-view .almanac-hour-card > em,
.almanac-view .almanac-hour-card > small {
  font-size:10px;
}
.almanac-view .almanac-hour-detail {
  margin:0 7px 7px;
  padding:7px;
}
.almanac-view .almanac-hour-detail header strong {
  font-size:14px;
}
.almanac-view .almanac-hour-detail header span {
  padding:2px 6px;
  font-size:11px;
}
.almanac-view .almanac-hour-detail dl {
  margin-top:5px;
}
.almanac-view .almanac-hour-detail dl div {
  padding:4px 0;
}
.almanac-view .almanac-hour-detail dt {
  font-size:11px;
}
.almanac-view .almanac-hour-detail dd {
  font-size:13px;
  line-height:1.4;
}
@media (max-width:370px) {
  .almanac-view .almanac-yiji { grid-template-columns:1fr; }
  .almanac-view .almanac-hour-card { padding-inline:5px; }
}
/* Almanac five-element pillars after redundant date detail removal */
.almanac-view .almanac-pillars strong {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:1px;
}

/* Formal mobile home v1 - 2026-08-06 */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-topbar {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  min-height: 88px;
  margin: -10px auto 0;
  padding: 12px 20px 20px;
  align-items: flex-start;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: var(--red);
  color: #fff;
}
.app-brand {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
}
.app-brand-logo {
  position: absolute;
  left: 0;
  width: 40px;
  height: 40px;
  /* 保留原有浅色衬底以凸显印章细节，同时收窄外圈，避免白边过重。 */
  padding: 2px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255, 255, 255, .82);
}
.app-brand h1 {
  margin: 0;
  color: #fff;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(1.42rem, 6vw, 1.65rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .12em;
}
.account-bar {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 8;
}
.account-menu-toggle {
  min-height: 40px;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
}
.account-menu-toggle:hover,
.account-menu-toggle:focus-visible { color: #fff; }
.account-menu-avatar { display: none; }
.account-menu { right: 0; }

.almanac-view,
.cases-view {
  position: relative;
  z-index: 2;
  margin-top: -20px;
}

.input-view {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  max-width: 520px;
  margin: -20px auto 0;
  padding: 0 10px calc(78px + env(safe-area-inset-bottom));
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.input-view .quick-chart-card {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.current-time-card {
  width: calc(100% - 16px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(73, 52, 45, .05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.current-time-card:active { transform: translateY(1px); }
.current-time-card:focus-visible {
  outline: 3px solid rgba(155, 47, 47, .22);
  outline-offset: 3px;
}
.current-time-main {
  min-height: 62px;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.current-date-copy { min-width: 0; }
.current-date-copy small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}
.current-date-copy strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.current-lunar-date {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.current-beijing-clock {
  flex: 0 0 auto;
  color: var(--red);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
}
.current-clock-copy {
  display:flex;
  align-items:baseline;
  flex:0 0 auto;
  gap:6px;
}
.current-hour-branch {
  color:var(--red);
  font-family:"QimenBoardSC","Noto Sans SC","Microsoft YaHei",sans-serif;
  font-size:16px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}
.current-four-pillars {
  height: 52px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 0;
  background: transparent;
}
.current-pillar {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
  align-content: center;
  background: transparent;
}
.current-pillar + .current-pillar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--line);
}
.current-pillar strong {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--red);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.current-pillar strong span { display: block; }
.current-four-pillars .current-pillar strong span { color: var(--red); }

.home-form-card {
  margin-top: 12px;
  padding: 0 15px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(73, 52, 45, .045);
}
.home-field-row {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color .12s ease;
}
.home-field-row:active { background: rgba(157, 55, 42, .035); }
#chart-entry-content {
  display: block;
  padding: 0 !important;
}
#digital-number-row[hidden],
#consultation-mode-row[hidden],
#phone-row[hidden],
#case-category-row[hidden],
#case-question-row[hidden],
#chart-time-row[hidden] {
  display: none !important;
}
#chart-entry-content #case-question-row:not([hidden]) {
  display: flex;
}
#chart-entry-content .home-field-row:last-child { border-bottom: 0; }
.home-field-label {
  width: 62px;
  flex: 0 0 62px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.quick-chart-card label.home-field-row > .home-field-label {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.quick-chart-card .name-gender-row > .home-field-label {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}
.consultation-mode-row > .home-field-label {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.2;
}
.quick-chart-card .home-name-input,
.quick-chart-card .home-name-input::placeholder {
  font-size: 16px !important;
}
.home-field-control {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.chart-type-switch {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  margin: 0;
}
.chart-type-switch button,
.gender-switch button {
  min-width: 0;
  min-height: 44px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.chart-type-switch button::before,
.gender-switch button::before {
  content: "";
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border: 1px solid #cbbfb6;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.chart-type-switch button[aria-pressed="true"],
.gender-switch button[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-weight: 500;
}
.chart-type-switch button[aria-pressed="true"]::before,
.gender-switch button[aria-pressed="true"]::before {
  content: "\2713";
  display: grid;
  place-items: center;
  border-color: var(--red);
  background: var(--paper);
  box-shadow: none;
  color: var(--red);
  font: 800 14px/1 Arial, sans-serif;
}
.name-gender-control { justify-content: space-between; gap: 8px; }
.home-name-input,
.home-phone-input,
.home-choice-select,
.home-question-input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.home-name-input { min-width: 0; flex: 1; }
.home-phone-input { min-width: 0; flex: 1; font-size: 20px; font-weight: 700; letter-spacing: .03em; }
.quick-chart-card .home-name-input,
.quick-chart-card .home-phone-input,
.quick-chart-card .home-choice-select,
.quick-chart-card .home-question-input {
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  outline: 0;
}
.home-name-input::placeholder,
.home-phone-input::placeholder,
.home-question-input::placeholder { color: #a99c96; }
.home-field-feedback {
  position: absolute;
  left: 74px;
  bottom: 2px;
  display: none;
  margin: 0;
  color: #a52c2c;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
}
.home-field-row.has-error { padding-bottom: 15px; }
.home-field-row.has-error .home-field-feedback { display: block; }
.home-field-row.has-error .home-name-input,
.home-field-row.has-error .home-phone-input,
.home-field-row.has-error .home-question-input { box-shadow: inset 0 -2px 0 #b33a32; }
.gender-field { flex: 0 0 auto; }
.gender-switch {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
}
.home-choice-select {
  appearance: none;
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, #9f8c83 50%), linear-gradient(135deg, #9f8c83 50%, transparent 50%);
  background-position: calc(100% - 8px) 18px, calc(100% - 3px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.home-question-input:disabled {
  color: var(--muted);
  opacity: .82;
}
.digital-number-row { min-height: 76px; }
.digital-number-control {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  padding: 17px 0 7px;
}
.digital-number-boxes {
  width: min(100%, 280px);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}
.digital-number-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
  font-size: 18px !important;
  font-weight: 800;
  text-align: center;
}
.digital-number-input:focus {
  border-color: var(--red) !important;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(155, 47, 47, .12);
}
.digital-number-feedback {
  min-height: 0;
  color: #a1241c;
  font-size: 11px;
  line-height: 1.35;
}
.chart-time-row .datetime-field { width: 100%; }
.chart-time-row .datetime-trigger {
  width: 100%;
  min-height: 61px;
  padding: 7px 0;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.chart-time-row .datetime-trigger:active { transform: none; background: transparent; }
.chart-time-row .datetime-trigger-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.chart-time-row .datetime-trigger-copy strong {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}
.chart-time-row #datetime-conversion {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.chart-time-row .datetime-trigger-copy small {
  color: #9f8c83;
  font-size: 10px;
}
.chart-time-row .datetime-trigger-arrow {
  color: #9f8c83;
  font-size: 20px;
}
.chart-time-row .datetime-feedback:empty { display: none; }
.chart-time-row .datetime-feedback:not(:empty) {
  width: 100%;
  margin: 4px 0 7px;
  padding: 7px 9px;
  display: block;
  font-size: 12px;
}
.quick-chart-card .start-chart {
  width: 100%;
  min-height: 50px;
  margin-top: 15px;
  border: 1px solid var(--red);
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .12em;
  box-shadow: none;
}
.quick-chart-card .start-chart:active { background: var(--red-dark); }
.open-case-records {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: .03em;
}
.open-case-records:active { color: var(--red); }
.home-offline-hint {
  margin: 4px 0 0;
  color: #9b8b83;
  font-size: 12px;
  text-align: center;
}
.quick-chart-card .reset-chart[hidden] { display: none !important; }

@media (max-width: 390px) {
  .input-view { padding-right: 10px; padding-left: 10px; }
  .app-topbar { padding-right: 14px; padding-left: 14px; }
  .account-bar { right: 14px; }
  .app-brand h1 { font-size: 1.4rem; }
  .current-date-copy strong { font-size: 12px; }
  .current-beijing-clock { font-size: 21px; }
  .home-form-card { padding: 0 12px; }
  .home-field-row { gap: 9px; }
  .home-field-label { width: 54px; flex-basis: 54px; }
  .chart-type-switch { gap: 4px; }
  .chart-type-switch button,
  .gender-switch button { font-size: 13px; gap: 3px; }
  .chart-type-switch button::before,
  .gender-switch button::before { width: 19px; height: 19px; flex-basis: 19px; }
  .gender-switch { gap: 8px; }
}

@media (min-width: 760px) {
  .app-topbar {
    margin: 0 auto 16px;
    border-radius: 16px;
  }
  .input-view { margin-top: 0; }
}


.result-screen-active .result-changsheng-toggle{
  height:31px;
  gap:3px;
  padding:0 3px;
  border:1px solid #d3b07e;
  border-radius:999px;
  color:#6f2020;
  background:linear-gradient(180deg,#fffdf7 0%,#f8ead7 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 1px 4px rgba(89,51,32,.12);
  font-size:13px;
  font-weight:900;
  letter-spacing:.04em;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.result-screen-active .result-changsheng-toggle:active{transform:scale(.98)}
.result-screen-active .result-changsheng-toggle:focus-visible{outline:2px solid rgba(155,47,47,.35);outline-offset:2px}
.result-screen-active .result-toggle-track{
  width:22px;
  height:14px;
  border:1px solid rgba(111,82,65,.18);
  background:#ded1c6;
  box-shadow:inset 0 1px 3px rgba(75,51,38,.16);
}
.result-screen-active .result-toggle-track::after{
  left:2px;
  top:2px;
  width:10px;
  height:10px;
  border:1px solid rgba(148,106,67,.2);
  background:#fffdf8;
  box-shadow:0 1px 4px rgba(59,36,24,.28);
}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"]{
  border-color:#9b2f2f;
  color:#8f2424;
  background:linear-gradient(180deg,#fff8f2 0%,#f4dfd7 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 2px 6px rgba(111,32,32,.16);
}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track{background:linear-gradient(180deg,#b84040 0%,#8f2424 100%);border-color:#7d1f1f}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}

/* Formal result pillar colors: heavenly stems / earthly branches */
.result-screen-active #pillars strong>span:first-child{color:#8f2433!important}
.result-screen-active #pillars strong>span:last-child{color:#245a9b!important}


.result-screen-active .result-display-toggles{display:flex;align-items:center;gap:5px;flex:1 1 0}
.result-screen-active .result-display-toggles .result-changsheng-toggle{flex:1 1 0;min-width:0;justify-content:center}
.result-screen-active .result-display-toggles .result-changsheng-toggle>span{white-space:nowrap}
.result-screen-active .result-status-tools{gap:5px;padding-inline:5px}
.result-screen-active .result-status-badges{gap:5px}
.result-screen-active .result-status-badge{flex:1 1 0;min-width:0;padding-inline:4px}


/* Formal result effect status buttons - 2026-08-06 */
.result-screen-active .result-status-badge{
  border:0;
  font-family:inherit;
  cursor:pointer;
}
.result-screen-active .result-status-badge:disabled{
  color:#fff;
  background:#b9b9b9!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28);
  cursor:default;
  opacity:1;
}
.result-screen-active .result-status-badge[aria-pressed="true"]{
  outline:2px solid #6f2020;
  outline-offset:1px;
}
.result-screen-active .result-status-badge:not(:disabled):active{transform:translateY(1px)}
.result-screen-active .palace.effect-filter-match{
  z-index:3;
  outline:3px solid #9b2f2f;
  outline-offset:-3px;
  box-shadow:inset 0 0 0 2px rgba(155,47,47,.35),0 0 0 2px rgba(155,47,47,.18);
}
.result-screen-active .palace.effect-filter-dimmed{opacity:.45}


/* 输入页类型菜单与事项输入：米白／枣红统一样式 */
.home-category-control { position: relative; }
.home-category-control .home-choice-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.home-category-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

/* Compact chart mode tabs: four text options fit one row without radio circles. */
.chart-mode-row .chart-type-switch {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
}
.chart-mode-row .chart-type-switch button {
  flex: 0 0 auto;
  min-width: auto;
  min-height: 42px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #77635c;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.chart-mode-row .chart-type-switch button::before {
  display: none !important;
  content: none !important;
}
.chart-mode-row .chart-type-switch button[aria-pressed="true"] {
  border-bottom-color: var(--red);
  background: transparent;
  color: var(--red-dark);
  font-weight: 700;
  box-shadow: none;
}
.chart-mode-row .chart-type-switch button:focus-visible {
  outline: 2px solid rgba(143, 41, 41, .38);
  outline-offset: -2px;
}
.chart-mode-row .chart-type-switch button,
.chart-mode-row .chart-type-switch button:hover,
.chart-mode-row .chart-type-switch button:active,
.chart-mode-row .chart-type-switch button:focus,
.chart-mode-row .chart-type-switch button:focus-visible {
  outline: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}
.chart-mode-row .chart-type-switch button[aria-pressed="true"],
.chart-mode-row .chart-type-switch button[aria-pressed="true"]:hover,
.chart-mode-row .chart-type-switch button[aria-pressed="true"]:active,
.chart-mode-row .chart-type-switch button[aria-pressed="true"]:focus,
.chart-mode-row .chart-type-switch button[aria-pressed="true"]:focus-visible {
  border-bottom-color: var(--red);
  color: var(--red-dark);
}
.chart-mode-row:active {
  background: transparent;
}
.chart-mode-row,
.chart-mode-row:hover,
.chart-mode-row:active,
.chart-mode-row:focus,
.chart-mode-row:focus-within {
  background: transparent !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
.home-category-trigger:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--red-dark);
}
.home-category-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: -4px 3px 0 0;
  border-right: 1.5px solid #9f8c83;
  border-bottom: 1.5px solid #9f8c83;
  transform: rotate(45deg);
  transition: transform .12s ease;
}
.home-category-trigger[aria-expanded="true"] .home-category-chevron { transform: rotate(225deg); }
.home-category-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  width: min(240px, calc(100vw - 116px));
  max-height: min(60vh, 320px);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid rgba(157, 55, 42, .18);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(73, 52, 45, .16);
}
.home-category-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.home-category-option:hover,
.home-category-option:focus-visible { background: rgba(157, 55, 42, .07); outline: 0; }
.home-category-option[aria-selected="true"] {
  background: rgba(157, 55, 42, .12);
  color: var(--red-dark);
  font-weight: 800;
}
.question-field:focus-within { background: rgba(157, 55, 42, .025); }
.home-question-input {
  cursor: text;
  caret-color: var(--red);
}
.home-question-input:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--ink);
}
@media screen and (max-width: 390px) {
  .home-category-menu { width: min(224px, calc(100vw - 104px)); }
}

/* Keep the account menu above cards without making the whole title bar cover them. */
.app-topbar { z-index: auto; overflow: visible; }
.app-topbar .account-bar { z-index: 31; }
.app-topbar .account-menu { z-index: 32; }

/* Formal mobile one-screen result page */
body.result-screen-active{margin:0;padding:0;overflow-x:hidden;background:#fffdf8}
body.result-screen-active.result-more-open,
body.result-screen-active.yizhang-open{overflow:hidden}
body.result-screen-active .app-shell{width:100%;max-width:none;min-height:100dvh;margin:0;padding:0}
body.result-screen-active .app-topbar,body.result-screen-active .app-navigation{display:none!important}
body.result-screen-active .result-view{width:100%;max-width:none;min-height:100dvh;margin:0;padding:0;overflow:visible;background:#fffdf8}
body.result-screen-active .result-view[hidden]{display:none!important}
.result-screen-active .result-header{position:relative;z-index:15;width:100%;margin:0;padding:0;border:0;border-radius:0;background:#9b2f2f;box-shadow:none}
.result-screen-active .result-topbar{display:grid;grid-template-columns:78px minmax(0,1fr) 78px;align-items:center;height:42px;padding:env(safe-area-inset-top,0) 7px 0;color:#fff;background:#9b2f2f}
.result-screen-active .result-topbar h2{min-width:0;margin:0;color:#fff;font-family:"STKaiti","KaiTi",serif;font-size:21px;font-weight:800;line-height:1;letter-spacing:.08em;text-align:center;white-space:nowrap}
.result-screen-active .result-title-digital{min-width:0;padding:2px 6px;border:0;border-radius:4px;color:inherit;background:transparent;box-shadow:none;font:inherit;line-height:inherit;letter-spacing:0;white-space:nowrap}
.result-screen-active .result-title-digital:not(:disabled):active{background:rgba(255,255,255,.14)}
.result-screen-active .result-title-digital:disabled{cursor:default;opacity:1}
.result-screen-active .result-top-action{width:max-content;min-width:60px;height:30px;padding:0 9px;border:1px solid rgba(255,255,255,.55);border-radius:8px;color:#000;background:#fff;box-shadow:none;font-size:18px;font-weight:400}
.result-screen-active .result-save{justify-self:end;display:inline-flex;align-items:center;gap:3px}
.result-screen-active .result-save-icon{font-size:14px;line-height:1;transform:translateY(-1px)}
.result-screen-active .chart-navigation{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;height:34px;margin:0;padding:2px 5px;border:0;border-bottom:1px solid #c7aa74;border-radius:0;background:#9b2f2f}
.result-screen-active .result-header>.chart-navigation button{min-width:0;min-height:0;height:30px;padding:0 2px;border:1px solid #e2cfa5;border-radius:7px;color:#33251f;background:#ffffe0;box-shadow:none;font-size:16px;font-weight:400;white-space:nowrap}
.result-screen-active .result-header>.chart-navigation button.now{color:#9b2f2f;border-color:#d0ad67;background:#fffff0}
.result-screen-active .chart{width:100%;max-width:none;margin:0;padding:0;border:0;border-radius:0;background:#fffdf8;box-shadow:none}
.result-screen-active .chart-meta{display:block;margin:0;padding:0;border:0;border-bottom:1px solid #a99788;background:#fff}
.result-screen-active .result-meta-table{display:block;margin:0}
.result-screen-active .result-meta-row{display:grid;min-height:29px;border-top:1px solid #cfc3b6}
.result-screen-active .result-date-row{grid-template-columns:49px minmax(0,1fr)}
.result-screen-active .result-time-row{display:grid!important;grid-template-columns:49px minmax(0,1fr)!important;grid-template-rows:auto auto!important;min-height:58px}
.result-screen-active .result-time-row .result-meta-label{grid-column:1!important;grid-row:1/3!important}
.result-screen-active .result-time-cell{display:flex!important;align-items:center!important;gap:4px!important;padding:4px 9px!important;border-top:1px solid #cfc3b6!important}
.result-screen-active .result-time-cell:first-of-type{border-top:0!important}
.result-screen-active .result-time-cell .result-meta-value{font-size:16px!important;overflow:visible!important;text-overflow:clip!important;justify-content:flex-start!important;padding:0!important;border:0!important;color:#241a17!important;font-weight:300!important}
.result-screen-active .result-time-cell{min-width:0!important}
.result-screen-active .result-time-cell .result-meta-value{flex:1 1 0!important;min-width:0!important}
.result-screen-active .date-prefix{color:#241a17!important;font-size:16px!important;font-weight:300!important;flex:0 0 auto!important}
.result-screen-active .result-ju-row{grid-template-columns:49px repeat(3,minmax(0,1fr))}
.result-screen-active .result-meta-label,.result-screen-active .result-meta-row>strong,.result-screen-active .result-meta-value{display:flex;align-items:center;justify-content:center;min-width:0;margin:0;padding:3px 4px;border-right:1px solid #cfc3b6;line-height:1.2;white-space:nowrap}
.result-screen-active .result-meta-label{color:#b89858;font-size:14px;font-weight:900;letter-spacing:.04em}
.result-screen-active .result-date-row .result-meta-value{justify-content:flex-start;padding-left:9px;overflow:hidden;color:#241a17;font-size:clamp(15px,4.3vw,18px);font-weight:900;text-overflow:ellipsis}
.result-screen-active .result-ju-row>strong{color:#241a17;font-size:clamp(13px,3.8vw,16px);font-weight:900}
.result-screen-active .result-hidden-tags{display:none!important}
.result-screen-active .chart-summary{display:block;margin:0}
.result-screen-active .chart-summary-main{display:grid;grid-template-columns:4fr 5fr 3fr 5fr;min-height:39px;margin:0;padding:0;overflow:hidden;border:0;border-top:1px solid #cfc3b6;border-radius:0;background:#fff}
.result-screen-active .chart-summary-main span{display:flex;flex-direction:row;align-items:baseline;justify-content:center;min-width:0;gap:1px;padding:3px 1px;border-right:1px solid #cfc3b6;white-space:nowrap}
.result-screen-active .chart-summary-main span::after{display:none!important;content:none!important}
.result-screen-active .chart-summary-main small{color:#b89858;font-size:15px;font-weight:900;line-height:1}
.result-screen-active .chart-summary-main strong{min-width:0;margin:0;overflow:visible;color:#241a17;font-size:clamp(13px,3.6vw,15px);font-weight:900;line-height:1.05;text-overflow:clip}
.result-screen-active .chart-summary-main span:nth-child(-n+4){border-bottom:1px solid #cfc3b6}
.result-screen-active .result-pillars-row{display:grid;grid-template-columns:49px minmax(0,1fr);min-height:43px;border-top:1px solid #cfc3b6}
.result-screen-active .result-pillars-row>.result-meta-label{border-right:1px solid #cfc3b6}
.result-screen-active .pillars{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;width:100%;margin:0;overflow:hidden;border:0;border-radius:0;background:#fff}
.result-screen-active .pillars div{display:grid;place-items:center;min-width:0;padding:2px 1px;border:0;border-right:1px solid #cfc3b6;border-radius:0;background:#fff}
.result-screen-active .pillars strong{display:block;margin:0;font-family:"STKaiti","KaiTi",serif;font-size:18px;font-weight:700;line-height:1;letter-spacing:.08em;text-align:center}
.result-screen-active .pillars strong span{display:block;line-height:1.02}
.result-screen-active .pillars small{display:none!important}
.result-screen-active .board-wrap{position:relative;display:grid;grid-template-columns:minmax(24px,1fr) minmax(0,326px) minmax(24px,1fr);grid-template-rows:28px 326px 28px;width:100%;height:382px;margin:0;padding:0;overflow:hidden;border:0;border-radius:0;background:#fffdf8}
.result-screen-active .board-wrap .board{position:relative;inset:auto;transform:none;grid-column:2;grid-row:2;width:326px;height:326px;min-width:0;min-height:0;margin:0 auto;border:1.5px solid #332722;background:#fff}
.result-screen-active .board-wrap .palace{min-width:0;min-height:0;padding:5px 6px 7px;border-color:#51443d;border-radius:0;background:#fff;font-family:"STKaiti","KaiTi",serif}
.result-screen-active .board-wrap .palace-god{font-size:17px;line-height:1}
.result-screen-active .board-wrap .star-door strong{font-size:17px;line-height:1}
.result-screen-active .board-wrap .star-door .door{font-size:17px;line-height:1}
.result-screen-active .board-wrap .stem{font-size:17px;line-height:1}
.result-screen-active .board-wrap .palace-name{font-size:9px;opacity:.64}
.result-screen-active .board-wrap .palace.center{display:grid;place-items:center;padding:0;grid-template-rows:1fr}
.result-screen-active .board-wrap .palace.center .taiji-scene{display:grid;place-items:center;width:64px;height:64px;margin:0}
.result-screen-active .board-wrap .palace.center .taiji-disc{width:64px;height:64px}
.result-screen-active .board-wrap .palace.center.yizhang-pressing{outline:2px solid rgba(155,47,47,.48);outline-offset:-3px}
.result-screen-active .board-wrap .palace.center.yizhang-pressing .taiji-scene{transform:scale(.94)}
.result-screen-active .board-wrap .center-host{font-size:10px}
.result-screen-active .board-wrap .direction-label{position:relative;inset:auto;transform:none;z-index:7;width:25px;height:25px;display:grid;place-items:center;border:1px solid rgba(155,47,47,.25);border-radius:50%;color:#9b2f2f;background:#fffdf8;font-size:13px;font-weight:900;line-height:1}
.result-screen-active .board-wrap .direction-south{grid-column:2;grid-row:1;align-self:center;justify-self:center}
.result-screen-active .board-wrap .direction-north{grid-column:2;grid-row:3;align-self:center;justify-self:center}
.result-screen-active .board-wrap .direction-east{grid-column:1;grid-row:2;align-self:center;justify-self:end}
.result-screen-active .board-wrap .direction-west{grid-column:3;grid-row:2;align-self:center;justify-self:start}
.result-screen-active .board-wrap .outer-ring{position:relative;inset:auto;transform:none;color:#2c211d;font-size:14px;font-weight:800}
.result-screen-active .board-wrap .outer-top,.result-screen-active .board-wrap .outer-bottom{grid-column:2;width:326px;height:28px;margin:0 auto}
.result-screen-active .board-wrap .outer-top{grid-row:1}
.result-screen-active .board-wrap .outer-bottom{grid-row:3}
.result-screen-active .board-wrap .outer-left,.result-screen-active .board-wrap .outer-right{grid-row:2;width:100%;height:326px}
.result-screen-active .board-wrap .outer-left{grid-column:1}
.result-screen-active .board-wrap .outer-right{grid-column:3}
.result-screen-active .board-wrap .outer-branch{color:#9b2f2f;font-size:11px}
.result-screen-active .board-wrap .board-horse{z-index:8;font-size:13px}
.result-screen-active .result-status-tools{display:flex;align-items:center;justify-content:center;gap:5px;min-height:32px;padding:2px 7px 0;border-top:1px solid #cfc3b6;background:#fff}
.result-screen-active .result-status-badges{display:flex;align-items:center;gap:5px;min-width:0;flex:1 1 0}
.result-screen-active .result-status-badge{display:grid;place-items:center;height:24px;flex:1 1 0;min-width:0;padding:0 4px;border-radius:6px;color:#fff;font-size:13px;font-weight:900;line-height:1;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22)}
.result-screen-active .result-status-badge.tomb-punish{background:#c521bc}
.result-screen-active .result-status-badge.in-tomb{background:#13861d}
.result-screen-active .result-status-badge.strike{background:#1238ad}
.result-screen-active .result-status-badge.door-press{background:#e21d1d}
.result-screen-active .result-changsheng-toggle{flex:0 0 auto;height:24px;display:flex;align-items:center;gap:6px;padding:0 7px 0 9px;border:1px solid #b97c77;border-radius:7px;color:#6f2020;background:#fff9f4;font-size:13px;font-weight:900}
.result-screen-active .result-toggle-track{position:relative;width:22px;height:14px;border-radius:999px;background:#c7b8ae;transition:.18s ease}
.result-screen-active .result-toggle-track::after{content:"";position:absolute;left:2px;top:2px;width:10px;height:10px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:.18s ease}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track{background:#9b2f2f}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}
.result-screen-active .result-bottom-tools{display:flex;align-items:center;justify-content:space-between;min-height:35px;padding:0 8px;border-top:1px solid #cfc3b6;background:#fbf7ef;color:#7d6e67;font-size:12px}
.result-screen-active .result-bottom-tools button{height:27px;padding:0 12px;border:1px solid #cdbdaf;border-radius:7px;color:#6f2020;background:#fffdf8;font-weight:800}
.result-screen-active .fortune-inline{margin:0;padding:0 4px}
.result-screen-active .dayun-heading{display:none!important}
.result-screen-active .liunian-heading{display:none!important}
.result-screen-active .dayun-section{margin:0;padding:2px 0 0;border:0}
.result-screen-active .fortune-entry-actions{gap:4px;margin:5px 0 0;padding:0 4px}
.result-screen-active .fortune-entry-actions[data-visible-count="2"]{padding-bottom:40px}
.result-screen-active .fortune-entry-actions[data-visible-count="1"] .fortune-entry-button,
.result-screen-active .fortune-entry-actions[data-visible-count="2"] .fortune-entry-button{color:#fff;border-color:var(--red);background:var(--red);box-shadow:0 2px 6px rgba(112,32,32,.2)}
.result-screen-active .fortune-entry-button{width:100%;min-width:0;height:36px;padding:0 2px;font-size:12px}
.result-screen-active .fortune-entry-icon{width:13px;height:13px;font-size:13px}
.result-screen-active .fortune-entry-actions .odo-effect-btn{min-height:0;padding:0 2px;border:1px solid #d3b07e;border-radius:999px;color:#6f2020;background:#fffdf8;box-shadow:0 1px 3px rgba(89,51,32,.1);font-size:12px;letter-spacing:0}
.result-screen-active .fortune-entry-actions .odo-effect-btn.active{color:#fff;background:#9b2f2f;box-shadow:0 1px 3px rgba(89,51,32,.1)}
.result-screen-active .dayun-table th{width:38px!important;font-size:14px!important;font-weight:500!important;padding:2px 1px!important}
.result-screen-active .dayun-table #dayun-ages .fortune-table-title{position:relative}
.result-screen-active .dayun-table #dayun-ages .fortune-table-label{position:absolute;top:5.4px;left:50%;margin:0;transform:translateX(-50%)}
.result-screen-active .dayun-table #toggle-liunian{position:absolute;left:50%;bottom:5px;margin:0;transform:translateX(-50%)}
.result-screen-active .liunian-table th{width:38px!important;font-size:14px!important;font-weight:500!important;padding:2px 1px!important}
.result-screen-active .dayun-table td{font-size:14px!important;font-weight:500!important;padding:2px 1px!important}
.result-screen-active .dayun-table #dayun-ganzhi td{font-size:16px!important;font-weight:500!important}
.result-screen-active .liunian-table td{font-size:14px!important;font-weight:500!important;padding:2px 1px!important}
.result-screen-active .liunian-table #liunian-ganzhi td{font-size:16px!important;font-weight:500!important}
.result-screen-active .dayun-table #dayun-ages td{font-size:13px!important}
.result-screen-active .liunian-table #liunian-ages td{font-size:13px!important}
.result-screen-active .dayun-table #dayun-years td{font-size:10px!important;font-weight:500!important}
.result-screen-active .liunian-table #liunian-years td{font-size:10px!important;font-weight:500!important}
@media(max-width:360px){
  .result-screen-active .dayun-table th{width:34px!important;font-size:11px!important;font-weight:500!important}
  .result-screen-active .liunian-table th{width:34px!important;font-size:11px!important;font-weight:500!important}
  .result-screen-active .dayun-table td{font-size:11px!important;font-weight:500!important}
  .result-screen-active .dayun-table #dayun-ganzhi td{font-size:13px!important;font-weight:500!important}
  .result-screen-active .liunian-table td{font-size:11px!important;font-weight:500!important}
  .result-screen-active .liunian-table #liunian-ganzhi td{font-size:13px!important;font-weight:500!important}
  .result-screen-active .dayun-table #dayun-ages td{font-size:10px!important}
  .result-screen-active .liunian-table #liunian-ages td{font-size:10px!important}
  .result-screen-active .dayun-table #dayun-years td{font-size:9px!important;font-weight:500!important}
  .result-screen-active .liunian-table #liunian-years td{font-size:9px!important;font-weight:500!important}
}
.result-screen-active .result-more-sheet{position:fixed;z-index:1000;inset:0;display:grid;align-items:end}
.result-screen-active .result-more-sheet[hidden]{display:none!important}
.result-screen-active .result-more-backdrop{position:absolute;inset:0;border:0;border-radius:0;background:rgba(35,22,18,.42);opacity:0;transition:opacity .18s ease}
.result-screen-active .result-more-panel{position:relative;z-index:1;width:100%;max-height:min(78dvh,660px);overflow:auto;border-radius:18px 18px 0 0;background:#fffdf8;box-shadow:0 -10px 35px rgba(50,25,18,.2);transform:translateY(24px);opacity:0;transition:transform .18s ease,opacity .18s ease}
.result-screen-active .result-more-sheet.open .result-more-backdrop{opacity:1}
.result-screen-active .result-more-sheet.open .result-more-panel{transform:translateY(0);opacity:1}
.result-screen-active .result-more-panel>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:9px 15px;border-bottom:1px solid #ded2c7;background:rgba(255,253,248,.96)}
.result-screen-active .result-more-panel header small{color:#9a8880;font-size:11px}
.result-screen-active .result-more-panel header h3{margin:1px 0 0;color:#6f2020;font-size:20px}
.result-screen-active .result-more-panel header button{width:36px;height:36px;padding:0;border:1px solid #d8c9bd;border-radius:50%;color:#6f2020;background:#fff;font-size:24px}
.result-screen-active .result-more-content{display:grid;gap:10px;padding:12px 14px calc(16px + env(safe-area-inset-bottom,0px))}
.result-screen-active .result-more-group{padding:12px;border:1px solid #e1d6cb;border-radius:12px;background:#fff}
.result-screen-active .result-more-group h4{margin:0 0 9px;color:#8b7770;font-size:12px}
.result-screen-active .result-more-view-mode{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.result-screen-active .result-more-view-mode>span{display:none}
.result-screen-active .result-more-view-mode button{min-height:40px;border:1px solid #d8c9bd;border-radius:9px;color:#604c45;background:#fffaf2;font-weight:800}
.result-screen-active .result-more-view-mode button.active{color:#fff;border-color:#9b2f2f;background:#9b2f2f}
.result-screen-active .result-more-actions>button,.result-screen-active .result-more-actions summary{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 2px;border:0;border-bottom:1px solid #eee4dc;color:#33251f;background:transparent;font-size:15px;font-weight:800;text-align:left;list-style:none}
.result-screen-active .result-more-actions summary::-webkit-details-marker{display:none}
.result-screen-active .result-more-actions>button span,.result-screen-active .result-more-actions summary span{color:#998981;font-size:11px;font-weight:500}
.result-screen-active .chart-basis-content{padding:10px 0 0}
.result-screen-active .result-user-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.result-screen-active .result-user-row span{min-width:0;overflow:hidden;color:#33251f;font-size:15px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.result-screen-active .result-user-row button,.result-screen-active .result-logout{min-height:38px;padding:0 12px;border:1px solid #d8c9bd;border-radius:8px;background:#fffaf2;color:#6f2020;font-weight:800}
.result-screen-active .result-logout{width:100%;margin-top:10px;color:#a12424;background:#fff7f3}
.result-screen-active .yizhang-sheet{position:fixed;z-index:1001;inset:0;display:grid;place-items:center;padding:16px}
.result-screen-active .yizhang-sheet[hidden]{display:none!important}
.result-screen-active .yizhang-backdrop{position:absolute;inset:0;border:0;border-radius:0;background:rgba(35,22,18,.42);opacity:0;transition:opacity .18s ease}
.result-screen-active .yizhang-panel{position:relative;z-index:1;width:min(326px,calc(100vw - 46px));height:min(326px,calc(100vw - 46px),calc(100dvh - 32px));overflow:hidden;border:1px solid #d8c9bd;border-radius:8px;background:#fffdf8;box-shadow:0 18px 44px rgba(50,25,18,.24);font-family:"QimenBoardSC",sans-serif;font-synthesis:none;transform:translateY(8px) scale(.98);opacity:0;transition:transform .18s ease,opacity .18s ease}
.result-screen-active .yizhang-sheet.open .yizhang-backdrop{opacity:1}
.result-screen-active .yizhang-sheet.open .yizhang-panel{transform:translateY(0);opacity:1}
.result-screen-active .yizhang-header{display:grid;grid-template-columns:36px minmax(0,1fr) 36px;align-items:center;height:46px;padding:5px 8px;border-bottom:1px solid #e2d7ce;background:#fffdf8}
.result-screen-active .yizhang-header h3{grid-column:2;margin:0;color:#4b352f;font-family:"QimenBoardSC",sans-serif;font-size:21px;line-height:1;text-align:center}
.result-screen-active .yizhang-header button{grid-column:3;width:30px;height:30px;padding:0;border:1px solid #d8c9bd;border-radius:50%;color:#6f2020;background:#fff;font-size:21px;line-height:1}
.result-screen-active .yizhang-content{display:grid;grid-template-rows:22px auto minmax(0,1fr);gap:4px;height:calc(100% - 46px);padding:8px 11px 11px}
.result-screen-active .yizhang-meta{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;color:#806f68;font-size:12px;line-height:1;white-space:nowrap}
.result-screen-active .yizhang-meta strong{max-width:110px;overflow:hidden;color:#4b352f;font-size:13px;text-overflow:ellipsis}
.result-screen-active .yizhang-meta span+span{padding-left:7px;border-left:1px solid #d9ccc2}
.result-screen-active .yizhang-dates{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:2px 9px;margin:0;color:#8d7d75;font-size:11px;line-height:1.25;text-align:center}
.result-screen-active .yizhang-layout{display:grid;grid-template-columns:50px repeat(3,minmax(0,1fr));grid-template-rows:14px 58px 14px 58px;gap:5px 6px;align-content:center;min-height:0}
.result-screen-active .yizhang-layout>small{align-self:center;color:#a08f87;font-size:10px;line-height:1;text-align:center}
.result-screen-active .yizhang-pre-label{grid-column:2/5;grid-row:1}
.result-screen-active .yizhang-post-label{grid-column:2/5;grid-row:3}
.result-screen-active .yizhang-branch{display:grid;place-items:center;align-self:center;justify-self:center;width:58px;height:58px;border:1px solid #e1d7ce;border-radius:6px;color:#302824;background:#f1ece6;font-family:"QimenBoardSC",sans-serif;font-size:20px;font-weight:400;line-height:1}
.result-screen-active .yizhang-pre-1{grid-column:2;grid-row:2}.result-screen-active .yizhang-pre-2{grid-column:3;grid-row:2}.result-screen-active .yizhang-pre-3{grid-column:4;grid-row:2}
.result-screen-active .yizhang-post-1{grid-column:2;grid-row:4}.result-screen-active .yizhang-post-2{grid-column:3;grid-row:4}.result-screen-active .yizhang-post-3{grid-column:4;grid-row:4}
.result-screen-active .yizhang-flow{grid-column:1;grid-row:2/5;display:grid;align-content:center;justify-items:center;gap:5px}
.result-screen-active .yizhang-flow small{color:#9b2f2f;font-size:10px;line-height:1}
.result-screen-active .yizhang-flow .yizhang-branch{width:50px;height:58px;color:#7d2424;background:#f5ebe7}
@media(max-width:370px){
.result-screen-active .result-topbar{grid-template-columns:72px minmax(0,1fr) 72px}
.result-screen-active .result-topbar h2{font-size:19px}
.result-screen-active .result-top-action{min-width:56px;padding-inline:7px;font-size:16px}
.result-screen-active .result-header>.chart-navigation button{font-size:14px}
.result-screen-active .result-date-row .result-meta-value{font-size:15px}
.result-screen-active .result-time-row .result-meta-value{font-size:15px!important}
.result-screen-active .result-time-row .date-prefix{font-size:17px!important}
.result-screen-active .chart-summary-main small,.result-screen-active .chart-summary-main strong{font-size:15px}
.result-screen-active .board-wrap{grid-template-columns:minmax(23px,1fr) minmax(0,314px) minmax(23px,1fr);grid-template-rows:30px 314px 30px;height:374px}
.result-screen-active .board-wrap .board{width:314px;height:314px}
.result-screen-active .board-wrap .outer-top,.result-screen-active .board-wrap .outer-bottom{width:314px;height:30px}
.result-screen-active .board-wrap .outer-left,.result-screen-active .board-wrap .outer-right{height:314px}
.result-screen-active .board-wrap .palace-god{font-size:17px}
.result-screen-active .board-wrap .star-door strong{font-size:17px}
.result-screen-active .board-wrap .star-door .door,.result-screen-active .board-wrap .stem{font-size:17px}
.result-screen-active .result-status-tools{gap:5px;padding-inline:5px}
.result-screen-active .result-status-badges{gap:5px}
.result-screen-active .result-status-badge{flex:1 1 0;min-width:0;padding-inline:3px;font-size:12px}
.result-screen-active .result-changsheng-toggle{gap:4px;padding-inline:6px;font-size:12px}
.result-screen-active .result-toggle-track{width:20px}
}
@media(min-width:700px){body.result-screen-active .result-view{max-width:560px;margin:0 auto;border-right:1px solid #ded2c7;border-left:1px solid #ded2c7}.result-screen-active .result-more-panel{max-width:560px;margin:0 auto}}

/* Formal result specificity fixes */
body.result-screen-active .result-view .result-header{display:block!important;grid-template-columns:none!important;gap:0!important}
body.result-screen-active .result-view .result-header>.chart-navigation{grid-column:1/-1!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;width:100%!important;height:34px!important;margin:0!important;padding:2px 5px!important;border:0!important;border-bottom:1px solid #c7aa74!important;border-radius:0!important;background:#9b2f2f!important}
body.result-screen-active .result-view .result-header>.chart-navigation button{grid-area:auto!important;min-width:0!important;min-height:0!important;height:30px!important;padding:0 2px!important;border:1px solid #e2cfa5!important;border-radius:7px!important;color:#33251f!important;background:#ffffe0!important;box-shadow:none!important;font-size:16px!important;font-weight:400!important;line-height:1!important;white-space:nowrap!important}
body.result-screen-active .result-view .result-header>.chart-navigation button.now{color:#9b2f2f!important;border-color:#d0ad67!important;background:#fffff0!important}
@media(max-width:370px){body.result-screen-active .result-view .result-header>.chart-navigation button{font-size:14px!important}}


/* Result board cleanup and changsheng control refinement */
.result-screen-active .board-wrap .palace{padding-bottom:5px}
.result-screen-active .result-changsheng-toggle{
  height:31px;
  gap:3px;
  padding:0 3px;
  border:1px solid #d3b07e;
  border-radius:999px;
  color:#6f2020;
  background:linear-gradient(180deg,#fffdf7 0%,#f8ead7 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 1px 4px rgba(89,51,32,.12);
  font-size:13px;
  font-weight:900;
  letter-spacing:.04em;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.result-screen-active .result-changsheng-toggle:active{transform:scale(.98)}
.result-screen-active .result-changsheng-toggle:focus-visible{outline:2px solid rgba(155,47,47,.35);outline-offset:2px}
.result-screen-active .result-toggle-track{
  width:22px;
  height:14px;
  border:1px solid rgba(111,82,65,.18);
  background:#ded1c6;
  box-shadow:inset 0 1px 3px rgba(75,51,38,.16);
}
.result-screen-active .result-toggle-track::after{
  left:2px;
  top:2px;
  width:10px;
  height:10px;
  border:1px solid rgba(148,106,67,.2);
  background:#fffdf8;
  box-shadow:0 1px 4px rgba(59,36,24,.28);
}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"]{
  border-color:#9b2f2f;
  color:#8f2424;
  background:linear-gradient(180deg,#fff8f2 0%,#f4dfd7 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 2px 6px rgba(111,32,32,.16);
}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track{background:linear-gradient(180deg,#b84040 0%,#8f2424 100%);border-color:#7d1f1f}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}
@media(max-width:370px){
  .result-screen-active .result-changsheng-toggle{height:24px;gap:5px;padding:0 5px 0 8px;font-size:12px}
  .result-screen-active .result-toggle-track{width:20px;height:14px}
  .result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(6px)}
}

/* Formal result pillar colors: heavenly stems / earthly branches */
.result-screen-active #pillars strong>span:first-child{color:#8f2433!important}
.result-screen-active #pillars strong>span:last-child{color:#245a9b!important}


/* Formal result outer-ring collision fix */
.result-screen-active .board-wrap .outer-top,
.result-screen-active .board-wrap .outer-bottom,
.result-screen-active .board-wrap .outer-left,
.result-screen-active .board-wrap .outer-right{padding:0!important;overflow:visible}
.result-screen-active .board-wrap .outer-slot{gap:0;min-width:0;min-height:0;line-height:1}
.result-screen-active .board-wrap .outer-top .outer-slot,
.result-screen-active .board-wrap .outer-bottom .outer-slot{display:grid!important;grid-template-columns:auto auto;grid-template-rows:1fr;align-items:center;justify-items:center;justify-content:center;gap:2px;height:100%;padding:0}
.result-screen-active .board-wrap .outer-top .outer-branch{grid-column:1;grid-row:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-top .outer-hidden{grid-column:2;grid-row:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-bottom .outer-hidden{grid-column:2;grid-row:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-bottom .outer-branch{grid-column:1;grid-row:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-left .outer-slot,
.result-screen-active .board-wrap .outer-right .outer-slot{display:grid!important;grid-template-rows:auto auto;grid-template-columns:1fr;align-items:center;justify-items:center;align-content:center;gap:2px;width:100%;height:100%;padding:0}
.result-screen-active .board-wrap .outer-left .outer-branch,
.result-screen-active .board-wrap .outer-right .outer-branch{writing-mode:vertical-rl;text-orientation:upright;letter-spacing:0;line-height:1}
.result-screen-active .board-wrap .outer-left .outer-hidden,
.result-screen-active .board-wrap .outer-right .outer-hidden{writing-mode:horizontal-tb!important;text-orientation:mixed;letter-spacing:0;line-height:1}
.result-screen-active .board-wrap .outer-left .outer-branch{grid-row:2;grid-column:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-left .outer-hidden{grid-row:1;grid-column:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-right .outer-hidden{grid-row:1;grid-column:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-right .outer-branch{grid-row:2;grid-column:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-branch{font-size:15px!important}
.result-screen-active .board-wrap .outer-hidden,
.result-screen-active .board-wrap .outer-hidden.empty{font-size:15px!important}

.result-screen-active .board-wrap .outer-left{padding-left:2px!important}
.result-screen-active .board-wrap .outer-right{padding-right:2px!important}

/* Left/Right: hidden stem on top (row 1), branch on bottom (row 2), centered */
.result-screen-active .board-wrap .outer-left .outer-hidden,
.result-screen-active .board-wrap .outer-right .outer-hidden{grid-row:1;grid-column:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-left .outer-branch,
.result-screen-active .board-wrap .outer-right .outer-branch{grid-row:2;grid-column:1;justify-self:center;align-self:center;transform:none}
/* centered layout - transform removed */
/* centered layout - transform removed */


/* Formal result board enlargement - 2026-08-06 */
.result-screen-active .board-wrap{
  --formal-board-size:clamp(304px,calc(100vw - 64px),359px);
  --formal-board-height:var(--formal-board-size);
  grid-template-columns:minmax(32px,1fr) minmax(0,var(--formal-board-size)) minmax(32px,1fr);
  grid-template-rows:32px var(--formal-board-height) 32px;
  height:calc(var(--formal-board-height) + 64px);
}
.result-screen-active .board-wrap .board{width:var(--formal-board-size);height:var(--formal-board-height)}
.result-screen-active .board-wrap .outer-top,
.result-screen-active .board-wrap .outer-bottom{width:var(--formal-board-size);height:32px}
.result-screen-active .board-wrap .outer-left,
.result-screen-active .board-wrap .outer-right{height:var(--formal-board-height)}
@media(max-width:370px){
  .result-screen-active .board-wrap{
    --formal-board-size:min(304px,calc(100vw - 60px));
    --formal-board-height:var(--formal-board-size);
    grid-template-columns:minmax(30px,1fr) minmax(0,var(--formal-board-size)) minmax(30px,1fr);
    grid-template-rows:30px var(--formal-board-height) 30px;
    height:calc(var(--formal-board-height) + 60px);
  }
  .result-screen-active .board-wrap .outer-top,
  .result-screen-active .board-wrap .outer-bottom{height:30px}
}

/* Preserve edge clearance after board enlargement */
.result-screen-active .board-wrap .outer-left .outer-branch,
.result-screen-active .board-wrap .outer-right .outer-branch{transform:none}


/* Formal result outer-branch toggle - 2026-08-06 */
.result-screen-active:not(.show-outer-branches) .board-wrap .outer-branch{visibility:hidden}
.result-screen-active .result-display-toggles{display:flex;align-items:center;gap:5px;flex:1 1 0}
.result-screen-active .result-display-toggles .result-changsheng-toggle{flex:1 1 0;min-width:0;justify-content:center}
.result-screen-active .result-display-toggles .result-changsheng-toggle>span{white-space:nowrap}
.result-screen-active .result-status-tools{gap:5px;padding-inline:5px}
.result-screen-active .result-status-badges{gap:5px}
.result-screen-active .result-status-badge{flex:1 1 0;min-width:0;padding-inline:4px}
@media(max-width:390px){
  .result-screen-active .result-status-tools{gap:3px;padding-inline:3px}
  .result-screen-active .result-status-badges{gap:3px}
  .result-screen-active .result-status-badge{flex:1 1 0;min-width:0;padding-inline:2px;font-size:11px}
  .result-screen-active .result-display-toggles{gap:3px}
  .result-screen-active .result-display-toggles .result-changsheng-toggle{flex:1 1 0;min-width:0;gap:2px;padding-inline:3px;font-size:11px}
  .result-screen-active .result-display-toggles .result-toggle-track{width:18px}
}


/* Formal result effect status buttons - 2026-08-06 */
.result-screen-active .result-status-badge{
  border:0;
  font-family:inherit;
  cursor:pointer;
}
.result-screen-active .result-status-badge:disabled{
  color:#fff;
  background:#b9b9b9!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28);
  cursor:default;
  opacity:1;
}
.result-screen-active .result-status-badge[aria-pressed="true"]{
  outline:2px solid #6f2020;
  outline-offset:1px;
}
.result-screen-active .result-status-badge:not(:disabled):active{transform:translateY(1px)}
.result-screen-active .palace.effect-filter-match{
  z-index:3;
  outline:3px solid #9b2f2f;
  outline-offset:-3px;
  box-shadow:inset 0 0 0 2px rgba(155,47,47,.35),0 0 0 2px rgba(155,47,47,.18);
}
.result-screen-active .palace.effect-filter-dimmed{opacity:.45}


/* 输入页类型菜单与事项输入：米白／枣红统一样式 */
.home-category-control { position: relative; }
.home-category-control .home-choice-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.home-category-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.home-category-trigger:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--red-dark);
}
.home-category-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: -4px 3px 0 0;
  border-right: 1.5px solid #9f8c83;
  border-bottom: 1.5px solid #9f8c83;
  transform: rotate(45deg);
  transition: transform .12s ease;
}
.home-category-trigger[aria-expanded="true"] .home-category-chevron { transform: rotate(225deg); }
.home-category-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  width: min(240px, calc(100vw - 116px));
  max-height: min(60vh, 320px);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid rgba(157, 55, 42, .18);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(73, 52, 45, .16);
}
.home-category-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.home-category-option:hover,
.home-category-option:focus-visible { background: rgba(157, 55, 42, .07); outline: 0; }
.home-category-option[aria-selected="true"] {
  background: rgba(157, 55, 42, .12);
  color: var(--red-dark);
  font-weight: 800;
}
.question-field:focus-within { background: rgba(157, 55, 42, .025); }
.home-question-input {
  cursor: text;
  caret-color: var(--red);
}
.home-question-input:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--ink);
}
@media screen and (max-width: 390px) {
  .home-category-menu { width: min(224px, calc(100vw - 104px)); }
}

/* Keep the account menu above cards without making the whole title bar cover them. */
.app-topbar { z-index: auto; overflow: visible; }
.app-topbar .account-bar { z-index: 31; }
.app-topbar .account-menu { z-index: 32; }

/* Day stem palace highlight - 2026-08-09 */
.palace.day-stem-highlight,
.palace.hour-stem-highlight { background: rgba(198,166,91,.12) !important; box-shadow: inset 0 0 0 2px var(--gold) !important; }
.palace.day-stem-highlight.selected-palace,
.palace.hour-stem-highlight.selected-palace { background: #fff4d7 !important; }

/* Odometer time display - 2026-08-09 */
.odo-time-display{margin:2px 0;padding:0 0 calc(24px + env(safe-area-inset-bottom,0px));display:none;}
.odo-wrap{background:linear-gradient(135deg,#fffdf7,#f8f1e5);border-radius:8px;padding:6px 2px;border:1px solid #d8cbbb;box-shadow:0 2px 10px rgba(58,34,23,0.08),inset 0 1px 3px rgba(198,166,91,0.12);}
.odo-row{display:flex;align-items:flex-end;justify-content:center;gap:0;flex-wrap:nowrap;overflow:hidden;}
.odo-window{position:relative;width:20px;height:30px;overflow:hidden;background:#fffdf7;border:1px solid #d8cbbb;border-radius:2px;box-shadow:inset 0 1px 2px rgba(118,105,99,0.15);flex-shrink:0;}
.odo-strip{position:absolute;top:0;left:0;width:100%;transition:none;will-change:auto;}
.odo-digit{height:30px;line-height:30px;text-align:center;font-family:"Arial Black","Arial",sans-serif;font-size:20px;font-weight:900;color:#241a17;}
.odo-sep{height:30px;line-height:30px;font-size:15px;color:var(--gold);font-weight:700;padding:0 1px;display:flex;align-items:center;flex-shrink:0;}
.odo-sep.active{color:var(--red);}
.odo-label{height:30px;line-height:30px;font-size:12px;color:var(--muted);font-weight:700;padding:0 1px;display:flex;align-items:center;flex-shrink:0;}
.odo-tag{height:30px;line-height:30px;font-size:15px;color:var(--red);font-weight:800;padding:0 3px;display:flex;align-items:center;flex-shrink:0;}
.odo-info{display:flex;justify-content:center;gap:8px;margin-top:4px;font-size:11px;color:var(--muted);letter-spacing:1px;}
.odo-btn{display:block;width:85%;margin:10px auto 0;padding:10px;font-size:18px;font-weight:700;color:#fff;background:var(--red);border:none;border-radius:10px;text-align:center;cursor:pointer;}
.odo-btn.active{background:#702020;}
.result-screen-active .odo-time-display{display:block;}
/* Odometer effect toggle */
.odo-effect-toggle{display:flex;gap:0;margin-bottom:6px;border:1px solid #d8cbbb;border-radius:8px;overflow:hidden;}
.odo-effect-btn{flex:1;padding:6px 0;font-size:13px;font-weight:700;color:var(--muted);background:transparent;border:none;cursor:pointer;}
.odo-effect-btn.active{color:#fff;background:var(--red);}
/* Board spinning effect during odometer scroll */
.board.odo-spinning{animation:odo-board-spin 0.5s linear infinite;}
@keyframes odo-board-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}
/* Outer 8 palaces clockwise shift during odometer scroll */
.board.odo-spinning>.palace:nth-child(1){animation:odo-cw-right .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(2){animation:odo-cw-right .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(3){animation:odo-cw-down .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(4){animation:odo-cw-up .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(6){animation:odo-cw-down .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(7){animation:odo-cw-up .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(8){animation:odo-cw-left .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(9){animation:odo-cw-left .2s linear infinite;}
@keyframes odo-cw-right{from{transform:translateX(0);}to{transform:translateX(100%);}}
@keyframes odo-cw-left{from{transform:translateX(0);}to{transform:translateX(-100%);}}
@keyframes odo-cw-down{from{transform:translateY(0);}to{transform:translateY(100%);}}
@keyframes odo-cw-up{from{transform:translateY(0);}to{transform:translateY(-100%);}}
/* Outer 8 palaces shift effect (no whole-board rotation) */
.board.odo-shifting>.palace:nth-child(1){animation:odo-cw-right .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(2){animation:odo-cw-right .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(3){animation:odo-cw-down .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(4){animation:odo-cw-up .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(6){animation:odo-cw-down .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(7){animation:odo-cw-up .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(8){animation:odo-cw-left .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(9){animation:odo-cw-left .2s linear infinite;}

/* Merged preview input time card: compact, calm and easier to scan. */
.current-time-card.time-info .current-beijing-clock{color:#49352f}
.current-time-card.time-info .current-four-pillars{display:flex;justify-content:space-between;gap:6px;padding:8px 12px 10px;border-top:0;background:transparent}
.current-time-card.time-info .current-pillar{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;padding:4px 0;border-radius:8px;background:rgba(113,80,46,.06)}
.current-time-card.time-info .current-pillar+.current-pillar::before{display:none}
.current-time-card.time-info .current-pillar strong{display:flex;flex-direction:column;align-items:center;gap:1px;color:#9a8880;font-family:inherit;font-size:12px;font-weight:600;line-height:1.2;letter-spacing:0}
.current-time-card.time-info .current-pillar strong span,.current-time-card.time-info .five-element-wood,.current-time-card.time-info .five-element-fire,.current-time-card.time-info .five-element-earth,.current-time-card.time-info .five-element-metal,.current-time-card.time-info .five-element-water,.current-time-card.time-info .five-element-default{color:#9a8880}

/* Merged preview touch feedback. */
.quick-chart-card .start-chart,.chart-type-switch button,.datetime-mode-tab,.palace-detail-tab:not(:disabled),.sheet-action,.bazi-pillar-tab,.bazi-search,.download-btn,.account-menu-item,.account-menu-logout,.account-menu-toggle,.admin-close,.almanac-use-time,.app-nav-item,.auth-submit,.back-to-input,.datetime-trigger,.door-press,.home-category-trigger,.odo-btn,.odo-effect-btn,.open-case-records,.palace-sheet-close,.palace-sheet-grabber,.pwa-install-button,.pwa-install-dismiss,.reset-chart,.result-branch-toggle,.result-changsheng-toggle,.result-logout,.result-save,.result-top-action,.view-mode-button,.current-time-card{transition:transform .12s ease}
.quick-chart-card .start-chart:active,.chart-type-switch button:active,.datetime-mode-tab:active,.palace-detail-tab:not(:disabled):active,.sheet-action:active,.bazi-pillar-tab:active,.bazi-search:active,.download-btn:active,.account-menu-item:active,.account-menu-logout:active,.account-menu-toggle:active,.admin-close:active,.almanac-use-time:active,.app-nav-item:active,.auth-submit:active,.back-to-input:active,.datetime-trigger:active,.door-press:active,.home-category-trigger:active,.odo-btn:active,.odo-effect-btn:active,.open-case-records:active,.palace-sheet-close:active,.palace-sheet-grabber:active,.pwa-install-button:active,.pwa-install-dismiss:active,.reset-chart:active,.result-branch-toggle:active,.result-changsheng-toggle:active,.result-logout:active,.result-save:active,.result-top-action:active,.view-mode-button:active,.current-time-card:active{transform:scale(.94)}
/* Mobile input form: reclaim vertical space without shrinking touch targets. */
@media (max-width:700px){
  .input-view .home-field-row:not(.chart-time-row){min-height:54px}
  .input-view .quick-chart-card .start-chart{margin-top:8px}

  /* Keep time and random chart entry containers on the same vertical rhythm. */
  #chart-entry-content[data-chart-type="时盘"],
  #chart-entry-content[data-chart-type="随机盘"]{
    display:block;
    gap:0;
    padding-top:0!important;
  }
}

/* Day stem palace highlight - 2026-08-09 */
.palace.day-stem-highlight,
.palace.hour-stem-highlight { background: rgba(198,166,91,.12) !important; box-shadow: inset 0 0 0 2px var(--gold) !important; }
.palace.day-stem-highlight.selected-palace,
.palace.hour-stem-highlight.selected-palace { background: #fff4d7 !important; }

/* Odometer time display - 2026-08-09 */
.odo-time-display{margin:2px 0;padding:0 0 calc(24px + env(safe-area-inset-bottom,0px));display:none;}
.odo-wrap{background:linear-gradient(135deg,#fffdf7,#f8f1e5);border-radius:8px;padding:6px 2px;border:1px solid #d8cbbb;box-shadow:0 2px 10px rgba(58,34,23,0.08),inset 0 1px 3px rgba(198,166,91,0.12);}
.odo-row{display:flex;align-items:flex-end;justify-content:center;gap:0;flex-wrap:nowrap;overflow:hidden;}
.odo-window{position:relative;width:20px;height:30px;overflow:hidden;background:#fffdf7;border:1px solid #d8cbbb;border-radius:2px;box-shadow:inset 0 1px 2px rgba(118,105,99,0.15);flex-shrink:0;}
.odo-strip{position:absolute;top:0;left:0;width:100%;transition:none;will-change:auto;}
.odo-digit{height:30px;line-height:30px;text-align:center;font-family:"Arial Black","Arial",sans-serif;font-size:20px;font-weight:900;color:#241a17;}
.odo-sep{height:30px;line-height:30px;font-size:15px;color:var(--gold);font-weight:700;padding:0 1px;display:flex;align-items:center;flex-shrink:0;}
.odo-sep.active{color:var(--red);}
.odo-label{height:30px;line-height:30px;font-size:12px;color:var(--muted);font-weight:700;padding:0 1px;display:flex;align-items:center;flex-shrink:0;}
.odo-tag{height:30px;line-height:30px;font-size:15px;color:var(--red);font-weight:800;padding:0 3px;display:flex;align-items:center;flex-shrink:0;}
.odo-info{display:flex;justify-content:center;gap:8px;margin-top:4px;font-size:11px;color:var(--muted);letter-spacing:1px;}
.odo-btn{display:block;width:85%;margin:10px auto 0;padding:10px;font-size:18px;font-weight:700;color:#fff;background:var(--red);border:none;border-radius:10px;text-align:center;cursor:pointer;}
.odo-btn.active{background:#702020;}
.result-screen-active .odo-time-display{display:block;}
/* Odometer effect toggle */
.odo-effect-toggle{display:flex;gap:0;margin-bottom:6px;border:1px solid #d8cbbb;border-radius:8px;overflow:hidden;}
.odo-effect-btn{flex:1;padding:6px 0;font-size:13px;font-weight:700;color:var(--muted);background:transparent;border:none;cursor:pointer;}
.odo-effect-btn.active{color:#fff;background:var(--red);}
/* Board spinning effect during odometer scroll */
.board.odo-spinning{animation:odo-board-spin 0.5s linear infinite;}
@keyframes odo-board-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}
/* Outer 8 palaces clockwise shift during odometer scroll */
.board.odo-spinning>.palace:nth-child(1){animation:odo-cw-right .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(2){animation:odo-cw-right .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(3){animation:odo-cw-down .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(4){animation:odo-cw-up .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(6){animation:odo-cw-down .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(7){animation:odo-cw-up .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(8){animation:odo-cw-left .2s linear infinite;}
.board.odo-spinning>.palace:nth-child(9){animation:odo-cw-left .2s linear infinite;}
@keyframes odo-cw-right{from{transform:translateX(0);}to{transform:translateX(100%);}}
@keyframes odo-cw-left{from{transform:translateX(0);}to{transform:translateX(-100%);}}
@keyframes odo-cw-down{from{transform:translateY(0);}to{transform:translateY(100%);}}
@keyframes odo-cw-up{from{transform:translateY(0);}to{transform:translateY(-100%);}}
/* Outer 8 palaces shift effect (no whole-board rotation) */
.board.odo-shifting>.palace:nth-child(1){animation:odo-cw-right .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(2){animation:odo-cw-right .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(3){animation:odo-cw-down .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(4){animation:odo-cw-up .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(6){animation:odo-cw-down .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(7){animation:odo-cw-up .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(8){animation:odo-cw-left .2s linear infinite;}
.board.odo-shifting>.palace:nth-child(9){animation:odo-cw-left .2s linear infinite;}

/* === August 9 modifications === */

/* Palace alignment - remove translateY for result screen */
.result-screen-active .palace-head, .result-screen-active .palace-core { transform:none; }
.result-screen-active .celestial-layer { transform:translateY(-8px); }
.result-screen-active .star-door strong { transform:translateY(-8px); }
.result-screen-active .celestial-layer .stem-stack { grid-template-rows:10px auto; }
.result-screen-active .celestial-layer .changsheng-state { line-height:10px; }

/* Fortune-inline: hide when empty */
.result-screen-active .fortune-inline:empty { display:none; }

/* Hidden stem position - bottom outer: horizontal layout (hidden left, branch right) */
.result-screen-active .board-wrap .outer-bottom .outer-slot{grid-template-columns:auto auto;grid-template-rows:1fr;justify-content:center;gap:2px}
.result-screen-active .board-wrap .outer-bottom .outer-hidden{grid-column:2;grid-row:1;justify-self:center;align-self:center}
.result-screen-active .board-wrap .outer-bottom .outer-branch{grid-column:1;grid-row:1;justify-self:center;align-self:center}

/* Vertical ganzhi for small screens */
@media screen and (max-width:420px) {
  .dayun-table #dayun-ganzhi td, .liunian-table #liunian-ganzhi td { writing-mode:vertical-rl; text-orientation:upright; letter-spacing:0; padding:2px 0!important; line-height:1; }
}

/* Font unification v2 - result screen: sans-serif + reduced font-weight */
body.result-screen-active .result-topbar h2,
body.result-screen-active .result-top-action,
body.result-screen-active .chart-navigation button,
body.result-screen-active .result-meta-label,
body.result-screen-active .result-meta-value,
body.result-screen-active .date-prefix,
body.result-screen-active .result-ju-row>strong,
body.result-screen-active .chart-summary-main small,
body.result-screen-active .chart-summary-main strong,
body.result-screen-active .pillars strong,
body.result-screen-active .direction-label,
body.result-screen-active .outer-ring,
body.result-screen-active .result-status-badge,
body.result-screen-active .result-changsheng-toggle,
body.result-screen-active .result-bottom-tools button,
body.result-screen-active .dayun-table th,
body.result-screen-active .dayun-table td,
body.result-screen-active .dayun-table #dayun-ganzhi td,
body.result-screen-active .liunian-table th,
body.result-screen-active .liunian-table td,
body.result-screen-active .liunian-table #liunian-ganzhi td,
body.result-screen-active .odo-time-display{
    font-family:"Noto Sans SC","Microsoft YaHei","PingFang SC",sans-serif!important;
}
/* font-weight 700 - 干支、四柱、方向标签、状态徽章 */
body.result-screen-active .pillars strong,
body.result-screen-active .direction-label,
body.result-screen-active .result-status-badge,
body.result-screen-active .dayun-table #dayun-ganzhi td,
body.result-screen-active .liunian-table #liunian-ganzhi td{
    font-weight:700!important;
}
/* font-weight 600 - 表格、元数据、摘要、标题、按钮 */
body.result-screen-active .result-topbar h2,
body.result-screen-active .result-top-action,
body.result-screen-active .chart-navigation button,
body.result-screen-active .result-meta-label,
body.result-screen-active .result-meta-value,
body.result-screen-active .date-prefix,
body.result-screen-active .result-ju-row>strong,
body.result-screen-active .chart-summary-main small,
body.result-screen-active .chart-summary-main strong,
body.result-screen-active .outer-ring,
body.result-screen-active .result-changsheng-toggle,
body.result-screen-active .result-bottom-tools button,
body.result-screen-active .dayun-table th,
body.result-screen-active .dayun-table td,
body.result-screen-active .liunian-table th,
body.result-screen-active .liunian-table td{
    font-weight:500!important;
}
body.result-screen-active .dayun-table #dayun-ganzhi td,
body.result-screen-active .liunian-table #liunian-ganzhi td{
    font-weight:500!important;
}

body.result-screen-active .result-time-cell .result-meta-value,
body.result-screen-active .date-prefix{
    font-weight:500!important;
}

body.result-screen-active .pillars strong{
    font-weight:500!important;
}

/* Outer ring branch & hidden stem font-weight 400 - 2026-08-09 */
body.result-screen-active .board-wrap .outer-branch,
body.result-screen-active .board-wrap .outer-hidden,
body.result-screen-active .board-wrap .outer-hidden.empty{
    font-weight:400!important;
}

/* Dayun/Liunian ganzhi color to black - 2026-08-09 */
body.result-screen-active .dayun-table #dayun-ganzhi td,
body.result-screen-active .liunian-table #liunian-ganzhi td{color:#000!important}

/* Merged preview input time card: compact, calm and easier to scan. */
.current-time-card.time-info .current-beijing-clock{color:#49352f}
.current-time-card.time-info .current-four-pillars{display:flex;justify-content:space-between;gap:6px;padding:8px 12px 10px;border-top:0;background:transparent}
.current-time-card.time-info .current-pillar{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;padding:4px 0;border-radius:8px;background:rgba(113,80,46,.06)}
.current-time-card.time-info .current-pillar+.current-pillar::before{display:none}
.current-time-card.time-info .current-pillar strong{display:flex;flex-direction:column;align-items:center;gap:1px;color:#9a8880;font-family:inherit;font-size:12px;font-weight:600;line-height:1.2;letter-spacing:0}
.current-time-card.time-info .current-pillar strong span,.current-time-card.time-info .five-element-wood,.current-time-card.time-info .five-element-fire,.current-time-card.time-info .five-element-earth,.current-time-card.time-info .five-element-metal,.current-time-card.time-info .five-element-water,.current-time-card.time-info .five-element-default{color:#9a8880}

/* Merged preview touch feedback. */
.quick-chart-card .start-chart,.chart-type-switch button,.datetime-mode-tab,.palace-detail-tab:not(:disabled),.sheet-action,.bazi-pillar-tab,.bazi-search,.download-btn,.account-menu-item,.account-menu-logout,.account-menu-toggle,.admin-close,.almanac-use-time,.app-nav-item,.auth-submit,.back-to-input,.datetime-trigger,.door-press,.home-category-trigger,.odo-btn,.odo-effect-btn,.open-case-records,.palace-sheet-close,.palace-sheet-grabber,.pwa-install-button,.pwa-install-dismiss,.reset-chart,.result-branch-toggle,.result-changsheng-toggle,.result-logout,.result-save,.result-top-action,.view-mode-button,.current-time-card{transition:transform .12s ease}
.quick-chart-card .start-chart:active,.chart-type-switch button:active,.datetime-mode-tab:active,.palace-detail-tab:not(:disabled):active,.sheet-action:active,.bazi-pillar-tab:active,.bazi-search:active,.download-btn:active,.account-menu-item:active,.account-menu-logout:active,.account-menu-toggle:active,.admin-close:active,.almanac-use-time:active,.app-nav-item:active,.auth-submit:active,.back-to-input:active,.datetime-trigger:active,.door-press:active,.home-category-trigger:active,.odo-btn:active,.odo-effect-btn:active,.open-case-records:active,.palace-sheet-close:active,.palace-sheet-grabber:active,.pwa-install-button:active,.pwa-install-dismiss:active,.reset-chart:active,.result-branch-toggle:active,.result-changsheng-toggle:active,.result-logout:active,.result-save:active,.result-top-action:active,.view-mode-button:active,.current-time-card:active{transform:scale(.94)}
.result-screen-active .chart-summary-main span:nth-child(4),.result-screen-active .chart-summary-main span:nth-child(8){justify-content:flex-start;padding-left:8px}

/* Result controls: compact effect selector and clearer display toggles. */
.result-screen-active .odo-time-display{margin:0;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
.result-screen-active .odo-effect-toggle{min-height:34px;margin:0 0 5px;border-radius:8px}

/* Mobile input form: reclaim vertical space without shrinking touch targets. */
@media (max-width:700px){
  .input-view .home-field-row:not(.chart-time-row){min-height:54px}
  .input-view .quick-chart-card .start-chart{margin-top:8px}

  /* Keep time and random chart entry containers on the same vertical rhythm. */
  #chart-entry-content[data-chart-type="时盘"],
  #chart-entry-content[data-chart-type="随机盘"]{
    display:block;
    gap:0;
    padding-top:0!important;
  }
}

/* Keep the result header rows isolated on devices with a safe-area inset. */
body.result-screen-active .result-view .result-header .result-topbar{
  position:relative;
  z-index:2;
  box-sizing:border-box;
  height:auto!important;
  min-height:calc(42px + env(safe-area-inset-top, 0px));
  padding:env(safe-area-inset-top, 0px) 7px 0!important;
  grid-template-rows:42px;
  overflow:hidden;
}
body.result-screen-active .result-view .result-header>.chart-navigation{
  position:relative;
  z-index:1;
  box-sizing:border-box;
  height:34px!important;
  min-height:34px;
  grid-auto-rows:30px;
  align-items:center;
  overflow:hidden;
}
body.result-screen-active .result-view .result-header>.chart-navigation button{
  box-sizing:border-box;
  height:30px!important;
  min-height:30px!important;
  max-height:30px;
  overflow:hidden;
  text-overflow:clip;
}
.result-screen-active .odo-effect-btn{min-height:34px;padding:0 8px;font-size:15px;line-height:1;letter-spacing:.02em}
.result-screen-active .odo-wrap{padding:7px 3px 8px}
.result-screen-active .odo-info{margin-top:3px;line-height:1.25}
.result-screen-active .odo-tag{margin-left:2px;padding-left:5px;border-left:1px solid #d8cbbb;font-size:14px;line-height:26px}
.result-screen-active .odo-btn{min-height:56px;margin:8px auto 0;padding:0;line-height:1}
.result-screen-active .result-changsheng-toggle{min-height:34px;height:34px;gap:5px;padding:0 7px 0 9px}
.result-screen-active .result-toggle-track{width:26px;height:16px}
.result-screen-active .result-toggle-track::after{width:12px;height:12px}
.result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}
@media(max-width:390px){
  .result-screen-active .result-changsheng-toggle{min-height:32px;height:32px;gap:4px;padding:0 6px 0 8px;font-size:15px!important}
  .result-screen-active .result-toggle-track{width:24px;height:16px}
  .result-screen-active .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(8px)}
}

/* Keep effect selection subordinate to the primary start action. */
.result-screen-active .odo-effect-btn.active{color:#8f2424;background:#f4dfd7;box-shadow:inset 0 0 0 1px #b97c77}

/* Restore the compact display toggles and reserve more space for status badges. */
.result-screen-active .result-display-toggles{flex:0 0 auto;gap:4px}
.result-screen-active .result-display-toggles .result-changsheng-toggle{flex:0 0 70px;min-width:70px;min-height:31px;height:31px;justify-content:center;gap:3px;padding:0 3px}
.result-screen-active .result-display-toggles .result-toggle-track{width:22px;height:14px}
.result-screen-active .result-display-toggles .result-toggle-track::after{width:10px;height:10px}
.result-screen-active .result-display-toggles .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}
@media(max-width:390px){
  .result-screen-active .result-display-toggles .result-changsheng-toggle{flex-basis:70px;min-width:70px;min-height:31px;height:31px;gap:3px;padding:0 3px;font-size:15px!important}
  .result-screen-active .result-display-toggles .result-toggle-track{width:22px;height:14px}
  .result-screen-active .result-display-toggles .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(10px)}
}
@media(max-width:370px){
  .result-screen-active .result-display-toggles .result-changsheng-toggle{flex-basis:70px;min-width:70px;min-height:24px;height:24px;gap:5px;padding:0 5px 0 8px;font-size:12px!important}
  .result-screen-active .result-display-toggles .result-toggle-track{width:20px;height:14px}
  .result-screen-active .result-display-toggles .result-changsheng-toggle[aria-pressed="true"] .result-toggle-track::after{transform:translateX(6px)}
}

/* 数字盘：只保留小九宫与显示控制按钮。 */
body.digital-chart-active .result-view{width:min(100%,720px)}
body.digital-chart-active .result-view .chart-meta,
body.digital-chart-active .result-view #result-panel-fortune,
body.digital-chart-active .result-view .odo-time-display,
body.digital-chart-active .result-view .detail-panel-compat,
body.digital-chart-active .result-view #status,
body.digital-chart-active .result-more-sheet{display:none!important}
body.digital-chart-active .result-view .chart{margin-top:0;padding:8px;border-radius:8px}
body.digital-chart-active .result-view .board-wrap{
  --digital-board-size:min(300px,calc(100vw - 82px));
  display:grid;
  grid-template-columns:minmax(36px,1fr) minmax(0,var(--digital-board-size)) minmax(36px,1fr);
  grid-template-rows:28px var(--digital-board-size) 28px;
  width:100%;
  height:calc(var(--digital-board-size) + 56px);
  max-width:620px;
  margin:0 auto;
  overflow:hidden;
}
body.digital-chart-active .result-view .outer-ring{
  display:grid!important;
  position:relative;
  inset:auto;
  transform:none;
  visibility:hidden;
}
body.digital-chart-active .result-view .board-horse{display:none!important}
body.digital-chart-active .result-view .board{
  grid-column:2;
  grid-row:2;
  width:100%;
  height:100%;
  grid-template-rows:repeat(3,minmax(0,1fr));
  grid-auto-rows:minmax(0,1fr);
}
body.digital-chart-active .result-view .palace{min-height:0;padding:0;overflow:hidden;transform:none}
body.digital-chart-active .result-view .palace:hover,
body.digital-chart-active .result-view .palace:focus-visible{background:#fffaf0;outline:2px solid var(--gold)}
body.digital-chart-active .result-view .palace.center{
  position:relative;
  display:block;
  min-height:0;
  padding:0;
  overflow:hidden;
  pointer-events:none;
  background:#faf7f0;
}
body.digital-chart-active .result-view .palace.center .taiji-scene{
  position:absolute;
  left:50%;
  top:50%;
  width:min(64px,70%);
  height:min(64px,70%);
  margin:0;
  transform:translate(-50%,-50%);
}
body.digital-chart-active .result-view .palace.center .taiji-scene::after{
  display:none;
}
body.digital-chart-active .result-view .digital-mini-grid{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));border:0}
body.digital-chart-active .result-view .digital-mini-cell{display:grid;place-items:center;min-width:0;min-height:0;border-right:1px solid rgba(112,54,45,.22);border-bottom:1px solid rgba(112,54,45,.22);font-size:19px;font-weight:500;line-height:1}
body.digital-chart-active .result-view .digital-mini-cell,
body.digital-chart-active .result-view .digital-mini-value{font-family:"QimenBoardSC",sans-serif!important;font-synthesis:none!important}
body.digital-chart-active .result-view .digital-mini-cell-changsheng{color:#a13a35;font-size:11px;font-weight:500;line-height:1;white-space:nowrap}
body.digital-chart-active:not(.show-changsheng) .result-view .digital-mini-cell-changsheng .digital-mini-value{visibility:hidden}
body.digital-chart-active .result-view .digital-mini-cell:nth-child(3n){border-right:0}
body.digital-chart-active .result-view .digital-mini-cell:nth-child(n+7){border-bottom:0}
body.digital-chart-active .result-view .digital-mini-value{display:inline-grid;place-items:center;min-width:1em;min-height:1em}
body.digital-chart-active .result-view .digital-palace-landing .digital-mini-grid{outline:2px solid #a27634;outline-offset:-1px;box-shadow:inset 0 0 0 1px rgba(162,118,52,.18)}
body.digital-chart-active .result-view .result-status-tools{margin-top:9px}
.digital-board-actions{display:none}
body.digital-chart-active .result-view .digital-board-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  width:100%;
  margin:0 0 10px;
}
body.digital-chart-active .result-view .digital-board-actions button{
  min-width:0;
  height:30px;
  padding:0 4px;
  border:1px solid #c7aa74;
  border-radius:7px;
  color:#6f2020;
  background:#fffaf0;
  font-size:14px;
  font-weight:900;
  line-height:1;
}
body.digital-chart-active .result-view .digital-board-actions button.active{
  color:#7b2b2b;
  background:#f3ded7;
  border-color:#c58b84;
  box-shadow:inset 0 0 0 1px rgba(123,43,43,.12);
}
body.digital-chart-active .result-view .digital-board-actions button:nth-child(2),
body.digital-chart-active .result-view .digital-board-actions button:nth-child(3){margin-right:4px}
body.digital-chart-active .result-view .digital-board-actions #digital-single-palace.active,
body.digital-chart-active .result-view .digital-board-actions #digital-liunian.active{
  color:#fffaf0;
  background:#6f2020;
  border-color:#6f2020;
  box-shadow:none;
}
body.digital-chart-active .result-view .digital-board-actions #digital-year-direction.active{
  color:#6f2020;
  background:#fffaf0;
  border-color:#c7aa74;
  box-shadow:none;
}
body.digital-chart-active .result-view .digital-board-actions button:disabled{
  cursor:not-allowed;
  opacity:.48;
}
body.digital-chart-active .result-view .digital-board-actions button:active{transform:scale(.96)}

/* 数字盘恢复地支开关：外围空间固定，开关只控制地支可见性。 */
body.digital-chart-active.show-outer-branches .result-view .board-wrap .outer-ring{visibility:visible}
body.digital-chart-active .result-view .board-wrap .outer-top,
body.digital-chart-active .result-view .board-wrap .outer-bottom{
  grid-column:2;
  width:100%;
  height:28px;
  margin:0 auto;
}
body.digital-chart-active .result-view .board-wrap .outer-top{grid-row:1}
body.digital-chart-active .result-view .board-wrap .outer-bottom{grid-row:3}
body.digital-chart-active .result-view .board-wrap .outer-left,
body.digital-chart-active .result-view .board-wrap .outer-right{
  grid-row:2;
  width:100%;
  height:var(--digital-board-size);
}
body.digital-chart-active .result-view .board-wrap .outer-left{grid-column:1}
body.digital-chart-active .result-view .board-wrap .outer-right{grid-column:3}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-slot,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-slot{
  display:grid!important;
  grid-template-columns:auto auto;
  grid-template-rows:1fr;
  align-items:center;
  justify-content:center;
  gap:2px;
}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-year-marker-group,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-year-marker-group{
  position:static;
  grid-column:1;
  grid-row:1;
  justify-self:end;
  transform:none;
}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-branch,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-branch{
  grid-column:2;
  grid-row:1;
  transform:none;
}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-hidden,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-hidden{
  grid-column:3;
  grid-row:1;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-slot,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-slot{
  display:grid!important;
  grid-template-columns:1fr;
  grid-template-rows:auto auto;
  align-content:center;
  justify-items:center;
  gap:2px;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-year-marker-group,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-year-marker-group{
  position:static;
  grid-column:1;
  grid-row:1;
  transform:none;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-hidden,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-hidden{
  grid-column:1;
  grid-row:2;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-branch,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-branch{
  grid-column:1;
  grid-row:2;
  transform:none;
}
body.digital-chart-active .result-view .board-wrap .outer-hidden{display:none!important}

/* 数字盘左右外圈：年干（含双年干）垂直置于年支正上方，共用同一列中心线。 */
body.digital-chart-active .result-view .board-wrap .outer-left .outer-slot,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-slot{
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  align-content:center!important;
  justify-items:center!important;
  gap:1px!important;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-year-marker-group,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-year-marker-group{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  width:max-content;
  max-width:100%;
  min-width:0;
  grid-column:1!important;
  grid-row:1!important;
  justify-self:center!important;
  align-self:end!important;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-year-marker,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-year-marker{
  position:static!important;
  transform:none!important;
}
body.digital-chart-active .result-view .board-wrap .outer-left .outer-branch,
body.digital-chart-active .result-view .board-wrap .outer-right .outer-branch{
  grid-column:1!important;
  grid-row:2!important;
  justify-self:center!important;
  align-self:start!important;
}

/* 数字盘上下外圈：年干在年支左侧并与年支水平对齐。 */
body.digital-chart-active .result-view .board-wrap .outer-top .outer-year-marker-group,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-year-marker-group{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  width:max-content;
  max-width:100%;
  min-width:0;
  grid-column:1!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
  position:static!important;
  transform:none!important;
}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-year-marker,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-year-marker{
  position:static!important;
  transform:none!important;
}
body.digital-chart-active .result-view .board-wrap .outer-top .outer-branch,
body.digital-chart-active .result-view .board-wrap .outer-bottom .outer-branch{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:center!important;
  align-self:center!important;
}

/* 数字盘沿用时盘/终身盘标题栏，姓名和性别单独显示在标题栏下方。 */
.digital-subject-meta{display:none}
body.digital-chart-active .result-view .result-header{display:block!important}
body.digital-chart-active .result-view .result-header>.chart-navigation{display:none!important}
body.digital-chart-active .result-view .digital-subject-meta{
  display:block;
  padding:5px 6px 0;
  background:#fffdf8;
}
body.digital-chart-active .result-view .digital-subject-table{
  width:100%;
  table-layout:fixed;
  border-collapse:collapse;
  color:#241a17;
  background:#fffdf8;
}
body.digital-chart-active .result-view .digital-subject-table th,
body.digital-chart-active .result-view .digital-subject-table td{
  height:30px;
  padding:2px 8px;
  border:1px solid #e2d9cf;
  vertical-align:middle;
}
body.digital-chart-active .result-view .digital-subject-table th{
  width:14%;
  color:#8d8179;
  background:#fbf7ef;
  font-size:13px;
  font-weight:800;
  text-align:center;
}
body.digital-chart-active .result-view .digital-subject-value{
  width:36%;
  overflow:hidden;
  text-align:center;
}
body.digital-chart-active .result-view .digital-subject-value strong{
  display:block;
  overflow:hidden;
  color:#241a17;
  font-size:17px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.digital-parameter-table{display:none}
body.digital-chart-active .result-view .digital-parameter-table{
  display:block;
  padding:6px 6px 2px;
  background:#fffdf8;
}
body.digital-chart-active .result-view .digital-parameter-table table{
  width:100%;
  table-layout:fixed;
  border-collapse:collapse;
  border:1px solid #ded5cb;
  background:#fffdfb;
}
body.digital-chart-active .result-view .digital-parameter-table th,
body.digital-chart-active .result-view .digital-parameter-table td{
  width:14.285%;
  padding:0;
  border-right:1px solid #e5ddd4;
  text-align:center;
  line-height:1.15;
  white-space:nowrap;
}
body.digital-chart-active .result-view .digital-parameter-table th:last-child,
body.digital-chart-active .result-view .digital-parameter-table td:last-child{border-right:0}
body.digital-chart-active .result-view .digital-parameter-table th{
  height:34px;
  color:#8f7138;
  background:#fbf7ef;
  font-size:14px;
  font-weight:800;
}
body.digital-chart-active .result-view .digital-parameter-table td{
  height:40px;
  border-top:1px solid #e5ddd4;
  color:#000;
  font-size:28px;
  font-weight:900;
}
body.digital-chart-active .result-view .digital-parameter-input{
  display:block;
  width:100%;
  height:40px;
  min-width:0;
  padding:0;
  border:0;
  border-radius:0;
  color:#000;
  background:transparent;
  font:inherit;
  line-height:1;
  text-align:center;
  outline:0;
  appearance:none;
}
body.digital-chart-active .result-view .digital-parameter-input:focus{
  background:#fff1d4;
  box-shadow:inset 0 0 0 2px #9b2f2f;
}
@media(max-width:420px){
  body.digital-chart-active .result-view .chart{padding:5px}
  body.digital-chart-active .result-view .digital-mini-grid{inset:0}
body.digital-chart-active .result-view .digital-mini-cell{font-size:17px}
  body.digital-chart-active .result-view .digital-mini-cell-changsheng{font-size:10px}
  body.digital-chart-active .result-view .digital-subject-meta{padding:4px 4px 0}
  body.digital-chart-active .result-view .digital-subject-table th,
  body.digital-chart-active .result-view .digital-subject-table td{height:30px;padding:2px 6px}
  body.digital-chart-active .result-view .digital-subject-table th{font-size:13px}
  body.digital-chart-active .result-view .digital-subject-value strong{font-size:17px}
  body.digital-chart-active .result-view .digital-parameter-table{padding:5px 4px 0}
  body.digital-chart-active .result-view .digital-parameter-table th{height:34px;font-size:13px}
  body.digital-chart-active .result-view .digital-parameter-table td,
  body.digital-chart-active .result-view .digital-parameter-input{height:40px;font-size:26px}
}

/* 数字盘反推数字：平时只显示入口，筛选项收进底部抽屉。 */
.digital-reverse-entry{display:none}
body.digital-chart-active .result-view .digital-reverse-entry{
  display:block;
  width:100%;
  padding:4px 0 0;
  background:#fffdf8;
}
body.digital-chart-active .result-view .digital-reverse-open{
  display:grid;
  grid-template-columns:22px minmax(0,1fr) auto 16px;
  align-items:center;
  gap:8px;
  width:100%;
  min-height:44px;
  margin:0;
  padding:0 10px;
  border:1px solid #cfa39a;
  border-left:4px solid #8f2424;
  border-radius:6px;
  color:#6f2020;
  background:#fff7f3;
  font-size:14px;
  font-weight:800;
  line-height:1;
  text-align:left;
  box-shadow:0 1px 2px rgba(111,32,32,.08);
}
body.digital-chart-active .result-view .digital-reverse-open:hover{
  border-color:#b97870;
  background:#fff1eb;
}
body.digital-chart-active .result-view .digital-reverse-open:active{
  background:#f7e3dc;
  transform:none;
}
body.digital-chart-active .result-view .digital-reverse-entry-icon{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:50%;
  color:#fff7f3;
  background:#8f2424;
  font-size:17px;
  font-weight:700;
  line-height:1;
}
body.digital-chart-active .result-view .digital-reverse-entry-title{
  min-width:0;
  overflow:hidden;
  color:#6f2020;
  font-size:16px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body.digital-chart-active .result-view .digital-reverse-open strong{
  min-width:0;
  overflow:hidden;
  color:#6f2020;
  font-size:14px;
  font-weight:900;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:right;
}
body.digital-chart-active .result-view .digital-reverse-entry-chevron{
  color:#8d8179;
  font-size:18px;
  line-height:1;
}
.digital-reverse-sheet[hidden]{display:none!important}
.digital-reverse-sheet{
  position:fixed;
  inset:0;
  z-index:80;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.digital-reverse-backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(28,20,17,.42);
}
.digital-reverse-panel{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  width:min(520px,100%);
  max-height:min(90vh,780px);
  padding:0 14px calc(14px + env(safe-area-inset-bottom,0px));
  border:1px solid #d6c5a9;
  border-bottom:0;
  border-radius:14px 14px 0 0;
  background:#fffdf8;
  box-shadow:0 -14px 34px rgba(43,28,18,.2);
}
.digital-reverse-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex:0 0 auto;
  padding:14px 2px 10px;
  border-bottom:1px solid #dfd2bd;
}
.digital-reverse-header-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.digital-reverse-header small{
  display:block;
  color:#8f7138;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
}
.digital-reverse-header h3{
  margin:2px 0 0;
  color:#241a17;
  font-size:22px;
  font-weight:900;
  line-height:1.15;
}
.digital-reverse-clear,
.digital-reverse-close{
  display:grid;
  place-items:center;
  min-width:58px;
  height:42px;
  padding:0 12px;
  border:1px solid #d6c5a9;
  border-radius:8px;
  color:#6f2020;
  background:#fff;
  font-size:16px;
  font-weight:900;
  line-height:1;
}
.digital-reverse-fields{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:9px 0;
}
.digital-reverse-field{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  align-items:center;
  gap:2px;
  min-height:50px;
  padding:4px 0;
  border-bottom:1px solid rgba(207,195,182,.62);
}
.digital-reverse-field h4{
  min-width:0;
  margin:0;
  overflow:hidden;
  color:#6f2020;
  font-size:16px;
  font-weight:900;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.digital-reverse-chips{
  display:grid;
  grid-template-columns:repeat(var(--reverse-option-count,9),minmax(0,1fr));
  gap:2px;
  min-width:0;
  overflow:visible;
  padding:0;
}
.digital-reverse-chip{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:0;
  min-height:46px;
  padding:0;
  border:1px solid #d6c5a9;
  border-radius:6px;
  color:#241a17;
  background:#fff;
  font-size:16px;
  font-weight:800;
  line-height:1;
}
.digital-reverse-chip-symbol{
  display:block;
  max-width:100%;
  overflow:hidden;
  font-size:18px;
  font-weight:900;
  line-height:1;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.digital-reverse-chip-number{
  display:block;
  color:#9b2f2f;
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;
  font-size:14px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
}
.digital-reverse-chip[aria-pressed="true"]{
  color:#fffaf0;
  border-color:#6f2020;
  background:#6f2020;
}
.digital-reverse-chip[aria-pressed="true"] .digital-reverse-chip-number{color:#ffe6a7}
.digital-reverse-chip:disabled{
  color:#aaa19a;
  background:#f2eee7;
  opacity:.72;
}
.digital-reverse-result{
  flex:0 0 auto;
  padding-top:10px;
  border-top:1px solid #dfd2bd;
}
.digital-reverse-result-head{
  display:grid;
  grid-template-columns:64px minmax(0,1fr) 42px 64px;
  align-items:center;
  gap:6px;
  min-height:36px;
  color:#8f7138;
  font-size:14px;
  font-weight:900;
  text-align:center;
}
.digital-reverse-result-head button{
  min-height:34px;
  padding:0 4px;
  border:1px solid #d6c5a9;
  border-radius:7px;
  color:#6f2020;
  background:#fff;
  font-size:14px;
  font-weight:900;
}
.digital-reverse-result-head button:disabled{
  color:#aaa19a;
  background:#f2eee7;
}
#digital-reverse-count{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#6f2020;
  font-size:17px;
  font-weight:900;
  line-height:1.2;
  text-align:center;
}
.digital-reverse-combos{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  grid-template-rows:repeat(2,38px);
  gap:4px;
  overflow:hidden;
  min-height:86px;
  padding:8px 0 2px;
}
.digital-reverse-combo{
  display:block;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:38px;
  padding:0 2px;
  overflow:hidden;
  border:1px solid #c7aa74;
  border-radius:7px;
  color:#6f2020;
  background:#fffaf0;
  font-family:Arial,"Helvetica Neue",sans-serif;
  font-variant-numeric:tabular-nums;
  font-size:16px;
  font-weight:900;
  letter-spacing:0;
  line-height:1;
  text-overflow:clip;
  white-space:nowrap;
}
.digital-reverse-empty{
  margin:0;
  color:#8d8179;
  font-size:14px;
  font-weight:700;
  line-height:42px;
  white-space:nowrap;
}
@media(max-width:420px){
  body.digital-chart-active .result-view .digital-reverse-open{grid-template-columns:22px minmax(0,1fr) auto 14px;gap:6px;min-height:42px;padding-inline:8px}
  body.digital-chart-active .result-view .digital-reverse-entry-icon{width:22px;height:22px;font-size:16px}
  body.digital-chart-active .result-view .digital-reverse-entry-title{font-size:15px}
  body.digital-chart-active .result-view .digital-reverse-open strong{font-size:13px}
  .digital-reverse-panel{max-height:90vh;padding-inline:8px}
  .digital-reverse-field{grid-template-columns:38px minmax(0,1fr);gap:2px;min-height:48px;padding-block:3px}
  .digital-reverse-field h4{font-size:15px}
  .digital-reverse-chip{min-height:44px;gap:3px}
  .digital-reverse-chip-symbol{font-size:16px}
  .digital-reverse-chip-number{font-size:14px}
  .digital-reverse-result-head{grid-template-columns:58px minmax(0,1fr) 42px 58px;font-size:12px}
  #digital-reverse-count{font-size:16px}
  .digital-reverse-result-head button{font-size:12px}
  .digital-reverse-combos{grid-template-rows:repeat(2,36px);gap:2px;min-height:80px}
  .digital-reverse-combo{min-height:36px;padding:0;font-size:12px;font-weight:800}
}

/* 输入页类型菜单与事项输入：米白／枣红统一样式 */
.home-category-control { position: relative; }
.home-category-control .home-choice-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.home-category-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

@media (max-width: 700px) {
  .chart-type-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
  }
}
.home-category-trigger:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--red-dark);
}
.home-category-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: -4px 3px 0 0;
  border-right: 1.5px solid #9f8c83;
  border-bottom: 1.5px solid #9f8c83;
  transform: rotate(45deg);
  transition: transform .12s ease;
}
.home-category-trigger[aria-expanded="true"] .home-category-chevron { transform: rotate(225deg); }
.home-category-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  width: min(240px, calc(100vw - 116px));
  max-height: min(60vh, 320px);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid rgba(157, 55, 42, .18);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(73, 52, 45, .16);
}
.home-category-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.home-category-option:hover,
.home-category-option:focus-visible { background: rgba(157, 55, 42, .07); outline: 0; }
.home-category-option[aria-selected="true"] {
  background: rgba(157, 55, 42, .12);
  color: var(--red-dark);
  font-weight: 800;
}
.question-field:focus-within { background: rgba(157, 55, 42, .025); }
.home-question-input {
  cursor: text;
  caret-color: var(--red);
}
.home-question-input:focus-visible {
  border-bottom: 2px solid var(--red);
  color: var(--ink);
}
@media screen and (max-width: 390px) {
  .home-category-menu { width: min(224px, calc(100vw - 104px)); }
}

/* Keep the account menu above cards without making the whole title bar cover them. */
.app-topbar { z-index: auto; overflow: visible; }
.app-topbar .account-bar { z-index: 31; }
.app-topbar .account-menu { z-index: 32; }

/* Center odometer glyphs inside each digit window across WebViews. */
.odo-time-display .odo-digit {
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  position:relative;
  top:-4px;
}

/* Random-chart time controls are part of the web result view too. */
body.result-screen-active .odo-time-display {
  display:block;
}

/* Digital chart: compact mobile summary. */
@media screen and (max-width:700px) {
  body.digital-chart-active .result-view .digital-subject-meta { padding:3px 5px 0; }
  body.digital-chart-active .result-view .digital-subject-table th,
  body.digital-chart-active .result-view .digital-subject-table td { height:27px; padding:1px 6px; }
  body.digital-chart-active .result-view .digital-subject-table th { font-size:12px; }
  body.digital-chart-active .result-view .digital-subject-value strong { font-size:16px; }
  body.digital-chart-active .result-view .digital-parameter-table { padding:4px 5px 1px; }
  body.digital-chart-active .result-view .digital-parameter-table th { height:29px; font-size:12px; }
  body.digital-chart-active .result-view .digital-parameter-table td,
  body.digital-chart-active .result-view .digital-parameter-input { height:35px; font-size:25px; }
  body.digital-chart-active .result-view .digital-board-actions { gap:5px; width:calc(100% - 10px); margin:0 5px 6px; }
  body.digital-chart-active .result-view .digital-board-actions button { height:32px; border-radius:8px; font-size:13px; }
}

@media screen and (max-width:420px) {
  body.digital-chart-active .result-view .digital-subject-meta { padding:3px 4px 0; }
  body.digital-chart-active .result-view .digital-subject-table th,
  body.digital-chart-active .result-view .digital-subject-table td { height:27px; padding:1px 5px; }
  body.digital-chart-active .result-view .digital-parameter-table { padding:4px 4px 1px; }
  body.digital-chart-active .result-view .digital-parameter-table th { height:28px; font-size:11px; }
  body.digital-chart-active .result-view .digital-parameter-table td,
  body.digital-chart-active .result-view .digital-parameter-input { height:34px; font-size:24px; }
}

/* Ordinary palaces use a bounded 3-column by 5-row content grid. */
.palace-15-layout {
  display:block;
  box-sizing:border-box;
  padding:5px 6px 7px;
  overflow:hidden;
  font-family:"STKaiti","KaiTi",serif;
  font-size:16px;
  font-weight:600;
  line-height:1;
  font-synthesis:none;
}
.palace-15-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:2fr 1fr 2fr 1fr 2fr;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
}
.palace-15-cell {
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  min-width:0;
  min-height:0;
  overflow:hidden;
  border-right:0;
  border-bottom:0;
  white-space:nowrap;
  text-overflow:clip;
}
.palace-15-cell:nth-child(3n) { border-right:0; }
.palace-15-cell:nth-child(n+13) { border-bottom:0; }
.palace-15-empty-cell { pointer-events:none; }
.palace-15-role-cell { justify-content:center; align-items:center; pointer-events:none; }
.palace-role-marks { display:flex; align-items:center; justify-content:center; gap:4px; width:100%; min-width:0; }
.palace-role-marks.has-two { justify-content:space-evenly; }
.palace-role-mark {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:1.15em;
  height:1.15em;
  box-sizing:border-box;
  color:var(--red);
  border:1px solid currentColor;
  border-radius:50%;
  font-family:"QimenBoardSC",sans-serif;
  font-size:13px;
  font-weight:400;
  line-height:1;
}
.fortune-role-mark { color:var(--red); }
.palace-15-god-cell,
.palace-15-marks-cell { justify-content:center; align-items:center; }
.palace-15-god,
.palace-15-star,
.palace-15-door,
.palace-15-stem { display:block; min-width:0; max-width:100%; overflow:hidden; font:inherit; font-weight:600; line-height:1; white-space:nowrap; }
.palace-15-marks { display:flex; align-items:center; justify-content:center; gap:3px; min-width:0; min-height:0; overflow:visible; }
.palace-15-layout .mark { min-width:12px; min-height:12px; font-size:12px; line-height:1; }
.palace-15-layout .mark.void { transform:none; }
.palace-15-layout .void-rings { width:16px; height:16px; }
.palace-15-changsheng {
  display:block;
  visibility:hidden;
  max-width:100%;
  overflow:hidden;
  color:var(--red);
  font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif;
  font-size:10px;
  font-weight:600;
  line-height:1;
  letter-spacing:0;
  white-space:nowrap;
  text-overflow:clip;
}
.show-changsheng .palace-15-changsheng { visibility:visible; }
.palace-15-celestial-changsheng,
.palace-15-earth-changsheng { align-items:center; padding:0; }
.palace-15-celestial-stem,
.palace-15-earth-stem { align-items:center; padding:0; }
.palace-15-star-cell,
.palace-15-door-cell { justify-content:center; }
.palace-15-layout .effect-positive,
.palace-15-layout .effect-caution,
.palace-15-layout .effect-special,
.palace-15-layout .effect-reference { font-weight:600; }

/* Keep the 15-cell palace typography identical across browsers and WebViews. */
.palace-15-layout,
.palace-15-layout .palace-15-god,
.palace-15-layout .palace-15-star,
.palace-15-layout .palace-15-door,
.palace-15-layout .palace-15-stem,
.palace-15-layout .mark,
.palace-15-layout .palace-15-changsheng {
  font-family:"QimenBoardSC",sans-serif !important;
  font-synthesis:none !important;
}

.palace-15-layout,
.palace-15-layout .palace-15-god,
.palace-15-layout .palace-15-star,
.palace-15-layout .palace-15-door,
.palace-15-layout .palace-15-stem,
.palace-15-layout .mark {
  font-size:16px !important;
  font-weight:400 !important;
}

.palace-15-layout .palace-15-changsheng {
  font-size:10px !important;
  font-weight:400 !important;
}

/* Time-row context for time and immediate charts. */
.result-screen-active .result-time-row.has-time-context {
  grid-template-columns:49px minmax(0,1fr) 92px !important;
  container-type:inline-size;
}
.result-screen-active .result-time-row.result-time-label-hidden .result-meta-label {
  display:none !important;
}
.result-screen-active .result-time-row.result-time-label-hidden.has-time-context {
  grid-template-columns:minmax(0,1fr) 92px !important;
}
.result-screen-active .result-time-row.result-time-label-hidden.has-time-context .result-time-cell:first-of-type,
.result-screen-active .result-time-row.result-time-label-hidden.has-time-context .result-time-cell:nth-of-type(2) {
  grid-column:1 !important;
}
.result-screen-active .result-time-row.result-time-label-hidden.has-time-context .result-time-context {
  grid-column:2 !important;
}
.result-screen-active .result-time-row.result-time-label-hidden .result-time-cell {
  justify-content:flex-start !important;
  gap:3px !important;
  overflow:hidden !important;
}
.result-screen-active .result-time-row.result-time-label-hidden .date-prefix {
  color:#b89858 !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-cell .result-meta-value {
  flex:0 1 auto !important;
  min-width:0 !important;
  max-width:calc(100% - 2.2em) !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  font-size:var(--result-time-font-size,16px) !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-cell .date-prefix {
  font-size:var(--result-time-font-size,16px) !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-cell {
  container-type:inline-size;
  justify-content:flex-start !important;
  gap:3px !important;
  overflow:hidden !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-cell:first-of-type {
  grid-column:2 !important;
  grid-row:1 !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-cell:nth-of-type(2) {
  grid-column:2 !important;
  grid-row:2 !important;
}
.result-screen-active .result-time-row.has-time-context .result-time-context {
  grid-column:3 !important;
  grid-row:1 / 3 !important;
  min-width:0;
  display:grid;
  grid-template-rows:repeat(2,minmax(0,1fr));
  border-left:1px solid #cfc3b6;
}
.result-screen-active .result-context-item {
  min-width:0;
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px 7px;
  overflow:hidden;
  border-top:1px solid #cfc3b6;
  white-space:nowrap;
}
.result-screen-active .result-context-item:first-child { border-top:0; }
.result-screen-active .result-context-item span {
  flex:0 0 auto;
  color:#b89858;
  font-family:"Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size:var(--result-context-font-size,16px);
  font-weight:500;
}
.result-screen-active .result-context-item strong {
  min-width:0;
  overflow:hidden;
  color:#241a17;
  font-family:"Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size:var(--result-context-font-size,16px);
  font-weight:500;
  text-overflow:clip;
}
.result-screen-active .result-time-context[hidden] { display:none !important; }

@media (max-width:700px) {
  .result-screen-active .result-time-row.has-time-context {
    grid-template-columns:49px minmax(0,1fr) 92px !important;
  }
  .result-screen-active .result-time-row.has-time-context .result-time-cell {
    min-width:0 !important;
    gap:3px !important;
    padding:3px 5px !important;
  }
  .result-screen-active .result-time-row.has-time-context .result-time-cell .result-meta-value {
    flex:0 1 auto !important;
    min-width:0 !important;
    max-width:calc(100% - 2.2em) !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
    font-size:var(--result-time-font-size,16px) !important;
  }
  .result-screen-active .result-time-row.has-time-context .result-time-cell .date-prefix {
    flex:0 0 auto !important;
    min-width:max-content !important;
    font-size:var(--result-time-font-size,16px) !important;
  }
  .result-screen-active .result-time-row.has-time-context .result-context-item {
    gap:2px;
    padding:3px 4px;
  }
  .result-screen-active .result-time-row.has-time-context .result-context-item span,
  .result-screen-active .result-time-row.has-time-context .result-context-item strong {
    font-size:var(--result-context-font-size,16px);
    font-weight:500;
  }
}

/* Result metadata labels use one size across every chart type. */
body.result-screen-active .result-meta-label,
body.result-screen-active .chart-summary-main small,
body.result-screen-active .result-time-row .date-prefix,
body.result-screen-active .result-context-item span {
  font-size:14px !important;
}
body.result-screen-active .result-time-row .date-prefix {
  color:#b89858 !important;
}
body.result-screen-active .result-time-row.has-time-context .result-time-cell .date-prefix {
  font-size:14px !important;
}
