/* ============================================================
   CoinMetra — "The Trading Tape"
   交易所票据带 × 涨绿跌红 × 硬朗黑体标题 × 等宽数字
   浅色宽幅：交易所行情带的秩序感
   ============================================================ */

:root {
  --paper: #f2f4f3;            /* 冷雾纸 */
  --paper-2: #e8ecea;
  --card: #ffffff;
  --ink: #14201c;              /* 深墨绿黑 */
  --ink-soft: #4a5a54;
  --ink-faint: #8c9a93;
  --up: #0d8a4f;               /* 涨绿 */
  --up-deep: #0a6b3e;
  --up-soft: rgba(13, 138, 79, .09);
  --down: #d6362e;             /* 跌红 */
  --down-soft: rgba(214, 54, 46, .08);
  --amber: #b07a10;            /* 中性/警示琥珀 */
  --amber-soft: rgba(176, 122, 16, .1);
  --volt: #f5c518;             /* 行情带电压黄 */
  --line: #dde3e0;
  --line-strong: #b8c2bd;
  --shadow-sm: 0 1px 3px rgba(20, 32, 28, .06);
  --shadow-md: 0 8px 26px rgba(20, 32, 28, .1);
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --body: 'Archivo', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(20, 32, 28, .025) 34px 35px),
    var(--paper);
  font-size: 15.5px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--up-deep); }

.wrap { max-width: 1560px; margin: 0 auto; padding: 0 30px 40px; }
.inner { max-width: 1080px; margin: 0 auto; }
.inner.narrow { max-width: 820px; }

/* ============ 行情跑马灯带 ============ */

.ticker {
  display: flex; gap: 34px; overflow: hidden; white-space: nowrap;
  background: var(--ink); color: var(--volt);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; padding: 6px 0 5px;
  animation: tickerSlide 40s linear infinite;
}
@keyframes tickerSlide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ Header ============ */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 244, 243, .93);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
.site-header .inner {
  max-width: 1560px; padding: 0 30px;
  height: 68px; display: flex; align-items: center; gap: 28px;
  position: relative;
}
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.logo-img { width: 38px; height: 38px; flex: none; }
.logo-text {
  font-family: var(--display); font-size: 20px; letter-spacing: -.01em;
  display: flex; align-items: baseline; gap: 9px;
}
.logo-text em {
  font-family: var(--mono); font-style: normal; font-size: 10.5px;
  color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase;
}
nav { margin-left: auto; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  display: block; padding: 8px 13px; border-radius: 8px;
  font-weight: 500; font-size: 14.5px; text-decoration: none;
  color: var(--ink-soft); transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--up-deep); background: var(--up-soft); }

/* 汉堡按钮（桌面隐藏） */
.menu-btn {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; width: 42px; height: 42px; margin-left: auto;
  border: 1.5px solid var(--ink); border-radius: 10px;
  background: var(--card); cursor: pointer; padding: 0;
}
.menu-btn .bar { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s; }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */

.hero { padding: 28px 0 22px; border-bottom: 1px solid var(--line-strong); }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(26px, 3vw, 38px); line-height: 1.12; letter-spacing: -.015em;
}
.hero h1 .accent { color: var(--up); }
.hero-sub { margin-top: 8px; color: var(--ink-soft); font-size: 15.5px; max-width: 720px; }

/* ============ Tool ============ */

.tool { padding: 26px 0 8px; }
.tool-grid { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 22px; align-items: start; }

/* --- 输入面板 --- */
.inputs {
  background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  padding: 20px 22px 22px; position: sticky; top: 88px;
  box-shadow: 5px 5px 0 rgba(20, 32, 28, .12);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-stamp {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; color: var(--ink);
  background: var(--volt); border-radius: 5px; padding: 2px 8px;
  transform: rotate(-2deg);
}
.panel-no { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }

.field { margin-bottom: 16px; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink);
}
.f-hint { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); font-weight: 500; }

.money-row {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line-strong); border-radius: 9px;
  background: #fff; padding: 0 12px; height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.money-row:focus-within { border-color: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.money-sign { font-family: var(--mono); font-size: 16px; color: var(--ink-faint); }
.money-row input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--ink);
  min-width: 0; height: 100%;
}

/* 币种网格 */
.coin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.coin-btn {
  height: 38px; border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: #fff; font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.coin-btn:hover { border-color: var(--up); color: var(--up-deep); }
.coin-btn.active { background: var(--ink); border-color: var(--ink); color: var(--volt); }

/* 分段选择 */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-btn {
  height: 40px; border: 1.5px solid var(--line-strong); border-radius: 9px;
  background: #fff; font-family: var(--body); font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.seg-btn:hover { border-color: var(--up); color: var(--up-deep); }
.seg-btn.active { background: var(--up); border-color: var(--up); color: #fff; }

.live-btn {
  margin-top: 8px; width: 100%; height: 36px;
  border: 1.5px dashed var(--line-strong); border-radius: 8px;
  background: var(--paper-2); font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.live-btn:hover { border-color: var(--up); color: var(--up-deep); }
.live-btn:disabled { opacity: .5; cursor: wait; }
.f-note { font-size: 12px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ledger-rule { border-top: 1.5px dashed var(--line-strong); margin: 4px 0 14px; }
.assumption { font-size: 11.5px; color: var(--ink-faint); line-height: 1.55; }

/* --- 结果区 --- */
.results { min-width: 0; }

.headline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.hl-cell {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 16px 20px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.hl-cell::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--line-strong);
}
.hl-cell.pos::before { background: var(--up); }
.hl-cell.neg::before { background: var(--down); }
.hl-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 6px;
}
.hl-num {
  font-family: var(--mono); font-size: clamp(26px, 2.6vw, 40px); font-weight: 700;
  line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.hl-num.pos { color: var(--up); }
.hl-num.neg { color: var(--down); }
.hl-num.hl-amber { color: var(--amber); }
.hl-num.hl-red { color: var(--down); }
.hl-num.hl-green { color: var(--up); }
.hl-sub { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.hl-sub.pos { color: var(--up-deep); }
.hl-sub.neg { color: var(--down); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2.5px solid var(--ink); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 18px 9px; border: none; background: transparent; cursor: pointer;
  font-family: var(--body); font-size: 14px; font-weight: 700; color: var(--ink-soft);
  border-radius: 9px 9px 0 0; position: relative; top: 2.5px;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--up-deep); }
.tab.active {
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--ink); border-bottom: 3.5px solid var(--card);
}
.view.hidden, .hidden { display: none !important; }

.view-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.sheet {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 20px 22px; box-shadow: var(--shadow-sm); min-width: 0;
}
.sheet-title {
  font-family: var(--display); font-weight: 400; font-size: 17px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.sheet-notes p { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.sheet-notes strong { color: var(--ink); }
.sheet-notes em { font-style: normal; color: var(--up-deep); font-weight: 600; }
.mono-note {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  background: var(--paper-2); border-radius: 7px; padding: 9px 12px; line-height: 1.6;
  overflow-wrap: break-word;
}

/* 结算表 */
.ledger-table { width: 100%; border-collapse: collapse; font-family: var(--mono); }
.ledger-table th {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); text-align: right; padding: 7px 10px;
  border-bottom: 2px solid var(--ink);
}
.ledger-table th:first-child, .ledger-table td:first-child { text-align: left; }
.ledger-table td {
  font-size: 13.5px; padding: 9px 10px; text-align: right;
  border-bottom: 1px solid var(--line); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ledger-table tr:hover td { background: var(--up-soft); }
.ledger-table td.pos { color: var(--up); font-weight: 600; }
.ledger-table td.neg { color: var(--down); font-weight: 600; }
.ledger-table td.lead-row { font-weight: 700; }
.ledger-table tr.total td { font-weight: 700; border-bottom: none; }

/* DCA */
.add-lot {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 6px 13px; border: 1.5px solid var(--ink); border-radius: 7px;
  background: var(--volt); color: var(--ink); cursor: pointer; transition: all .15s;
}
.add-lot:hover { background: var(--ink); color: var(--volt); }
.lots-table input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 6px;
  padding: 6px 8px; font-family: var(--mono); font-size: 13px; color: var(--ink);
  background: #fff; text-align: right;
}
.lots-table input:focus { outline: none; border-color: var(--up); }
.del-lot {
  width: 30px; height: 30px; border: 1.5px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--down); font-size: 15px; cursor: pointer;
  transition: all .15s; line-height: 1;
}
.del-lot:hover { border-color: var(--down); background: var(--down-soft); }
.dca-summary {
  margin-top: 16px; padding: 14px 16px; background: var(--paper-2); border-radius: 9px;
  font-family: var(--mono); font-size: 13px; line-height: 1.9; color: var(--ink);
}
.dca-summary b { color: var(--up-deep); }
.dca-summary .neg-val { color: var(--down); }

/* 税费 */
.tax-result { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 4px; }
.idr-cell {
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 15px 18px;
  background: #fff;
}
select {
  width: 100%; height: 46px; padding: 0 12px;
  border: 1.5px solid var(--line-strong); border-radius: 9px; background: #fff;
  font-family: var(--body); font-size: 14.5px; font-weight: 500; color: var(--ink);
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.tax-note {
  margin-top: 12px; font-family: var(--mono); font-size: 12px;
  color: var(--ink-soft); background: var(--paper-2); border-radius: 8px;
  padding: 11px 14px; line-height: 1.7;
}
.tax-warn {
  margin-top: 10px; font-size: 12.5px; color: var(--amber);
  background: var(--amber-soft); border: 1.5px dashed var(--amber); border-radius: 9px;
  padding: 10px 14px; line-height: 1.55;
}

/* ============ Content / FAQ ============ */

.content-section { padding: 34px 0 6px; }
.content-section h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.4vw, 30px);
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2.5px solid var(--ink);
  letter-spacing: -.01em;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 11px;
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.info-card h3 { font-family: var(--display); font-weight: 400; font-size: 16.5px; margin-bottom: 8px; letter-spacing: 0; }
.info-card p { font-size: 13.8px; color: var(--ink-soft); }

.faq-item {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 11px;
  margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 15px 20px; font-weight: 600; font-size: 15px;
  list-style: none; position: relative; padding-right: 46px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 19px; color: var(--up); font-weight: 600;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary { border-bottom: 1px dashed var(--line-strong); }
.faq-item p { padding: 13px 20px 16px; font-size: 14px; color: var(--ink-soft); }

/* ============ 文章列表（CMS 强制白卡规范） ============ */

.article-list { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.article-list a {
  display: block; padding: 16px 20px;
  border: 1px solid #e0e0e0; border-radius: 8px; background: #ffffff;
  text-decoration: none; transition: border-color .2s, box-shadow .2s; color: #1a1a1a;
}
.article-list a:hover {
  border-color: #2563eb; box-shadow: 0 4px 12px rgba(37, 99, 235, .15);
}
.article-list .article-title { font-weight: 600; font-size: .95rem; color: #1a1a1a; margin-bottom: 6px; line-height: 1.4; }
.article-list a:hover .article-title { color: #2563eb; }
.article-list .article-desc { font-size: .82rem; color: #666; line-height: 1.5; }
.articles-empty { color: var(--ink-faint); font-size: 14px; padding: 14px 0; }
.view-all-link { margin-top: 16px; }

/* ============ 文章详情页（亮色阅读区，强制规范） ============ */

.article-content { padding: 56px 0; background: #f5f6f8; }
.article-content .inner { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.article-content article {
  background: #ffffff; border-radius: 16px; padding: 56px 64px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}
.article-content h1 { font-family: var(--display); font-size: 29px; line-height: 1.3; margin-bottom: 12px; font-weight: 400; }
.article-meta { font-size: 13px; color: #888; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid #eee; }
.article-content h2 { font-family: var(--display); font-size: 21px; margin: 30px 0 12px; font-weight: 400; }
.article-content h3 { font-size: 17px; margin: 22px 0 10px; }
.article-content p { font-size: 15px; line-height: 1.8; color: #333; margin-bottom: 14px; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 14px; color: #333; }
.article-back {
  display: inline-block; margin-bottom: 20px; text-decoration: none;
  color: var(--up-deep); font-weight: 600; font-size: 14px;
}
.article-back:hover { text-decoration: underline; }

.faq-section { margin-top: 36px; border-top: 2px solid #eee; padding-top: 24px; }
.faq-section h2 { font-family: var(--display); font-size: 20px; margin-bottom: 16px; font-weight: 400; }
.faq-section details {
  border: 1px solid #e5e5e5; border-radius: 9px; margin-bottom: 9px; background: #fafafa;
}
.faq-section summary { padding: 13px 17px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.faq-section p { padding: 0 17px 13px; margin: 0; }

.related-articles { margin-top: 36px; border-top: 2px solid #eee; padding-top: 24px; }
.related-articles h2 { font-family: var(--display); font-size: 20px; margin-bottom: 14px; font-weight: 400; }
.related-articles a {
  display: block; padding: 12px 16px; border: 1px solid #e5e5e5; border-radius: 8px;
  background: #fff; text-decoration: none; color: #1a1a1a; margin-bottom: 8px;
  font-weight: 600; font-size: .92rem; transition: border-color .2s;
}
.related-articles a:hover { border-color: #2563eb; color: #2563eb; }

/* ============ Footer ============ */

.site-footer { border-top: 3px solid var(--ink); background: var(--paper-2); margin-top: 50px; }
.foot-inner {
  max-width: 1560px; margin: 0 auto; padding: 34px 30px 20px;
  display: grid; grid-template-columns: minmax(0, 1.6fr) auto auto; gap: 44px;
}
.foot-brand .brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-bottom: 10px; }
.foot-brand img { width: 30px; height: 30px; }
.foot-brand .brand-link span { font-family: var(--display); font-size: 18px; }
.foot-brand p { font-size: 13px; color: var(--ink-soft); max-width: 420px; line-height: 1.6; }
.foot-col h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 10px;
}
.foot-col a { display: block; font-size: 13.5px; color: var(--ink-soft); text-decoration: none; padding: 3.5px 0; }
.foot-col a:hover { color: var(--up-deep); }
.foot-base {
  max-width: 1560px; margin: 0 auto; padding: 14px 30px 18px;
  border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
}

/* ============ 动效 ============ */

@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero h1, .hero-sub { animation: riseIn .5s ease both; }
.hero-sub { animation-delay: .08s; }
.hl-cell { animation: riseIn .5s ease both; }
.hl-cell:nth-child(2) { animation-delay: .07s; }
.hl-cell:nth-child(3) { animation-delay: .14s; }

/* 盈亏数字闪变 */
@keyframes flashUp { 0% { background: var(--up-soft); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: var(--down-soft); } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ 断点 1120px ============ */

@media (max-width: 1120px) {
  .tool-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .view-grid { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr auto; gap: 28px; }
}

/* ============ 断点 760px（手机全量收紧） ============ */

@media (max-width: 760px) {
  .wrap, .site-header .inner, .foot-inner, .foot-base { padding-left: 18px; padding-right: 18px; }
  .ticker { animation: none; }

  /* 头部防横向滚动（7.8.1） */
  .site-header .inner { flex-wrap: wrap; height: auto; padding: 10px 18px; row-gap: 6px; }
  .logo-text { font-size: 17px; }
  .logo-img { width: 32px; height: 32px; }
  .logo-text em { display: none; }
  .menu-btn { display: flex; }
  nav { display: contents; }
  .nav-links {
    position: absolute; top: 100%; left: 14px; right: 14px;
    flex-direction: column; gap: 2px; padding: 8px; margin: 0;
    background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
    box-shadow: 0 14px 40px rgba(20, 32, 28, .16);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links a { padding: 11px 13px; font-size: 15px; }

  /* 布局降单列 */
  .tool-grid { grid-template-columns: 1fr; }
  .inputs { position: static; box-shadow: none; }
  .headline { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; }
  .tax-result { grid-template-columns: 1fr; }
  .coin-grid { grid-template-columns: repeat(5, 1fr); }
  .foot-inner { grid-template-columns: 1fr; gap: 24px; }

  /* 字号与内边距收紧（7.8.4） */
  .hero h1 { font-size: 23px; }
  .hero { padding: 22px 0 18px; }
  .hero-sub { font-size: 14px; }
  .content-section h2 { font-size: 20px; }
  .content-section { padding: 26px 0 4px; }
  .hl-num { font-size: 30px; }
  .inputs, .sheet, .info-card, .faq-item { padding: 14px 15px; }
  .sheet-notes p { font-size: 13.5px; }
  .tab { padding: 9px 12px; font-size: 13px; }
  .ledger-table th, .ledger-table td { padding: 6px 7px; font-size: 12.5px; }
  .money-row input { font-size: 16px; }   /* ≥16px 防 iOS 聚焦缩放 */
  .dca-summary { font-size: 12px; padding: 11px 13px; }

  /* 汉堡 :has 门控（7.7.3，保护无按钮的合规页/文章页） */
  .site-header .inner:not(:has(.menu-btn)) nav { display: block; }
  .site-header .inner:not(:has(.menu-btn)) .nav-links {
    position: static; opacity: 1; visibility: visible; transform: none;
    flex-direction: row; flex-wrap: wrap; gap: 6px;
    background: none; border: none; box-shadow: none; padding: 0;
    transition: none;
  }
  .site-header .inner:not(:has(.menu-btn)) .nav-links a { padding: 6px 9px; font-size: .8rem; }
}

/* ============ 断点 400px（超窄屏） ============ */

@media (max-width: 400px) {
  .coin-grid { grid-template-columns: repeat(4, 1fr); }
  .coin-btn { font-size: 11px; height: 34px; }
  .seg-btn { font-size: 12.5px; height: 38px; }
  .hl-num { font-size: 26px; }
  .lots-table input { font-size: 12px; padding: 5px 6px; }
}

/* 触屏常显（7.8.3） */
@media (hover: none) {
  .tab:hover, .coin-btn:hover, .seg-btn:hover, .add-lot:hover, .del-lot:hover { color: inherit; }
  .coin-btn.active:hover, .seg-btn.active:hover { color: #fff; }
  .coin-btn.active:hover { color: var(--volt); }
  .add-lot:hover { background: var(--volt); color: var(--ink); }
}
