/* ============================================================
   China Tax Notes — US/EU-style reference site design system
   Rebuilt 2026-10-26. Clean editorial look: navy + federal blue,
   generous whitespace, card grids, sticky chrome.
   ============================================================ */

:root {
  --navy-950: #081827;
  --navy-900: #0A1F33;
  --navy-800: #0F2E4C;
  --navy-700: #16436B;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-050: #EFF4FE;
  --ink: #16283A;
  --muted: #5B6B7C;
  --faint: #8B99A8;
  --line: #E3E9F1;
  --line-soft: #EDF1F7;
  --bg: #FFFFFF;
  --bg-soft: #F5F8FB;
  --amber-600: #D97706;
  --amber-050: #FFF8EC;
  --green-700: #0E7C4A;
  --red-600: #DC2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 51, .06);
  --shadow-md: 0 6px 20px -6px rgba(10, 31, 51, .14);
  --wrap: 1120px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .4); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
h1, h2, h3, h4 { color: var(--navy-900); line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 .5em; }

/* ---------- Skip link ---------- */
.skip { position: absolute; left: -9999px; top: 0; background: var(--navy-900); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; color: #fff; text-decoration: none; }

/* ============================ Header ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.02em;
  color: var(--navy-900); white-space: nowrap;
}
.brand:hover { color: var(--navy-800); text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: var(--navy-800); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand .mark svg { width: 17px; height: 17px; display: block; }
.mainnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.mainnav a {
  display: inline-block; padding: 8px 13px; border-radius: 8px;
  color: var(--ink); font-size: 15.5px; font-weight: 500;
}
.mainnav a:hover { background: var(--bg-soft); color: var(--navy-800); text-decoration: none; }
.mainnav a.on { color: var(--blue-700); background: var(--blue-050); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 9px; border: 1px solid transparent;
  font-size: 15.5px; font-weight: 600; cursor: pointer; line-height: 1.3;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue-600); color: var(--blue-700); text-decoration: none; background: var(--blue-050); }
.btn-lg { padding: 13px 26px; font-size: 16.5px; border-radius: 11px; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; stroke: var(--navy-900); }

/* ============================ Hero ============================ */
.hero {
  background:
    radial-gradient(900px 380px at 18% -10%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(700px 320px at 88% 0%, rgba(217, 119, 6, .07), transparent 55%),
    linear-gradient(180deg, #F8FAFD 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--line-soft);
  padding: 72px 0 64px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -0.03em;
  max-width: 780px; margin: 0 auto 16px;
}
.hero h1 .accent { color: var(--blue-600); }
.hero .lede {
  font-size: clamp(17px, 2vw, 19.5px); color: var(--muted);
  max-width: 660px; margin: 0 auto 32px;
}
.hero-search {
  display: flex; max-width: 620px; margin: 0 auto 18px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 6px; box-shadow: var(--shadow-md);
}
.hero-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16.5px; padding: 10px 14px; color: var(--ink); min-width: 0;
}
.hero-search input::placeholder { color: var(--faint); }
.hero-search .btn { border-radius: 10px; flex: 0 0 auto; }
.trust-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--navy-700);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; box-shadow: var(--shadow-sm);
}
.chip svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--green-700); }

/* ============================ Sections ============================ */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: 26px; font-weight: 750; margin: 0; }
.section-head .more { font-size: 15px; font-weight: 600; white-space: nowrap; }
.kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-600); margin-bottom: 8px;
}

/* ---------- Card grids ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #D3DEEA; transform: translateY(-2px); }
.card .cat {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-600);
}
.card h3 { font-size: 18.5px; margin: 0; }
.card h3 a { color: var(--navy-900); }
.card h3 a:hover { color: var(--blue-700); text-decoration: none; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.card .meta { font-size: 13px; color: var(--faint); margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line-soft); }

/* Topic tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-align: left; transition: box-shadow .18s ease, transform .18s ease;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.tile .ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--blue-050);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.tile .ico svg { width: 20px; height: 20px; color: var(--blue-600); }
.tile h3 { font-size: 16.5px; margin: 0 0 4px; color: var(--navy-900); }
.tile p { margin: 0; font-size: 14px; color: var(--muted); }

/* Trust strip */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item .ico {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  background: var(--navy-800); display: flex; align-items: center; justify-content: center;
}
.trust-item .ico svg { width: 22px; height: 22px; color: #fff; }
.trust-item h3 { font-size: 16.5px; margin: 0 0 4px; }
.trust-item p { margin: 0; font-size: 14.5px; color: var(--muted); }

/* ---------- Callout / notice ---------- */
.callout {
  border: 1px solid #F1E2C4; background: var(--amber-050);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 14.5px; color: #7A5410; line-height: 1.65;
}
.callout.blue { border-color: #CFDDF9; background: var(--blue-050); color: var(--navy-700); }
.callout strong { color: inherit; }

/* ============================ Page head (list/page) ============================ */
.pagehead {
  background: linear-gradient(180deg, #F8FAFD, #fff);
  border-bottom: 1px solid var(--line-soft); padding: 46px 0 38px;
}
.pagehead .crumbs { margin-bottom: 12px; }
.pagehead h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 8px; }
.pagehead .lede { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0; }

.crumbs { font-size: 13.5px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--blue-700); }
.crumbs .sep { color: #C4CED9; }

/* ============================ Article layout ============================ */
.artwrap { max-width: var(--wrap); margin: 0 auto; padding: 40px 24px 64px; }
.artlayout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }

.article-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 48px; box-shadow: var(--shadow-sm);
}
.article-card h1 { font-size: clamp(25px, 3.4vw, 33px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 14px; }
.meta-row {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  font-size: 14px; color: var(--muted);
  padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line-soft);
}
.meta-row .lbl { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; margin-right: 5px; }

.article-body { font-size: 17px; line-height: 1.85; color: var(--ink); }
.article-body h2 { font-size: 22px; font-weight: 750; margin: 34px 0 12px; padding-top: 8px; scroll-margin-top: 90px; }
.article-body h3 { font-size: 18px; font-weight: 700; margin: 26px 0 10px; }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; line-height: 1.6;
  border: 1px solid var(--line);
}
.article-body th {
  background: var(--navy-800); color: #fff; text-align: left;
  padding: 10px 14px; font-weight: 650; font-size: 14px; letter-spacing: .02em;
}
.article-body td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.article-body tbody tr:nth-child(even) { background: var(--bg-soft); }
.article-body blockquote {
  margin: 18px 0; padding: 14px 20px; border-left: 4px solid var(--blue-600);
  background: var(--blue-050); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--navy-700);
}
.article-body img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.article-body .lead { font-size: 17.5px; color: var(--navy-700); font-weight: 500; }

.src-note {
  margin-top: 32px; padding: 16px 20px; border-radius: var(--radius);
  border: 1px dashed #C9D6E6; background: var(--bg-soft);
  font-size: 14px; color: var(--muted); line-height: 1.7;
}

/* Sidebar */
.artside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }
.side-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.side-card h3 {
  font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 12px;
}
.side-card ul { list-style: none; margin: 0; padding: 0; }
.side-card li { margin-bottom: 8px; }
.side-card li:last-child { margin-bottom: 0; }
.side-card a { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.side-card a:hover { color: var(--blue-700); }
#toc a { display: block; padding: 5px 0 5px 14px; border-left: 2px solid var(--line); color: var(--muted); }
#toc a:hover { color: var(--blue-700); text-decoration: none; }
#toc a.on { border-left-color: var(--blue-600); color: var(--blue-700); font-weight: 650; }
#toc a.lv3 { padding-left: 28px; font-size: 13.5px; }

/* Collapsible in-article TOC — only shown when the right rail collapses */
.toc-m { display: none; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.toc-m > summary {
  cursor: pointer; list-style: none; padding: 12px 16px; user-select: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--navy-700);
}
.toc-m > summary::-webkit-details-marker { display: none; }
.toc-m > summary::after { content: "+"; font-size: 15px; font-weight: 600; color: var(--faint); line-height: 1; }
.toc-m[open] > summary::after { content: "\2212"; }
.toc-m > summary:hover { color: var(--blue-700); }
.toc-m nav { display: flex; flex-direction: column; padding: 2px 16px 14px; }
.toc-m a { font-size: 14.5px; color: var(--muted); padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.toc-m a:hover { color: var(--blue-700); text-decoration: none; }
.toc-m a.on { color: var(--blue-700); border-left-color: var(--blue-600); font-weight: 650; }
.toc-m a.lv3 { padding-left: 26px; font-size: 13.5px; }

/* ============================ Lists / archive ============================ */
.arch { display: flex; flex-direction: column; gap: 14px; }
.arch-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; transition: box-shadow .15s ease, border-color .15s ease;
}
.arch-item:hover { box-shadow: var(--shadow-md); border-color: #D3DEEA; }
.arch-item h3 { font-size: 18.5px; margin: 0 0 6px; }
.arch-item h3 a { color: var(--navy-900); }
.arch-item h3 a:hover { color: var(--blue-700); text-decoration: none; }
.arch-item .ex { color: var(--muted); font-size: 14.5px; margin: 0 0 8px; }
.arch-item .meta { font-size: 13px; color: var(--faint); }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.pager a, .pager span {
  display: inline-flex; min-width: 40px; justify-content: center; align-items: center;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); background: #fff;
}
.pager a:hover { border-color: var(--blue-600); color: var(--blue-700); text-decoration: none; }
.pager span { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

.empty-note {
  text-align: center; padding: 56px 24px; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft);
}

/* ============================ Search page ============================ */
.search-form {
  display: flex; gap: 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 13px; padding: 6px; box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.search-form input {
  flex: 1; border: 0; outline: 0; background: transparent; font: inherit;
  font-size: 16px; padding: 10px 14px; color: var(--ink); min-width: 0;
}
.search-form .btn { border-radius: 9px; }

/* ============================ Footer ============================ */
.site-footer { background: var(--navy-950); color: #B9C6D4; margin-top: 72px; }
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px;
  padding: 52px 0 40px;
}
.foot-brand .brand { color: #fff; font-size: 18px; }
.foot-brand .brand .mark { background: rgba(255,255,255,.12); }
.foot-brand p { font-size: 14px; line-height: 1.7; color: #8FA1B3; margin: 14px 0 0; max-width: 320px; }
.site-footer h4 {
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; margin: 4px 0 14px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #B9C6D4; font-size: 14.5px; }
.site-footer a:hover { color: #fff; }
.foot-legal {
  border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0 26px;
  font-size: 13px; color: #74879B; line-height: 1.7;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}

/* ============================ Responsive ============================ */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .trust { grid-template-columns: 1fr; }
  .artlayout { grid-template-columns: 1fr; }
  .artside { position: static; }
  .article-card { padding: 32px 28px; }
  .toc-m { display: block; }
  #tocbox { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header-in { height: 58px; }
  .nav-toggle { display: inline-flex; }
  .mainnav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow-md); margin-left: 0;
  }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 11px 12px; font-size: 16px; }
  .header-actions .btn-ghost { display: none; }
  .hero { padding: 48px 0 44px; }
  .hero-search { flex-direction: column; padding: 8px; }
  .hero-search .btn { width: 100%; }
  .cards, .tiles { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .article-card { padding: 26px 20px; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .wrap { padding: 0 18px; }
  .artwrap { padding: 24px 18px 48px; }
}

/* ============================ Tool pages (calculators) ============================ */
.toolhead {
  background: linear-gradient(180deg, #F8FAFD, #fff);
  border-bottom: 1px solid var(--line-soft); padding: 46px 0 38px;
}
.toolhead h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 8px; }
.toolhead .lede { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0; }

.toolwrap { max-width: 820px; margin: 0 auto; padding: 40px 24px 64px; }

.calc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 32px; box-shadow: var(--shadow-md);
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 650; color: var(--navy-800); }
.field input, .field select {
  font: inherit; font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 11px 14px; background: #fff; outline: 0; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.hint { font-size: 13.5px; color: var(--faint); margin: -6px 0 18px; }

.results { margin-top: 24px; border-top: 1px solid var(--line-soft); padding-top: 22px; }
.results h2 { font-size: 15px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0; }
.facts .fact {
  background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 14px 16px;
}
.facts dt { font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 21px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.01em; }
.facts dd small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.facts .hero-fact dd { font-size: 26px; color: var(--blue-700); }

@media (max-width: 720px) {
  .calc { padding: 22px 18px; }
  .calc-grid { grid-template-columns: 1fr; }
  .toolwrap { padding: 28px 18px 48px; }
}
