:root {
  --paper: #f7f2e8;
  --paper-2: #efe7d8;
  --paper-3: #e7dcc8;
  --ink: #1d1a16;
  --ink-2: #453f36;
  --muted: #7c7365;
  --line: #d8cdb9;
  --line-2: #c4b69c;
  --red: #9c2b23;
  --red-soft: #b8443a;
  --gold: #a8864f;
  --jade: #4f6b5d;
  --shadow: 0 1px 2px rgba(60, 45, 30, .06), 0 12px 30px -18px rgba(60, 45, 30, .35);
  --radius: 6px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --kai: "Kaiti SC", "KaiTi", STKaiti, "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(168, 134, 79, .07), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(156, 43, 35, .05), transparent 38%),
    repeating-linear-gradient(0deg, rgba(120, 95, 60, .018) 0 1px, transparent 1px 3px);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(247, 242, 232, .88);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  height: 62px;
}
.seal {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--red); color: #fff8ee;
  font-family: var(--kai); font-size: 20px; line-height: 1;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 238, .35);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand b { font-family: var(--kai); font-size: 21px; letter-spacing: .14em; font-weight: 600; }
.brand span { color: var(--muted); font-size: 12.5px; letter-spacing: .04em; }
.topbar .spacer { flex: 1; }
.topbar .ghost-link { color: var(--ink-2); font-size: 13.5px; padding: 6px 10px; border-radius: 4px; }
.topbar .ghost-link:hover { background: var(--paper-2); text-decoration: none; }

/* ---------------- hero ---------------- */
.hero { padding: 54px 0 30px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -40px;
  width: 320px; height: 320px; opacity: .12; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke='%231d1a16' stroke-width='0.6'><circle cx='50' cy='50' r='42'/><circle cx='50' cy='50' r='30'/><circle cx='50' cy='50' r='18'/><path d='M50 8v84M8 50h84M20 20l60 60M80 20l-60 60'/></g></svg>") center/contain no-repeat;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--red); font-size: 12px; letter-spacing: .22em;
  border: 1px solid rgba(156, 43, 35, .28); border-radius: 999px;
  padding: 3px 12px; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--kai); font-weight: 500;
  font-size: clamp(30px, 4.6vw, 46px); line-height: 1.35;
  margin: 0 0 14px; letter-spacing: .04em;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead { margin: 0; max-width: 660px; color: var(--ink-2); font-size: 16px; }
.hero .meta-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.hero .meta-row b { color: var(--ink); font-weight: 600; }

/* ---------------- system grid ---------------- */
.grid-systems {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 0 46px;
}
.sys-card {
  position: relative; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #fbf7ef, #f5eee1);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 16px; color: inherit; font: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: var(--shadow);
}
.sys-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.sys-card .glyph {
  font-family: var(--kai); font-size: 26px; color: var(--red);
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border: 1px solid rgba(156,43,35,.25); border-radius: 50%;
  margin-bottom: 10px;
}
.sys-card .glyph svg { width: 29px; height: 29px; display: block; }
.sys-card .glyph svg [stroke] { stroke-width: 2; }
.title-icon { display: inline-flex; vertical-align: -4px; margin-right: 10px; color: var(--red); }
.title-icon svg { width: 28px; height: 28px; }
.sys-card h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: .06em; }
.sys-card p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.6; }
.sys-card .arrow { position: absolute; right: 14px; top: 16px; color: var(--line-2); transition: transform .18s; }
.sys-card:hover .arrow { transform: translateX(3px); color: var(--red); }

/* ---------------- panel / form ---------------- */
.view { display: none; }
.view.active { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 26px 0 16px; }
.section-head h2 { font-family: var(--kai); font-size: 26px; margin: 0; font-weight: 500; letter-spacing: .08em; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.back-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; padding: 4px 0; }
.back-btn:hover { color: var(--red); }

.panel-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }

.card {
  background: #fbf7ef;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px 22px 24px; }
.card h3 { margin: 0 0 16px; font-size: 15px; letter-spacing: .12em; color: var(--ink-2); font-weight: 600; }

.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .04em; }
.field .hint { color: var(--muted); font-size: 12px; margin-left: 6px; }
.field input[type=text], .field input[type=date], .field input[type=time],
.field input[type=number], .field select, .field textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 14.5px; color: var(--ink);
  background: #fffdf8; border: 1px solid var(--line-2); border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(156,43,35,.09);
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.65; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 62px; padding: 7px 14px; font-size: 13.5px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; background: #fffdf8;
  cursor: pointer; transition: all .15s;
}
.pills label:hover { border-color: var(--red); color: var(--red); }
.pills input:checked + label { background: var(--red); border-color: var(--red); color: #fff8ee; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox input { accent-color: var(--red); width: 15px; height: 15px; }

.submit-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 26px; font: inherit; font-size: 15px; letter-spacing: .1em;
  background: var(--red); color: #fff8ee; border: 1px solid var(--red); border-radius: 4px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--red-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-secondary {
  background: transparent; color: var(--red); border-color: rgba(156,43,35,.4);
  padding: 8px 18px; font-size: 13.5px; letter-spacing: .06em;
}
.btn-secondary:hover { background: rgba(156,43,35,.06); }
.btn-mini { padding: 5px 12px; font-size: 12.5px; letter-spacing: .04em; }

.aside-note { font-size: 13.5px; color: var(--ink-2); }
.aside-note h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .12em; color: var(--red); }
.aside-note ul { margin: 0 0 16px; padding-left: 18px; }
.aside-note li { margin-bottom: 6px; }
.aside-note p { margin: 0 0 10px; }

details.caliber { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
details.caliber summary { cursor: pointer; font-size: 13px; color: var(--muted); }
details.caliber p { font-size: 12.8px; color: var(--muted); margin: 8px 0 0; }

/* ---------------- result ---------------- */
.result-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 18px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.tag.red { color: var(--red); background: rgba(156,43,35,.06); border-color: rgba(156,43,35,.25); }
.tag.jade { color: var(--jade); background: rgba(79,107,93,.07); border-color: rgba(79,107,93,.25); }

.warn-box {
  border-left: 3px solid var(--gold); background: rgba(168,134,79,.08);
  padding: 10px 14px; margin: 0 0 16px; font-size: 13px; color: var(--ink-2); border-radius: 0 4px 4px 0;
}
.warn-box ul { margin: 4px 0 0; padding-left: 18px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font: inherit; font-size: 14.5px; letter-spacing: .08em; color: var(--muted);
  padding: 9px 18px; cursor: pointer;
}
.tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.chart-shell { background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chart-shell iframe { display: block; width: 100%; border: 0; min-height: 620px; background: #fbf7ef; }
.chart-hint { font-size: 12.5px; color: var(--muted); padding: 8px 2px 0; }

/* bazi summary */
.pillar-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.pillar {
  text-align: center; padding: 14px 6px 12px; background: #fffdf8;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.pillar .lab { font-size: 11.5px; color: var(--muted); letter-spacing: .2em; }
.pillar .gz { font-family: var(--kai); font-size: 30px; line-height: 1.25; margin: 6px 0 2px; color: var(--ink); }
.pillar .gz span { color: var(--red); }
.pillar .ss { font-size: 12px; color: var(--muted); }
.pillar.day { border-color: rgba(156,43,35,.45); box-shadow: inset 0 0 0 1px rgba(156,43,35,.12); }

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.fact { background: var(--paper-2); border-radius: 4px; padding: 10px 12px; }
.fact .k { font-size: 11.5px; color: var(--muted); letter-spacing: .1em; }
.fact .v { font-size: 14.5px; margin-top: 2px; }

/* ziwei */
.ziwei-wrap { overflow-x: auto; padding: 6px; }
.ziwei-grid {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); grid-template-rows: repeat(4, minmax(150px, 1fr));
  gap: 4px; background: var(--line); border: 1px solid var(--line-2); min-width: 660px;
}
.palace {
  background: #fffdf8; padding: 8px 9px; position: relative; font-size: 12px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 3px;
}
.palace .p-name { font-size: 12.5px; font-weight: 600; color: var(--red); letter-spacing: .1em; }
.palace .p-gz { position: absolute; right: 8px; top: 7px; color: var(--muted); font-size: 11.5px; }
.palace .p-major { font-family: var(--kai); font-size: 17px; color: var(--ink); letter-spacing: .05em; }
.palace .p-major .badge { font-family: var(--serif); font-size: 10.5px; color: var(--muted); margin-left: 2px; }
.palace .p-minor { color: var(--ink-2); font-size: 11.5px; }
.palace .p-dec { color: var(--muted); font-size: 10.5px; margin-top: auto; }
.palace .shen { color: var(--gold); font-size: 10.5px; }
.palace.center {
  grid-column: 2 / span 2; grid-row: 2 / span 2;
  background: linear-gradient(160deg, #f3ead9, #efe4d0);
  align-items: center; justify-content: center; text-align: center; gap: 6px;
}
.palace.center .c-title { font-family: var(--kai); font-size: 26px; letter-spacing: .2em; color: var(--red); }
.palace.center .c-row { font-size: 12.5px; color: var(--ink-2); }
.palace.center .c-sub { font-size: 11.5px; color: var(--muted); max-width: 300px; }
.sihua-lu { color: #2f7a53; }
.sihua-quan { color: #8a5a1f; }
.sihua-ke { color: #2f5f8a; }
.sihua-ji { color: #8f2f2f; }

/* qimen */
.qimen-wrap { overflow-x: auto; padding: 6px; }
.qimen-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 4px; background: var(--line); border: 1px solid var(--line-2); min-width: 600px; }
.qp { background: #fffdf8; padding: 10px; min-height: 132px; position: relative; font-size: 12px; }
.qp .qp-name { font-size: 12.5px; color: var(--red); font-weight: 600; letter-spacing: .08em; }
.qp .qp-dir { position: absolute; right: 9px; top: 9px; color: var(--muted); font-size: 11px; }
.qp .qp-stems { display: flex; gap: 10px; margin: 6px 0 4px; font-family: var(--kai); font-size: 20px; }
.qp .qp-stems .earth { color: var(--ink-2); }
.qp .qp-stems .sky { color: var(--red); }
.qp .qp-line { color: var(--ink-2); }
.qp .qp-line b { font-weight: 600; color: var(--ink); }
.qp .qp-note { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.qp.center { background: #f3ead9; }
.qp .kong { color: var(--red); font-size: 10.5px; }

/* tarot */
.tarot-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tcard {
  aspect-ratio: 3 / 4.6; border: 1px solid var(--line-2); border-radius: 8px;
  background: linear-gradient(170deg, #fffdf8, #f1e7d4);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px; position: relative; box-shadow: var(--shadow);
}
.tcard::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(168,134,79,.35); border-radius: 5px; pointer-events: none;
}
.tcard .t-pos { font-size: 11px; color: var(--muted); letter-spacing: .16em; position: relative; z-index: 2; }
.tcard .t-glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--kai); font-size: 86px; color: rgba(156, 43, 35, .07);
  pointer-events: none; z-index: 0; letter-spacing: 0;
}
.tcard .t-seal {
  position: absolute; right: 10px; bottom: 34px; width: 26px; height: 26px;
  display: grid; place-items: center; border: 1px solid rgba(156,43,35,.35);
  border-radius: 50%; color: var(--red); font-family: var(--kai); font-size: 13px; z-index: 2;
}
.tcard .t-name { font-family: var(--kai); font-size: 24px; line-height: 1.25; text-align: center; color: var(--ink); position: relative; z-index: 2; }
.tcard .t-sub { font-size: 12px; color: var(--muted); text-align: center; position: relative; z-index: 2; }
.tcard .t-ori { font-size: 11px; color: var(--red); text-align: center; letter-spacing: .1em; position: relative; z-index: 2; }
.tcard.major { background: linear-gradient(170deg, #fdf6e6, #ecdcbd); }
.tcard.reversed { border-color: rgba(156, 43, 35, .45); }
.tcard.reversed .t-ori { color: var(--ink-2); }

/* yinyuan */
.stick-card {
  display: grid; grid-template-columns: 1fr 2fr; gap: 24px;
  background: linear-gradient(170deg, #fffdf8, #f4ebda);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 26px; margin-bottom: 18px;
}
.stick-poem { text-align: center; border-right: 1px dashed var(--line-2); padding-right: 20px; }
.stick-poem .num { font-family: var(--kai); font-size: 30px; color: var(--red); letter-spacing: .1em; }
.stick-poem .lvl { font-size: 12px; color: var(--muted); letter-spacing: .2em; margin-bottom: 12px; }
.stick-poem p { font-family: var(--kai); font-size: 18px; line-height: 2; margin: 0; }
.stick-body h3 { margin: 0 0 8px; font-size: 14px; color: var(--red); letter-spacing: .1em; }
.stick-body p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.stick-body .meta { font-size: 12px; color: var(--muted); }

/* fengshui tables */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fffdf8; min-width: 640px; }
.mini-table th, .mini-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.mini-table th { background: var(--paper-2); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.mini-table tbody tr:nth-child(even) { background: rgba(239, 231, 216, .35); }

/* plain text output (fengshui) */
.text-panel {
  background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; white-space: pre-wrap; word-break: break-word;
  font-size: 13.5px; line-height: 1.85; color: var(--ink-2);
  max-height: 620px; overflow: auto;
}
.text-panel b { color: var(--ink); }

/* reading */
.reading-wrap { display: grid; grid-template-columns: minmax(0, 860px) 260px; gap: 22px; align-items: start; justify-content: space-between; }
.reading {
  background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; min-height: 320px; font-size: 15.5px; line-height: 1.95; color: var(--ink-2);
}
.reading h2 {
  font-family: var(--kai); font-size: 21px; color: var(--ink); font-weight: 600;
  margin: 26px 0 10px; padding-left: 12px; border-left: 3px solid var(--red); letter-spacing: .06em;
}
.reading h2:first-child { margin-top: 0; }
.reading h3 { font-size: 16px; color: var(--ink); margin: 20px 0 8px; }
.reading p { margin: 0 0 12px; }
.reading strong { color: var(--ink); font-weight: 600; }
.reading em { font-style: normal; color: var(--red); }
.reading ul, .reading ol { margin: 0 0 14px; padding-left: 22px; }
.reading li { margin-bottom: 5px; }
.reading blockquote {
  margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--gold);
  background: rgba(168,134,79,.07); color: var(--ink-2); font-size: 14px;
}
.reading hr { border: 0; border-top: 1px dashed var(--line); margin: 20px 0; }
.reading code { background: var(--paper-2); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.reading table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 13.5px; }
.reading th, .reading td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.reading th { background: var(--paper-2); }
.reading .cursor { display: inline-block; width: 7px; height: 17px; background: var(--red); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.reading-side { position: sticky; top: 78px; }
.side-block { border: 1px solid var(--line); border-radius: var(--radius); background: #fbf7ef; padding: 16px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.side-block h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; color: var(--ink-2); }
.side-block .big { font-family: var(--kai); font-size: 22px; color: var(--red); }
.side-block ol { margin: 0; padding-left: 16px; }
.side-block li { margin-bottom: 4px; }

.ask-row { display: flex; gap: 8px; margin-top: 16px; }
.ask-row input { flex: 1; padding: 9px 11px; font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: 4px; background: #fffdf8; }
.ask-row input:focus { outline: none; border-color: var(--red); }

.empty-state { color: var(--muted); font-size: 14px; text-align: center; padding: 60px 20px; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
.spinner.dark { border-color: rgba(156,43,35,.25); border-top-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-card { padding: 50px 20px; text-align: center; color: var(--muted); }
.loading-card .big-spin { width: 30px; height: 30px; border-width: 3px; margin-bottom: 14px; }
.loading-steps { font-size: 12.5px; margin-top: 6px; color: var(--muted); }

/* footer */
footer.site-footer { margin-top: 60px; border-top: 1px solid var(--line); padding: 26px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; }
footer .f-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
footer .f-links a { color: var(--muted); margin-right: 14px; }
footer .disc { margin-top: 10px; line-height: 1.8; max-width: 820px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #f7f2e8; padding: 10px 18px; border-radius: 4px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 90; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

.error-box {
  border: 1px solid rgba(156,43,35,.3); background: rgba(156,43,35,.05);
  color: var(--red); padding: 14px 16px; border-radius: 4px; font-size: 14px; margin: 12px 0;
}

/* about modal */
.modal { position: fixed; inset: 0; background: rgba(29,26,22,.45); display: none; z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal .modal-card { background: var(--paper); max-width: 720px; width: 100%; max-height: 84vh; overflow: auto; border-radius: 8px; padding: 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal h2 { font-family: var(--kai); margin: 0 0 14px; font-size: 24px; letter-spacing: .06em; }
.modal h3 { font-size: 14px; margin: 18px 0 6px; color: var(--red); letter-spacing: .08em; }
.modal p, .modal li { font-size: 13.8px; color: var(--ink-2); line-height: 1.8; }
.modal ul { padding-left: 20px; margin: 6px 0; }
.modal .close-x { float: right; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }

/* paywall */
.paywall { padding: 4px 2px; }
.paywall h3 { font-family: var(--kai); font-size: 22px; margin: 0 0 8px; color: var(--ink); letter-spacing: .06em; }
.paywall p { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.8; }
.pay-balance { font-size: 13px; color: var(--ink-2); background: var(--paper-2); padding: 7px 12px; border-radius: 4px; display: inline-block; margin-bottom: 14px; }
.pay-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pay-preset { padding: 8px 18px; border: 1px solid var(--line-2); background: #fffdf8; border-radius: 4px; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: baseline; gap: 7px; }
.pay-preset b { font-family: var(--kai); font-size: 18px; font-weight: 500; }
.pay-preset span { font-size: 12px; color: var(--muted); }
.pay-preset.selected { border-color: var(--red); color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.pay-preset.selected span { color: var(--red); opacity: .8; }
.pay-how { font-size: 13px; color: var(--ink-2); background: rgba(168,134,79,.08); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 0 4px 4px 0; margin-bottom: 14px; }
.pay-support { margin: 0 0 10px; }
.pay-support .btn { padding: 9px 22px; }
.pay-qr { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pay-qr img { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 4px; }
.pay-qr .pay-note { font-size: 12.5px; color: var(--muted); max-width: 220px; line-height: 1.7; }
.code-row { display: flex; gap: 8px; margin-bottom: 12px; }
.code-row input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 4px; font: inherit; font-size: 14px; background: #fffdf8; }
.pay-claim { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.pay-claim summary { cursor: pointer; font-size: 13.5px; color: var(--red); }
.claim-form { display: grid; gap: 8px; margin-top: 10px; }
.claim-form input { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 4px; font: inherit; font-size: 14px; background: #fffdf8; }

.quota-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.notice-bar { background: rgba(168,134,79,.12); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; padding: 8px 16px; text-align: center; line-height: 1.6; }

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .wrap { width: calc(100% - 36px); }
  .panel-grid { grid-template-columns: 1fr; }
  .reading-wrap { grid-template-columns: 1fr; }
  .reading-side { position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .hero { padding-top: 40px; }
}

@media (max-width: 999px) {
  .grid-systems { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .grid-systems { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sys-card { padding: 14px 13px 13px; }
  .sys-card .glyph { width: 40px; height: 40px; margin-bottom: 8px; }
  .sys-card .glyph svg { width: 24px; height: 24px; }
  .sys-card h3 { font-size: 16px; }
  .sys-card p { font-size: 12.2px; }
  .reading-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .wrap { width: calc(100% - 28px); }
  .hero { padding: 30px 0 20px; }
  .hero h1 { font-size: clamp(27px, 8vw, 36px); }
  .hero .meta-row { gap: 10px 16px; font-size: 12.5px; }
  .section-head h2 { font-size: 22px; }
  .pillar-strip { gap: 6px; }
  .pillar { padding: 10px 4px 9px; }
  .pillar .gz { font-size: 23px; }
  .pillar .ss { font-size: 11px; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .stick-card { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .stick-poem { border-right: 0; border-bottom: 1px dashed var(--line-2); padding: 0 0 16px; }
  .reading { padding: 20px 18px; }
  .reading-side { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .chart-shell iframe { min-height: 520px; }
  .chart-hint { font-size: 11.5px; line-height: 1.7; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 9px 14px; }
  .pay-qr { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 430px) {
  .wrap { width: calc(100% - 22px); }
  .grid-systems { gap: 9px; }
  .sys-card { padding: 12px 11px 12px; }
  .sys-card .glyph { width: 36px; height: 36px; }
  .sys-card .glyph svg { width: 21px; height: 21px; }
  .sys-card h3 { font-size: 15px; letter-spacing: .02em; }
  .sys-card p { font-size: 11.5px; line-height: 1.55; }
  .sys-card .arrow { display: none; }
  .fact-grid { grid-template-columns: 1fr; }
  .reading { padding: 18px 14px; font-size: 15px; }
  .reading h2 { font-size: 19px; }
  .pay-preset { flex: 1; }
  .pay-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pay-preset { padding: 7px 4px; justify-content: center; gap: 4px; }
  .pay-preset b { font-size: 16px; }
  .pay-preset span { font-size: 10.5px; white-space: nowrap; }
  .code-row { flex-direction: column; }
  .code-row .btn { width: 100%; }
  .title-icon svg { width: 24px; height: 24px; }
}

@media (max-width: 360px) {
  .grid-systems { grid-template-columns: 1fr; }
  .sys-card p { font-size: 12px; }
  .pillar .gz { font-size: 20px; }
}
