:root {
  --bg: #0f1419;
  --bg-elev: #171d25;
  --line: #2a3441;
  --text: #e8eef5;
  --muted: #8b9aab;
  --accent: #3ecf8e;
  --accent-ink: #062416;
  --danger: #ff7b72;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2a3a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #16261f 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 16px calc(28px + var(--safe-bottom));
}

.top h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gate {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.reveal-btn {
  width: min(100%, 280px);
  min-height: 52px;
  font-size: 1.05rem;
}

.list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list[hidden],
.gate[hidden],
.empty[hidden] {
  display: none;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  background: color-mix(in srgb, var(--bg-elev) 88%, #fff 4%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.row-text {
  margin: 0;
  padding: 8px 4px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 1rem;
}

.copy-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  min-width: 72px;
  padding: 0 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}

.copy-btn:active {
  transform: scale(0.97);
}

.copy-btn.copied {
  background: #9be7c4;
}

.empty {
  margin: 28px 0;
  color: var(--muted);
  text-align: center;
}

.foot {
  margin-top: 28px;
  text-align: center;
}

.foot a,
.actions a {
  color: var(--muted);
  text-decoration: none;
}

.foot a:hover,
.actions a:hover {
  color: var(--text);
}

.field {
  display: block;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.editor {
  width: 100%;
  resize: vertical;
  min-height: 280px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.editor:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  background: #e8eef5;
  color: #0f1419;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

@media (min-width: 640px) {
  .page {
    padding-top: 48px;
  }

  .row {
    padding: 14px 14px 14px 16px;
  }
}
