/* China Plainly — site styles. System fonts only; no external requests. */
:root {
  --brand: #c8102e; --brand-dark: #a00d25; --brand-tint: #fdf0f2;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #cbd5e1;
  --bg: #ffffff; --surface: #f8fafc; --surface-2: #f1f5f9;
  --ok: #047857; --ok-tint: #ecfdf5; --no: #b42318; --no-tint: #fef3f2;
  --warn: #b45309; --warn-tint: #fffbeb; --warn-line: #f59e0b;
  --link: #0b5cad;
  --radius: 14px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%), 0 1px 3px rgb(15 23 42 / 6%);
  --shadow: 0 4px 14px rgb(15 23 42 / 8%), 0 2px 4px rgb(15 23 42 / 5%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #f0435e; --brand-dark: #ff6b80; --brand-tint: #2a1418;
    --ink: #e5e7eb; --ink-2: #cbd5e1; --muted: #94a3b8; --line: #1f2937; --line-2: #334155;
    --bg: #0b1120; --surface: #111827; --surface-2: #172033;
    --ok: #34d399; --ok-tint: #0c2a22; --no: #f87171; --no-tint: #2b1212;
    --warn: #fbbf24; --warn-tint: #2a2210; --warn-line: #b45309;
    --link: #7cb7ff;
    --shadow-sm: none; --shadow: 0 6px 20px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--ink-2); background: var(--bg); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.015em; }
h2 { font-size: 1.4rem; margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin: 0.3rem 0; }
strong { color: var(--ink); }
.muted { color: var(--muted); font-size: 0.92rem; }
.zh { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand b { color: var(--brand); font-weight: 700; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }

/* Page heading */
.page-head { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); padding: 28px 0 30px; }
.page-head h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem); margin: 0.3rem 0 0.7rem; max-width: 22em; }
.page-head .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46em; margin: 0; }
.crumbs { font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.checked { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 0.85rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.checked .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }

.home .page-head { padding: 56px 0 52px; background: radial-gradient(1200px 400px at 85% -10%, var(--brand-tint), transparent 60%), linear-gradient(180deg, var(--surface), var(--bg)); }
.home .page-head h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.3rem); max-width: 16em; }
.home .page-head .lead { font-size: 1.25rem; }

.content { padding-top: 28px; padding-bottom: 64px; }
.content > p, .content > ul, .content > ol { max-width: 48em; }
.content > .warning { max-width: none; }

/* Feature cards (home) */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 4px 0 28px; }
.feature { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink-2); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--ink-2); }
.feature strong { font-size: 1.08rem; }
.feature span { font-size: 0.95rem; color: var(--muted); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand) !important; margin-bottom: 6px; }
.icon { width: 24px; height: 24px; }
.icon.small { width: 18px; height: 18px; }
.feature .go { position: absolute; right: 18px; top: 22px; color: var(--line-2); transition: color .15s ease, transform .15s ease; }
.feature:hover .go { color: var(--brand); transform: translateX(2px); }
.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: start; }
.split h2 { margin-top: 0.6rem; }
.link-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.link-list li { margin: 0; border-bottom: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 4px; text-decoration: none; color: var(--ink); font-weight: 500; }
.link-list a::after { content: "→"; flex: none; color: var(--muted); transition: transform .15s ease; }
.link-list a:hover::after { color: var(--brand); transform: translateX(2px); }
.link-list a:hover { color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.card:hover { border-color: var(--brand); }
.card strong { display: block; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 0.93rem; }

/* Tools and forms */
.tool { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0 26px; box-shadow: var(--shadow); }
.tool h2 { margin: 0 0 14px; font-size: 1.15rem; }
.row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: end; margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
input, select, button { font: inherit; font-size: 1rem; }
input[type="date"], input[type="number"], select {
  display: block; margin-top: 6px; min-height: 44px; padding: 8px 12px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); min-width: 12rem; max-width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.row > input[type="date"] { margin-top: 0; }
button { min-height: 44px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; }
button:hover { background: var(--surface-2); }
fieldset.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 0 0 14px; }
fieldset.checks legend { font-weight: 600; font-size: 0.9rem; color: var(--ink); padding: 0 6px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 18px 6px 0; }
label.inline input { width: 18px; height: 18px; accent-color: var(--brand); }

.result { margin-top: 8px; }
.result:empty { display: none; }
.answer { font-size: 1.45rem; font-weight: 700; color: var(--ink); margin: 6px 0 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border-left: 5px solid var(--line-2); }
.answer.yes { color: var(--ok); background: var(--ok-tint); border-left-color: var(--ok); }
.answer.no { color: var(--no); background: var(--no-tint); border-left-color: var(--no); }
.big .answer { font-size: 2.6rem; font-variant-numeric: tabular-nums; padding: 10px 18px; }
.error { color: var(--no); font-weight: 600; }
.warning { position: relative; background: var(--warn-tint); border: 1px solid color-mix(in srgb, var(--warn-line) 45%, transparent); border-left: 5px solid var(--warn-line); border-radius: var(--radius-sm); padding: 12px 16px 12px 46px; color: var(--ink-2); max-width: none; }
.warning::before { content: "!"; position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--warn-line); color: #fff; font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; }
ul.options, ol.checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
ul.options li, ol.checklist li { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
ul.options li.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-tint); }
ul.options li.ok strong { color: var(--ok); }
ul.options li.not-ok { color: var(--muted); }
ul.options li.not-ok strong { color: var(--ink-2); }
ol.checklist { counter-reset: step; }
ol.checklist li { counter-increment: step; position: relative; padding-left: 52px; }
ol.checklist li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }

.button { display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; padding: 11px 18px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; box-shadow: var(--shadow-sm); }
.button:hover { background: var(--brand-dark); color: #fff; }

/* Tables */
.table-wrap, table.data { margin: 14px 0 22px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
table.data th, table.data td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--surface); color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
table.data tbody th { color: var(--ink); width: 28%; background: var(--surface); }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--surface) 70%, transparent); }
table.compact td, table.compact th { padding: 7px 8px; text-align: center; }
.table-wrap { overflow-x: auto; }
tr.hour-office td { background: var(--ok-tint); }
tr.hour-lunch td { background: var(--warn-tint); }
tr.current td { font-weight: 700; color: var(--ink); box-shadow: inset 0 2px 0 var(--brand), inset 0 -2px 0 var(--brand); }

/* FAQ and sources */
.faq { margin-top: 2.4rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; margin: 10px 0; background: var(--bg); }
.faq details[open] { background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 14px 24px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.4rem; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }
.source { margin-top: 40px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--muted); }
.source ul { margin: 8px 0; padding-left: 1.1em; }
.source a { color: var(--ink-2); }
.big-list { list-style: none; padding: 0; }
.big-list li { margin: 12px 0; font-size: 1.05rem; }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 48px 0 28px; font-size: 0.92rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand b { color: #ff6b80; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-about p { color: #94a3b8; margin-top: 12px; max-width: 22em; }
.site-footer h2 { color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.fineprint { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 18px; color: #94a3b8; font-size: 0.82rem; }

/* Responsive */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 10px; padding-bottom: 6px; min-height: 0; }
  .main-nav { width: calc(100% + 12px); overflow-x: auto; scrollbar-width: none; margin: 0 -6px; padding-bottom: 4px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 6px 10px; font-size: 0.9rem; }
  .site-header { position: static; }
  .page-head { padding-top: 20px; padding-bottom: 22px; }
  .content { padding-top: 22px; }
  .home .page-head { padding-top: 32px; padding-bottom: 30px; }
  .feature-grid { grid-template-columns: 1fr; gap: 10px; }
  .feature { padding: 16px 16px 16px 76px; min-height: 76px; }
  .feature-icon { position: absolute; left: 16px; top: 16px; margin: 0; }
  .tool { padding: 16px; }
  .row > label, .row input[type="date"], .row select { width: 100%; }
  input[type="date"], input[type="number"], select { width: 100%; min-width: 0; }
  table.data { display: block; overflow-x: auto; font-size: 0.88rem; }
  table.data tbody th { width: auto; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .skip, .button { display: none; }
  .page-head { background: none; border: 0; }
  .tool, .feature { box-shadow: none; }
}

/* Language switcher and Chinese typography */
.header-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lang-switch { flex: none; display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 600; background: var(--bg); }
.lang-switch::before { content: ""; width: 14px; height: 14px; margin-right: 6px; border: 1.6px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) center/1.6px 100% no-repeat, linear-gradient(currentColor, currentColor) center/100% 1.6px no-repeat; opacity: .75; }
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }
.lang-zh { line-height: 1.75; }
.lang-zh h1, .lang-zh h2, .lang-zh h3 { letter-spacing: 0; }
.lang-zh .page-head h1 { line-height: 1.3; }
@media (max-width: 720px) {
  .header-row { position: relative; }
  .header-right { width: 100%; }
  .lang-switch { position: absolute; right: 16px; top: 10px; }
}
