:root {
  --bg: #0b1220;
  --card: #131c2e;
  --card2: #1a2540;
  --line: #26324d;
  --fg: #e6edf3;
  --dim: #8b98ad;
  --accent: #4ade80;
  --accent2: #34d399;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(11,18,32,.98), rgba(11,18,32,.92));
  backdrop-filter: blur(8px);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.hd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.install-btn {
  flex: none; border: 1px solid var(--accent); color: var(--accent);
  background: transparent; border-radius: 18px; padding: 6px 14px; font-size: 13px;
}
.install-btn:active { background: rgba(74,222,128,.15); }
#search {
  margin-top: 12px; width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-size: 15px; outline: none;
}
#search:focus { border-color: var(--accent2); }
main { padding: 14px 16px 20px; max-width: 640px; margin: 0 auto; }
.tip { font-size: 12.5px; color: var(--dim); line-height: 1.6; margin-bottom: 12px; }
.tip b { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.card:active { background: var(--card2); }
.card .num { font-size: 22px; font-weight: 800; color: var(--accent2); font-variant-numeric: tabular-nums; }
.card .lbl { font-size: 12px; color: var(--dim); margin-top: 3px; min-height: 32px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .qr {
  margin-top: 8px; width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line);
}
.empty { text-align: center; color: var(--dim); padding: 40px 0; }
footer { text-align: center; font-size: 12px; color: #4b5a74; padding: 16px 0 28px; }
footer .apk { margin-top: 8px; }
footer .apk a { color: #7dd3fc; text-decoration: none; border-bottom: 1px dashed #7dd3fc; }
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; max-width: 420px; width: 100%; padding: 20px 20px 24px; text-align: center; }
.mb-top { display: flex; align-items: center; justify-content: space-between; }
.m-num { font-size: 26px; font-weight: 800; color: var(--accent2); }
.close { border: none; background: var(--card2); color: var(--fg); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; }
.m-label { color: var(--dim); font-size: 14px; margin: 10px 0 14px; }
.qr-wrap { background: #fff; border-radius: 12px; padding: 10px; }
.qr-wrap img { width: 100%; height: auto; display: block; border-radius: 6px; }
.m-hint { font-size: 13px; color: var(--accent); margin-top: 14px; line-height: 1.7; }
#guide-body .g-title { color: var(--accent2); font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.hidden { display: none !important; }
.fab {
  position: fixed; right: 18px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30;
  width: 58px; height: 58px; border-radius: 50%; border: none; font-size: 30px; line-height: 1;
  color: #06210f; background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 6px 18px rgba(34, 197, 94, .45); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(.94); }
.f-label { display: block; font-size: 13px; color: var(--dim); text-align: left; margin: 14px 0 6px; }
.f-input {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-size: 15px; outline: none;
  border: 1px solid var(--line); background: var(--card2); color: var(--fg);
}
.f-input:focus { border-color: var(--accent2); }
.f-photo { display: flex; gap: 10px; }
.f-tip { font-size: 12px; color: #5d6b84; margin-top: 8px; text-align: left; }
.photo-btn {
  flex: 1; padding: 12px 0; border-radius: 10px; font-size: 14px; cursor: pointer;
  border: 1px dashed var(--accent2); color: var(--accent2); background: transparent;
}
.photo-btn:active { background: rgba(52, 211, 153, .1); }
.f-preview {
  margin-top: 10px; width: 100%; max-height: 220px; object-fit: contain;
  border-radius: 10px; background: #fff; border: 1px solid var(--line);
}
.f-msg { font-size: 13px; margin-top: 10px; min-height: 18px; text-align: left; }
.f-msg.err { color: #f87171; }
.submit-btn {
  width: 100%; margin-top: 8px; padding: 13px 0; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #4ade80, #22c55e); color: #06210f;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.submit-btn:disabled { opacity: .55; }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60;
  background: rgba(20, 30, 50, .95); color: var(--fg); font-size: 14px;
  padding: 10px 20px; border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.4); white-space: nowrap;
}
