/* OpenNet content platform — design system and public site. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: rgba(15, 20, 27, 0.72);
  --panel-solid: #10151c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edf3;
  --muted: #9aa6b6;
  --dim: #6b7688;
  --accent: #b7ff5a;
  --accent-ink: #0a1005;
  --accent-soft: rgba(183, 255, 90, 0.1);
  --cyan: #67e8f9;
  --cyan-soft: rgba(103, 232, 249, 0.1);
  --amber: #ffb84d;
  --amber-soft: rgba(255, 184, 77, 0.1);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  font: 15px/1.65 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:not(.admin-body) {
  display: flex;
  flex-direction: column;
}

body:not(.admin-body) main { flex: 1 0 auto; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 46% at 12% -4%, rgba(183, 255, 90, 0.11), transparent 62%),
    radial-gradient(48% 38% at 92% 6%, rgba(103, 232, 249, 0.08), transparent 62%),
    radial-gradient(46% 40% at 50% 108%, rgba(183, 255, 90, 0.05), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 92% 64% at 50% 0%, #000 18%, transparent 74%);
}

::selection { background: rgba(183, 255, 90, 0.28); color: #fff; }

a { color: var(--accent); }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- utilities ---------- */
.wrap {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.hidden, [hidden] { display: none !important; }
.min-w-0 { min-width: 0; }
.noscript-note { padding: 48px; text-align: center; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 12, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(183, 255, 90, 0.16), rgba(103, 232, 249, 0.08));
  border: 1px solid rgba(183, 255, 90, 0.26);
  box-shadow: 0 0 22px rgba(183, 255, 90, 0.12);
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 3px;
}

.site-nav { display: flex; gap: 26px; }
.site-nav .nav-icon { display: none; }

.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--text); }

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.site-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-wrap { position: relative; }

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 70;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #0f141b;
  box-shadow: var(--shadow);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
}

.menu-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.menu-item svg { flex-shrink: 0; color: var(--dim); }
.menu-item:hover svg { color: var(--muted); }
.menu-item.is-danger { color: var(--red); }
.menu-item.is-danger:hover { background: var(--red-soft); }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }

.install-btn { color: var(--accent); }
.notify-wrap { position: relative; }
.notify-btn { position: relative; color: var(--muted); }
.notify-btn.has-unread { color: var(--text); }

.notify-count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  width: 340px;
  max-height: min(430px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #0f141b;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.notify-list { overflow-y: auto; }

.notify-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notify-item:last-child { border-bottom: 0; }
.notify-item:hover { background: rgba(255, 255, 255, 0.035); }
.notify-item.is-unread { background: rgba(183, 255, 90, 0.045); }

.notify-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.notify-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.notify-item.is-unread .notify-title::before { background: var(--accent); box-shadow: 0 0 8px rgba(183, 255, 90, 0.6); }

.notify-body { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.notify-time { margin-top: 4px; color: var(--dim); font-size: 10.5px; }
.notify-empty { padding: 34px 18px; color: var(--dim); font-size: 12.5px; text-align: center; }

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.account-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85), transparent 42%),
    conic-gradient(from 210deg, hsl(var(--hue, 100) 80% 58%), hsl(calc(var(--hue, 100) + 60) 85% 52%), hsl(var(--hue, 100) 80% 58%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.account-addr {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: -0.02em;
}

/* ---------- buttons and badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(180deg, #c8ff84, #a9f04f);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(183, 255, 90, 0.35), 0 10px 30px rgba(183, 255, 90, 0.16);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(183, 255, 90, 0.55), 0 14px 36px rgba(183, 255, 90, 0.24); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line-strong); }

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.btn-danger {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ff9b9b;
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.18); }

.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 14px; }

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--line); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge[data-tone="lime"] { color: var(--accent); border-color: rgba(183, 255, 90, 0.3); background: var(--accent-soft); }
.badge[data-tone="cyan"] { color: var(--cyan); border-color: rgba(103, 232, 249, 0.28); background: var(--cyan-soft); }
.badge[data-tone="amber"] { color: var(--amber); border-color: rgba(255, 184, 77, 0.3); background: var(--amber-soft); }
.badge[data-tone="red"] { color: var(--red); border-color: rgba(255, 107, 107, 0.3); background: var(--red-soft); }
.badge[data-tone="gray"] { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

.grade {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.grade[data-grade="A"] { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.grade[data-grade="B"] { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(103, 232, 249, 0.3); }
.grade[data-grade="C"] { color: var(--amber); background: var(--amber-soft); border-color: rgba(255, 184, 77, 0.3); }

.mono-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.mono-chip:hover { border-color: var(--line-strong); color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 80px 0 16px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.88fr);
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.hero h1 {
  margin: 20px 0 20px;
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent) 8%, var(--cyan) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 28px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--dim);
  font-size: 12.5px;
}

.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { color: var(--accent); }

.hero-visual { position: relative; }

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -18% -14%;
  background: radial-gradient(closest-side, rgba(183, 255, 90, 0.13), transparent 72%);
  filter: blur(12px);
  z-index: -1;
}

.receipt {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012)),
    rgba(12, 16, 22, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.8s var(--ease) both;
}

.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
}

.receipt-status { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 600; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(183, 255, 90, 0.5);
  animation: pulse 2.2s infinite;
}

.receipt-file {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 20px;
}

.kind-tile {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.24);
  background: linear-gradient(150deg, rgba(103, 232, 249, 0.16), rgba(183, 255, 90, 0.08));
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.receipt-file-name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  word-break: break-all;
}

.receipt-file-meta { color: var(--dim); font-size: 12px; margin-top: 3px; }

.receipt-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.receipt-amount strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.receipt-amount span { color: var(--muted); font-size: 13px; font-weight: 600; }

.receipt-rows { display: grid; gap: 9px; padding: 18px 0 4px; }

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--dim);
}

.receipt-row b { font-weight: 500; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.receipt-row b.ok { color: var(--accent); }

.receipt-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11.5px;
}

.float-pill {
  position: absolute;
  right: -14px;
  bottom: -18px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(183, 255, 90, 0.3);
  border-radius: 12px;
  background: rgba(12, 17, 22, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  color: var(--muted);
  animation: float 5.5s ease-in-out infinite;
}
.float-pill b { color: var(--accent); font-family: var(--mono); font-size: 12.5px; }

.receipt-cover {
  position: absolute;
  left: -20px;
  top: -16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(12, 17, 22, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  font-size: 11.5px;
  color: var(--muted);
  animation: float 6.5s ease-in-out infinite reverse;
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  overflow: hidden;
}

.stat { padding: 18px 22px; background: rgba(10, 14, 19, 0.78); }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat-label { margin-top: 3px; color: var(--dim); font-size: 12px; }

/* ---------- sections ---------- */
.section { padding: 32px 0; scroll-margin-top: 88px; }

/* 首页统计条紧接玩法说明，单独收紧这一处 */
#how { padding-top: 32px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-sub { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }

.section-head .btn { flex-shrink: 0; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.step {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}

.step::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(183, 255, 90, 0.1), transparent);
}

.step-top { display: flex; align-items: center; justify-content: space-between; }
.step-num { font-family: var(--mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.12em; }
.step-icon { color: var(--dim); }
.step h3 { margin: 16px 0 6px; font-size: 15.5px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

/* ---------- upload ---------- */
.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    rgba(12, 16, 22, 0.6);
}

.upload-card { position: relative; padding: 24px; }

.dropzone {
  position: relative;
  display: block;
  width: 100%;
  padding: 38px 24px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.dropzone:hover, .dropzone.is-drag {
  border-color: rgba(183, 255, 90, 0.6);
  background: var(--accent-soft);
  box-shadow: inset 0 0 40px rgba(183, 255, 90, 0.05);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(183, 255, 90, 0.28);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.dropzone-title { font-weight: 600; font-size: 14.5px; }
.dropzone-title em { font-style: normal; color: var(--accent); }
.drop-title-tap { display: none; }
.dropzone-hint { margin-top: 5px; color: var(--dim); font-size: 12.5px; }

.file-selected {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.file-selected .kind-tile { width: 42px; height: 42px; border-radius: 11px; }
.file-selected-name { font-weight: 600; font-size: 13.5px; word-break: break-all; line-height: 1.4; }
.file-selected-meta { margin-top: 2px; color: var(--dim); font-size: 12px; }
.file-selected .icon-btn { margin-left: auto; flex-shrink: 0; }

.upload-fields { display: grid; gap: 14px; margin-top: 18px; }

.field label, .field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.field label .opt { color: var(--dim); font-weight: 400; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input::placeholder { color: var(--dim); }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: rgba(183, 255, 90, 0.45); box-shadow: 0 0 0 3px rgba(183, 255, 90, 0.1); }

textarea.input { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
textarea.secret-input { font-family: var(--mono); font-size: 12.5px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.checkbox input:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a1005' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.upload-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.upload-submit .hint { color: var(--dim); font-size: 12px; line-height: 1.5; }
.upload-submit .btn { flex-shrink: 0; }

.progress-wrap { margin-top: 16px; }

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  box-shadow: 0 0 18px rgba(183, 255, 90, 0.4);
  transition: width 0.2s ease;
}

.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--dim); font-size: 11.5px; }

.form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.5;
}
.form-error:empty { min-height: 0; margin: 0; }

.success-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(183, 255, 90, 0.26);
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.6;
}

.success-card svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.success-card b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.success-card .mono-chip { margin-top: 6px; }

.side-card { padding: 22px; }
.side-card h3 { margin: 0 0 4px; font-size: 14.5px; }
.side-card > .muted { font-size: 12.5px; margin: 0 0 16px; }

.notice-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.notice-list li { display: flex; gap: 11px; }

.notice-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  flex-shrink: 0;
}

.notice-list b { display: block; font-size: 13px; font-weight: 600; }
.notice-list p { margin: 1px 0 0; color: var(--dim); font-size: 12px; line-height: 1.55; }

.reward-table {
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}

.reward-row b { color: var(--text); font-family: var(--mono); font-weight: 500; }

.gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: inherit;
  background: rgba(8, 11, 15, 0.8);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.gate-inner { max-width: 320px; text-align: center; }
.gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.gate-inner h3 { margin: 0 0 6px; font-size: 16px; }
.gate-inner p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------- lists ---------- */
.item-list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s, background 0.18s;
}

.list-item:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.03); }

.list-item .kind-tile { width: 40px; height: 40px; border-radius: 10px; }

.item-main { min-width: 0; }
.item-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.item-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; color: var(--dim); font-size: 12px; }
.item-meta .mono { font-size: 11.5px; }
.item-error { margin-top: 4px; color: var(--red); font-size: 11.5px; line-height: 1.5; }

.item-side { display: flex; align-items: center; gap: 10px; }
.item-amount { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.item-amount small { display: block; color: var(--dim); font-family: var(--font); font-size: 11px; }

/* ---------- earnings ---------- */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.balance-card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
}

.balance-card.is-primary {
  border-color: rgba(183, 255, 90, 0.3);
  background:
    radial-gradient(120% 120% at 10% 0%, rgba(183, 255, 90, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 30px rgba(183, 255, 90, 0.06);
}

.balance-label { color: var(--dim); font-size: 11.5px; }
.balance-card.is-primary .balance-label { color: var(--accent); }

.balance-value {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.balance-card.is-primary .balance-value { color: var(--accent); }
.balance-hint { margin-top: 4px; color: var(--dim); font-size: 11px; line-height: 1.5; }

/* ---------- catalog ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-box { position: relative; flex: 1 1 auto; min-width: 240px; max-width: 380px; }

.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.search-box .input { padding-left: 39px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active { color: var(--accent); border-color: rgba(183, 255, 90, 0.35); background: var(--accent-soft); }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.content-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 18% 0%, hsl(var(--hue, 100) 82% 55% / 0.3), transparent 62%),
    linear-gradient(140deg, #10161e, #090d12);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 78%);
}

.cover::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 130px;
  height: 130px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 60px hsl(var(--hue, 100) 80% 55% / 0.18) inset;
}

.cover-file {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  background: rgba(9, 13, 18, 0.55);
  color: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
}

.cover-ext {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 1;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(6, 9, 13, 0.55);
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cover .grade { position: absolute; top: 10px; right: 10px; z-index: 1; }

.card-body { padding: 15px 16px 16px; }

.card-title {
  min-height: 2.8em;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 11.5px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }
.card-link.is-disabled { color: var(--dim); pointer-events: none; }

/* ---------- audit ---------- */
.audit-feed { border-top: 1px solid var(--line); }

.audit-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.audit-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.audit-icon[data-tone="lime"] { color: var(--accent); border-color: rgba(183, 255, 90, 0.28); background: var(--accent-soft); }
.audit-icon[data-tone="red"] { color: var(--red); border-color: rgba(255, 107, 107, 0.28); background: var(--red-soft); }
.audit-icon[data-tone="amber"] { color: var(--amber); border-color: rgba(255, 184, 77, 0.28); background: var(--amber-soft); }
.audit-icon[data-tone="cyan"] { color: var(--cyan); border-color: rgba(103, 232, 249, 0.28); background: var(--cyan-soft); }

.audit-main { min-width: 0; }
.audit-text { font-size: 13.5px; line-height: 1.5; }
.audit-text strong { font-weight: 600; word-break: break-all; }
.audit-text .badge { margin-left: 6px; vertical-align: 1px; }
.audit-meta { margin-top: 2px; color: var(--dim); font-size: 11.5px; }

.audit-side { display: flex; align-items: center; gap: 14px; }
.audit-reward { font-family: var(--mono); font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.audit-time { color: var(--dim); font-size: 11.5px; white-space: nowrap; }

/* ---------- empty / loading ---------- */
.empty {
  padding: 46px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--dim);
  font-size: 13.5px;
}
.empty svg { margin: 0 auto 10px; color: var(--dim); }
.empty b { display: block; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 3px; }

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
.skeleton-card { height: 232px; border-radius: 17px; }
.skeleton-row { height: 64px; }

/* ---------- faq ---------- */
.faq-list { display: grid; gap: 9px; max-width: 860px; }

.faq {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0 18px;
  transition: border-color 0.18s;
}

.faq:hover { border-color: var(--line-strong); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--dim);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.22s var(--ease), color 0.2s;
}

.faq[open] summary::after { transform: rotate(45deg); color: var(--accent); }

.faq p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.faq p:last-child { margin-bottom: 16px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 40px; padding: 48px 0 32px; border-top: 1px solid var(--line); }

.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 34ch; }
.footer-brand p { margin: 12px 0 0; color: var(--dim); font-size: 12.5px; line-height: 1.7; }


.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
}

/* ---------- modal ---------- */
dialog.modal {
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

dialog.modal::backdrop {
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #121820, #0b0f14);
  box-shadow: var(--shadow);
  animation: modal-in 0.24s var(--ease) both;
}

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.015em; }
.modal-sub { margin: 6px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.login-tab {
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.login-tab:hover { color: var(--text); }
.login-tab.is-active { background: rgba(183, 255, 90, 0.12); color: var(--accent); }

.email-sent { margin: 0 0 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.email-sent b { color: var(--text); }
.code-input { font-family: var(--mono); font-size: 18px; letter-spacing: 0.35em; text-align: center; }
.code-row { display: flex; align-items: stretch; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { height: 42px; border-radius: 11px; flex-shrink: 0; }

.wallet-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.wallet-panel h3 { margin: 0 0 4px; font-size: 16px; }
.wallet-panel p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.wallet-panel-meta { display: flex; flex-wrap: wrap; gap: 18px 32px; margin: 16px 0; }
.wallet-panel-meta > div { display: grid; gap: 4px; }
.wallet-panel-meta b { font-size: 15px; }
.wallet-send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 16px; }
.wallet-send-grid .field { margin-bottom: 0; }
.wallet-send-grid .field-wide { grid-column: 1 / -1; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.field-head label { margin-bottom: 0; }
.wallet-send-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.wallet-send-hint { margin: 0; color: var(--muted); font-size: 12px; }
.wallet-send-footer .btn { min-width: 156px; justify-content: center; }

.wallet-note {
  display: flex;
  gap: 9px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}
.wallet-note svg { flex-shrink: 0; margin-top: 1px; color: var(--muted); }

.field { margin-bottom: 13px; }
.field:last-of-type { margin-bottom: 0; }

.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-actions .btn { width: 100%; }

.text-switch {
  align-self: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-switch:hover { color: var(--muted); }

.modal-actions-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions-row .btn { width: auto; }

.form-error[role="alert"] { color: var(--red); }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-primary .spinner { border-color: rgba(10, 16, 5, 0.25); border-top-color: var(--accent-ink); }

/* ---------- toast ---------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(16, 21, 28, 0.96);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 0.28s var(--ease) both;
}
.toast svg { flex-shrink: 0; margin-top: 2px; }
.toast[data-type="success"] { border-color: rgba(183, 255, 90, 0.3); }
.toast[data-type="success"] svg { color: var(--accent); }
.toast[data-type="error"] { border-color: rgba(255, 107, 107, 0.34); }
.toast[data-type="error"] svg { color: var(--red); }
.toast[data-type="info"] svg { color: var(--cyan); }
.toast.is-out { animation: toast-out 0.22s ease forwards; }

/* ---------- animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(183, 255, 90, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(183, 255, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(183, 255, 90, 0); }
}

@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero { padding-top: 64px; }
  .hero-grid { gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: 1fr; }
  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .float-pill, .receipt-cover { display: none; }
  .hero-visual::before { inset: 0; }
}

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 6px; }
  .site-nav {
    order: 3;
    width: 100%;
    gap: 18px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; font-size: 13px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 520px; }
  .hero h1 { font-size: clamp(36px, 8vw, 56px); }
  .stats { grid-template-columns: 1fr; margin-top: 44px; }
  .stat { padding: 15px 20px; }
  .stat-value { font-size: 20px; }
  .section { padding: 32px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: auto; gap: 10px; }
  .brand-text small { display: none; }
  .header-actions .btn span { display: none; }
  .header-actions .btn { padding: 0 14px; }
  .hero { padding: 48px 0 16px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-sub { font-size: 15px; }
  .hero-trust { gap: 8px 14px; }
  .receipt { padding: 20px; }
  .float-pill { display: none; }
  .receipt-cover { display: none; }
  .steps { grid-template-columns: 1fr; }
  .upload-card, .side-card { padding: 18px; }
  .upload-submit { flex-direction: column; align-items: stretch; }
  .upload-submit .btn { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; max-width: none; width: 100%; }
  .filters { overflow-x: auto; padding-bottom: 2px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .list-item { grid-template-columns: auto minmax(0, 1fr); }
  .list-item .item-side { grid-column: 1 / -1; justify-content: flex-end; }
  .audit-item { grid-template-columns: auto minmax(0, 1fr); }
  .audit-side { grid-column: 2; justify-content: flex-start; gap: 10px; }
  .footer-grid { flex-direction: column; gap: 28px; }
  .wallet-send-grid { grid-template-columns: 1fr; }
  .wallet-send-grid .field-wide { grid-column: auto; }
  .wallet-send-footer { flex-direction: column; align-items: stretch; gap: 16px; }
  .wallet-send-footer .btn { width: 100%; }
  .toast-stack { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .toast { max-width: none; }
  .notify-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 74px;
    width: auto;
    max-height: calc(100vh - 96px);
  }
}

@media (max-width: 420px) {
  .site-header .account-addr { display: none; }
  .site-header .account-chip { padding: 3px; }
}

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

/* ---------- page display split ---------- */
html[data-page="home"] #upload,
html[data-page="home"] #earnings,
html[data-page="home"] #mine,
html[data-page="home"] #faq { display: none; }

html[data-page="catalog"] .hero,
html[data-page="catalog"] #how,
html[data-page="catalog"] #upload,
html[data-page="catalog"] #earnings,
html[data-page="catalog"] #mine,
html[data-page="catalog"] #audit,
html[data-page="catalog"] #faq { display: none; }

html[data-page="audit"] .hero,
html[data-page="audit"] #how,
html[data-page="audit"] #upload,
html[data-page="audit"] #earnings,
html[data-page="audit"] #mine,
html[data-page="audit"] #catalog,
html[data-page="audit"] #faq { display: none; }

html[data-page="upload"] .hero,
html[data-page="upload"] #how,
html[data-page="upload"] #earnings,
html[data-page="upload"] #catalog,
html[data-page="upload"] #audit,
html[data-page="upload"] #faq { display: none; }

html[data-page="earnings"] .hero,
html[data-page="earnings"] #how,
html[data-page="earnings"] #upload,
html[data-page="earnings"] #mine,
html[data-page="earnings"] #catalog,
html[data-page="earnings"] #audit,
html[data-page="earnings"] #faq { display: none; }

html[data-page="help"] .hero,
html[data-page="help"] #how,
html[data-page="help"] #upload,
html[data-page="help"] #earnings,
html[data-page="help"] #mine,
html[data-page="help"] #catalog,
html[data-page="help"] #audit { display: none; }

/* 首页只展示最新几条 */
.title-home { display: none; }
html[data-page="home"] .title-home { display: inline; }
html[data-page="home"] .title-page { display: none; }

html[data-page="home"] #catalog .toolbar { display: none; }
html[data-page="home"] #catalogGrid > *:nth-child(n+4) { display: none; }
html[data-page="home"] #auditFeed > *:nth-child(n+6) { display: none; }

html[data-page="catalog"] .catalog-all { display: none; }
html:not([data-page="catalog"]) .catalog-upload { display: none; }
html[data-page="audit"] .audit-all { display: none; }

html[data-page="catalog"] .site-nav a[href="/catalog"],
html[data-page="audit"] .site-nav a[href="/audit"],
html[data-page="upload"] .site-nav a[href="/upload"],
html[data-page="earnings"] .site-nav a[href="/earnings"],
html[data-page="help"] .site-nav a[href="/help"] {
  color: var(--text);
}
html[data-page="catalog"] .site-nav a[href="/catalog"]::after,
html[data-page="audit"] .site-nav a[href="/audit"]::after,
html[data-page="upload"] .site-nav a[href="/upload"]::after,
html[data-page="earnings"] .site-nav a[href="/earnings"]::after,
html[data-page="help"] .site-nav a[href="/help"]::after {
  transform: scaleX(1);
}

/* ---------- mobile app shell ---------- */
@media (max-width: 640px) {
  :root { --tabbar-h: 58px; }

  html { -webkit-text-size-adjust: 100%; }

  button, a { -webkit-tap-highlight-color: transparent; }

  /* backdrop-filter would turn the header into the containing block
     for the fixed tab bar and notification panel. */
  .site-header {
    padding-top: env(safe-area-inset-top);
    background: rgba(7, 9, 12, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .header-inner { flex-wrap: nowrap; height: 58px; padding: 0; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-text { font-size: 15px; }
  .header-actions { gap: 4px; }
  .header-actions .btn { height: 38px; padding: 0 12px; }
  .account-chip { height: 36px; padding-right: 8px; }
  .avatar { width: 24px; height: 24px; }

  /* nav becomes a bottom tab bar */
  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    order: initial;
    width: 100%;
    gap: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px calc(4px + env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(7, 9, 12, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: visible;
  }
  .site-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 10px;
    color: var(--dim);
    font-size: 10.5px;
    line-height: 1.2;
  }
  .site-nav a::after { display: none; }
  .site-nav a:active { background: rgba(255, 255, 255, 0.05); }
  .site-nav .nav-icon { display: block; width: 20px; height: 20px; }
  html[data-page="catalog"] .site-nav a[href="/catalog"],
  html[data-page="audit"] .site-nav a[href="/audit"],
  html[data-page="upload"] .site-nav a[href="/upload"],
  html[data-page="earnings"] .site-nav a[href="/earnings"],
  html[data-page="help"] .site-nav a[href="/help"] {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .site-footer {
    margin-top: 24px;
    padding: 32px 0 calc(28px + var(--tabbar-h) + env(safe-area-inset-bottom));
  }
  .toast-stack { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); }
  .notify-panel {
    top: calc(64px + env(safe-area-inset-top));
    max-height: calc(100vh - 142px - env(safe-area-inset-top));
    max-height: calc(100dvh - 142px - env(safe-area-inset-top));
  }

  /* forms: 16px avoids iOS focus zoom; 46px keeps touch targets comfortable */
  .input { height: 46px; font-size: 16px; }
  textarea.input, textarea.secret-input { font-size: 16px; }
  textarea.input { height: auto; }
  .checkbox input { width: 20px; height: 20px; }
  .btn { height: 46px; font-size: 14.5px; }
  .btn-sm { height: 40px; font-size: 13px; }
  .btn-lg { height: 50px; }
  .icon-btn { width: 38px; height: 38px; }
  .chip { height: 38px; padding: 0 15px; }
  .filters { flex-wrap: nowrap; }
  .search-box .input { height: 46px; }

  /* dialogs rise from the bottom as sheets */
  dialog.modal {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    margin: 0;
  }
  .modal-card {
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation: sheet-in 0.26s var(--ease) both;
  }
  .modal-actions-row { display: grid; grid-template-columns: 1fr 1fr; }
  .modal-actions-row .btn { width: 100%; }

  .hero { padding: 36px 0 8px; }
  .hero h1 { margin: 14px 0; font-size: clamp(30px, 8.8vw, 42px); }
  .hero-sub { font-size: 14.5px; line-height: 1.7; }
  .hero-actions { margin: 22px 0 18px; }
  .hero-trust { font-size: 12px; }
  .receipt { padding: 18px; border-radius: 18px; }
  .receipt-amount strong { font-size: 30px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 32px; }
  .stat { padding: 13px 10px; text-align: center; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10.5px; line-height: 1.4; }

  .section { padding: 28px 0; }
  .section-head { gap: 14px; margin-bottom: 18px; }
  .section-title { font-size: 24px; }
  .section-sub { font-size: 14px; }

  .steps { gap: 10px; }
  .step { padding: 18px; }
  .upload-card, .side-card { padding: 16px; border-radius: 16px; }
  .dropzone { padding: 30px 16px; }
  .drop-title-drag { display: none; }
  .drop-title-tap { display: inline; }
  .upload-submit .btn { height: 48px; }

  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cover { aspect-ratio: 16 / 11; }
  .cover-file { width: 44px; height: 44px; border-radius: 12px; }
  .cover-ext { top: 8px; left: 8px; }
  .cover .grade { top: 8px; right: 8px; }
  .card-body { padding: 11px 12px 12px; }
  .card-title { font-size: 12.5px; }
  .card-meta { margin-top: 8px; font-size: 10.5px; }

  .list-item { padding: 13px 14px; gap: 10px; border-radius: 13px; }
  .list-item .kind-tile { width: 36px; height: 36px; }
  .item-title { font-size: 13px; }
  .item-side { width: 100%; justify-content: space-between; }
  .item-amount { text-align: left; }
  .audit-item { gap: 10px; }
  .audit-side { width: 100%; justify-content: space-between; }

  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .balance-card { padding: 13px 14px; }
  .balance-value { font-size: 18px; }
  .balance-hint { font-size: 10.5px; }
  #earnings .section-head .btn { width: 100%; }
  .wallet-panel { padding: 15px; }
  .wallet-panel-meta { gap: 12px 20px; }
}

@media (max-width: 380px) {
  .code-row { flex-direction: column; }
  .code-row .btn { width: 100%; }
}

@keyframes sheet-in {
  from { opacity: 0.5; transform: translateY(100%); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
