:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-ink: #312e81;
  --ok: #059669;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e0e7ff 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #fce7f3 0%, transparent 45%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.wrap.narrow { width: min(640px, calc(100% - 2rem)); padding-top: 4rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { width: 36px; height: 36px; }
.brand span { font-size: 1.15rem; }
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.hero {
  margin-bottom: 1.75rem;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin: 0 0 0.75rem;
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.lede {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
  font-size: 1.05rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; }
}

form.card {
  display: grid;
  gap: 1rem;
}
label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}
input[type="text"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
textarea { min-height: 96px; resize: vertical; }

.tone-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
@media (max-width: 560px) {
  .tone-row { grid-template-columns: repeat(2, 1fr); }
}
.tone {
  position: relative;
}
.tone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tone span {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.tone input:checked + span,
.tone span:hover {
  border-color: #a5b4fc;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tone input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
button, .btn {
  font: inherit;
  font-weight: 650;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, opacity 0.15s;
}
button:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #4338ca; }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #f8fafc; }
.btn-tiny {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid #c7d2fe;
}
.btn-tiny:hover { background: #e0e7ff; }
.btn-tiny.copied {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.results {
  display: grid;
  gap: 1rem;
}
.results.empty {
  min-height: 280px;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}
.results.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.section-body { padding: 0.35rem 0.5rem 0.5rem; }
.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
}
.line:hover { background: #f8fafc; }
.line p {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-word;
}
.line .meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.outline {
  margin: 0;
  padding: 0.75rem 1.1rem 1rem 1.75rem;
}
.outline li { margin: 0.35rem 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.toolbar .left {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

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

/* ---- Auth / header account ---- */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.auth-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 9px;
}
.auth-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0.28rem 0.65rem 0.28rem 0.75rem;
}
.auth-user .phone {
  font-weight: 650;
  letter-spacing: 0.01em;
}
.auth-user .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 1.35rem 1.35rem 1.25rem;
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
}
.modal-close:hover { background: #f1f5f9; color: var(--ink); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 0.25rem;
  margin-bottom: 1rem;
}
.auth-tab {
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
}
.auth-tab.active {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.auth-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.auth-form { gap: 0.9rem; }
.auth-error {
  margin: 0;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
}
input[type="tel"],
input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="tel"]:focus,
input[type="password"]:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ---- Login / register page ---- */
.login-grid {
  display: grid;
  grid-template-columns: 1.1fr minmax(320px, 420px);
  gap: 2.5rem;
  align-items: center;
  min-height: calc(100vh - 16rem);
}
@media (max-width: 880px) {
  .login-grid { grid-template-columns: 1fr; gap: 1.5rem; min-height: 0; }
}
.login-intro h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.login-points {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
}
.login-points li { display: flex; align-items: center; gap: 0.55rem; }
.login-points .tick {
  display: inline-grid;
  place-items: center;
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
}
.login-card { padding: 1.5rem; }
.btn-block { width: 100%; margin-top: 0.25rem; }
.auth-switch {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.hp-field {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}
.turnstile-box[hidden] { display: none; }
.turnstile-box { min-height: 65px; }
.noscript { text-align: center; color: var(--muted); }
