:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: #e3e3e6;
  --blue: #0071e3;
  --blue-ink: #0060c0;
  --gold: #f5b301;
  --silver: #b9bcc2;
  --bronze: #cd7f4d;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--ink-3); }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,253,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; height: 52px;
  display: flex; align-items: center; gap: 24px; padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6a3d, #ff2d78); box-shadow: 0 0 12px rgba(255,45,120,.5); }
.nav-links { display: flex; gap: 26px; margin-left: 8px; }
.nav-links a { font-size: 14px; color: var(--ink-2); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  margin-left: auto; border: none; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 500;
  padding: 7px 16px; border-radius: 980px; transition: background .2s, transform .1s;
}
.nav-cta:hover { background: var(--blue-ink); }
.nav-cta:active { transform: scale(.97); }

/* ---------------- 布局 ---------------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 22px 80px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 30px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.section-head .sub { color: var(--ink-3); font-size: 14px; }

/* ---------------- Hero ---------------- */
.hero { padding: 84px 0 28px; text-align: center; }
.hero h1 {
  font-size: clamp(36px, 6vw, 68px); font-weight: 700; letter-spacing: -.03em;
  margin: 0 0 16px; line-height: 1.05;
  background: linear-gradient(120deg, #1d1d1f 20%, #ff2d78 60%, #ff6a3d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 20px; color: var(--ink-2); margin: 0 auto 28px; max-width: 640px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  border: none; cursor: pointer; font-size: 16px; font-weight: 500;
  padding: 12px 24px; border-radius: 980px; transition: all .2s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); transform: translateY(-1px); }
.btn-ghost { background: rgba(0,0,0,.05); color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.09); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; border: 1px solid rgba(0,0,0,.04);
}
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- 排行榜 ---------------- */
.tabs { display: inline-flex; background: rgba(0,0,0,.05); border-radius: 980px; padding: 4px; gap: 4px; margin-bottom: 22px; }
.tabs button {
  border: none; cursor: pointer; background: transparent; color: var(--ink-2);
  font-size: 15px; padding: 8px 20px; border-radius: 980px; transition: all .2s;
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.lb-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  margin-bottom: 10px; cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.lb-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rank {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: rgba(0,0,0,.05); color: var(--ink-2);
}
.rank.r1 { background: linear-gradient(135deg,#ffe08a,#f5b301); color:#5a3d00; }
.rank.r2 { background: linear-gradient(135deg,#eef0f3,#b9bcc2); color:#3a3d44; }
.rank.r3 { background: linear-gradient(135deg,#e7b48c,#cd7f4d); color:#4a2613; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px;
  background: linear-gradient(135deg, #6a8dff, #9b6bff);
}
.avatar.s { width: 36px; height: 36px; flex-basis: 36px; font-size: 14px; }
.lb-main { flex: 1; min-width: 0; }
.lb-main .name { font-weight: 600; font-size: 16px; }
.lb-main .meta { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.score-pill {
  font-weight: 700; font-size: 18px; color: var(--ink);
  background: rgba(0,113,227,.08); padding: 6px 12px; border-radius: 980px; white-space: nowrap;
}
.score-pill small { font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* ---------------- 店家卡 ---------------- */
.store-card { cursor: pointer; transition: transform .12s, box-shadow .2s; }
.store-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.store-card h3 { margin: 0 0 6px; font-size: 19px; }
.store-card .loc { color: var(--ink-3); font-size: 13px; margin-bottom: 10px; }
.store-card .desc { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.store-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.chip { font-size: 12px; color: var(--ink-3); background: rgba(0,0,0,.05); padding: 4px 10px; border-radius: 980px; }

/* ---------------- 帖子 ---------------- */
.post {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 14px; cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.post:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.post-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-top .who { font-size: 14px; font-weight: 600; }
.post-top .when { color: var(--ink-3); font-size: 12px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 980px; margin-left: auto; }
.tag.review { background: rgba(0,113,227,.1); color: var(--blue); }
.tag.whistleblow { background: rgba(255,45,120,.1); color: #ff2d78; }
.post h3 { margin: 0 0 6px; font-size: 18px; }
.post .body { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.post .post-foot { margin-top: 12px; color: var(--ink-3); font-size: 13px; display: flex; gap: 18px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font-size: 15px; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: #fafafa; color: var(--ink); font-family: inherit;
  transition: border .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue); background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.stars { display: flex; gap: 6px; font-size: 26px; }
.stars span { cursor: pointer; color: var(--line); transition: color .12s; }
.stars span.on { color: var(--gold); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px){ .row-2 { grid-template-columns: 1fr; } }

/* ---------------- 详情 ---------------- */
.detail-hero { text-align: center; padding: 24px 0 8px; }
.detail-hero .avatar { width: 80px; height: 80px; flex-basis: 80px; font-size: 30px; margin: 0 auto 14px; }
.detail-hero h1 { font-size: 28px; margin: 0 0 6px; }
.detail-hero .meta { color: var(--ink-3); }
.bigscore { font-size: 46px; font-weight: 700; }
.bars { margin: 18px 0; }
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar .lab { width: 84px; font-size: 13px; color: var(--ink-2); }
.bar .track { flex: 1; height: 8px; background: rgba(0,0,0,.06); border-radius: 980px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg,#0071e3,#9b6bff); border-radius: 980px; }
.bar .val { width: 36px; text-align: right; font-size: 13px; font-weight: 600; }
.rating-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rating-item:last-child { border-bottom: none; }
.rating-item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rating-item .who { font-weight: 600; font-size: 14px; }
.rating-item .sc { color: var(--gold); font-weight: 700; }
.rating-item .cm { color: var(--ink-2); font-size: 14px; line-height: 1.5; }

/* ---------------- 弹层 ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .26s ease; }
.modal[hidden] { display: none !important; }
.modal.open { opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .26s ease; }
.modal.open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 28px;
  transform: translateY(16px) scale(.96); opacity: 0;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .24s ease;
  will-change: transform, opacity;
}
.modal.open .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal-card h3 { margin: 0 0 18px; font-size: 22px; }
.modal-close { position: absolute; top: 16px; right: 18px; border: none; background: none; font-size: 24px; cursor: pointer; color: var(--ink-3); transition: transform .15s; }
.modal-close:active { transform: scale(.85); }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: rgba(29,29,31,.92); color: #fff; padding: 12px 22px; border-radius: 980px;
  font-size: 14px; z-index: 200; animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty { text-align: center; color: var(--ink-3); padding: 50px 0; }
.back-link { color: var(--blue); font-size: 14px; cursor: pointer; display: inline-block; margin-bottom: 12px; }

/* ---------------- footer ---------------- */
.footer { text-align: center; padding: 40px 22px 60px; color: var(--ink-3); font-size: 13px; }
.footer p { margin: 4px 0; }

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root { --bg:#000; --card:#1c1c1e; --ink:#f5f5f7; --ink-2:#a1a1a6; --ink-3:#86868b; --line:#333; --shadow:0 4px 24px rgba(0,0,0,.5); }
  .nav { background: rgba(20,20,22,.7); }
  .field input, .field textarea, .field select { background:#2a2a2c; }
}

/* ---------------- 用户态 / 登录切换 ---------------- */
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ub-name { font-size: 14px; font-weight: 600; }
.ub-logout { border: none; background: none; color: var(--ink-3); font-size: 14px; cursor: pointer; }
.ub-logout:hover { color: var(--ink); }
.seg { display: inline-flex; background: rgba(0,0,0,.05); border-radius: 980px; padding: 4px; gap: 4px; width: 100%; }
.seg button { flex: 1; border: none; cursor: pointer; background: transparent; color: var(--ink-2); font-size: 15px; padding: 8px; border-radius: 980px; transition: all .2s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ---------------- 移动端发布按钮 ---------------- */
.fab { display: none; }

/* ---------------- 底部标签栏（移动端） ---------------- */
.tabbar { display: none; }

/* ---------------- 移动端适配 ---------------- */
@media (max-width: 820px) {
  .nav-links, .user-box { display: none; }
  .nav-inner { justify-content: flex-start; }
  .fab {
    display: flex; position: fixed; right: 18px; bottom: calc(70px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer; z-index: 60;
    background: var(--blue); color: #fff; font-size: 28px; line-height: 1;
    align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,113,227,.45);
  }
  .fab:active { transform: scale(.94); }
  .hero { padding: 52px 0 18px; }
  .hero h1 { font-size: clamp(30px, 9vw, 46px); }
  .hero p { font-size: 16px; margin-bottom: 22px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { margin-top: 34px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head h2 { font-size: 24px; }
  main { padding: 0 16px 100px; }
  .modal { padding: 12px; }
  .modal-card { padding: 20px 18px; border-radius: 18px; }
  .field input, .field textarea, .field select { font-size: 16px; }
  .lb-row { padding: 12px; gap: 12px; }
  .score-pill { font-size: 16px; }
  .post { padding: 16px; }
  .detail-hero { padding: 12px 0 4px; }
  .row-2 { grid-template-columns: 1fr; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(251,251,253,.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0 6px; font-size: 11px; color: var(--ink-3); transition: color .2s;
  }
  .tabbar a .ic { font-size: 20px; line-height: 1; transition: transform .2s; }
  .tabbar a.active { color: var(--blue); }
  .tabbar a.active .ic { transform: translateY(-2px) scale(1.08); }
  .tabbar a:active { transform: scale(.92); }
}

@media (prefers-color-scheme: dark) {
  .tabbar { background: rgba(20,20,22,.92); border-top-color: rgba(255,255,255,.08); }
}

/* ---------------- 动画（丝滑） ---------------- */
.page-in { animation: pageIn .42s cubic-bezier(.2,.8,.2,1) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 列表/卡片入场：逐项错落上浮 */
.stagger > * { animation: revealUp .5s cubic-bezier(.2,.8,.2,1) backwards; }
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: .045s; }
.stagger > *:nth-child(3) { animation-delay: .09s; }
.stagger > *:nth-child(4) { animation-delay: .135s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .225s; }
.stagger > *:nth-child(7) { animation-delay: .27s; }
.stagger > *:nth-child(8) { animation-delay: .315s; }
.stagger > *:nth-child(9) { animation-delay: .36s; }
.stagger > *:nth-child(10) { animation-delay: .405s; }
.stagger > *:nth-child(11) { animation-delay: .45s; }
.stagger > *:nth-child(12) { animation-delay: .495s; }
@keyframes revealUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 点赞 / 轻交互：弹性放大 */
.pop { animation: pop .34s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
