/* Fairtide 循道 · 人生潮汐表
   气质：清朗、安静、留白；潮汐表与海图，不是命馆。运势用水位，不用红绿（docs/design/00 第 5.2 节、03 第 4 节）。 */

:root {
  --paper: #fbfaf7;
  --sand: #f3eee4;
  --sand-2: #ebe4d6;
  --ink: #1f2a33;
  --ink-2: #5b6770;
  --ink-3: #8a949b;
  --line: #e3ded3;
  --water-1: #e8f1f5;
  --water-2: #cfe2ea;
  --water-3: #afcfdc;
  --water-4: #8fb9cb;
  --water-5: #6b9fb6;
  --water-6: #4a82a0;
  --water-7: #2f5d7c;
  --tide-mark: #c9a227;
  --el-wood: #6f8f6f;
  --el-fire: #b0715a;
  --el-earth: #a88d5e;
  --el-metal: #8b939a;
  --el-water: #4a6f8a;
  --serif: "Noto Serif SC", "Noto Serif TC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Noto Sans TC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius: 6px;
  --measure: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.9;
}
a { color: var(--water-7); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.45; margin: 1.6em 0 0.6em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 17px; }
p { margin: 0.6em 0; }
small, .muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.7; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--sand); font-family: var(--sans); font-weight: 500; font-size: 14px; color: var(--ink-2); }
blockquote { margin: 1em 0; padding: 0.6em 1em; border-left: 3px solid var(--water-3); background: #f6f3ec; color: var(--ink-2); }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; color: var(--ink-2); }

/* 版式 */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.read { max-width: var(--measure); margin: 0 auto; }
.site-head { border-bottom: 1px solid var(--line); background: rgba(251, 250, 247, 0.94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand b { font-size: 20px; letter-spacing: 0.02em; }
.brand span { font-size: 15px; color: var(--ink-2); }
.brand .sub { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.site-head nav { margin-left: auto; display: flex; gap: 16px; font-family: var(--sans); font-size: 14px; align-items: center; }
.site-head nav a { color: var(--ink-2); text-decoration: none; }
.site-head nav a:hover, .site-head nav a.on { color: var(--ink); }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 13px; }
.site-foot { margin-top: 80px; border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--ink-2); font-size: 15px; }
.site-foot .creed { font-size: 16px; color: var(--ink); letter-spacing: 0.04em; }
.site-foot .links { font-family: var(--sans); font-size: 13px; margin-top: 12px; display: flex; gap: 16px; flex-wrap: wrap; }

/* 按钮与表单 */
.btn { display: inline-block; font-family: var(--sans); font-size: 15px; border-radius: var(--radius); padding: 10px 22px; border: 1px solid var(--water-7); background: var(--water-7); color: #fff; text-decoration: none; cursor: pointer; line-height: 1.4; }
.btn:hover { background: #244a63; color: #fff; }
.btn.ghost { background: transparent; color: var(--water-7); }
.btn.ghost:hover { background: var(--water-1); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
form .field { margin: 18px 0; }
label { display: block; font-family: var(--sans); font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--water-3); border-color: var(--water-5); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choices label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0; cursor: pointer; background: #fff; color: var(--ink); font-size: 15px; }
.choices input { margin: 0; }
.choices label:has(input:checked) { border-color: var(--water-6); background: var(--water-1); }
.hint { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.note { background: var(--sand); border-radius: var(--radius); padding: 14px 18px; color: var(--ink-2); font-size: 15px; }
.note.warn { background: #f7efe0; border: 1px solid #ead9b5; color: #6d5525; }
.error { background: #f7ebe6; border: 1px solid #e6cbbf; color: #7a3e2a; border-radius: var(--radius); padding: 12px 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.card.sand { background: var(--sand); border-color: var(--sand-2); }
.stack > * + * { margin-top: 16px; }
.pill { display: inline-block; font-family: var(--sans); font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 20px; white-space: nowrap; }
.pill.water { border-color: var(--water-3); color: var(--water-7); background: var(--water-1); }
.pill.mark { border-color: var(--tide-mark); color: #7d6413; background: #fbf4dc; }

/* 首页 */
.hero { padding: 72px 0 40px; }
.hero h1 { font-size: 36px; margin: 0 0 12px; letter-spacing: 0.02em; }
.hero .lead { font-size: 20px; color: var(--ink-2); max-width: 640px; }
.hero .cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.tide-art { width: 100%; height: 120px; display: block; margin: 8px 0 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 32px 0; }
.features h3 { margin: 0 0 6px; font-size: 18px; }
.features p { margin: 0; color: var(--ink-2); font-size: 15px; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.steps > div { border-top: 2px solid var(--water-4); padding-top: 10px; }
.steps b { display: block; font-size: 18px; }
.steps span { color: var(--ink-2); font-size: 15px; }
.creed-block { text-align: center; padding: 40px 0 10px; font-size: 20px; line-height: 2.1; letter-spacing: 0.06em; }

/* 海图：排盘格 */
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.chart-head h1 { margin: 0; }
.meta-line { font-family: var(--sans); font-size: 14px; color: var(--ink-2); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.pillars { display: grid; grid-template-columns: 76px repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; margin: 18px 0; }
.pillars > div { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.pillars .rh { text-align: left; font-family: var(--sans); font-size: 13px; color: var(--ink-3); background: var(--sand); display: flex; align-items: center; padding-left: 12px; }
.pillars .ch { font-family: var(--sans); font-size: 13px; color: var(--ink-2); background: var(--sand); }
.pillars .day { background: #f6f9fb; }
.pillars .ch.day { background: var(--water-1); color: var(--water-7); font-weight: 600; }
.glyph { font-size: 34px; line-height: 1.2; font-weight: 600; display: block; }
.glyph.small { font-size: 18px; }
.tg { font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.hid { font-size: 14px; line-height: 1.7; }
.hid span.role { font-family: var(--sans); font-size: 11px; color: var(--ink-3); }
.el-木 { color: var(--el-wood); }
.el-火 { color: var(--el-fire); }
.el-土 { color: var(--el-earth); }
.el-金 { color: var(--el-metal); }
.el-水 { color: var(--el-water); }
.cell-small { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
@media (max-width: 640px) {
  .pillars { grid-template-columns: 58px repeat(4, 1fr); }
  .glyph { font-size: 28px; }
  .pillars > div { padding: 8px 4px; }
}

.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; height: 140px; margin: 12px 0 4px; }
.bars .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars .bar i { display: block; width: 100%; max-width: 46px; border-radius: 4px 4px 0 0; }
.bars .bar b { font-size: 15px; margin-top: 6px; }
.bars .bar small { font-family: var(--sans); font-size: 12px; }
.bg-木 { background: var(--el-wood); } .bg-火 { background: var(--el-fire); } .bg-土 { background: var(--el-earth); } .bg-金 { background: var(--el-metal); } .bg-水 { background: var(--el-water); }

.axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.axis .step { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px 6px; text-align: center; position: relative; }
.axis .step.now { border-color: var(--tide-mark); box-shadow: 0 0 0 1px var(--tide-mark) inset; }
.axis .step .gz { font-size: 22px; font-weight: 600; display: block; }
.axis .step .yr { font-family: var(--sans); font-size: 12px; color: var(--ink-2); display: block; }
.axis .step .now-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--tide-mark); color: #fff; font-family: var(--sans); font-size: 11px; border-radius: 999px; padding: 0 8px; line-height: 18px; white-space: nowrap; }

/* 折叠块 */
details.block { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin: 12px 0; }
details.block > summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary b { font-size: 17px; }
details.block > summary span { font-family: var(--sans); font-size: 13px; color: var(--ink-3); }
details.block > summary::after { content: "展开"; font-family: var(--sans); font-size: 12px; color: var(--water-6); white-space: nowrap; }
details.block[open] > summary::after { content: "收起"; }
details.block > .inner { padding: 0 18px 18px; }
.method { border-top: 1px dashed var(--line); padding: 10px 0; }
.method:first-child { border-top: 0; }
.method .v { font-size: 18px; font-weight: 600; }
.method details { margin-top: 4px; }
.method details summary { cursor: pointer; font-family: var(--sans); font-size: 12px; color: var(--water-6); }
.method dl { display: grid; grid-template-columns: 76px 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 14px; }
.method dt { font-family: var(--sans); color: var(--ink-3); font-size: 12px; padding-top: 2px; }
.method dd { margin: 0; color: var(--ink-2); }
.rel-group { margin: 10px 0; }
.rel-group h4 { margin: 8px 0 4px; font-size: 15px; color: var(--ink-2); }
.rel-group ul { margin: 0; padding-left: 1.2em; }
.rel-group li { font-size: 15px; }
.scroll-x { overflow-x: auto; }

/* 简报 */
.report-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.toc { position: sticky; top: 80px; font-family: var(--sans); font-size: 14px; line-height: 1.9; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc a { color: var(--ink-2); text-decoration: none; display: block; border-left: 2px solid transparent; padding-left: 10px; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--water-7); border-left-color: var(--water-6); }
.toc .tools { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  .report-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: #fff; }
}
.report h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 2.2em; }
.report section:first-of-type h2 { margin-top: 0.8em; }
.report table { margin: 12px 0; }
.report .para { margin: 0.9em 0; }
.report .basis { margin: 4px 0 14px; }
.report .basis > summary { cursor: pointer; font-family: var(--sans); font-size: 12px; color: var(--water-6); list-style: none; display: inline-block; }
.report .basis > summary::-webkit-details-marker { display: none; }
.report .basis > summary::before { content: "◇ "; }
.report .basis[open] > summary::before { content: "◆ "; }
.report .basis > div { background: #f6f3ec; border-radius: var(--radius); padding: 10px 14px; margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.overview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.overview .one-line { font-size: 21px; line-height: 1.8; }
.overview h3 { font-family: var(--sans); font-size: 13px; color: var(--ink-3); font-weight: 500; margin: 22px 0 6px; letter-spacing: 0.08em; }
.overview ol.do-now { padding-left: 1.3em; margin: 0; }
.fixed-tip { background: var(--water-1); border-radius: var(--radius); padding: 10px 14px; color: var(--water-7); font-size: 15px; }
.howto { border-left: 3px solid var(--water-4); padding: 4px 0 4px 14px; color: var(--ink-2); font-size: 15px; }
.about-report { color: var(--ink-3); font-size: 14px; margin-top: 40px; }
.feedback-link { margin: 18px 0 6px; font-family: var(--sans); font-size: 13px; }
.feedback-link summary { cursor: pointer; color: var(--ink-3); list-style: none; display: inline-block; }
.feedback-link summary::-webkit-details-marker { display: none; }
.feedback-link form { margin-top: 8px; }
.feedback-link textarea { min-height: 72px; font-size: 15px; }
.feedback-link .sent { color: var(--water-7); }

/* 走势轴（水位七档） */
.tideaxis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 4px; overflow-x: auto; margin: 10px 0 2px; }
.tideaxis .cell { text-align: center; }
.tideaxis .water { height: 96px; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: flex; align-items: flex-end; overflow: hidden; gap: 1px; }
.tideaxis .water i { flex: 1; display: block; }
.tideaxis .lvl { font-size: 14px; margin-top: 4px; display: block; }
.tideaxis .yr { font-family: var(--sans); font-size: 11px; color: var(--ink-2); display: block; line-height: 1.4; }
.tideaxis .cell.now .water { border-color: var(--tide-mark); box-shadow: 0 0 0 1px var(--tide-mark) inset; }
.tideaxis .cell.now .lvl::after { content: " ←"; color: var(--tide-mark); }
.lv-1 { background: var(--water-1); } .lv-2 { background: var(--water-2); } .lv-3 { background: var(--water-3); } .lv-4 { background: var(--water-4); }
.lv-5 { background: var(--water-5); } .lv-6 { background: var(--water-6); } .lv-7 { background: var(--water-7); }
.legend { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.timeline { list-style: none; padding: 0; margin: 12px 0; border-left: 2px solid var(--water-3); }
.timeline li { padding: 6px 0 10px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--water-5); }
.timeline .t { font-family: var(--sans); font-size: 13px; color: var(--water-7); display: block; }
.actions-table td:first-child { white-space: nowrap; font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.actions-table label.chk { display: flex; gap: 8px; align-items: flex-start; font-family: var(--serif); font-size: 15px; color: var(--ink); margin: 2px 0; cursor: pointer; }
.actions-table label.chk input { margin-top: 6px; }
.actions-table label.chk:has(input:checked) span { color: var(--ink-3); text-decoration: line-through; }

/* 生成进度 */
.progress { list-style: none; padding: 0; margin: 20px 0; }
.progress li { padding: 8px 0 8px 30px; position: relative; color: var(--ink-3); }
.progress li::before { content: "○"; position: absolute; left: 4px; color: var(--ink-3); }
.progress li.done { color: var(--ink-2); }
.progress li.done::before { content: "●"; color: var(--water-5); }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress li.now::before { content: "◐"; color: var(--tide-mark); }

/* 港 */
.harbor-list { display: grid; gap: 14px; }
.harbor-list .card h3 { margin: 0 0 4px; }
.reports-mini { list-style: none; padding: 0; margin: 10px 0 0; font-size: 15px; }
.reports-mini li { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding: 6px 0; }

/* 打印 */
@media print {
  .site-head, .site-foot, .toc, .feedback-link, .no-print { display: none !important; }
  .report-layout { display: block; }
  .report .basis { display: none; }
  body { background: #fff; font-size: 13pt; }
}

/* ---------- 手机 ---------- */
.site-head nav a { white-space: nowrap; }
.report-layout > * { min-width: 0; }
.report table, .overview table { display: block; overflow-x: auto; max-width: 100%; }
.toc-d > summary { display: none; }
@media (max-width: 900px) {
  .toc-d > summary { display: block; cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
  .toc-d > summary::after { content: " ▾"; color: var(--ink-3); }
  .toc-d[open] > summary { margin-bottom: 6px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .brand .sub { display: none; }
  .site-head .wrap { gap: 10px; }
  .site-head nav { gap: 12px; }
  .chart-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  h1 { font-size: 26px; }
}

/* 潮汐图：干支与"现在" */
.tideaxis { padding-top: 12px; }
.tideaxis .gz { font-size: 13px; color: var(--ink-2); display: block; }
.tideaxis .cell { position: relative; }
.tideaxis .cell.now .lvl::after { content: none; }
.tideaxis .cell.now::before { content: "现在"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--tide-mark); color: #fff; font-family: var(--sans); font-size: 11px; border-radius: 999px; padding: 0 8px; line-height: 18px; white-space: nowrap; z-index: 1; }
.tideaxis .cell.now .lvl { font-weight: 600; }
