:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --primary: #f97316; --primary-d: #ea580c; --primary-l: #fff4ec; --ok: #16a34a; --chip: #f3f4f6;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 4px 16px rgba(17,24,39,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b22; --text: #f3f4f6; --muted: #9ca3af; --line: #272b35;
    --primary-l: #2a1a0e; --chip: #232733; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 600; }
.brand b { color: var(--primary); }
.brand img { border-radius: 9px; }
.lang { display: flex; background: var(--chip); border-radius: 10px; padding: 3px; }
.lang button { border: 0; background: transparent; color: var(--muted); font: 600 13px/1 inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.lang button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 640px; }

.group { margin-top: 32px; }
.group:first-child { margin-top: 28px; }
.group h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 14px; }
.gi { font-size: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.grid > * { min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; position: relative; }
.card.rec { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l), var(--shadow); }
.badge { position: absolute; top: -10px; right: 14px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.card-head { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.card-head > div:last-child { min-width: 0; }
.ic { flex: 0 0 48px; height: 48px; border-radius: 12px; background: var(--primary-l); display: grid; place-items: center; font-size: 24px; }
.card h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.desc { margin: 0; color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip { background: var(--chip); color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.chip.v { color: var(--text); }
.actions { display: flex; gap: 8px; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent; font: 600 15px/1 inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); }
.btn.qr { flex: 0 0 auto; }
.sha { background: none; border: 0; padding: 0; color: var(--muted); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left; cursor: pointer; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.sha:hover { color: var(--text); }
.steps { margin: 0; padding-left: 20px; color: var(--text); font-size: 14px; display: grid; gap: 6px; }

.err { margin-top: 24px; padding: 14px; border-radius: 12px; background: #fef2f2; color: #b91c1c; }
.foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding-top: 40px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

dialog { border: 0; border-radius: 20px; padding: 0; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(15,17,21,.55); }
.qr-box { padding: 24px; text-align: center; position: relative; width: 360px; max-width: 100%; }
.qr-box h3 { margin: 0 32px 14px; font-size: 18px; }
.qr-box img { width: 280px; height: 280px; max-width: 100%; height: auto; background: #fff; border-radius: 12px; }
.qr-hint { color: var(--muted); font-size: 14px; margin: 12px 0 6px; }
.qr-box code { font-size: 12px; color: var(--muted); word-break: break-all; }
.x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--chip);
  color: var(--text); font-size: 16px; cursor: pointer; }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
  .foot { flex-direction: column; gap: 4px; }
}
