/* ===== 降重 design system — flat / teal / professional ===== */
:root {
  --bg: #F5F8FA;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #E6F7FB 0%, rgba(230,247,251,0) 60%), #F5F8FA;
  --ink: #0F172A;
  --muted: #475569;
  --faint: #94A3B8;
  --line: #E2E8F0;
  --line-2: #EEF2F6;
  --card: #FFFFFF;

  --accent: #0E7490;        /* deep teal */
  --accent-2: #0891B2;      /* bright teal */
  --accent-ink: #0B5566;
  --accent-bg: #ECFEFF;
  --accent-bg-2: #E0F7FB;

  --ok: #059669;
  --ok-bg: #ECFDF5;
  --err: #DC2626;
  --err-bg: #FEF2F2;
  --warn: #B45309;
  --warn-bg: #FFFBEB;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
  --shadow-md: 0 4px 14px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.10), 0 6px 18px rgba(15,23,42,.05);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

/* ===== hero ===== */
.hero { text-align: center; padding: 64px 24px 28px; }
.brand { display: inline-flex; align-items: center; gap: 16px; }
.logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(14,116,144,.30), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo svg { width: 28px; height: 28px; }
.hero h1 {
  margin: 0;
  font-size: 52px; font-weight: 800; letter-spacing: -0.035em;
  background: linear-gradient(180deg, #0B132B 0%, #1E3A44 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); font-size: 17px; margin: 14px 0 0; font-weight: 500; }
.features { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.pill {
  font-size: 12.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-bg);
  border: 1px solid #B6E8EE;
  padding: 5px 12px; border-radius: 980px;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

/* ===== card ===== */
.card {
  max-width: 920px; margin: 28px auto 48px; padding: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

/* ===== quota / status banner ===== */
.quota-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px; margin-bottom: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-bg), #F0FBFD);
  border: 1px solid #C8EBF0;
  border-radius: var(--r-md);
}
.quota-chip { font-size: 13.5px; color: var(--accent-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.quota-chip::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(5,150,105,.18);
}
.quota-chip b { color: var(--accent); font-size: 16px; font-weight: 800; }
.quota-redeem { display: inline-flex; gap: 6px; }
.quota-redeem input {
  font: inherit; font-size: 13px; padding: 8px 14px; width: 170px;
  border: 1px solid var(--line); border-radius: 980px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.quota-redeem input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(8,145,178,.15); }

/* ===== textarea ===== */
textarea#input {
  width: 100%; min-height: 210px; resize: vertical;
  font-size: 15.5px; line-height: 1.8; font-family: inherit;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #FBFCFD;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea#input::placeholder { color: var(--faint); }
textarea#input:focus { border-color: var(--accent-2); background: #fff; box-shadow: 0 0 0 3px rgba(8,145,178,.15); }

/* ===== pipe toggle (switch) ===== */
.pipe-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 16px; font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none; font-weight: 500;
}
.pipe-toggle input {
  appearance: none; -webkit-appearance: none;
  width: 38px; height: 22px; border-radius: 980px;
  background: #CBD5E1; position: relative; cursor: pointer; margin: 0;
  transition: background .2s ease; flex: none;
}
.pipe-toggle input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.pipe-toggle input:checked { background: var(--accent); }
.pipe-toggle input:checked::after { transform: translateX(16px); }

/* ===== controls ===== */
.controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 18px; flex-wrap: wrap;
}
.selectors { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field select {
  font: inherit; font-size: 13.5px; color: var(--ink); font-weight: 600;
  padding: 8px 30px 8px 14px;
  border: 1px solid var(--line); border-radius: 980px;
  background: #fff; cursor: pointer; outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(8,145,178,.15); }

.segmented { display: inline-flex; background: #EEF2F6; border: 1px solid var(--line); border-radius: 980px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 7px 18px; border-radius: 980px; transition: color .18s, background .18s, box-shadow .18s;
}
.segmented button:hover:not(.active) { color: var(--ink); }
.segmented button.active { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* ===== buttons ===== */
.actions { display: flex; gap: 8px; align-items: center; }
button.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff; border: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  padding: 12px 30px; border-radius: 980px;
  box-shadow: 0 6px 16px rgba(14,116,144,.30), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .06s, box-shadow .15s, filter .15s;
}
button.primary:hover { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(14,116,144,.38), inset 0 1px 0 rgba(255,255,255,.25); }
button.primary:active { transform: translateY(1px); }
button.primary[disabled] { background: #CBD5E1; box-shadow: none; cursor: default; filter: none; }

button.ghost {
  background: #fff; color: var(--accent-ink);
  border: 1px solid var(--line); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 980px;
  transition: background .15s, border-color .15s, color .15s;
}
button.ghost:hover { background: var(--accent-bg); border-color: #B6E8EE; }
button.ghost.mini { padding: 4px 12px; font-size: 12.5px; }

/* ===== error ===== */
.err {
  margin-top: 16px; color: var(--err); background: var(--err-bg);
  border: 1px solid #FECACA;
  padding: 12px 16px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 500;
}

/* ===== metrics ===== */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 6px; }
.metric {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  background: #FBFCFD; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
  transition: border-color .15s, background .15s;
}
.metric::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-2); }
.metric .num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; min-width: 60px; color: var(--accent-ink); }
.metric .lab { font-size: 12.5px; color: var(--muted); line-height: 1.4; font-weight: 500; }
.metric .lab small { color: var(--faint); font-weight: 400; }

/* ===== diag ===== */
.diag {
  margin-top: 14px; padding: 11px 16px;
  background: #FBFCFD; border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
}
.diag .badge {
  background: var(--accent-bg); color: var(--accent-ink);
  padding: 3px 10px; border-radius: 980px; font-size: 11.5px; font-weight: 700;
  margin-right: 6px; border: 1px solid #B6E8EE;
}
.diag .sep { color: #CBD5E1; margin: 0 6px; }
.diag .warn { color: var(--err); font-weight: 600; }

/* ===== cols ===== */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.col h3 {
  font-size: 13px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
  color: var(--faint); font-weight: 700; text-transform: none; letter-spacing: 0.02em;
}
.text {
  font-size: 15px; line-height: 1.9; color: #1E293B;
  background: #FBFCFD; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px; min-height: 80px;
}
#orig.text { color: #94A3B8; background: #F8FAFC; }
.sentence { display: block; padding: 2px 0 2px 10px; border-left: 3px solid transparent; border-radius: 2px; transition: background .15s; }
.sentence.hot { border-left-color: var(--ok); background: var(--ok-bg); }

/* ===== note + footer ===== */
.note { color: var(--faint); font-size: 11.5px; line-height: 1.6; margin-top: 18px; }
.note a { color: var(--accent-2); font-weight: 600; }
.note b { color: var(--muted); font-weight: 700; }

.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 0 0 40px; font-weight: 500; }

/* ===== focus / a11y ===== */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
button { cursor: pointer; }

/* ===== responsive ===== */
@media (max-width: 680px) {
  .hero { padding: 44px 18px 20px; }
  .hero h1 { font-size: 38px; }
  .logo { width: 44px; height: 44px; border-radius: 12px; }
  .logo svg { width: 24px; height: 24px; }
  .card { padding: 20px; border-radius: 16px; margin: 20px 14px 36px; }
  .cols { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .selectors { justify-content: space-between; }
  .actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
