:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #172033;
  --ink-2: #45516a;
  --muted: #7a869f;
  --line: #e4e9f2;
  --line-strong: #d5dcea;
  --primary: #4657e8;
  --primary-2: #6d5dfc;
  --primary-soft: #eef0ff;
  --ok: #13875d;
  --ok-bg: #e9f8f1;
  --warn: #b96a0a;
  --warn-bg: #fff5e6;
  --err: #cc3d4b;
  --err-bg: #fff0f1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 34px rgba(35, 49, 87, .08);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 68% -10%, rgba(81, 91, 232, .09), transparent 30%),
    var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
svg { display: block; }
code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #44506b;
  background: #f0f3f8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid rgba(221, 227, 239, .9);
  background: rgba(251, 252, 255, .88);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 25px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: 0 9px 18px rgba(70, 87, 232, .24);
}

.brand-title { font-size: 15px; font-weight: 760; letter-spacing: -.2px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav-label {
  padding: 0 11px;
  margin: 9px 0 8px;
  color: #99a2b5;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-list { display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #58647c;
  font-weight: 650;
  transition: .18s ease;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--ink); background: #f0f3fa; }
.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(70, 87, 232, .08);
}

.flow-mini {
  margin-top: 20px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.flow-mini-title { color: var(--ink-2); font-size: 11px; font-weight: 750; margin-bottom: 9px; }
.flow-mini-steps { display: flex; align-items: center; gap: 5px; }
.flow-mini-step {
  padding: 3px 7px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #5a66c8;
  background: #edf0ff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.flow-mini-line { flex: 1; height: 1px; background: #e2e6f0; }
.sidebar-foot { margin-top: auto; }
.privacy-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
  font-size: 11.5px;
}
.privacy-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-weight: 700;
  margin-bottom: 5px;
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27b17d;
  box-shadow: 0 0 0 3px #e2f7ef;
}

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(224, 229, 239, .9);
  background: rgba(255, 255, 255, .76);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.breadcrumb { color: var(--muted); font-size: 12.5px; }
.breadcrumb b { color: var(--ink); font-weight: 700; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.topbar-note svg { width: 16px; height: 16px; }

.content {
  width: min(1230px, 100%);
  margin: 0 auto;
  padding: 36px 34px 64px;
  animation: page-enter .24s ease;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.eyebrow {
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1.page-title {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -.04em;
}
.lead { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-body { padding: 22px; }
.card-head {
  padding: 21px 22px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.card-title { margin: 0; font-size: 15px; font-weight: 760; letter-spacing: -.01em; }
.card-desc { margin-top: 3px; color: var(--muted); font-size: 12px; }

.btn {
  min-height: 42px;
  padding: 10px 17px;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-2);
  background: #fff;
  font-weight: 720;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #5968ee);
  box-shadow: 0 8px 18px rgba(70, 87, 232, .22);
}
.btn-primary:hover { box-shadow: 0 11px 24px rgba(70, 87, 232, .28); }
.btn-secondary { border: 1px solid var(--line-strong); }
.btn-secondary:hover { color: var(--primary); border-color: #b9c2ed; background: var(--primary-soft); }
.btn-danger { color: var(--err); border: 1px solid #f1cbd0; background: #fff; }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.btn[disabled] { opacity: .58; cursor: wait; transform: none; }

.tag, .status-badge, .step-badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 760;
  white-space: nowrap;
}
.tag { padding: 3px 8px; }
.tag-required { color: var(--err); background: var(--err-bg); }
.tag-optional { color: var(--muted); background: #eef1f6; }
.status-badge { padding: 5px 9px; }
.status-badge.ok, .step-badge.ok { color: var(--ok); background: var(--ok-bg); }
.status-badge.fail, .step-badge.err { color: var(--err); background: var(--err-bg); }
.status-badge.warn, .step-badge.warn { color: var(--warn); background: var(--warn-bg); }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill { padding: 4px 9px; color: #59647a; background: #eff2f7; }

.pipeline-rail {
  margin-bottom: 18px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rail-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 680; }
.rail-step-no {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #657088;
  background: #edf0f6;
  font-size: 10px;
}
.rail-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c3c9df;
  flex: none;
}
.rail-step.active { color: var(--primary); }
.rail-step.active .rail-step-no {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 11px rgba(70, 87, 232, .25);
}
.rail-step.active .rail-step-dot {
  background: var(--primary);
}
.rail-line { flex: 1; min-width: 14px; height: 1px; background: var(--line); }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr); gap: 18px; }
.upload-panel { padding: 22px; }
.field { margin-bottom: 15px; }
.field-label {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 720;
}
.dropzone {
  position: relative;
  min-height: 188px;
  padding: 24px;
  border: 1.5px dashed #bbc4e9;
  border-radius: 15px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(145deg, #f9faff, #f4f6ff);
  cursor: pointer;
  transition: .2s ease;
}
.dropzone:hover, .dropzone.is-dragging {
  border-color: var(--primary);
  background: #f0f2ff;
  box-shadow: inset 0 0 0 3px rgba(70, 87, 232, .04);
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #fff;
  box-shadow: 0 7px 19px rgba(66, 80, 143, .12);
}
.upload-icon svg { width: 23px; height: 23px; }
.drop-title { font-size: 15px; font-weight: 750; }
.drop-sub { margin-top: 5px; color: var(--muted); font-size: 12px; }
.file-status {
  display: none;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #dfe4f1;
  border-radius: 11px;
  align-items: center;
  gap: 10px;
  background: #fff;
  text-align: left;
}
.file-status.show { display: flex; }
.file-glyph {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 9px;
  font-weight: 850;
  flex: none;
}
.file-status-copy { min-width: 0; flex: 1; }
.file-status-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 12px; }
.file-status-meta { color: var(--muted); font-size: 10.5px; }
.file-ok { color: var(--ok); font-weight: 900; }
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.resource-drop {
  position: relative;
  width: 100%;
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: block;
  background: var(--surface-soft);
  cursor: pointer;
  transition: .18s ease;
}
.resource-drop:hover, .resource-drop.is-dragging { border-color: #b9c2e7; background: #f5f6ff; }
.resource-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 720; }
.resource-glyph {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #5968d9;
  background: #eaedff;
  font-size: 9px;
  font-weight: 850;
}
.resource-hint { margin: 6px 0 0 38px; display: block; color: var(--muted); font-size: 10.5px; }
.text-input {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}
.text-input:focus {
  border-color: #aab4ef;
  box-shadow: 0 0 0 3px rgba(70, 87, 232, .08);
}
.field-hint { margin-top: 6px; color: var(--muted); font-size: 10.5px; }
.submit-row {
  margin-top: 19px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.submit-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.security-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.security-note svg { width: 15px; height: 15px; }

.scope-card { padding: 5px 20px 18px; }
.scope-list { margin: 0; padding: 0; list-style: none; }
.scope-list li { padding: 13px 0; border-bottom: 1px solid #edf0f5; display: flex; gap: 11px; }
.scope-list li:last-child { border-bottom: 0; }
.scope-check {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--ok);
  background: var(--ok-bg);
  flex: none;
}
.scope-name { font-size: 12.5px; font-weight: 700; }
.scope-desc { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.spec-cta {
  margin-top: 10px;
  padding: 12px;
  border-radius: 11px;
  display: block;
  color: #4d58b6;
  background: var(--primary-soft);
  font-size: 11.5px;
  font-weight: 680;
}
.spec-cta:hover { background: #e7eaff; }

.quick-rules { margin-top: 18px; overflow: hidden; }
.rule-grid { padding: 0 22px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule-item {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  gap: 9px;
  color: var(--ink-2);
  background: var(--surface-soft);
  font-size: 11.5px;
}
.rule-mark { color: var(--primary); font-weight: 900; flex: none; }
.page-note { margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.8; }

.result-hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.result-hero.pass { border-color: #ccebdd; background: linear-gradient(120deg, #f0fbf6, #f9fffc); }
.result-hero.fail { border-color: #f0cdd2; background: linear-gradient(120deg, #fff4f5, #fffafa); }
.result-main { display: flex; align-items: center; gap: 16px; }
.result-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.result-icon.pass { background: var(--ok); box-shadow: 0 8px 18px rgba(19, 135, 93, .2); }
.result-icon.fail { background: var(--err); box-shadow: 0 8px 18px rgba(204, 61, 75, .18); }
.result-icon svg { width: 24px; height: 24px; }
.result-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.result-desc { margin-top: 3px; color: var(--muted); font-size: 12px; }

.metrics { margin: 16px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { padding: 16px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric-label { color: var(--muted); font-size: 10.5px; font-weight: 700; }
.metric-value { margin-top: 5px; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.metric-value.ok { color: var(--ok); }
.metric-value.warn { color: var(--warn); }
.metric-value.err { color: var(--err); }

.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.section-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.data-table th {
  padding: 10px 18px;
  color: var(--muted);
  background: #fafbfe;
  font-size: 10.5px;
  font-weight: 750;
  text-align: left;
  letter-spacing: .03em;
}
.data-table td {
  padding: 13px 18px;
  border-top: 1px solid #edf0f5;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}
.data-table tbody tr:hover { background: #fafbfe; }

.tabs { padding: 0 20px; display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 12px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.issues { padding: 15px; display: grid; gap: 10px; }
.issue {
  padding: 12px 13px;
  border-radius: 11px;
  display: flex;
  gap: 10px;
}
.issue.err { background: var(--err-bg); }
.issue.warn { background: var(--warn-bg); }
.issue.ok { background: var(--ok-bg); }
.issue-mark {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 9px;
  font-weight: 900;
}
.issue.err .issue-mark { color: var(--err); background: #f8d8dc; }
.issue.warn .issue-mark { color: var(--warn); background: #ffe7be; }
.issue.ok .issue-mark { color: var(--ok); background: #d2f0e2; }
.issue-text { color: var(--ink-2); font-size: 11.5px; }
.issue-text b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 12px; }
.empty-state { padding: 24px; color: var(--ok); text-align: center; font-size: 12px; }

.action-card { padding: 20px; }
.action-list { margin-top: 15px; display: grid; gap: 9px; }
.action-list .btn { width: 100%; justify-content: flex-start; }
.action-tip { margin-top: 16px; padding: 11px; border-radius: 10px; color: var(--muted); background: #f7f8fb; font-size: 10.5px; }
.resource-list { padding: 0 20px 18px; display: grid; gap: 9px; }
.resource-row { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 3px; }
.resource-row strong { font-size: 11.5px; }
.resource-row span { color: var(--muted); font-size: 10.5px; }

.step-list { margin: 0; padding: 0 18px 18px; list-style: none; display: grid; gap: 10px; }
.step-item { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.step-item.is-open { border-color: #ced5eb; }
.step-toggle {
  width: 100%;
  padding: 14px 15px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafbfe;
  cursor: pointer;
  text-align: left;
}
.step-toggle:hover { background: #f5f7fc; }
.step-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  font-weight: 900;
}
.step-icon.ok { color: var(--ok); background: var(--ok-bg); }
.step-icon.err { color: var(--err); background: var(--err-bg); }
.step-title { flex: 1; font-size: 12.5px; font-weight: 740; }
.step-badge { padding: 4px 8px; }
.chevron { color: var(--muted); transition: transform .2s ease; }
.step-item.is-open .chevron { transform: rotate(90deg); }
.step-body { display: none; padding: 15px; border-top: 1px solid var(--line); background: #fff; }
.step-item.is-open .step-body { display: block; }
.log {
  max-height: 300px;
  overflow: auto;
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  color: #cdd6e7;
  background: #192132;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.7;
}
.log .warn { color: #ffd182; }
.log .err { color: #ff9ca6; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 13px; }
.check-item { padding: 5px 0; display: flex; gap: 7px; color: var(--ink-2); font-size: 11px; }
.check-item.fail { color: var(--err); }
.check-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.download-card {
  padding: 22px;
  border-color: #ccebdd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(120deg, #f0fbf6, #fbfffd);
}
.download-name { font-size: 16px; font-weight: 780; }
.download-desc { margin-top: 4px; color: #5e776d; font-size: 11.5px; }
.footer-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.spec-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 18px; align-items: start; }
.toc-card { position: sticky; top: 92px; padding: 16px; max-height: calc(100vh - 115px); overflow: auto; }
.toc-title { margin-bottom: 10px; font-size: 11px; font-weight: 800; }
.toc-card ul { margin: 0; padding: 0; list-style: none; }
.toc-card li { margin: 1px 0; }
.toc-card li ul { padding-left: 9px; }
.toc-card a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 10.5px; }
.toc-card a:hover, .toc-card a.active { color: var(--primary); background: var(--primary-soft); }
.toc-toggle { display: none; width: 100%; margin-bottom: 10px; }
.doc-card { padding: 28px 32px 50px; overflow: hidden; }
.doc { color: var(--ink-2); line-height: 1.75; }
.doc h1 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -.025em;
}
.doc h2 { margin: 31px 0 12px; padding-top: 5px; color: var(--ink); font-size: 19px; letter-spacing: -.02em; }
.doc h3 { margin: 22px 0 9px; color: var(--ink); font-size: 14.5px; }
.doc p { margin: 9px 0; }
.doc ul, .doc ol { margin: 9px 0; padding-left: 21px; }
.doc li { margin: 4px 0; }
.doc table { width: 100%; margin: 13px 0; border-collapse: collapse; font-size: 11.5px; }
.doc th, .doc td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { color: var(--ink); background: #fafbfe; font-weight: 720; }
.doc pre { padding: 15px; border-radius: 11px; overflow: auto; color: #dbe3f2; background: #192132; font-size: 11px; line-height: 1.65; }
.doc pre code { padding: 0; color: inherit; background: transparent; }
.doc blockquote { margin: 13px 0; padding: 11px 15px; border-left: 3px solid var(--primary); border-radius: 0 9px 9px 0; color: #4c5786; background: var(--primary-soft); }
.doc-meta { margin: -16px 0 20px; color: var(--muted); font-size: 11px; }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(246, 248, 252, .78);
  backdrop-filter: blur(7px);
}
.loading-overlay.show { display: grid; }
.loading-box {
  min-width: 320px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}
.spinner {
  width: 37px;
  height: 37px;
  margin: 0 auto 14px;
  border: 3px solid #e6e9f8;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-weight: 780; }
.loading-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 1020px) {
  .upload-layout, .result-layout { grid-template-columns: 1fr; }
  .scope-card { order: -1; }
  .scope-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar {
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
  }
  .brand { margin-right: auto; padding: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-sub, .nav-label, .flow-mini, .sidebar-foot { display: none; }
  .nav-list { display: flex; gap: 4px; }
  .nav-item { width: auto; padding: 9px; }
  .nav-item span { display: none; }
  .topbar { display: none; }
  .content { padding: 25px 16px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .pipeline-rail { gap: 7px; }
  .rail-step span:last-child { display: none; }
  .resource-grid, .scope-list, .rule-grid { grid-template-columns: 1fr; }
  .submit-row, .download-card, .result-hero { align-items: flex-start; flex-direction: column; }
  .submit-actions { width: 100%; justify-content: stretch; }
  .submit-actions .btn { flex: 1; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .spec-layout { display: block; }
  .toc-toggle { display: inline-flex; }
  .toc-card { display: none; position: static; max-height: none; margin-bottom: 12px; }
  .toc-card.show { display: block; }
  .doc-card { padding: 22px 18px 40px; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .result-main { align-items: flex-start; }
  .result-title { font-size: 17px; }
  .btn { width: 100%; }
  .nav-item { width: auto; }
}

@media print {
  .sidebar, .topbar, .heading-actions, .footer-actions, .action-card, .toc-card, .toc-toggle { display: none !important; }
  .app-shell { display: block; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; }
  .card, .result-hero { box-shadow: none; break-inside: avoid; }
  .step-body { display: block !important; }
}

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

/* Apple-inspired readability refresh */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f7f9;
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --line: #dedee3;
  --line-strong: #c7c7cc;
  --primary: #0071e3;
  --primary-2: #0077ed;
  --primary-soft: #edf6ff;
  --ok: #18794e;
  --ok-bg: #edf8f2;
  --warn: #9a5b00;
  --warn-bg: #fff6e6;
  --err: #c9343c;
  --err-bg: #fff0f1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 18px;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

code {
  color: #424245;
  background: #f0f0f2;
}

.app-shell { grid-template-columns: 232px minmax(0, 1fr); }

.sidebar {
  padding: 22px 16px;
  border-color: #dedee3;
  background: rgba(250, 250, 252, .94);
  backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  min-width: 0;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  box-shadow: none;
  flex: none;
}

.brand-copy {
  min-width: 0;
  display: block;
}

.brand-title,
.brand-sub {
  display: block;
  white-space: nowrap;
}

.brand-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav-label {
  margin: 8px 0 7px;
  color: #86868b;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.nav-list { gap: 4px; }

.nav-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #424245;
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover { color: var(--ink); background: #ededf0; }
.nav-item.active {
  color: #0059b3;
  background: #e8f2ff;
  box-shadow: none;
  font-weight: 600;
}

.privacy-card {
  padding: 14px;
  border-color: var(--line);
  color: #6e6e73;
  background: rgba(255, 255, 255, .8);
  font-size: 12px;
}

.privacy-head {
  color: #3a3a3c;
  font-weight: 600;
}

.topbar {
  height: 60px;
  padding: 0 32px;
  border-color: rgba(210, 210, 215, .8);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px);
}

.breadcrumb {
  color: #6e6e73;
  font-size: 13px;
}

.breadcrumb span { padding: 0 5px; color: #aeaeb2; }
.breadcrumb b { color: var(--ink); font-weight: 600; }
.topbar-note { color: #6e6e73; font-size: 12px; }

.content {
  width: min(1200px, 100%);
  padding: 48px 40px 72px;
  animation: none;
}

.page-heading {
  margin-bottom: 30px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 8px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

h1.page-title,
.spec-heading h1 {
  color: var(--ink);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.lead,
.spec-heading p {
  max-width: 720px;
  margin-top: 12px;
  color: #515154;
  font-size: 16px;
  line-height: 1.6;
}

.card {
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.card-head { padding: 22px 24px 16px; }
.card-title { color: var(--ink); font-size: 16px; font-weight: 650; }
.card-desc { color: var(--muted); font-size: 13px; }

.btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  color: #1d1d1f;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}

.btn:hover { transform: none; }
.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}
.btn-primary:hover { background: #0077ed; box-shadow: none; }
.btn-secondary { border-color: var(--line-strong); }
.btn-secondary:hover { color: #0059b3; border-color: #7eb7ef; background: #f5faff; }

.tag, .status-badge, .step-badge, .pill {
  font-size: 11px;
  font-weight: 600;
}

.tag-optional { color: #5c5c60; background: #ececef; }

.pipeline-rail {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.rail-step {
  color: #515154;
  font-size: 12px;
  font-weight: 500;
}

.rail-step-dot {
  width: 7px;
  height: 7px;
  background: #8e8e93;
}

.rail-line { background: #c7c7cc; }

.upload-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.upload-panel { padding: 26px; }
.field { margin-bottom: 22px; }
.field-label {
  margin-bottom: 10px;
  color: #2c2c2e;
  font-size: 14px;
  font-weight: 600;
}

.dropzone {
  min-height: 210px;
  padding: 30px;
  border: 1.5px dashed #9a9aa1;
  border-radius: 16px;
  background: #fafafa;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--primary);
  background: #f4f9ff;
  box-shadow: none;
}

.upload-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  color: var(--primary);
  background: #edf6ff;
  box-shadow: none;
}

.drop-title {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.drop-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-hint {
  margin-top: 8px;
  color: #6e6e73;
  font-size: 12px;
}

.resource-grid { gap: 14px; }
.resource-drop {
  min-height: 108px;
  padding: 16px;
  border-color: var(--line-strong);
  background: #fafafa;
}
.resource-drop:hover,
.resource-drop.is-dragging { border-color: var(--primary); background: #f4f9ff; }
.resource-head { color: var(--ink); font-size: 14px; font-weight: 600; }
.resource-glyph {
  width: 32px;
  height: 32px;
  color: #0059b3;
  background: #e8f2ff;
}
.resource-hint { margin: 8px 0 0 41px; color: var(--muted); font-size: 12px; }

.text-input {
  min-height: 48px;
  padding: 11px 14px;
  border-color: var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
}
.text-input::placeholder { color: #8e8e93; }
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 113, 227, .12); }
.requirements-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.submit-row {
  margin-top: 24px;
  padding-top: 22px;
}
.security-note { color: #6e6e73; font-size: 12px; }

.scope-card { padding: 4px 22px 20px; }
.scope-list li { padding: 15px 0; border-color: #e8e8ed; gap: 12px; }
.scope-check {
  color: #18794e;
  background: #eaf7f0;
}
.scope-name { color: var(--ink); font-size: 14px; font-weight: 600; }
.scope-desc { margin-top: 3px; color: #6e6e73; font-size: 12px; line-height: 1.45; }
.spec-cta {
  padding: 13px 14px;
  color: #0059b3;
  background: #edf6ff;
  font-size: 13px;
  font-weight: 600;
}
.spec-cta:hover { background: #e2f0ff; }

.quick-rules { margin-top: 20px; }
.rule-grid { padding: 0 24px 24px; gap: 12px; }
.rule-item {
  padding: 14px 15px;
  border-color: var(--line);
  color: #3a3a3c;
  background: #fafafa;
  font-size: 13px;
  line-height: 1.55;
}
.rule-mark { color: #0059b3; }
.page-note { color: #6e6e73; font-size: 12px; }

.result-hero,
.metric,
.step-item {
  border-color: var(--line);
  box-shadow: none;
}
.result-title { font-size: 22px; font-weight: 700; }
.result-desc { color: #515154; font-size: 13px; }
.metric-label { color: #6e6e73; font-size: 12px; }
.metric-value { font-size: 28px; }
.data-table th { color: #6e6e73; background: #f7f7f9; font-size: 12px; }
.data-table td { color: #3a3a3c; font-size: 13px; }
.tab { color: #6e6e73; font-size: 13px; }
.issue-text { color: #3a3a3c; font-size: 13px; }
.issue-text b { font-size: 13px; }
.step-title { font-size: 14px; }
.step-toggle { background: #fafafa; }
.check-item { color: #3a3a3c; font-size: 12px; }

.spec-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.toc-card { width: 260px; padding: 20px; }
.toc-card a { padding: 8px 10px; color: #3a3a3c; font-size: 14px; line-height: 1.45; }
.doc {
  color: #3a3a3c;
  font-size: 18px;
  line-height: 1.9;
}
.doc h1 { font-size: 34px; }
.doc h2 {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 26px;
}
.doc h3 { font-size: 21px; }
.doc h4 { font-size: 18px; }
.doc p { max-width: 72ch; }
.doc table {
  margin: 20px 0 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 15px;
}
.doc th, .doc td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); }
.doc tr:last-child td { border-bottom: 0; }
.doc tbody tr:nth-child(even) { background: #fafafa; }
.doc pre { margin: 18px 0 26px; font-size: 14px; }
.doc blockquote { color: #3a3a3c; background: #f2f7fc; }

.requirements-card {
  margin: 16px 0;
  padding-bottom: 20px;
}
.requirements-card p {
  margin: 0;
  padding: 0 24px;
  color: #3a3a3c;
  white-space: pre-wrap;
}

.live-progress { width: min(460px, 78vw); margin-top: 22px; text-align: left; }
.progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e5ea;
}
.progress-bar {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
  transition: width .3s ease;
}
.progress-meta {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #515154;
  font-size: 12px;
}
.progress-value { color: var(--ink); }
.progress-steps {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.progress-steps span {
  padding: 7px 4px;
  border-radius: 8px;
  color: #6e6e73;
  background: #f2f2f4;
  font-size: 11px;
  text-align: center;
}
.progress-steps span.active { color: #0059b3; background: #e8f2ff; font-weight: 600; }
.progress-steps span.done { color: #18794e; background: #eaf7f0; }
.progress-steps span.failed { color: var(--err); background: var(--err-bg); }

.process-view {
  margin: 24px 0;
  padding: 26px;
  scroll-margin-top: 84px;
}
.process-view[hidden] { display: none; }
.process-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.process-head h2 { margin: 0; font-size: 24px; }
.process-message { margin: 6px 0 0; color: var(--muted); }
.process-percent { color: var(--primary); font-size: 28px; }
.process-progress {
  height: 8px;
  margin: 22px 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e5ea;
}
.process-progress span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}
.live-step-list { display: grid; gap: 12px; }
.live-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  gap: 14px;
  background: #fafafa;
}
.live-step-index {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6e6e73;
  background: #ededf0;
  font-weight: 700;
  flex: none;
}
.live-step-content { min-width: 0; flex: 1; }
.live-step-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.live-step-title span { color: var(--muted); font-size: 12px; }
.live-step-output {
  margin-top: 7px;
  color: #6e6e73;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.live-step.active { border-color: #7eb7ef; background: #f4f9ff; }
.live-step.active .live-step-index { color: #fff; background: var(--primary); }
.live-step.done { border-color: #bfe4d2; background: #f6fcf9; }
.live-step.done .live-step-index { color: #18794e; background: #dff3e9; }
.live-step.failed { border-color: #efc3c6; background: #fff7f7; }
.live-step.failed .live-step-index { color: var(--err); background: var(--err-bg); }
.process-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.process-actions[hidden] { display: none; }
.process-view.has-error { border-color: #efc3c6; }

.metric-link { display: block; color: inherit; }
.metric-link small { color: var(--muted); font-size: 11px; }
.warning-summary { margin: 16px 0; overflow: hidden; scroll-margin-top: 84px; }

.history-card { overflow: hidden; }
.history-list { display: grid; }
.history-row {
  min-width: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 88px minmax(220px, 1.4fr) minmax(160px, 1fr) 74px 18px;
  align-items: center;
  gap: 16px;
}
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: #f7f9fc; }
.history-kind {
  padding: 5px 8px;
  border-radius: 999px;
  color: #0059b3;
  background: #e8f2ff;
  font-size: 11px;
  text-align: center;
}
.history-kind.check { color: #6b4c00; background: #fff4cf; }
.history-main { min-width: 0; display: grid; }
.history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main small, .history-summary { color: var(--muted); font-size: 12px; }
.history-status { font-size: 12px; font-weight: 600; text-align: right; }
.history-status.success { color: var(--ok); }
.history-status.failed { color: var(--err); }
.history-status.running { color: var(--primary); }
.history-arrow { color: var(--muted); font-size: 22px; }
.history-empty { padding: 70px 24px; text-align: center; }
.history-empty p { color: var(--muted); }
.record-state { padding: 28px; }

.loading-overlay { background: rgba(245, 245, 247, .82); }
.loading-box { border-color: var(--line); box-shadow: var(--shadow); }
.spinner { border-color: #d9d9de; border-top-color: var(--primary); }

@media (max-width: 1120px) {
  .upload-layout,
  .result-layout { grid-template-columns: 1fr; }
  .scope-card { order: initial; }
  .scope-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    height: auto;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
  }
  .brand { margin-right: auto; padding: 0; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-sub, .nav-label, .sidebar-foot { display: none; }
  .nav-list { display: flex; gap: 4px; }
  .nav-item { width: auto; min-height: 40px; padding: 9px 11px; }
  .nav-item svg { display: none; }
  .topbar { display: none; }
  .content { padding: 32px 20px 56px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .pipeline-rail { overflow-x: auto; }
  .rail-step { flex: none; }
  .resource-grid, .scope-list, .rule-grid { grid-template-columns: 1fr; }
  .submit-row, .download-card, .result-hero { align-items: stretch; flex-direction: column; }
  .submit-actions { width: 100%; }
  .submit-actions .btn { flex: 1; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .spec-layout { display: block; }
  .toc-toggle { display: inline-flex; }
  .toc-card { display: none; position: static; max-height: none; margin-bottom: 12px; }
  .toc-card.show { display: block; }
  .doc-card { padding: 24px 20px 40px; }
  .doc { font-size: 17px; }
  .history-row {
    grid-template-columns: 80px minmax(0, 1fr) 70px 16px;
  }
  .history-summary { display: none; }
}

@media (max-width: 540px) {
  .brand-title { font-size: 14px; }
  .nav-item span { display: inline; }
  .page-heading { margin-bottom: 22px; }
  h1.page-title, .spec-heading h1 { font-size: 32px; }
  .lead, .spec-heading p { font-size: 15px; }
  .upload-panel { padding: 18px; }
  .dropzone { min-height: 180px; padding: 22px 16px; }
  .submit-actions { display: grid; grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .process-view { padding: 20px 16px; }
  .process-head { gap: 12px; }
  .process-percent { font-size: 22px; }
  .history-row {
    grid-template-columns: 1fr 70px 16px;
    gap: 10px;
  }
  .history-kind { display: none; }
}
