:root {
  --ink: #0f1a14;
  --ink-2: #1a2e24;
  --fog: #d8e6dc;
  --mist: #a8c4b2;
  --paper: #f3f7f4;
  --signal: #c8f05a;
  --signal-ink: #1a2e08;
  --warn: #ff8a5b;
  --danger: #ff5c6a;
  --ok: #3ddc97;
  --mute: rgba(243, 247, 244, 0.55);
  --line: rgba(216, 230, 220, 0.14);
  --radius: 18px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --display: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--paper);
  background: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 10% -10%, #2a5c3f 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 0%, #3a4a18 0%, transparent 45%),
    linear-gradient(180deg, #0f1a14 0%, #122018 40%, #0c1410 100%);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  max-width: 560px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--signal);
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--mute);
  letter-spacing: 0.04em;
}

.icon-btn,
.ghost,
.chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fog);
  border-radius: 999px;
  padding: 8px 14px;
}

.icon-btn:active,
.ghost:active,
.chip:active {
  transform: scale(0.97);
}

.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

.intro h1 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 5.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 12px 0 10px;
}

.intro p {
  margin: 0 0 20px;
  color: var(--mist);
  line-height: 1.55;
  font-size: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.78rem;
  color: var(--mute);
}

.field input,
.pane textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* iOS 防缩放 */
  color: var(--paper);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.field input:focus,
.pane textarea:focus {
  border-color: rgba(200, 240, 90, 0.45);
  box-shadow: 0 0 0 3px rgba(200, 240, 90, 0.12);
}

.pane textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.5;
}

.input-panel {
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.tab {
  flex: 1;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 10px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.tab.active {
  background: var(--signal);
  color: var(--signal-ink);
}

.pane.hidden {
  display: none;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  border: 1.5px dashed rgba(200, 240, 90, 0.35);
  border-radius: var(--radius);
  background: rgba(200, 240, 90, 0.04);
  cursor: pointer;
  padding: 24px;
  text-align: center;
}

.drop-title {
  font-weight: 700;
  color: var(--signal);
}

.drop-hint {
  font-size: 0.85rem;
  color: var(--mute);
}

.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
  padding-bottom: 4px;
}

.thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.cta {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--signal-ink);
  background: linear-gradient(135deg, #d8f86a 0%, #a8e03a 100%);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(168, 224, 58, 0.22);
}

.cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.cta.compact {
  width: auto;
  padding: 12px 22px;
  margin: 0;
}

.cta.loading {
  opacity: 0.85;
  pointer-events: none;
}

.hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--mute);
  text-align: center;
}

.result {
  margin-top: 28px;
  animation: rise 0.35s ease;
}

.result.hidden {
  display: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

@media (max-width: 420px) {
  .summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .summary .stat.total {
    grid-column: 1 / -1;
  }
}

.stat {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.stat.total {
  background: rgba(200, 240, 90, 0.12);
  border-color: rgba(200, 240, 90, 0.28);
}

.stat .n {
  display: block;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat.total .n { color: var(--signal); }
.stat.real .n { color: var(--ok); }
.stat.scam .n { color: var(--danger); }
.stat .l {
  font-size: 0.7rem;
  color: var(--mute);
  margin-top: 2px;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 18px 0 10px;
}

.msg {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.msg.real {
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.06);
}

.msg.scam {
  border-color: rgba(255, 92, 106, 0.4);
  background: rgba(255, 92, 106, 0.07);
}

.msg-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.real { background: rgba(61, 220, 151, 0.2); color: var(--ok); }
.badge.browse { background: rgba(255, 255, 255, 0.08); color: var(--mist); }
.badge.ad { background: rgba(255, 138, 91, 0.18); color: var(--warn); }
.badge.scam { background: rgba(255, 92, 106, 0.2); color: var(--danger); }
.badge.unclear { background: rgba(255, 255, 255, 0.08); color: var(--fog); }

.msg-body {
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 8px;
}

.msg-reason {
  font-size: 0.8rem;
  color: var(--mute);
  margin: 0 0 10px;
}

.reply-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px;
}

.reply-box p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.copy-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--signal);
  color: var(--signal-ink);
  cursor: pointer;
}

.dlg {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  width: min(92vw, 400px);
  background: var(--ink-2);
  color: var(--paper);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.dlg::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.dlg-body {
  padding: 22px 20px 18px;
}

.dlg-body h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.dlg-note {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--mute);
  line-height: 1.45;
}

.dlg-note strong {
  color: var(--warn);
  font-weight: 700;
}

.dlg-section {
  margin: 14px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--signal);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}

.chip {
  font-size: 0.8rem;
  padding: 6px 12px;
}

.dlg-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast[hidden] {
  display: none;
}
