:root {
  --ink: #101a2b;
  --sub: #5c6b80;
  --line: #e2e8f2;
  --bg: #f3f6fb;
  --card: #ffffff;
  --brand: #1f6feb;
  --brand-ink: #0b4bc4;
  --warm: #ff7a1a;
  --danger: #d93a2b;
  --ok: #128a5a;
  --r: 18px;
  --fs: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html.large { --fs: 21px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs)/1.65 "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(31, 111, 235, .14);
}

.mini {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sub);
  font: inherit;
  font-size: .82rem;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
}

.mini[aria-pressed="true"] {
  border-color: var(--brand);
  color: var(--brand);
  background: #eaf1ff;
}

/* ---------- screens ---------- */
main { flex: 1; }
.screen { animation: in .22s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 {
  font-size: 2.05rem;
  line-height: 1.3;
  margin: 26px 0 12px;
  letter-spacing: -.02em;
}

.lead {
  color: var(--sub);
  margin: 0 0 26px;
  font-size: 1rem;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { margin-top: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 15px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:active { transform: scale(.985); }

.btn.xl { min-height: 68px; font-size: 1.18rem; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 111, 235, .25);
}

.btn.primary:active { background: var(--brand-ink); }

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sub);
  font-weight: 500;
  min-height: 48px;
}

.ico { font-size: 1.25em; line-height: 1; }

/* ---------- text panel ---------- */
.panel {
  margin-top: 18px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.panel-label { display: block; font-size: .9rem; color: var(--sub); margin-bottom: 8px; }

textarea {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: #fafcff;
  resize: vertical;
  margin-bottom: 12px;
}

textarea:focus { outline: 2px solid rgba(31, 111, 235, .35); border-color: var(--brand); }

/* ---------- samples ---------- */
.samples { margin-top: 30px; }
.samples p { color: var(--sub); font-size: .9rem; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.chip:active { background: #eaf1ff; }

/* ---------- loading ---------- */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62dvh;
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #dbe6ff;
  border-top-color: var(--brand);
  animation: spin .9s linear infinite;
  margin-bottom: 22px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 1.25rem; font-weight: 600; margin: 0; line-height: 1.5; }
.loading-sub { color: var(--sub); font-size: .9rem; margin: 10px 0 0; }

/* ---------- result ---------- */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 10px; }

.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff1e4;
  color: #b35200;
  font-size: .82rem;
  font-weight: 700;
}

.tag.soft { background: #eaf1ff; color: var(--brand-ink); font-weight: 500; }

.tag.danger { background: #fdecea; color: #a8281c; }

h2 {
  font-size: 1.6rem;
  line-height: 1.35;
  margin: 4px 0 10px;
  letter-spacing: -.01em;
}

.one-line {
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 600;
  margin: 0 0 22px;
  padding-left: 14px;
  border-left: 5px solid var(--brand);
}

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

.card h3 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--sub);
  margin: 0 0 12px;
  letter-spacing: .04em;
}

.card p { margin: 0; }
.card ul, .card ol { margin: 0; padding: 0; list-style: none; }

.steps { counter-reset: s; }

.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 16px 44px;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.55;
}

.steps li:last-child { padding-bottom: 0; }

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--brand-ink);
  font-size: .95rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.steps li small {
  display: block;
  font-weight: 400;
  color: var(--sub);
  font-size: .92rem;
  margin-top: 3px;
}

.checks li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 1.05rem;
}

.checks li:last-child { border-bottom: 0; padding-bottom: 0; }
.checks li:first-child { padding-top: 0; }

.checks li::before {
  content: "";
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin-top: 4px;
  border: 2px solid #c3cfdf;
  border-radius: 6px;
}

.split { display: grid; gap: 16px; }

.strong { font-size: 1.08rem; font-weight: 600; line-height: 1.55; }

.alert { background: #fff7f5; border-color: #ffdbd3; }
.alert h3 { color: var(--danger); }

.dots li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 1rem;
  line-height: 1.55;
}

.alert .dots li { color: #8f2a1d; }

.dots li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}

.warn { background: #fffbe8; border-color: #f6e6a8; }
.warn h3 { color: #9a6b00; }

/* 原文 */
.raw summary {
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  color: var(--sub);
  letter-spacing: .04em;
  list-style: none;
}

.raw summary::-webkit-details-marker { display: none; }

.raw summary::after {
  content: "展开";
  float: right;
  font-weight: 400;
  color: var(--brand);
}

.raw[open] summary::after { content: "收起"; }

.raw pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font: .95rem/1.75 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #3b4a60;
}

.disclaimer {
  color: var(--sub);
  font-size: .82rem;
  text-align: center;
  margin: 22px 0 0;
  line-height: 1.7;
}

/* ---------- share ---------- */
.share-title { font-size: 1.15rem; margin: 20px 0 14px; }

#shareImg {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fff;
  display: block;
}

/* ---------- footer / toast ---------- */
footer {
  padding: 18px 0 4px;
  text-align: center;
}

.stats { color: #93a1b5; font-size: .78rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: rgba(16, 26, 43, .92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: .9rem;
  max-width: 82vw;
  text-align: center;
  z-index: 50;
}

@media (min-width: 620px) {
  .split { grid-template-columns: 1fr 1fr; }
}