/* ============================================================
   Seal — clean light design system (devbay style)
   Light theme is the default; dark via [data-theme="dark"]
   ============================================================ */

:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --card: #ffffff;
  --card-strong: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
  --accent-1: #6366f1;
  --accent-2: #4f46e5;
  --accent-3: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 0.625rem;
  --radius-sm: 0.5rem;
  --shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 4px 12px 0 rgba(15, 23, 42, 0.08);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #1e293b;
  --card-strong: #0f172a;
  --border: #334155;
  --border-strong: #475569;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent-1: #818cf8;
  --accent-2: #a5b4fc;
  --accent-3: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; }

.brand-mark { width: 38px; height: 38px; border-radius: 11px; }

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-tag { font-size: 0.82rem; color: var(--text-dim); white-space: nowrap; }

@media (max-width: 640px) { .brand-tag { display: none; } }

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-soft);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover { color: var(--text); }

.lang-btn[aria-pressed="true"] {
  background: var(--accent-1);
  color: #fff;
}

/* ---------- layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
  animation: fadeUp 0.5s ease both;
}

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

.hero { text-align: center; margin-bottom: 1.75rem; animation: fadeUp 0.5s ease both; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  background: var(--card);
  margin-bottom: 1rem;
}

.badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  color: var(--accent-1);
}

.hero p { color: var(--text-dim); font-size: clamp(0.98rem, 2.5vw, 1.12rem); margin: 0 auto; max-width: 46ch; }

/* ---------- form ---------- */

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.secret-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 1rem 1.1rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.secret-input::placeholder { color: var(--text-faint); }

.secret-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0;
}

.select {
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  outline: none;
  cursor: pointer;
}

.select:focus { border-color: var(--accent-1); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.toggle input { display: none; }

.toggle .track {
  width: 40px; height: 22px;
  border-radius: 9999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.15s ease;
  flex: none;
}

.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.toggle input:checked + .track { background: var(--accent-1); }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  color: #fff;
  background: var(--accent-1);
}

.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { background: var(--accent-2); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent-1); color: var(--accent-1); }

.btn-danger { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.35); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.16); }

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- result ---------- */

.result-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.result-title svg { color: var(--success); flex: none; }

.link-row { display: flex; gap: 0.6rem; margin-bottom: 0.8rem; }

.link-field {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  outline: none;
}

.link-field:focus { border-color: var(--accent-1); }

.btn-icon { padding: 0.7rem 1.2rem; font-size: 0.88rem; flex: none; }

.note {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 0.75rem 0 0;
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}

.note svg { flex: none; margin-top: 2px; }

.warning-note { color: var(--warning); }
.danger-note { color: var(--danger); }

.actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.actions .btn { flex: 1; }

/* ---------- reveal view ---------- */

.reveal-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--accent-1);
}

.reveal-icon svg { color: #fff; }

.reveal-title { text-align: center; font-size: 1.35rem; font-weight: 800; margin: 0 0 0.4rem; }
.reveal-sub { text-align: center; color: var(--text-dim); font-size: 0.95rem; margin: 0 0 1.5rem; }

.secret-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 45vh;
  overflow-y: auto;
  user-select: all;
  margin-bottom: 1.1rem;
}

.burned-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
}

.burned-card { text-align: center; padding-top: 2.4rem; padding-bottom: 2.4rem; }
.burned-card svg { color: var(--text-faint); margin-bottom: 0.9rem; }
.burned-card h2 { margin: 0 0 0.5rem; }
.burned-card p { color: var(--text-dim); margin: 0 0 1.4rem; }

/* ---------- how it works ---------- */

.how { margin-top: 2.2rem; animation: fadeUp 0.5s ease 0.15s both; }

.how h2 {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin: 0 0 1.2rem;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }

@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  text-align: center;
}

.step .num {
  width: 30px; height: 30px;
  margin: 0 auto 0.6rem;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: var(--accent-1);
}

.step h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.step p { margin: 0; font-size: 0.82rem; color: var(--text-dim); }

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 1.6rem 1rem 2.2rem;
  color: var(--text-faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.site-footer p { margin: 0.25rem 0; }

.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent-1); }

/* ---------- misc ---------- */

.hidden { display: none !important; }

::selection { background: rgba(99, 102, 241, 0.2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9999px; }
::-webkit-scrollbar-track { background: transparent; }
