/* ============================================================
 * style.css · Subbie Compliance Flow
 * 纯本地样式，无任何外链字体/图标/库。
 * 约束：375px 无横向滚动；触控目标 ≥44px；NL/ES 长词不撑破布局；
 *       深色模式跟随系统；打印只输出留痕记录。
 * ============================================================ */

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #4b5568;
  --line: #d9dfea;
  --brand: #1c3f8f;
  --brand-ink: #ffffff;
  --ok: #14653a;
  --okbg: #e6f4ec;
  --warn: #8a4b00;
  --warnbg: #fdf1de;
  --bad: #a1121b;
  --badbg: #fdeaec;
  --grey: #4b5568;
  --greybg: #eef1f6;
  --focus: #0b63d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --card: #171d27;
    --ink: #eef2f8;
    --muted: #b9c3d4;
    --line: #2c3543;
    --brand: #8fb4ff;
    --brand-ink: #0c1220;
    --ok: #7fd6a1;
    --okbg: #12291d;
    --warn: #f0c07a;
    --warnbg: #2b2113;
    --bad: #ff9aa2;
    --badbg: #2e1519;
    --grey: #b9c3d4;
    --greybg: #1b2230;
    --focus: #8fb4ff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html, body { max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
  word-break: normal;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--brand); }
a:hover { text-decoration: underline; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 12px 16px;
  border: 2px solid var(--focus);
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

header.site .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0 10px;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
}

.spacer { flex: 1 1 auto; }

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.lang a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
}

.lang a[aria-current="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.tagline {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

main { padding: 18px 0 40px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 16px;
}

.panel > h2 {
  font-size: 17px;
  margin: 0 0 4px;
}

.panel > p.sub {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.steps {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.banner {
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  background: var(--greybg);
  color: var(--ink);
}

.banner.info { background: var(--warnbg); border-color: var(--warn); }
.banner.bad { background: var(--badbg); border-color: var(--bad); }
.banner.ok { background: var(--okbg); border-color: var(--ok); }

label.field {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea,
button,
.file-btn {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 9px 11px;
  max-width: 100%;
}

textarea { min-height: 66px; resize: vertical; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
.file-btn:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button, .file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

button.primary, .file-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

button:disabled { opacity: .6; cursor: progress; }

button.link {
  background: none;
  border: none;
  color: var(--brand);
  text-decoration: underline;
  padding: 6px 2px;
  min-height: 44px;
}

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

@media (min-width: 640px) {
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: repeat(3, 1fr); }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.row > * { min-width: 0; }

.verdict {
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 2px solid var(--line);
  margin: 0 0 12px;
}

.verdict.ready { border-color: var(--ok); background: var(--okbg); }
.verdict.blocked { border-color: var(--bad); background: var(--badbg); }

.verdict h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.verdict p { margin: 0; font-size: 13.5px; }

.verdict ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; }

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--greybg);
  color: var(--grey);
  white-space: nowrap;
}

.chip.expired { background: var(--badbg); border-color: var(--bad); color: var(--bad); }
.chip.soon { background: var(--warnbg); border-color: var(--warn); color: var(--warn); }
.chip.valid { background: var(--okbg); border-color: var(--ok); color: var(--ok); }
.chip.incomplete, .chip.missing, .chip.nodate { background: var(--greybg); border-color: var(--grey); color: var(--grey); }

.item {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
  background: var(--card);
}

.item.s-missing { border-left-color: var(--grey); }
.item.s-nodate { border-left-color: var(--grey); }
.item.s-expired { border-left-color: var(--bad); }
.item.s-soon { border-left-color: var(--warn); }
.item.s-valid { border-left-color: var(--ok); }

.item .top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.item .top .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

label.file-btn { cursor: pointer; }

.item .tick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  min-width: 0;
}

.item .tick input { width: 22px; height: 22px; min-height: 22px; }

.item .name { min-width: 0; overflow-wrap: anywhere; }

.item .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.details {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

@media (min-width: 720px) {
  .details { grid-template-columns: repeat(2, 1fr); }
}

.details label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 3px; }
.details input, .details select { width: 100%; }
.details .wide { grid-column: 1 / -1; }

.scrollbox {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.dash-row:last-child { border-bottom: none; }

.dash-row .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.dash-row .nx { font-size: 12.5px; color: var(--muted); }
.dash-row .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  background: var(--greybg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin: 6px 0 0;
}

.rec {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card);
}

.rec h4 { margin: 0 0 4px; font-size: 14.5px; overflow-wrap: anywhere; }
.rec .meta { font-size: 12.5px; color: var(--muted); }

details.disc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

details.disc summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.disc ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--muted); }
details.disc li { margin-bottom: 6px; }

footer.site {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

footer.site p { margin: 0 0 6px; }

.price {
  font-weight: 600;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 打印：只输出留痕记录 ---------- */
#print-area { display: none; }

@media print {
  body { background: #fff; color: #000; }
  header.site, main, footer.site, .skip, #bac-intent, #intent-slot { display: none !important; }
  #print-area {
    display: block;
    font-size: 12pt;
  }
  #print-area h1 { font-size: 16pt; margin: 0 0 6pt; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area th, #print-area td {
    border: 1px solid #999;
    padding: 4pt 5pt;
    text-align: left;
    vertical-align: top;
    font-size: 10pt;
  }
  #print-area .hash { word-break: break-all; font-size: 9pt; border: none; background: none; padding: 0; }
}
