:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2329;
  background: #f5f6f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: #f5f6f8; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }
.app { min-height: 100vh; }
header {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 14px 14px 12px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8e9eb;
}
.logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: #3370ff; color: white; font-weight: 800; font-size: 18px;
}
.head-copy { min-width: 0; }
h1 { font-size: 16px; margin: 0 0 2px; line-height: 1.3; }
header p { margin: 0; color: #8f959e; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { padding: 12px 12px 20px; }
.card {
  background: #fff; border: 1px solid #e6e8eb; border-radius: 12px;
  padding: 13px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(31,35,41,.02);
}
.section-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.segmented {
  display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px;
  border-radius: 9px; background: #f2f3f5;
}
.segmented button {
  border: 0; border-radius: 7px; padding: 8px 6px; background: transparent; color: #646a73; font-size: 12px;
}
.segmented button.active { background: #fff; color: #1f2329; font-weight: 650; box-shadow: 0 1px 4px rgba(31,35,41,.08); }
.field-label { display: grid; gap: 7px; font-size: 12px; color: #646a73; }
select {
  width: 100%; min-height: 36px; border: 1px solid #d9dce0; border-radius: 8px;
  padding: 0 10px; background: #fff; color: #1f2329;
}
select:focus { outline: 2px solid rgba(51,112,255,.18); border-color: #3370ff; }
.toggle, .check-item { display: flex; gap: 8px; align-items: center; font-size: 12px; color: #3b4048; }
.toggle { margin-top: 10px; }
.top-gap { margin-top: 12px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: #3370ff; }
.example { margin-top: 7px; padding: 7px 9px; border-radius: 7px; background: #f7f8fa; color: #8f959e; font-size: 11px; line-height: 1.5; }
.check-list { display: grid; gap: 8px; }
.muted { color: #8f959e; font-size: 12px; }
.hint-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: #8f959e; font-size: 11px; }
.link-btn { border: 0; background: none; padding: 2px 0; color: #3370ff; font-size: 11px; }
.ghost { border: 1px solid #d9dce0; background: #fff; color: #646a73; border-radius: 7px; padding: 6px 9px; }
.small { font-size: 11px; }
.progress-card { background: #fff; border: 1px solid #dbe5ff; border-radius: 12px; padding: 12px; margin: 10px 0; }
.progress-head { display: flex; justify-content: space-between; gap: 10px; color: #646a73; font-size: 11px; margin-bottom: 8px; }
.progress-track { width: 100%; height: 7px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: #3370ff; transition: width .18s ease; }
.failures { background: #fff; border: 1px solid #f5c6c6; border-radius: 10px; padding: 10px; margin: 10px 0; font-size: 11px; }
.failures summary { cursor: pointer; color: #c94b4b; font-weight: 650; }
.failure-list { display: grid; gap: 7px; margin-top: 9px; }
.failure { display: grid; gap: 2px; }
.failure b { font-weight: 600; word-break: break-all; }
.failure span { color: #8f959e; }
.actions { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(to bottom, rgba(245,246,248,0), #f5f6f8 30%); }
.primary, .danger { width: 100%; border: 0; border-radius: 10px; min-height: 42px; color: #fff; font-weight: 700; }
.primary { background: #3370ff; }
.primary:hover { background: #2b64e8; }
.danger { background: #f54a45; }
.privacy { text-align: center; color: #a2a7ae; font-size: 10px; line-height: 1.5; padding: 10px 8px 0; }
.toast {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 99;
  max-width: calc(100vw - 32px); padding: 9px 12px; border-radius: 8px;
  background: rgba(31,35,41,.92); color: #fff; font-size: 11px; box-shadow: 0 6px 24px rgba(31,35,41,.2);
}
@media (prefers-color-scheme: dark) {
  :root { color: #e7e9ec; background: #1f2329; }
  body, main { background: #1f2329; }
  header { background: rgba(37,41,48,.96); border-bottom-color: #373b42; }
  header p, .muted, .privacy, .hint-row, .failure span { color: #8f959e; }
  .card, .progress-card, .failures { background: #292d33; border-color: #3a3f47; }
  .segmented, .example { background: #20242a; }
  .segmented button.active { background: #3a3f47; color: #fff; }
  select, .ghost { background: #292d33; color: #e7e9ec; border-color: #4a5059; }
  .toggle, .check-item, .field-label { color: #d0d3d7; }
  .actions { background: linear-gradient(to bottom, rgba(31,35,41,0), #1f2329 30%); }
  .progress-track { background: #3a3f47; }
}
