/* ============================================================
   Nebula 星云社区 v2.0 — 现代社区视觉体系
   设计语言：紫粉渐变 / 双列瀑布流 / 玻璃拟态 / 大圆角
   ============================================================ */
:root {
  --primary: #7c3aed;
  --primary-2: #a855f7;
  --primary-3: #c084fc;
  --accent: #ec4899;
  --hot: #ff4d6d;
  --gold: #f59e0b;
  --success: #10b981;
  --cyan: #06b6d4;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 48%, #ec4899 100%);
  --grad-warm: linear-gradient(135deg, #f59e0b, #f43f5e);
  --grad-cool: linear-gradient(135deg, #06b6d4, #3b82f6);
  --bg: #f5f6fb;
  --card: #ffffff;
  --card-2: #f8f8fd;
  --text: #1d1d2b;
  --text-2: #6b6b82;
  --text-3: #a0a0b5;
  --border: #eeeef5;
  --shadow: 0 4px 20px rgba(90, 60, 160, .07);
  --shadow-lg: 0 12px 36px rgba(90, 60, 160, .14);
  --r: 18px;
  --r-sm: 12px;
  --nav-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
[data-theme="dark"] {
  --bg: #0d0e14;
  --card: #181a23;
  --card-2: #222532;
  --text: #ececf5;
  --text-2: #a0a1b5;
  --text-3: #6f7186;
  --border: #272a38;
  --shadow: 0 4px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transition: background .25s, color .25s;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 顶部 Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.hero-header {
  position: sticky; top: 0; z-index: 100; color: #fff;
  background: var(--grad);
  padding: calc(10px + var(--safe-t)) 14px 0;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, .22);
}
.hero-header::before {
  content: ''; position: absolute; top: -60px; right: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}
.brand-row { display: flex; align-items: center; gap: 10px; position: relative; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.search-pill {
  flex: 1; min-width: 0; height: 34px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255,255,255,.22);
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  font-size: 12px; color: rgba(255,255,255,.92);
}
.hdr-icon { position: relative; font-size: 20px; width: 30px; text-align: center; flex-shrink: 0; }
.hdr-icon .badge {
  position: absolute; top: -3px; right: 0; min-width: 16px; height: 16px;
  background: var(--hot); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 1.5px solid #fff;
}
.top-tabs { display: flex; gap: 20px; margin-top: 10px; position: relative; overflow-x: auto; }
.top-tab {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,.68);
  padding: 8px 0 10px; white-space: nowrap; position: relative;
}
.top-tab.active { color: #fff; font-size: 15px; font-weight: 800; }
.top-tab.active::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px; background: #fff;
}
.plain-header {
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px 12px;
}
.plain-header .back { font-size: 26px; line-height: 1; width: 26px; }
.plain-header .title { flex: 1; font-size: 16px; font-weight: 800; text-align: center; }
.plain-header .right { min-width: 26px; text-align: right; font-size: 18px; }

/* ---------- 通用 ---------- */
.page { display: none; animation: pageIn .28s ease both; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border-radius: var(--r); margin: 12px; padding: 14px; box-shadow: var(--shadow); }
.section { padding: 16px 14px 8px; display: flex; align-items: center; justify-content: space-between; }
.section h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.section .more { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 3px; }
.emoji-img { background: linear-gradient(135deg, var(--primary-bg, #efe9ff), #fce7f3); }
.divider { height: 8px; background: transparent; }
.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty .ico { font-size: 54px; margin-bottom: 12px; opacity: .65; }
.empty p { font-size: 14px; }
.load-more { text-align: center; padding: 18px; color: var(--text-3); font-size: 12px; }

/* ---------- 轮播 ---------- */
.banner { margin: 12px; height: 148px; border-radius: var(--r); overflow: hidden; position: relative; box-shadow: var(--shadow-lg); background: #ddd6fe; }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .55s; }
.banner-slide.active { opacity: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30,10,60,.78), rgba(30,10,60,.18)); }
.banner-copy { position: absolute; z-index: 2; left: 18px; bottom: 26px; color: #fff; max-width: 78%; }
.banner-copy .tag { font-size: 10px; background: rgba(255,255,255,.24); border: 1px solid rgba(255,255,255,.35); padding: 2px 8px; border-radius: 999px; }
.banner-copy h3 { font-size: 19px; font-weight: 800; margin-top: 7px; line-height: 1.3; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.banner-dots { position: absolute; z-index: 3; bottom: 11px; left: 18px; display: flex; gap: 5px; }
.banner-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.55); transition: .3s; }
.banner-dots i.active { width: 16px; background: #fff; }

/* ---------- 快捷入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 14px 8px; background: var(--card); margin: 0 12px; border-radius: var(--r); box-shadow: var(--shadow); }
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.quick-emoji { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 21px; color: #fff; box-shadow: 0 5px 12px rgba(0,0,0,.10); }
.quick-tile span { font-size: 11px; color: var(--text-2); }

/* ---------- 话题横滑 ---------- */
.topic-strip { display: flex; gap: 9px; overflow-x: auto; padding: 2px 14px 4px; scrollbar-width: none; }
.topic-mini {
  flex-shrink: 0; width: 132px; border-radius: 14px; padding: 11px 12px; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.topic-mini::after { content: ''; position: absolute; right: -18px; top: -18px; width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.14); }
.topic-mini .rn { font-size: 10px; opacity: .8; font-weight: 700; }
.topic-mini .nm { font-size: 13px; font-weight: 800; margin: 3px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-mini .ht { font-size: 10px; opacity: .85; display: flex; align-items: center; gap: 3px; }

/* ---------- 公告 ---------- */
.notice {
  margin: 12px; background: linear-gradient(90deg, #fff7ed, #fef3c7); border-radius: var(--r-sm);
  padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #92400e;
}
[data-theme="dark"] .notice { background: #352a15; color: #fcd34d; }
.notice .lb { background: var(--gold); color: #fff; font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 6px; flex-shrink: 0; }
.notice .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

/* ---------- 双列瀑布流 ---------- */
.waterfall { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 12px 12px; align-items: start; }
.wf-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wf-card { background: var(--card); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); break-inside: avoid; animation: cardIn .35s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wf-cover { position: relative; width: 100%; background: linear-gradient(135deg, #ede9fe, #fce7f3); overflow: hidden; }
.wf-cover img { width: 100%; display: block; object-fit: cover; transition: transform .4s; }
.wf-card:active .wf-cover img { transform: scale(1.04); }
.wf-cover .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.16);
}
.wf-cover .play i {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--primary); padding-left: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.wf-cover .dur { position: absolute; right: 7px; bottom: 7px; background: rgba(0,0,0,.62); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 5px; }
.wf-cover .imgcount { position: absolute; right: 7px; top: 7px; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 5px; }
.wf-body { padding: 10px 11px 11px; }
.wf-title { font-size: 13.5px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wf-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.wf-topics span { font-size: 10px; color: var(--primary); background: #f3efff; border-radius: 5px; padding: 1px 6px; }
[data-theme="dark"] .wf-topics span { background: #2b2145; color: var(--primary-3); }
.wf-author { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.wf-author img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.wf-author .nm { flex: 1; min-width: 0; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-author .lk { font-size: 10.5px; color: var(--text-3); display: flex; align-items: center; gap: 2px; }
.wf-author .lk.on { color: var(--hot); }
.wf-poll { margin-top: 9px; }
.wf-poll .q { font-size: 11px; color: var(--text-2); margin-bottom: 5px; }
.wf-poll .bar { height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.wf-poll .bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }

/* ---------- 单列帖子行（热榜/详情推荐） ---------- */
.post-row { display: flex; gap: 11px; padding: 13px 14px; background: var(--card); border-bottom: 1px solid var(--border); }
.post-row .thumb { width: 84px; height: 66px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: linear-gradient(135deg,#ede9fe,#fce7f3); }
.post-row .body { flex: 1; min-width: 0; }
.post-row .t { font-size: 14px; font-weight: 700; line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row .m { font-size: 11px; color: var(--text-3); margin-top: 7px; display: flex; gap: 9px; }

/* ---------- 热榜 ---------- */
.rank-num { width: 22px; text-align: center; font-size: 15px; font-weight: 900; font-style: italic; flex-shrink: 0; color: var(--text-3); }
.rank-num.r1 { color: #ff4757; } .rank-num.r2 { color: #ff7f50; } .rank-num.r3 { color: #f7b731; }
.hot-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--border); }
.hot-item .ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--card-2); flex-shrink: 0; }
.hot-item .bd { flex: 1; min-width: 0; }
.hot-item .nm { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-item .ds { font-size: 11px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-item .heat { font-size: 11px; color: var(--hot); font-weight: 700; flex-shrink: 0; }
.hot-item .fire { font-size: 12px; }
.hot-card { margin: 12px; border-radius: var(--r); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.hot-card .hd { background: var(--grad-warm); color: #fff; padding: 14px 16px 12px; }
.hot-card .hd h3 { font-size: 17px; font-weight: 800; }
.hot-card .hd p { font-size: 11px; opacity: .9; margin-top: 2px; }

/* ---------- 话题广场 ---------- */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 12px 12px; }
.topic-tile { border-radius: 15px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); position: relative; }
.topic-tile .cv { height: 84px; background: linear-gradient(135deg, #7c3aed, #ec4899); position: relative; overflow: hidden; }
.topic-tile .cv img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.topic-tile .cv::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.28)); }
.topic-tile .ic { position: absolute; left: 11px; top: 10px; font-size: 24px; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.topic-tile .bd { padding: 10px 11px 12px; }
.topic-tile .nm { font-size: 13.5px; font-weight: 800; }
.topic-tile .ds { font-size: 10.5px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-tile .st { font-size: 10.5px; color: var(--primary); margin-top: 7px; font-weight: 600; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 2px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); font-size: 12px; white-space: nowrap; color: var(--text-2); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }

/* ---------- 圈子 / 应用 ---------- */
.circle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 12px; }
.circle-tile { border-radius: 15px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.circle-tile .cv { height: 88px; position: relative; background: linear-gradient(135deg,#7c3aed,#ec4899); }
.circle-tile .cv img { width: 100%; height: 100%; object-fit: cover; }
.circle-tile .cv::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,transparent,rgba(0,0,0,.4)); }
.circle-tile .nm { position: absolute; left: 11px; bottom: 8px; color: #fff; font-size: 13px; font-weight: 800; z-index: 2; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.circle-tile .bd { padding: 9px 11px 11px; }
.circle-tile .ds { font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circle-tile .st { font-size: 10px; color: var(--text-3); margin-top: 6px; }
.app-row { display: flex; gap: 12px; padding: 13px 14px; background: var(--card); border-bottom: 1px solid var(--border); align-items: center; }
.app-icon { width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.app-row .bd { flex: 1; min-width: 0; }
.app-row .nm { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.app-row .ds { font-size: 11px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row .st { font-size: 10px; color: var(--text-3); margin-top: 5px; display: flex; gap: 9px; }
.btn-sm { background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; padding: 7px 15px; border-radius: 999px; flex-shrink: 0; }
.btn-sm.ghost { background: var(--card-2); color: var(--text-2); }

/* ---------- 商城 ---------- */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 12px 12px; }
.product-tile { background: var(--card); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); }
.product-tile .cv { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 58px; background: linear-gradient(135deg, #ede9fe, #fce7f3); }
.product-tile .bd { padding: 10px; }
.product-tile .nm { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-tile .pr { color: var(--hot); font-size: 17px; font-weight: 900; margin-top: 5px; }
.product-tile .pr small { color: var(--text-3); font-size: 10px; text-decoration: line-through; font-weight: 400; margin-left: 4px; }
.product-tile .buy { width: 100%; margin-top: 8px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; padding: 7px; border-radius: 9px; }

/* ---------- 底部导航（玻璃拟态） ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 10px; position: relative; }
.nav-item .ico { font-size: 21px; line-height: 1.1; transition: transform .2s; }
.nav-item.active { color: var(--primary); font-weight: 700; }
.nav-item.active .ico { transform: translateY(-2px) scale(1.08); }
.nav-publish {
  width: 46px; height: 46px; margin-top: -18px; border-radius: 16px;
  background: var(--grad); color: #fff; font-size: 27px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(124,58,237,.42); border: 3px solid var(--card);
}
.nav-item.active .nav-publish { transform: none; }

/* ---------- 帖子详情 ---------- */
.detail-cover { width: 100%; aspect-ratio: 4/3; background: var(--card-2); position: relative; overflow: hidden; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .ctr { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.detail-body { background: var(--card); border-radius: 20px 20px 0 0; margin-top: -18px; position: relative; z-index: 2; padding: 18px 16px; }
.detail-title { font-size: 20px; font-weight: 900; line-height: 1.4; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0; }
.detail-tags span { font-size: 12px; color: var(--primary); background: #f3efff; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
[data-theme="dark"] .detail-tags span { background: #2b2145; color: var(--primary-3); }
.detail-author { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-author img { width: 40px; height: 40px; border-radius: 50%; }
.detail-author .bd { flex: 1; }
.detail-author .nm { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.detail-author .mt { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.detail-text { font-size: 14.5px; line-height: 1.95; white-space: pre-wrap; word-break: break-word; padding: 16px 0 4px; }
.detail-img { width: 100%; border-radius: 12px; margin-top: 12px; }
.poll-box { background: var(--card-2); border-radius: 14px; padding: 14px; margin-top: 14px; }
.poll-box .q { font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.poll-opt { margin-bottom: 10px; }
.poll-opt .row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.poll-opt .bar { height: 8px; background: var(--border); border-radius: 5px; overflow: hidden; }
.poll-opt .bar i { display: block; height: 100%; background: var(--grad); border-radius: 5px; transition: width .5s; }
.comment-item { display: flex; gap: 10px; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.comment-item img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.comment-item .bd { flex: 1; min-width: 0; }
.comment-item .nm { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.comment-item .tx { font-size: 14px; margin-top: 4px; line-height: 1.6; }
.comment-item .meta { font-size: 10.5px; color: var(--text-3); margin-top: 7px; display: flex; gap: 14px; }
.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 250;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 9px 12px calc(9px + var(--safe-b));
  display: flex; align-items: center; gap: 10px;
}
.action-bar .inp { flex: 1; background: var(--card-2); border-radius: 999px; padding: 9px 14px; font-size: 13px; color: var(--text-3); }
.action-bar .chat-inp { flex: 1; min-width: 0; background: var(--card-2); border-radius: 999px; padding: 9px 14px; font-size: 13px; }
.action-bar .act { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--text-2); min-width: 36px; }
.action-bar .act i { font-size: 20px; font-style: normal; line-height: 1.1; }
.action-bar .act.on { color: var(--hot); }
@keyframes heartPop { 0%{transform:scale(1)} 40%{transform:scale(1.45)} 100%{transform:scale(1)} }
.heart-pop { animation: heartPop .38s ease; }

/* ---------- 搜索 ---------- */
.search-head { display: flex; align-items: center; gap: 9px; padding: calc(11px + var(--safe-t)) 12px 11px; background: var(--card); position: sticky; top: 0; z-index: 100; }
.search-head .back { font-size: 24px; }
.search-head .box { flex: 1; display: flex; align-items: center; gap: 7px; background: var(--card-2); border-radius: 999px; padding: 9px 13px; }
.search-head input { flex: 1; min-width: 0; background: none; font-size: 14px; }
.search-head .go { color: var(--primary); font-size: 13px; font-weight: 700; }
.search-suggest { padding: 14px; }
.search-suggest h4 { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.kw-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.kw-cloud span { padding: 7px 13px; background: var(--card); border-radius: 999px; font-size: 12px; color: var(--text-2); box-shadow: var(--shadow); }
.kw-cloud span.hot { color: var(--hot); font-weight: 700; }
.result-tabs { display: flex; gap: 18px; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--border); }
.result-tabs span { font-size: 13px; color: var(--text-3); padding-bottom: 6px; }
.result-tabs span.active { color: var(--primary); font-weight: 800; border-bottom: 2px solid var(--primary); }

/* ---------- 排行榜 ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding: 22px 12px 16px; background: var(--grad); color: #fff; border-radius: 0 0 24px 24px; }
.podium .p { flex: 1; max-width: 110px; text-align: center; }
.podium .av { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 7px; border: 3px solid rgba(255,255,255,.7); object-fit: cover; }
.podium .p.first .av { width: 66px; height: 66px; border-color: #fde047; box-shadow: 0 0 18px rgba(253,224,71,.6); }
.podium .nm { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .sc { font-size: 10px; opacity: .85; }
.podium .medal { font-size: 22px; margin-bottom: 3px; }

/* ---------- 个人中心 ---------- */
.profile-hero { background: var(--grad); color: #fff; padding: calc(26px + var(--safe-t)) 18px 44px; position: relative; overflow: hidden; }
.profile-hero::before { content: ''; position: absolute; top: -70px; right: -50px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.09); }
.profile-hero::after { content: ''; position: absolute; bottom: -30px; left: -30px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.06); }
.profile-user { display: flex; align-items: center; gap: 13px; position: relative; z-index: 2; }
.profile-user img { width: 64px; height: 64px; border-radius: 20px; border: 3px solid rgba(255,255,255,.45); object-fit: cover; }
.profile-user .bd { flex: 1; min-width: 0; }
.profile-user .nm { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 7px; }
.profile-user .sg { font-size: 12px; opacity: .88; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vip-card { margin: -26px 12px 12px; position: relative; z-index: 3; background: linear-gradient(135deg, #2d1b4e, #4a2a6b); color: #fde68a; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; }
.vip-card .crown { font-size: 28px; }
.vip-card .bd { flex: 1; }
.vip-card .t { font-weight: 800; font-size: 14px; }
.vip-card .s { font-size: 10.5px; opacity: .8; margin-top: 2px; }
.vip-card .go { font-size: 11px; border: 1px solid rgba(253,230,138,.5); padding: 4px 10px; border-radius: 999px; }
.stat-bar { display: flex; background: var(--card); margin: 0 12px 12px; border-radius: var(--r); padding: 15px 0; box-shadow: var(--shadow); }
.stat-bar .s { flex: 1; text-align: center; }
.stat-bar .n { font-size: 18px; font-weight: 900; }
.stat-bar .l { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.badge-wall { display: flex; gap: 9px; padding: 0 14px 12px; overflow-x: auto; }
.badge-i { width: 54px; text-align: center; flex-shrink: 0; }
.badge-i .e { width: 44px; height: 44px; margin: 0 auto 4px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--card-2); }
.badge-i .l { font-size: 9.5px; color: var(--text-3); white-space: nowrap; }
.menu-list { background: var(--card); border-radius: var(--r); margin: 12px; overflow: hidden; box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.menu-item:last-child { border-bottom: none; }
.menu-item .ico { font-size: 19px; width: 24px; text-align: center; }
.menu-item .tx { flex: 1; font-size: 14px; }
.menu-item .ar { color: var(--text-3); }

/* ---------- 签到 / 任务 ---------- */
.signin-hero { margin: 12px; border-radius: var(--r); background: var(--grad-warm); color: #fff; padding: 22px; text-align: center; box-shadow: var(--shadow-lg); }
.signin-hero .num { font-size: 48px; font-weight: 900; line-height: 1; }
.signin-hero .lb { font-size: 12px; opacity: .9; margin-top: 4px; }
.signin-hero .btn { margin-top: 16px; background: #fff; color: #e11d48; font-weight: 800; padding: 11px 30px; border-radius: 999px; font-size: 14px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; padding: 14px; }
.calendar .d { aspect-ratio: 1; border-radius: 9px; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-3); }
.calendar .d.signed { background: var(--success); color: #fff; font-weight: 800; }
.calendar .d.today { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-weight: 800; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: none; }
.task-item .ico { font-size: 25px; }
.task-item .bd { flex: 1; min-width: 0; }
.task-item .nm { font-weight: 800; font-size: 13.5px; }
.task-item .rw { font-size: 10.5px; color: var(--gold); margin-top: 2px; }
.task-progress { height: 5px; background: var(--card-2); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.task-progress i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
.task-btn { background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 13px; border-radius: 999px; flex-shrink: 0; }
.task-btn.claimed { background: var(--card-2); color: var(--text-3); }

/* ---------- 消息 / AI ---------- */
.msg-item { display: flex; gap: 11px; padding: 13px 14px; background: var(--card); border-bottom: 1px solid var(--border); }
.msg-item .ic { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.msg-item .bd { flex: 1; min-width: 0; }
.msg-item .t { font-size: 13.5px; font-weight: 800; }
.msg-item .c { font-size: 12px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .tm { font-size: 10.5px; color: var(--text-3); margin-top: 5px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); align-self: center; }
.chat-messages { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 9px; max-width: 86%; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .av { width: 32px; height: 32px; border-radius: 11px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.chat-msg .bub { background: var(--card); padding: 11px 14px; border-radius: 4px 14px 14px 14px; font-size: 13.5px; line-height: 1.7; box-shadow: var(--shadow); }
.chat-msg.user .bub { background: var(--grad); color: #fff; border-radius: 14px 4px 14px 14px; }

/* ---------- 表单 / 发布抽屉 ---------- */
.form-group { margin-bottom: 15px; }
.form-label { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; display: block; color: var(--text-2); }
.form-input, .form-textarea { width: 100%; background: var(--card-2); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; transition: border-color .2s; }
.form-input:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.btn-primary { background: var(--grad); color: #fff; padding: 13px; border-radius: 999px; font-size: 15px; font-weight: 800; width: 100%; box-shadow: 0 8px 20px rgba(124,58,237,.25); }
.btn-ghost { background: var(--card-2); color: var(--text); padding: 11px; border-radius: 999px; width: 100%; font-weight: 700; }
.sheet-mask { position: fixed; inset: 0; background: rgba(15,10,30,.5); z-index: 500; animation: fadeIn .2s; }
.sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 501; background: var(--card); border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto; padding: 8px 16px calc(24px + var(--safe-b)); animation: sheetUp .3s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 14px; }
.sheet-head { display: flex; align-items: center; margin-bottom: 16px; }
.sheet-head .t { flex: 1; text-align: center; font-weight: 800; font-size: 16px; }
.sheet-head .x { font-size: 22px; color: var(--text-3); }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.type-tile { background: var(--card-2); border-radius: 13px; padding: 12px 4px; text-align: center; font-size: 12px; }
.type-tile .e { font-size: 23px; display: block; margin-bottom: 4px; }
.type-tile.active { background: var(--grad); color: #fff; font-weight: 800; }

/* ---------- 登录 ---------- */
.auth-page { min-height: 100vh; background: var(--grad); color: #fff; padding: calc(60px + var(--safe-t)) 24px 30px; }
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-brand .lg { font-size: 56px; }
.auth-brand .nm { font-size: 27px; font-weight: 900; margin-top: 8px; }
.auth-brand .sl { opacity: .85; font-size: 13px; margin-top: 5px; }
.auth-box { background: var(--card); color: var(--text); border-radius: 22px; padding: 24px; }
.auth-tabs { display: flex; gap: 22px; margin-bottom: 22px; }
.auth-tabs span { font-size: 16px; color: var(--text-3); padding-bottom: 8px; border-bottom: 2px solid transparent; }
.auth-tabs span.active { color: var(--primary); border-color: var(--primary); font-weight: 800; }

/* ---------- 骨架屏 ---------- */
.sk-wrap { padding: 4px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sk-card { background: var(--card); border-radius: 15px; overflow: hidden; }
.sk-img, .sk-line { background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sk-img { height: 170px; }
.sk-line { height: 11px; border-radius: 5px; margin: 11px; }
.sk-line.short { width: 60%; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- 图片预览 ---------- */
.img-viewer { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s; }
.img-viewer img { max-width: 100%; max-height: 86vh; object-fit: contain; }
.img-viewer .close { position: absolute; top: calc(18px + var(--safe-t)); right: 18px; color: #fff; font-size: 28px; }
.img-viewer .counter { position: absolute; bottom: 30px; color: rgba(255,255,255,.8); font-size: 13px; }

/* ---------- 桌面模拟手机 ---------- */
@media (min-width: 768px) {
  body { max-width: 460px; margin: 0 auto; min-height: 100vh; box-shadow: 0 0 60px rgba(0,0,0,.13); }
  .bottom-nav, .action-bar, .sheet, .img-viewer { max-width: 460px; left: 50%; transform: translateX(-50%); }
  .sheet { animation: none; }
}

/* ---------- 抽奖活动（转盘 / 九宫格 / 盲盒） ---------- */
.lottery-hero { background: var(--grad-warm); color: #fff; padding: calc(28px + var(--safe-t)) 18px 46px; text-align: center; position: relative; overflow: hidden; }
.lottery-hero::before { content: ''; position: absolute; top: -80px; left: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.11); }
.lottery-hero::after { content: ''; position: absolute; bottom: -60px; right: -30px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.lottery-hero h2 { font-size: 24px; font-weight: 900; position: relative; }
.lottery-hero p { font-size: 12px; opacity: .9; margin-top: 5px; position: relative; }
.lottery-points { margin: -26px 12px 12px; position: relative; z-index: 2; background: var(--card); border-radius: 15px; padding: 13px 16px; display: flex; align-items: center; box-shadow: var(--shadow-lg); }
.lottery-points .ico { font-size: 24px; }
.lottery-points .bd { flex: 1; margin-left: 10px; }
.lottery-points .bd b { font-size: 16px; }
.lottery-points .bd span { font-size: 11px; color: var(--text-3); }
.lottery-tabs { display: flex; gap: 8px; padding: 4px 12px 12px; }
.lottery-tabs .chip { flex: 1; text-align: center; }
.wheel-wrap { position: relative; width: 288px; height: 288px; margin: 14px auto 8px; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 28px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.3)); }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 10px 30px rgba(180,60,120,.28); position: relative; transition: transform 3.8s cubic-bezier(.12,.78,.2,1); }
.wheel-item { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.wheel-item .inner { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; text-align: center; transform: translate(-50%,-50%); }
.wheel-item .e { font-size: 21px; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.wheel-item .t { font-size: 9.5px; color: #fff; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.35); line-height: 1.2; }
.wheel-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; z-index: 4; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: var(--hot); box-shadow: 0 4px 14px rgba(0,0,0,.2); cursor: pointer; }
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 6px 12px 12px; }
.grid9 .cell { aspect-ratio: 1; border-radius: 13px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; border: 2px solid transparent; }
.grid9 .cell .e { font-size: 24px; }
.grid9 .cell.on { border-color: var(--hot); background: #fff1f2; transform: scale(1.03); }
.grid9 .cell.draw { background: var(--grad); color: #fff; cursor: pointer; }
.grid9 .cell.draw .e { font-size: 26px; }
.boxes { display: flex; justify-content: center; gap: 18px; padding: 30px 12px 18px; }
.boxes .box { width: 86px; height: 96px; border-radius: 16px; background: linear-gradient(135deg,#fbbf24,#f59e0b); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 40px; box-shadow: 0 8px 20px rgba(245,158,11,.32); cursor: pointer; transition: transform .25s; }
.boxes .box:nth-child(2) { background: linear-gradient(135deg,#a78bfa,#7c3aed); box-shadow: 0 8px 20px rgba(124,58,237,.32); }
.boxes .box:nth-child(3) { background: linear-gradient(135deg,#f472b6,#ec4899); box-shadow: 0 8px 20px rgba(236,72,153,.32); }
.boxes .box:active { transform: scale(.94); }
.boxes .box.open { animation: boxShake .6s ease; }
@keyframes boxShake { 0%,100%{transform:rotate(0)} 20%{transform:rotate(-8deg)} 40%{transform:rotate(8deg)} 60%{transform:rotate(-5deg)} 80%{transform:rotate(5deg)} }
.lottery-hint { text-align: center; font-size: 11.5px; color: var(--text-3); padding: 4px 14px 14px; }
.record-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--card); border-bottom: 1px solid var(--border); }
.record-row .e { font-size: 22px; }
.record-row .bd { flex: 1; }
.record-row .bd .n { font-size: 13px; font-weight: 700; }
.record-row .bd .t { font-size: 10.5px; color: var(--text-3); }
.record-row .cost { font-size: 11px; color: var(--hot); }
.prize-modal { position: fixed; inset: 0; z-index: 600; background: rgba(20,10,35,.65); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s; }
.prize-dialog { background: var(--card); border-radius: 22px; padding: 30px 24px; width: 82%; max-width: 320px; text-align: center; animation: prizePop .4s cubic-bezier(.2,1.3,.4,1); }
@keyframes prizePop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.prize-dialog .big { font-size: 64px; line-height: 1; }
.prize-dialog h3 { font-size: 20px; font-weight: 900; margin: 14px 0 6px; }
.prize-dialog p { font-size: 13px; color: var(--text-2); }
