:root {
  --bg: #0b0b0e;
  --card: #17171c;
  --card-2: #22222a;
  --text: #f2f2f4;
  --dim: #9a9aa5;
  --green: #3ddc74;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center; padding: 12px 16px;
  background: rgba(11, 11, 14, .82); backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
main { padding: 4px 16px 0; max-width: 560px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: #101015; border-top: 1px solid #26262e;
}
.tabbar a {
  color: var(--dim); text-decoration: none; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; padding: 6px 0; border-radius: 14px;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a:active { transform: scale(.94); }
.tabbar a.active { color: var(--green); background: #1a2b20; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.sec h2 { margin: 0; font-size: 20px; }
.sec small { color: var(--dim); font-size: 13px; font-weight: 400; margin-left: 6px; }
.sec a { color: var(--dim); text-decoration: none; font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card-2); border-radius: 999px; padding: 8px 16px;
  font-size: 14px; color: var(--text);
}
.hscroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.cell { flex: 0 0 96px; text-align: center; font-size: 12px; color: var(--text); }
.cell img { width: 88px; height: 88px; object-fit: cover; background: var(--card-2); }
.cell .avatar { border-radius: 50%; }
.cell .sq { border-radius: 12px; }
.cell div { margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank { color: var(--green); font-weight: 700; }
.loading, .empty { color: var(--dim); text-align: center; padding: 44px 0; }
.gate {
  position: fixed; inset: 0; z-index: 20; display: flex;
  align-items: center; justify-content: center; background: var(--bg); padding: 24px;
}
.gate.hidden { display: none; }
.gate .card { width: 100%; max-width: 320px; text-align: center; }
.gate h2 { margin: 0 0 6px; font-size: 22px; }
.gate p { margin: 0; color: var(--dim); font-size: 14px; }
.gate input {
  width: 100%; margin: 12px 0; padding: 12px; border-radius: 12px;
  border: 1px solid #33333d; background: var(--card-2); color: var(--text); font-size: 16px;
}
.gate button {
  width: 100%; padding: 12px; border: 0; border-radius: 999px;
  background: var(--green); color: #08130c; font-size: 16px; font-weight: 700;
  transition: transform .1s ease;
}
.gate button:active { transform: scale(.97); }
/* 回顾卡：渐变 + 噪点，布局照截图（左列两小一大，右列一大两小） */
.recap-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px;
}
.recap-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: 18px 16px; min-height: 64px; display: flex; align-items: center;
  color: #fff; text-decoration: none; font-size: 19px; font-weight: 700;
}
.recap-card .emoji { font-size: 30px; margin-right: 10px; }
.recap-card.tall { min-height: 150px; align-items: flex-end; font-size: 26px; line-height: 1.15; }
.recap-card::after {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
.grad-pink { background: linear-gradient(135deg, #2b2030, #17171c 60%); }
.grad-pink .emoji, .grad-cyan .emoji, .grad-olive .emoji, .grad-teal .emoji { filter: none; }
.grad-cyan { background: linear-gradient(135deg, #12333a, #17171c 60%); }
.grad-blue { background: linear-gradient(160deg, #2aa5c9, #1f4dbf); }
.grad-purple { background: linear-gradient(160deg, #c77bec, #7f4bd8); }
.grad-olive { background: linear-gradient(135deg, #3a3d12, #17171c 60%); }
.grad-teal { background: linear-gradient(135deg, #113b33, #17171c 60%); }
/* 回顾详情页大数字卡：复用入口卡的渐变+噪点做识别延续，排版放大做年度报告气质 */
.recap-hero { display: block; text-align: center; padding: 32px 22px 26px; }
.recap-hero .period { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.recap-hero .headline {
  font-size: clamp(32px, 11vw, 46px); font-weight: 800; letter-spacing: -.02em;
  line-height: 1.05; margin: 10px 0 12px;
}
.recap-hero .stats { font-size: 15px; color: rgba(255, 255, 255, .88); }
.recap-hero .prev { margin-top: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .64); }
.recap-hero .period, .recap-hero .headline, .recap-hero .stats, .recap-hero .prev {
  text-shadow: 0 1px 6px rgba(0, 0, 0, .28);
}
.seg { display: inline-flex; background: var(--card); border-radius: 999px; padding: 4px; gap: 4px; margin: 10px 0; }
.seg button {
  border: 0; background: transparent; color: var(--dim); padding: 8px 14px;
  border-radius: 999px; font-size: 14px;
}
.seg button.active { background: var(--green); color: #08130c; font-weight: 700; }
/* 独立单按钮（区别于 .seg 的分段容器语义），工具页「清除本机口令」用；
   描边空心 pill，避免和 .gate button 的实心绿 CTA 抢主次 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--green); background: transparent; color: var(--green);
  padding: 11px 20px; margin-top: 4px; border-radius: 999px; font-size: 15px; font-weight: 600;
  transition: transform .1s ease, background .15s ease;
}
.btn:active { transform: scale(.97); background: rgba(61, 220, 116, .14); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.rowlist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border-radius: 14px; background: transparent;
}
.row:nth-child(-n+3) .rank { font-size: 17px; }
.row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--card-2); }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.row .grow span, .row .meta { color: var(--dim); font-size: 13px; }
.row .meta { text-align: right; white-space: nowrap; }
.bignum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.bignum { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.bignum b { display: block; font-size: 26px; margin-top: 2px; }
.bignum span { color: var(--dim); font-size: 13px; }
svg.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .tabbar a, .gate button, .btn { transition: none; }
  .tabbar a:active, .gate button:active, .btn:active { transform: none; }
}
