/* TaxMetra — The Assessor's Ledger（估税官台账）
 * 米色台账纸 + 横线纹理 · 墨绿黑 × 估税官绿 × 戳记红 × 财政金
 * DM Serif Display 铭牌衬线 + Public Sans 表单正文 + Spline Sans Mono 台账数字
 */
:root {
  --paper: #f7f4ec;             /* 台账米纸 */
  --paper-2: #efeadd;
  --card: #ffffff;
  --ink: #1d2b24;               /* 墨绿黑 */
  --ink-soft: #47564d;
  --ink-faint: #8b968d;
  --green: #2e6b4f;             /* 估税官绿 */
  --green-deep: #1f4c38;
  --green-soft: rgba(46, 107, 79, .09);
  --red: #b23a2e;               /* 戳记红 */
  --red-soft: rgba(178, 58, 46, .08);
  --gold: #a07c1c;              /* 财政金 */
  --gold-soft: rgba(160, 124, 28, .12);
  --navy: #274a68;
  --rule: rgba(29, 43, 36, .07);
  --line: #e0dccc;
  --line-strong: #c4bda8;
  --shadow-sm: 0 1px 3px rgba(29, 43, 36, .07);
  --shadow-md: 0 8px 26px rgba(29, 43, 36, .1);
  --display: 'DM Serif Display', Georgia, serif;
  --body: 'Public Sans', 'Segoe UI', sans-serif;
  --mono: 'Spline Sans 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: var(--paper);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.site-header {
  background: var(--green-deep); color: #f2efe3;
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 60;
}
.site-header .inner {
  max-width: 1560px; margin: 0 auto; padding: 10px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.logo-img { width: 38px; height: 38px; flex: 0 0 38px; }
.logo-text {
  font-family: var(--display); font-size: 22px; letter-spacing: .01em; color: #f7f4ec;
  display: flex; flex-direction: column; line-height: 1.12;
}
.logo-text em {
  font-family: var(--mono); font-style: normal; font-size: 9.5px; letter-spacing: .22em;
  text-transform: uppercase; color: #c9b98a;
}
.nav-links { display: flex; gap: 4px; list-style: none; align-items: center; }
.nav-links a {
  color: #d9d4c0; text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 7px; transition: color .15s, background .15s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.menu-btn { display: none; background: none; border: 1.5px solid rgba(255,255,255,.3); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.menu-btn .bar { display: block; width: 20px; height: 2px; background: #f2efe3; margin: 4px 0; transition: .2s; }
.menu-btn.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open .bar:nth-child(2) { opacity: 0; }
.menu-btn.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ 版式容器 ============ */

.wrap { max-width: 1560px; margin: 0 auto; padding: 0 28px 30px; }
.inner { max-width: 1560px; margin: 0 auto; padding: 0 28px; }
.inner.narrow { max-width: 900px; }

.hero { padding: 26px 4px 20px; }
.hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.2vw, 40px);
  letter-spacing: -.005em; line-height: 1.14;
}
.hero h1 .accent { color: var(--green); font-style: italic; }
.hero-sub { color: var(--ink-soft); font-size: 14.5px; max-width: 760px; margin-top: 8px; }

/* ============ 工具区 ============ */

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

/* 输入面板 = 台账纸 */
.inputs {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.panel-head {
  background: var(--ink); color: #f2efe3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
}
.panel-stamp {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); border: 1.5px solid var(--gold); border-radius: 5px; padding: 3px 9px;
}
.panel-no { font-family: var(--mono); font-size: 11px; color: #b7bfae; letter-spacing: .12em; }

.fields {
  padding: 16px 18px 18px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
}

.field { margin-bottom: 13px; }
.field label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink);
  margin-bottom: 5px;
}
.field label .ln { font-family: var(--mono); font-size: 10px; color: var(--green); letter-spacing: .05em; }
.f-hint { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--ink-faint); }

input[type="number"], select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  font-family: var(--mono); font-size: 14px; color: var(--ink); background: #fdfcf7;
  transition: border-color .15s, box-shadow .15s;
}
input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
select { cursor: pointer; }

.money-row { position: relative; display: flex; align-items: center; }
.money-sign {
  position: absolute; left: 12px; font-family: var(--mono); font-size: 13.5px;
  color: var(--ink-faint); pointer-events: none;
}
.money-row input { padding-left: 28px; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 65+ 复选 */
.check-row { display: flex; align-items: center; gap: 9px; margin: 2px 0 12px; }
.check-row input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; flex: 0 0 17px;
}
.check-row label { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); cursor: pointer; margin: 0; display: flex; gap: 8px; }
.check-row label .ln { font-family: var(--mono); font-size: 10px; color: var(--green); }

.fieldset-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin: 16px 0 10px; padding-top: 12px;
  border-top: 1.5px dashed var(--line-strong);
}
.assumption { font-size: 11.5px; color: var(--ink-faint); line-height: 1.55; margin-top: 14px; padding-top: 10px; border-top: 1.5px dashed var(--line-strong); }

/* ============ 结果区 ============ */

.results { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.headline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.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(--ink);
}
.hl-cell.hl-green::before { background: var(--green); }
.hl-cell.hl-red::before { background: var(--red); }
.hl-cell.hl-gold::before { background: var(--gold); }
.hl-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 7px;
}
.hl-num {
  font-family: var(--display); font-size: clamp(26px, 2.6vw, 38px); line-height: 1.05;
  color: var(--ink); letter-spacing: -.01em;
}
.hl-cell.hl-green .hl-num { color: var(--green-deep); }
.hl-cell.hl-red .hl-num { color: var(--red); }
.hl-cell.hl-gold .hl-num { color: var(--gold); }
.hl-sub { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* 退税 / 补税印章 */
.stamp-bar { display: flex; gap: 12px; align-items: stretch; }
.stamp {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 12px 20px; box-shadow: var(--shadow-sm);
}
.stamp .s-word {
  font-family: var(--display); font-size: 21px; letter-spacing: .06em; text-transform: uppercase;
  border: 3px double currentColor; border-radius: 7px; padding: 4px 13px;
  transform: rotate(-2.5deg); opacity: .92;
}
.stamp.s-refund { color: var(--green-deep); }
.stamp.s-refund .s-word { background: var(--green-soft); }
.stamp.s-due { color: var(--red); }
.stamp.s-due .s-word { background: var(--red-soft); }
.stamp .s-amount { font-family: var(--mono); font-size: 21px; font-weight: 600; color: var(--ink); }
.stamp .s-note { font-size: 11.5px; color: var(--ink-faint); text-align: right; line-height: 1.4; }

/* Tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink-soft);
  border: 1.5px solid var(--line-strong); border-radius: 9px;
  padding: 9px 16px; cursor: pointer; transition: all .15s; font-weight: 600;
}
.tab:hover { color: var(--ink); border-color: var(--ink-faint); }
.tab.active { background: var(--ink); color: #f2efe3; border-color: var(--ink); }

.view {
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 20px 22px;
}
.view.hidden { display: none; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }

.sheet-title {
  font-family: var(--display); font-weight: 400; font-size: 19px; margin-bottom: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* 台账表 */
.ledger-table { width: 100%; border-collapse: collapse; }
.ledger-table th {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); text-align: right; padding: 7px 10px;
  border-bottom: 2px solid var(--ink);
}
.ledger-table th:first-child { text-align: left; }
.ledger-table td {
  padding: 8px 10px; font-size: 13.5px; border-bottom: 1px solid var(--rule);
  text-align: right; font-family: var(--mono);
}
.ledger-table td:first-child { text-align: left; font-family: var(--body); }
.ledger-table tr.total-row td {
  border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; padding-top: 9px;
}
.ledger-table tr.hit td { background: var(--green-soft); }
.ledger-table tr.zero-row td { color: var(--ink-faint); }

.rate-chip {
  display: inline-block; font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 6px; background: var(--paper-2); color: var(--ink-soft);
}
.rate-chip.r1 { background: var(--green-soft); color: var(--green-deep); }
.rate-chip.r2 { background: var(--gold-soft); color: var(--gold); }
.rate-chip.r3 { background: var(--red-soft); color: var(--red); }

.marginal-note {
  margin-top: 12px; font-size: 12.5px; color: var(--ink-soft);
  background: var(--paper-2); border-left: 3px solid var(--gold);
  padding: 9px 13px; border-radius: 0 8px 8px 0; line-height: 1.5;
}
.marginal-note strong { font-family: var(--mono); color: var(--gold); }

/* 工资单频率 */
.seg { display: flex; gap: 0; border: 1.5px solid var(--line-strong); border-radius: 9px; overflow: hidden; margin-bottom: 15px; }
.seg-btn {
  flex: 1; padding: 9px 6px; background: var(--paper-2); color: var(--ink-soft);
  border: none; cursor: pointer; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600; transition: all .15s;
}
.seg-btn + .seg-btn { border-left: 1.5px solid var(--line-strong); }
.seg-btn.active { background: var(--green-deep); color: #f2efe3; }
.pay-net {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  background: var(--green-soft); border: 1.5px dashed var(--green); border-radius: 10px;
  padding: 12px 17px; margin-bottom: 14px;
}
.pay-net .pn-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--green-deep); }
.pay-net .pn-amount { font-family: var(--display); font-size: 30px; color: var(--green-deep); }
.pay-net .pn-note { font-size: 11px; color: var(--ink-soft); }

/* 备注 */
.sheet-notes p { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; line-height: 1.6; }
.sheet-notes strong { color: var(--ink); }
.notes-list { list-style: none; }
.notes-list li {
  font-size: 12.5px; color: var(--ink-soft); padding: 7px 0 7px 22px; position: relative;
  border-bottom: 1px dashed var(--rule); line-height: 1.5;
}
.notes-list li::before {
  content: '§'; position: absolute; left: 2px; top: 7px;
  font-family: var(--display); color: var(--gold); font-size: 14px;
}
.mono-note { font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--paper-2); padding: 9px 12px; border-radius: 8px; line-height: 1.6; overflow-x: auto; }

/* ============ 内容区 / 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: 17px; margin-bottom: 8px; }
.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(--green); 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(--green-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(--gold); 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: 19px; }
.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(--green-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; }

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

/* ============ 响应式 ============ */

@media (max-width: 1200px) {
  .tool-grid { grid-template-columns: 360px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .tool-grid { grid-template-columns: 1fr; }
  .view-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 700px) {
  .wrap, .inner, .site-header .inner, .foot-inner { padding-left: 16px; padding-right: 16px; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--green-deep); flex-direction: column; align-items: stretch;
    padding: 8px 16px 14px; gap: 2px; border-bottom: 3px solid var(--gold);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 10px; font-size: 15px; }
  .menu-btn { display: block; }
  .headline { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; }
  .stamp { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stamp .s-note { text-align: left; }
  .view { padding: 16px 14px; }
  .ledger-table th, .ledger-table td { padding: 7px 6px; font-size: 12.5px; }
  .article-content article { padding: 34px 22px; }
  .foot-inner { grid-template-columns: 1fr; }
  .hero { padding-top: 18px; }
}
@media (hover: none) {
  .tab:hover, .nav-links a:hover, .seg-btn:hover { color: inherit; background: inherit; border-color: var(--line-strong); }
  .tab.active:hover { background: var(--ink); color: #f2efe3; }
  .article-list a:hover, .related-articles a:hover { border-color: #e0e0e0; box-shadow: none; }
}
