/* ===== 历史社区圈子 · 网页版 响应式样式（移动优先） ===== */
:root {
  --c-bg: #f5f2ea;          /* 宣纸底色 */
  --c-surface: #ffffff;
  --c-surface-2: #f0ece1;
  --c-ink: #2b2620;         /* 墨色正文 */
  --c-ink-1: #2b2620;       /* 兼容旧引用（原 --c-ink-1 未定义，导致 .gated h2 等颜色回退异常） */
  --c-ink-2: #6b6258;       /* 次级文字 */
  --c-line: #e6e0d4;
  --c-paper-2: #f0ece1;     /* 兼容旧引用（pin-method-tab 等曾误用未定义变量，回退为次级表面） */
  --c-topbar-bg: rgba(255,255,255,.92);   /* 顶部栏毛玻璃底色（深色模式覆盖） */
  --c-bottomnav-bg: rgba(255,255,255,.96);/* 底部 Tab 毛玻璃底色（深色模式覆盖） */
  --c-switch-off: #c9c2b5;  /* 开关关闭态底色（深色模式覆盖） */
  --c-primary: #a8322d;     /* 印章红 */
  --c-primary-2: #b8403a;   /* 主色亮调（按钮渐变 / 按压） */
  --c-primary-weak: #f3e2dd;
  --c-gold: #c8a96a;        /* 描金（装饰 / 描边用） */
  --c-gold-deep: #9a7b34;   /* 描金（文字用，对比度达标） */
  --c-blue: #2f6fb0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px rgba(60,40,20,.10);
  --shadow-sm: 0 2px 8px rgba(60,40,20,.08);
  --shadow-hover: 0 10px 30px rgba(60,40,20,.14);
  --topbar-h: 52px;
  --bottomnav-h: 56px;
  --maxw: 720px;
  /* 字体：正文无衬线，标题衬线（文史墨韵） */
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  /* 动效 */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--c-ink-2); }
.center { text-align: center; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-topbar-bg);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--c-line);
}
.topbar-inner {
  height: var(--topbar-h); max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
}
.brand {
  font-weight: 800; font-size: 20px; letter-spacing: 2px;
  color: var(--c-primary);
}
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  border: none; background: transparent; font-size: 20px;
  width: 38px; height: 38px; border-radius: 50%; line-height: 1;
}
.icon-btn:active { background: var(--c-surface-2); }
.searchbar { padding: 8px 14px 12px; border-top: 1px solid var(--c-line); }
.searchbar form { display: flex; gap: 8px; }
.searchbar input {
  flex: 1; border: 1px solid var(--c-line); border-radius: 999px;
  padding: 9px 14px; font-size: 14px; background: var(--c-surface); outline: none;
}
.searchbar input:focus { border-color: var(--c-primary); }

/* ===== 主内容 ===== */
.app-content {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 12px calc(var(--bottomnav-h) + 24px);
  min-height: calc(100vh - var(--topbar-h));
}

/* ===== 底部 Tab ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--bottomnav-h);
  background: var(--c-bottomnav-bg);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--c-line);
  display: flex; align-items: stretch; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--c-ink-2);
}
.nav-item .nav-ico { font-size: 20px; line-height: 1; }

/* 一键返回首页（悬浮按钮） */
.fab-home {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(120, 30, 20, .28);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.fab-home:active { transform: scale(.94); box-shadow: 0 3px 10px rgba(120, 30, 20, .3); }
.fab-home.hidden { display: none; }

/* 一键返回顶部（悬浮按钮，叠在返回首页之上） */
.fab-top {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottomnav-h) + 16px + 56px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-primary);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.fab-top:active { transform: scale(.94); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.fab-top.hidden { display: none; }

/* 全局悬浮发帖入口（印章红，叠在返回顶部之上，引导随时发帖分享） */
.fab-post {
  position: fixed; right: 16px;
  bottom: calc(var(--bottomnav-h) + 16px + 112px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--c-primary); color: #fff; font-size: 24px; line-height: 1;
  box-shadow: 0 8px 22px rgba(120, 30, 20, .30);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.fab-post:active { transform: scale(.94); box-shadow: 0 4px 12px rgba(120, 30, 20, .34); }
.fab-post.hidden { display: none; }
[data-theme="dark"] .fab-post { box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }

/* 首页发帖引导卡 —— 与普通卡片/周赛条明显区分：红底金边 + 白色大徽章 + 脉冲光环 */
.home-post-cta {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(100deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
  color: #fff;
  border: 1.5px solid rgba(216, 184, 118, .85);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(120, 30, 20, .22); cursor: pointer; overflow: visible;
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.home-post-cta:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(120, 30, 20, .34); border-color: rgba(216, 184, 118, 1); }
.home-post-cta:active { transform: translateY(-1px) scale(.995); }
.home-post-cta__ico {
  position: relative; width: 54px; height: 54px; border-radius: 16px; flex: none;
  background: #fff; color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; font-size: 27px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22); transform: translateY(-3px);
}
.home-post-cta__ico::after {
  content: ""; position: absolute; inset: -7px; border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, .75); animation: ctaPulse 1.9s ease-out infinite;
}
@keyframes ctaPulse {
  0%   { transform: scale(.9);  opacity: .85; }
  70%  { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}
.home-post-cta__txt { flex: 1; min-width: 0; }
.home-post-cta__txt b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.3; }
.home-post-cta__txt span { font-size: 12px; opacity: .92; }
.home-post-cta__btn {
  flex: none; background: #fff; color: var(--c-primary);
  border-radius: 999px; padding: 10px 15px; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  display: inline-flex; align-items: center; gap: 4px;
}
.home-post-cta__btn::after { content: "\2192"; font-weight: 800; font-size: 16px; }
[data-theme="dark"] .home-post-cta { background: linear-gradient(100deg, #8a2e28, #b8403a); border-color: rgba(216, 184, 118, .55); }
@media (prefers-reduced-motion: reduce) {
  .home-post-cta__ico::after { animation: none; display: none; }
}
.nav-item.active { color: var(--c-primary); font-weight: 700; }
.nav-publish .nav-ico {
  background: var(--c-primary); color: #fff; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ===== 通用组件 ===== */
.btn-primary {
  background: var(--c-primary); color: #fff; border: none; border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 600;
}
.btn-primary:active { opacity: .9; }
.btn-ghost {
  background: var(--c-surface-2); color: var(--c-ink); border: 1px solid var(--c-line);
  border-radius: 999px; padding: 8px 16px; font-size: 14px;
}
.btn-block { width: 100%; }
.card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; margin-bottom: 12px;
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--c-surface-2); color: var(--c-ink-2);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; border: none;
}
.chip.active { background: var(--c-primary); color: #fff; }
.tag {
  display: inline-block; background: var(--c-primary-weak); color: var(--c-primary);
  border-radius: 6px; padding: 1px 8px; font-size: 12px; margin-right: 6px;
}
.skeleton {
  background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%);
  background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 8px;
}
@keyframes sk { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* ===== 帖子卡片 ===== */
.post {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px; margin-bottom: 12px;
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--c-surface-2); flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; }
.post-author { font-weight: 600; font-size: 14px; }
.post-meta { font-size: 12px; color: var(--c-ink-2); }
.post-title { font-size: 16px; font-weight: 700; margin: 4px 0 6px; line-height: 1.4; }
.post-content { font-size: 14px; color: var(--c-ink); white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.post-tag { display: inline-block; background: var(--c-primary-weak); color: var(--c-primary); border-radius: 999px; padding: 2px 10px; font-size: 12px; text-decoration: none; transition: transform var(--dur-fast, 120ms) var(--ease-standard); }
.post-tag:active { transform: scale(.96); }
.post-imgs { position: relative; display: grid; gap: 6px; margin-top: 8px; }
.post-imgs.g1 { grid-template-columns: 1fr; }
.post-imgs.g2 { grid-template-columns: 1fr 1fr; }
.post-imgs.g3 { grid-template-columns: repeat(3,1fr); }
.post-imgs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; background: var(--c-surface-2); }
/* 列表页瀑布流：仅显示 1 张图，超量时在第 1 张叠 +N 角标 */
.img-more {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  min-width: 22px; padding: 2px 7px; box-sizing: border-box;
  font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center;
  color: #fff; background: rgba(0,0,0,.55); border-radius: 12px;
  backdrop-filter: blur(2px); pointer-events: none;
}
.post-foot { display: flex; gap: 16px; margin-top: 10px; color: var(--c-ink-2); font-size: 13px; }
.post-foot .act { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--c-ink-2); font-size: 13px; padding: 4px; }
.post-foot .act.liked { color: var(--c-primary); }
.post-foot .act.collected { color: var(--c-gold); }
.post-circle { color: var(--c-blue); font-size: 12px; }

/* ===== 帖子列表瀑布流（首页 #feed / 圈子详情 #circlePosts / 我的帖子·收藏 .post-waterfall） ===== */
/* 注意：#profileContent 不再参与多列布局，否则「设置/足迹」等非帖子内容会被劈裂遮挡。
   仅当内容为帖子时，用 .post-waterfall 包裹以启用两列瀑布流。 */
#feed, #circlePosts, .post-waterfall { column-count: 2; column-gap: 12px; }
#feed .post, #circlePosts .post, .post-waterfall .post {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 12px; width: 100%;
}
/* 瀑布流窄卡片内图片改为单列满宽，避免多图被压得太小 */
#feed .post-imgs, #circlePosts .post-imgs, .post-waterfall .post-imgs { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  #feed, #circlePosts, .post-waterfall { column-count: 3; }
}
/* 加载更多按钮：与瀑布流底部保持间距（多列容器尾部 margin 会被吸收） */
#feedMore, .load-more { margin-top: 16px; }

/* ===== 圈子 ===== */
.circle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.circle-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.circle-card h3 { margin: 0 0 4px; font-size: 15px; }
.circle-card .desc { font-size: 12px; color: var(--c-ink-2); height: 32px; overflow: hidden; }
.circle-card .stat { font-size: 12px; color: var(--c-ink-2); margin-top: 6px; }
.circle-card .cc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.circle-card .cc-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--c-surface-2); }
.circle-card .cc-meta { min-width: 0; flex: 1; }
.circle-card .cc-meta h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.cc-official { font-size: 10px; font-weight: 600; color: #fff; background: var(--c-primary); border-radius: 4px; padding: 0 4px; line-height: 16px; }
.circle-card .desc { margin-top: 0; }
.circle-card .cc-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.circle-card .cc-foot .btn-sm { min-width: 84px; }
.circle-card .cc-foot button { cursor: pointer; }
.circle-banner { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); background: var(--c-surface-2); margin-bottom: 12px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--c-surface-2); border-radius: 999px; }
.seg::-webkit-scrollbar { display: none; }
.seg .chip { background: transparent; color: var(--c-ink-2); }
.seg .chip.active { background: var(--c-surface); color: var(--c-primary); box-shadow: var(--shadow-sm); font-weight: 700; }

/* ===== 帖子详情 ===== */
.detail-title { font-size: 20px; font-weight: 800; margin: 6px 0 10px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.detail-tag { display: inline-block; background: var(--c-primary-weak); color: var(--c-primary); border-radius: 999px; padding: 3px 12px; font-size: 13px; text-decoration: none; transition: transform var(--dur-fast, 120ms) var(--ease-standard); }
.detail-tag:active { transform: scale(.96); }
.detail-body { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
/* 帖子详情返回栏（吸顶，位于顶部栏下方） */
.detail-topbar {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 10px;
  margin: -12px -12px 12px; padding: 11px 12px;
  background: var(--c-topbar-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 2px 10px rgba(60,40,20,.06);
}
.back-btn {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--c-ink);
  cursor: pointer; line-height: 1;
  transition: background .15s var(--ease-standard), transform .12s var(--ease-standard);
}
.back-btn:active { background: var(--c-line); transform: scale(.97); }
.detail-crumb {
  flex: 1; min-width: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--c-ink); letter-spacing: .5px;
}
.dt-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.comments { margin-top: 14px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.comment .c-body { flex: 1; }
.comment .c-name { font-weight: 600; font-size: 13px; }
.comment .c-text { font-size: 14px; }
.comment .c-time { font-size: 11px; color: var(--c-ink-2); }

/* ===== 发帖 ===== */
.publish-form { padding: 16px; }
.pf-head { margin-bottom: 14px; }
.pf-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--c-ink); margin: 0 0 4px; }
.pf-sub { font-size: 12px; color: var(--c-ink-2); margin: 0; }
.pf-label { font-size: 13px; color: var(--c-ink-2); display: block; margin-bottom: 6px; }
.pub-select { width: 100%; margin: 0 0 14px; -webkit-appearance: none; appearance: none; text-align: center; cursor: pointer; }
.pub-select:focus { border-color: var(--c-primary); outline: none; }
.pf-input { margin-bottom: 10px; }
.publish-form textarea, .publish-form input {
  width: 100%; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; background: var(--c-surface);
}
.publish-form textarea { min-height: 120px; resize: vertical; }
.publish-form input:focus, .publish-form textarea:focus { border-color: var(--c-primary); }
.img-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--c-surface-2); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .del { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; line-height: 1; }
.img-add { width: 84px; height: 84px; border: 1px dashed var(--c-line); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--c-ink-2); font-size: 26px; background: var(--c-surface); }

/* ===== 个人主页 ===== */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.profile-head .name { font-size: 18px; font-weight: 700; }
.profile-head .bio { font-size: 13px; color: var(--c-ink-2); }
.profile-stats { display: flex; gap: 18px; margin: 8px 0 14px; }
.profile-stats div { text-align: center; }
.profile-stats b { font-size: 17px; display: block; }
.profile-stats span { font-size: 12px; color: var(--c-ink-2); }
.tabs { display: flex; border-bottom: 1px solid var(--c-line); margin-bottom: 12px; }
.tabs .tab { padding: 8px 14px; font-size: 14px; color: var(--c-ink-2); border: none; background: none; position: relative; }
.tabs .tab.active { color: var(--c-primary); font-weight: 700; }
.tabs .tab.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--c-primary); }

/* ===== 登录遮罩 ===== */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,16,12,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay .panel {
  width: 360px; max-width: 92vw; background: var(--c-surface);
  border-radius: 18px; box-shadow: var(--shadow); padding: 24px 22px; text-align: center;
}
.overlay h2 { margin: 0 0 4px; font-size: 19px; }
.overlay .close-x {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border: none; background: transparent; color: var(--c-ink-2); font-size: 24px; line-height: 1;
  cursor: pointer; border-radius: 50%; transition: background .15s, color .15s;
}
.overlay .close-x:hover { background: var(--c-line); color: var(--c-ink-1); }
.overlay .panel { position: relative; }
.overlay .sub { color: var(--c-ink-2); font-size: 13px; margin-bottom: 16px; }
.qr-box {
  width: 220px; height: 220px; margin: 0 auto 12px; border: 1px solid var(--c-line);
  border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #faf9f6;
}
.qr-box img { width: 200px; height: 200px; }
.qr-box.expired { color: var(--c-primary); font-size: 14px; }
.login-hint { font-size: 13px; color: var(--c-ink-2); min-height: 20px; margin-bottom: 12px; }
.login-hint.ok { color: #1a7f37; }
.login-hint.err { color: var(--c-primary); }
.success-user { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 10px 0; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(20,16,12,.88); color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; z-index: 200; max-width: 80vw; text-align: center;
}
.toast.err { background: rgba(168,50,45,.95); }

.empty { text-align: center; color: var(--c-ink-2); padding: 48px 16px; font-size: 14px; opacity: .9; }

/* 富空状态：图标 + 标题 + 描述 + 行动按钮（由 util.emptyState 生成） */
.empty-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 44px 20px; text-align: center;
}
.empty-box .eb-ico {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
}
.empty-box .eb-title { font-size: 15px; font-weight: 700; color: var(--c-ink); font-family: var(--font-display); }
.empty-box .eb-desc { margin: 0; font-size: 13px; color: var(--c-ink-2); line-height: 1.6; }
.empty-box .eb-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.empty-box .eb-actions .btn-primary,
.empty-box .eb-actions .btn-ghost { padding: 8px 18px; border-radius: 999px; font-size: 13px; }
[data-theme="dark"] .empty-box .eb-ico { box-shadow: var(--shadow); }

/* ===== 内容页（关于我们 / 隐私政策 / 用户协议 / 联系我们） ===== */
.legal-page { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--bottomnav-h) + 24px); }
.legal-head { text-align: center; margin-bottom: 18px; }
.legal-back { display: inline-block; font-size: 13px; color: var(--c-primary); margin-bottom: 10px; text-decoration: none; }
.legal-back:hover { text-decoration: underline; }
.legal-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--c-ink); margin: 4px 0 6px; }
.legal-sub { margin: 0; color: var(--c-ink-2); font-size: 14px; }
.legal-updated { margin: 6px 0 0; color: var(--c-ink-3); font-size: 12px; }
.legal-doc {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: 24px 22px; box-shadow: var(--shadow-sm); line-height: 1.85; color: var(--c-ink); font-size: 15px;
}
.legal-doc h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--c-ink); margin: 22px 0 10px; padding-left: 11px; border-left: 4px solid var(--c-primary); }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3 { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--c-ink); margin: 16px 0 8px; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul { margin: 0 0 12px; padding-left: 22px; }
.legal-doc li { margin: 6px 0; }
.legal-doc strong { color: var(--c-ink); font-weight: 700; }
.legal-doc a { color: var(--c-primary); }
.contact-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.contact-card { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--radius-md); padding: 14px 16px; }
.contact-card .cc-ico { font-size: 22px; line-height: 1; }
.contact-card .cc-body { display: flex; flex-direction: column; }
.contact-card .cc-label { font-size: 12px; color: var(--c-ink-2); }
.contact-card .cc-value { font-size: 15px; font-weight: 700; color: var(--c-ink); word-break: break-all; }
[data-theme="dark"] .legal-doc { box-shadow: var(--shadow); }
[data-theme="dark"] .contact-card { background: var(--c-surface-2); }

/* 卡片内分区标题（衬线，统一各子页面区块标题视觉） */
.card-h {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--c-ink); margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}

/* 未登录引导卡（发帖/我的/我的圈子） */
.gated { text-align: center; padding: 32px 20px; }
.gated .gated-icon { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.gated h2 { margin: 6px 0; font-size: 18px; color: var(--c-ink-1); }
.gated .muted { margin: 0 0 18px; }
.gated .btn-block { max-width: 220px; margin: 0 auto; }

/* ===== 桌面端（≥768）增强 ===== */
@media (min-width: 768px) {
  .post-imgs.g1 { max-width: 420px; }
  .post-imgs.g2, .post-imgs.g3 { max-width: 520px; }
  .app-content { padding-top: 18px; }
}
/* 宽屏：桌面端页面整体加宽，双栏首页才有足够空间 */
@media (min-width: 1024px) {
  :root { --maxw: 1080px; }
}
@media (min-width: 1440px) {
  :root { --maxw: 1200px; }
}

/* ===== 首页周赛 banner（墨底描金，与红底发帖卡区分） ===== */
.weekly-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(120deg, #2a1b15, #4a2c20);
  color: #f3e4c4; border: 1px solid rgba(216, 184, 118, .35); border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.weekly-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.weekly-banner .wb-title { font-size: 16px; font-weight: 800; color: #f6e8c8; }
.weekly-banner .wb-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.weekly-banner .wb-go { font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--c-gold, #d8b876); }

/* ===== 首页答题中心 banner（品牌绿，与周赛墨金区分） ===== */
.answer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(120deg, #06ad56, #07c160);
  color: #eafff3; border: 1px solid rgba(7, 193, 96, .4); border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.answer-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.answer-banner .wb-title { font-size: 16px; font-weight: 800; color: #fff; }
.answer-banner .wb-sub { font-size: 12px; opacity: .92; margin-top: 2px; }
.answer-banner .wb-go { font-size: 14px; font-weight: 700; white-space: nowrap; color: #eafff3; }

/* ===== 周赛主页 ===== */
.weekly-hero { position: relative; overflow: hidden; }
.weekly-hero.s-live { background: linear-gradient(135deg, #fff, #fdeceb); border-color: #f0c9c4; }
.weekly-hero.s-warm { background: linear-gradient(135deg, #fff, #fff3e0); }
.weekly-hero.s-end  { background: linear-gradient(135deg, #fff, #eef3f0); }
.weekly-hero.s-cancel { background: linear-gradient(135deg, #fff, #f0f0f0); }
.weekly-hero.s-wait { background: linear-gradient(135deg, #fff, #eef1f6); }
.weekly-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.weekly-period { font-size: 14px; color: var(--c-ink-2); font-weight: 600; }
.weekly-state { margin-top: 6px; }
.weekly-entry {
  text-align: center; font-weight: 800; color: var(--c-primary);
  font-size: 18px; line-height: 1; white-space: nowrap;
}
.weekly-entry span { display: block; font-size: 11px; font-weight: 600; color: var(--c-ink-2); margin-top: 2px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge.s-live { background: var(--c-primary); color: #fff; }
.badge.s-warm { background: #f0a93a; color: #fff; }
.badge.s-end  { background: var(--c-surface-2); color: var(--c-ink-2); }
.badge.s-cancel { background: #d9d9d9; color: #555; }
.badge.s-wait { background: #dbe4f2; color: #2f6fb0; }
.weekly-count { text-align: center; margin: 14px 0 12px; }
.wc-label { font-size: 12px; color: var(--c-ink-2); }
.wc-time {
  font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.weekly-primary .btn-block { margin-top: 4px; }
.weekly-note { font-size: 12px; color: var(--c-ink-2); margin: 8px 2px 0; line-height: 1.5; }

/* 我的机会 */
.sec-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.chance-row { display: flex; align-items: center; gap: 12px; }
.chance-num { font-size: 22px; font-weight: 800; color: var(--c-primary); white-space: nowrap; }
.chance-num span { font-size: 13px; color: var(--c-ink-2); font-weight: 600; }
.chance-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.chance-bar span { display: block; height: 100%; background: var(--c-primary); border-radius: 999px; transition: width .3s; }

/* 奖品 */
.prize-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prize-item { text-align: center; }
.prize-img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px;
  background: var(--c-surface-2); margin-bottom: 6px;
}
.prize-img.prize-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--c-primary);
  background: var(--c-primary-weak);
}
.prize-rank { font-size: 12px; color: var(--c-primary); font-weight: 700; }
.prize-name { font-size: 13px; font-weight: 600; margin-top: 2px; min-height: 18px; }
.prize-pts { font-size: 11px; color: var(--c-ink-2); margin-top: 2px; }

/* 榜单行 */
.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--c-line);
}
.rank-row:first-child { border-top: none; }
.rank-row .avatar { width: 36px; height: 36px; }
.rank-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-size: 12px; color: var(--c-ink-2); white-space: nowrap; }
.rank-reward { font-size: 11px; color: var(--c-gold); font-weight: 700; }
.rank-no {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: var(--c-surface-2); color: var(--c-ink-2);
}
.rank-no.rank-1 { background: #f3c969; color: #6a4a00; }
.rank-no.rank-2 { background: #d7d7d7; color: #444; }
.rank-no.rank-3 { background: #e6b27a; color: #5a3200; }
.rank-row.me { background: var(--c-primary-weak); border-radius: 10px; padding: 10px 8px; margin: 0 -8px; }
.weekly-myrank .rank-line { font-size: 15px; }
.weekly-myrank .rank-line b { color: var(--c-primary); font-size: 18px; }

/* ===== 答题面板 ===== */
.weekly-panel { width: 420px; max-width: 94vw; text-align: left; }
.wp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wp-chance { font-size: 12px; color: var(--c-ink-2); }
.wp-timer { font-size: 18px; font-weight: 800; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.wp-q { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.wp-opts { display: flex; flex-direction: column; gap: 10px; }
.wp-opt {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--c-surface); border: 1.5px solid var(--c-line); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; color: var(--c-ink); transition: border-color .15s, background .15s;
}
.wp-opt:active { background: var(--c-surface-2); }
.wp-opt.selected { border-color: var(--c-primary); background: var(--c-primary-weak); }
.wp-opt.locked { pointer-events: none; opacity: .85; }
.wp-opt.correct { border-color: #2e9e5b; background: #e6f6ec; }
.wp-opt.wrong { border-color: var(--c-primary); background: #fbe7e4; }
.wp-opt-idx {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  background: var(--c-surface-2); color: var(--c-ink-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.wp-opt.selected .wp-opt-idx, .wp-opt.correct .wp-opt-idx { background: var(--c-primary); color: #fff; }
.wp-opt.wrong .wp-opt-idx { background: var(--c-primary); color: #fff; }
.wp-result { margin-top: 12px; }
.wp-res { font-size: 15px; font-weight: 800; }
.wp-res.ok { color: #2e9e5b; }
.wp-res.bad { color: var(--c-primary); }
.wp-exp { font-size: 13px; color: var(--c-ink-2); margin-top: 6px; line-height: 1.6; }
.weekly-panel .btn-block { margin-top: 14px; }

/* ===== 报名引导弹窗 ===== */
.weekly-guide { width: 380px; max-width: 92vw; text-align: left; }
.weekly-guide h2 { margin: 0 0 14px; font-size: 18px; text-align: center; }
.weekly-guide-qr {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--c-surface); border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.weekly-guide-qr img {
  width: 180px; height: 180px; border-radius: 10px; object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.weekly-guide-qr span { font-size: 12px; color: var(--c-ink-2); }
.weekly-guide-body { font-size: 14px; line-height: 1.75; color: var(--c-ink-2); }
.weekly-guide-body p { margin: 0 0 8px; color: var(--c-ink); }
.weekly-guide-body ul { margin: 0; padding-left: 18px; }
.weekly-guide-body li { margin-bottom: 4px; }
.weekly-guide .btn-block { margin-top: 16px; }

/* ===== 首页快捷入口（5 列宫格 + 图标圆形底） ===== */
.entry-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px 10px; }
.entry-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 8px 2px; border-radius: 14px; position: relative; cursor: pointer;
  background: var(--c-surface-2);
  transition: transform var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard);
}
.entry-item:active { transform: scale(.95); background: var(--c-surface); }
.entry-ico {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  background: var(--c-surface); box-shadow: var(--shadow-sm);
}
.entry-label { font-size: 12px; color: var(--c-ink-2); }
.entry-badge {
  position: absolute; top: 4px; right: 10px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--c-primary); color: #fff;
  font-size: 11px; line-height: 16px; text-align: center;
}

/* 顶栏铃铛按钮 + 未读角标 */
.topbar-bell { position: relative; }
.icon-badge {
  position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--c-primary); color: #fff;
  font-size: 11px; line-height: 16px; text-align: center; box-sizing: border-box;
}

/* ===== 积分商城 ===== */
.shop-seg { margin: 12px 0 4px; }
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px 0;
}
.shop-card {
  background: var(--c-surface); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column;
}
.shop-card:active { transform: scale(.99); }
.shop-card-img { width: 100%; aspect-ratio: 1 / 1; background: var(--c-surface-2); }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.shop-card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.shop-card-name { font-size: 14px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11px;
  background: var(--c-surface-2); color: var(--c-ink-2); }
.tag-code { background: #e8edf7; color: var(--c-blue); }
.tag-vir { background: #eaf5ee; color: #2e9e5b; }
.shop-card-foot { display: flex; align-items: baseline; justify-content: space-between; }
.shop-price { color: var(--c-primary); font-weight: 800; font-size: 15px; }
.shop-stock { font-size: 11px; color: var(--c-ink-2); }
.shop-detail { padding: 16px; }
.shop-detail-img { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--c-surface-2); margin-bottom: 12px; }
.shop-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-detail-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.shop-detail-name { font-size: 18px; font-weight: 800; }
.shop-detail-price { color: var(--c-primary); font-weight: 800; font-size: 20px; margin: 8px 0; }
.shop-detail-desc { font-size: 14px; color: var(--c-ink-2); line-height: 1.8; white-space: pre-wrap; }

/* 兑换订单 */
.order-list { padding: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.order-item { display: flex; gap: 12px; padding: 12px; }
.order-img { width: 64px; height: 64px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--c-surface-2); }
.order-img img { width: 100%; height: 100%; object-fit: cover; }
.order-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.order-info { flex: 1; min-width: 0; }
.order-name { font-weight: 700; }
.order-meta { font-size: 13px; color: var(--c-primary); margin: 2px 0; }
.order-status { font-size: 12px; color: var(--c-ink-2); }
.order-code { font-size: 12px; margin-top: 4px; color: var(--c-ink-2); }
.order-code b { color: var(--c-ink); letter-spacing: .5px; }
.order-actions { margin-top: 6px; }

/* 地址选择 */
.addr-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--c-line);
  border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.addr-row.sel { border-color: var(--c-primary); background: var(--c-primary-weak); }
.addr-row input { margin-top: 4px; }
.ipt { width: 100%; padding: 9px 10px; border: 1px solid var(--c-line); border-radius: 10px;
  font-size: 14px; margin-bottom: 8px; background: var(--c-surface); color: var(--c-ink); }

/* ===== 消息通知 ===== */
.msg-list { padding: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; gap: 10px; align-items: flex-start; position: relative; padding: 12px; }
.msg-row.unread { background: var(--c-primary-weak); }
.msg-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--c-surface-2); }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-avatar-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c-ink-2); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-ink-2); }
.msg-type { font-weight: 700; color: var(--c-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); flex-shrink: 0; }
.msg-content { font-size: 14px; margin: 4px 0; line-height: 1.6; }
.msg-del { position: absolute; top: 8px; right: 10px; border: none; background: none;
  color: var(--c-ink-2); font-size: 18px; line-height: 1; padding: 2px 4px; }

/* ===== 搜索结果页 ===== */
.search-form2 { display: flex; gap: 8px; padding: 12px 0 4px; }
.search-form2 .ipt { flex: 1; margin: 0; }

/* ===== 签到 + 排行榜 ===== */
.checkin-card { padding: 16px; }
.checkin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checkin-title { font-size: 16px; font-weight: 800; }
.checkin-sub { font-size: 13px; color: var(--c-ink-2); margin-top: 4px; }
.checkin-sub b { color: var(--c-primary); }
.btn-primary.disabled, .btn-primary:disabled { opacity: .55; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 14px; }
.cal-d { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 7px; background: var(--c-surface-2); color: var(--c-ink-2); }
.cal-d.on { background: var(--c-primary-weak); color: var(--c-primary); font-weight: 700; }
.cal-d.today { outline: 2px solid var(--c-gold); }
.rank-card { padding: 16px; }
.rank-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--c-line); }
.rank-row:last-child { border-bottom: none; }
.rank-row.top { background: linear-gradient(90deg, var(--c-primary-weak), transparent); border-radius: 10px; }
.rank-no { width: 28px; text-align: center; font-weight: 800; font-size: 15px; color: var(--c-ink-2); flex-shrink: 0; }
.rank-no.medal { font-size: 18px; }
.rank-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--c-surface-2); }
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-avatar-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c-ink-2); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; line-height: 1.4; }
.rank-title { font-size: 11px; color: var(--c-gold); margin-left: 6px; font-weight: 600; }

/* ==================== 私信 ==================== */
.dm-list { display: flex; flex-direction: column; }
.dm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--c-line);
  cursor: pointer; background: var(--c-paper);
}
.dm-row:active { background: var(--c-paper-2); }
.dm-row .avatar { width: 44px; height: 44px; flex: 0 0 44px; }
.dm-row-main { flex: 1; min-width: 0; }
.dm-row-top { display: flex; justify-content: space-between; align-items: baseline; }
.dm-name { font-weight: 600; color: var(--c-ink); font-size: 15px; }
.dm-time { font-size: 12px; color: var(--c-ink-3); flex: 0 0 auto; margin-left: 8px; }
.dm-last {
  font-size: 13px; color: var(--c-ink-2); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.dm-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--c-red);
  flex: 0 0 9px; box-shadow: 0 0 0 3px rgba(148, 30, 22, .12);
}
.dm-box {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 12px; overflow-y: auto;
  height: calc(100vh - 220px); background: var(--c-paper-2);
}
.dm-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.dm-msg .avatar.sm { width: 30px; height: 30px; flex: 0 0 30px; }
.dm-msg.me { flex-direction: row-reverse; }
.dm-bubble {
  max-width: 72%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: var(--c-paper); color: var(--c-ink); border: 1px solid var(--c-line);
  word-break: break-word; white-space: pre-wrap;
}
.dm-msg.me .dm-bubble {
  background: var(--c-red); color: #fff; border-color: var(--c-red);
}
.dm-img { max-width: 160px; border-radius: 8px; display: block; }
.dm-input {
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px;
  border-top: 1px solid var(--c-line); background: var(--c-paper);
  position: sticky; bottom: 0;
}
.dm-input .ipt { flex: 1; resize: none; max-height: 100px; border-radius: 10px; }
.dm-input .btn-primary { flex: 0 0 auto; padding: 8px 16px; border-radius: 10px; }
.entry-badge {
  position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--c-red); color: #fff; font-size: 11px;
  line-height: 16px; text-align: center; font-weight: 600;
}
.entry-item { position: relative; }

/* ==================== 用户主页 ==================== */
.user-hero { text-align: center; padding: 18px 14px; }
.user-hero .avatar.lg { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px; display: block; border: 2px solid var(--c-red); }
.user-name { font-size: 18px; font-weight: 700; color: var(--c-ink); }
.user-title { display: inline-block; margin-top: 4px; padding: 1px 8px; font-size: 12px; color: var(--c-red); border: 1px solid var(--c-red); border-radius: 10px; }
.user-bio { margin-top: 8px; font-size: 13px; color: var(--c-ink-2); line-height: 1.6; }
.user-loc { margin-top: 6px; font-size: 12px; color: var(--c-ink-3); }
.user-stats { display: flex; justify-content: center; gap: 22px; margin: 14px 0 4px; }
.user-stats div { display: flex; flex-direction: column; align-items: center; }
.user-stats b { font-size: 16px; color: var(--c-ink); }
.user-stats span { font-size: 12px; color: var(--c-ink-3); margin-top: 2px; }
.user-actions { display: flex; gap: 10px; margin-top: 14px; }
.user-actions .btn-ghost, .user-actions .btn-primary { flex: 1; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; }
.mini-row .muted { font-size: 12px; white-space: nowrap; }

/* ==================== 群聊 ==================== */
.chat-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--c-line); cursor: pointer; position: relative; }
.chat-row:active { background: var(--c-paper-2); }
.chat-row .avatar { width: 46px; height: 46px; border-radius: 10px; flex: 0 0 auto; }
.chat-main { flex: 1; min-width: 0; }
.chat-top { display: flex; justify-content: space-between; align-items: baseline; }
.chat-name { font-weight: 600; color: var(--c-ink); }
.chat-mem { font-size: 12px; color: var(--c-ink-3); }
.chat-last { margin-top: 3px; font-size: 13px; color: var(--c-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-box { display: flex; flex-direction: column; gap: 10px; padding: 12px 4px; min-height: 320px; max-height: 60vh; overflow-y: auto; }
.role-tag { display: inline-block; margin-left: 6px; font-style: normal; font-size: 10px; color: #fff; background: var(--c-red); border-radius: 6px; padding: 0 4px; vertical-align: middle; }
.dm-fab { margin-left: auto; white-space: nowrap; }

/* ==================== 网盘资源（瀑布流） ==================== */
/* 多列瀑布流：复用首页 feed-masonry 思路（CSS columns，无需 JS） */
#driveList { column-count: 5; column-gap: 14px; }
#driveList > .drive-card { break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 14px; }
#driveList .empty { column-span: all; }

/* 卡片从横向改为纵向：封面全宽（自然高度 → 高度不一，形成瀑布） */
.drive-card { padding: 0; overflow: hidden; }
.drive-cover { width: 100%; height: auto; display: block; background: var(--c-paper-2); }
.drive-body { padding: 12px; display: flex; flex-direction: column; }
.drive-title { font-weight: 600; color: var(--c-ink); line-height: 1.4; }
.drive-desc { margin-top: 4px; font-size: 13px; color: var(--c-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drive-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.drive-tags .tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--c-paper-2); color: var(--c-ink-2); border: 1px solid var(--c-line); }
.drive-tags .tag-paid { color: var(--c-red); border-color: var(--c-red); background: #fff0ee; }
.drive-tags .tag-free { color: #1a8a3c; border-color: #b6e3c4; background: #eafaf0; }
.drive-body .btn-primary { margin-top: 10px; }

/* 响应式列数：宽屏 3 列，窄屏（含手机）2 列，保持瀑布观感 */
/* 网盘瀑布流：宽屏 5 列，逐步降级避免卡片过窄 */
@media (max-width: 1400px) { #driveList { column-count: 4; } }
@media (max-width: 1100px) { #driveList { column-count: 3; } }
@media (max-width: 800px)  { #driveList { column-count: 2; } }
@media (max-width: 500px)  { #driveList { column-count: 1; } }

/* 网盘资源：详情页卡片 + 揭示面板 */
.drive-card-web { padding: 12px; }
.drive-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.drive-plat { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--c-paper-2); color: var(--c-ink-2); border: 1px solid var(--c-line); }
.drive-name { font-weight: 600; color: var(--c-ink); }
.dr-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--c-line); }
.dr-field { flex: 1; min-width: 0; }
.dr-label { font-size: 12px; color: var(--c-ink-2); margin-bottom: 2px; }
.dr-val { font-size: 13px; color: var(--c-ink); word-break: break-all; }
.dr-gate { font-size: 13px; color: var(--c-ink-2); padding: 10px 0; }
.dr-price { font-size: 13px; color: var(--c-red); padding: 6px 0 10px; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 14px; line-height: 1.6; }
.drive-reveal { max-width: 340px; }
.drive-reveal .dr-row { border-top: none; padding: 6px 0; }
.drive-reveal .panel { padding: 18px; }

/* 发帖：置顶方式切换 + 积分天数 */
.pin-method { display: flex; gap: 8px; margin-bottom: 10px; }
.pin-method-tab { flex: 1; padding: 8px 0; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-paper-2); color: var(--c-ink-2); font-size: 13px; cursor: pointer; }
.pin-method-tab.sel { border-color: var(--c-primary, #07c160); color: var(--c-primary, #07c160); background: #eafaf0; font-weight: 600; }
.pin-days { display: flex; flex-wrap: wrap; gap: 8px; }
.pin-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border: 1px solid var(--c-line); border-radius: 10px; font-size: 14px; cursor: pointer; }
.pin-day .pin-cost { font-size: 11px; color: var(--c-ink-2); }
.pin-day.sel { border-color: var(--c-primary, #07c160); background: #eafaf0; color: var(--c-primary, #07c160); }
.pin-hint { font-size: 12px; color: var(--c-ink-2); margin-top: 8px; }
.pin-empty { font-size: 13px; color: var(--c-ink-2); padding: 8px 0; }
.pin-empty a { color: var(--c-primary, #07c160); }

/* 缩小版小程序码（引导弹窗） */
.qr-sm { width: 132px; height: 132px; object-fit: contain; border-radius: 8px; border: 1px solid var(--c-line); margin: 0 auto; display: block; background: #fff; }

/* ==================== 答题中心 / 单人 / 对战 ==================== */
.ans-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 6px; }
.back-x { font-size: 26px; line-height: 1; color: var(--c-ink-1); background: none; border: none; padding: 0 6px; cursor: pointer; }
.ans-title { font-size: 17px; font-weight: 800; color: var(--c-ink-1); }
.answer-stats { display: flex; justify-content: space-around; text-align: center; }
.ans-stat { display: flex; flex-direction: column; align-items: center; }
.ans-stat b { font-size: 20px; color: var(--c-primary); }
.ans-stat span { font-size: 12px; color: var(--c-ink-2); margin-top: 2px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mode-card { background: var(--c-surface-2); border-radius: 12px; padding: 16px 8px; text-align: center; cursor: pointer; transition: transform .1s; }
.mode-card:active { transform: scale(.97); }
.mode-ico { font-size: 28px; }
.mode-name { font-weight: 700; margin-top: 6px; color: var(--c-ink-1); }
.mode-desc { font-size: 11px; color: var(--c-ink-3); margin-top: 3px; }
.ans-progress { font-size: 13px; color: var(--c-ink-2); margin-bottom: 10px; }
.ans-progress b { color: var(--c-primary); }
.ans-q { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 14px; color: var(--c-ink-1); }
.wp-result { margin: 10px 0; }
.wp-res { font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 10px; text-align: center; }
.wp-res.ok { background: #e6f6ec; color: #2e9e5b; }
.wp-res.bad { background: #fbe7e4; color: var(--c-primary); }
.ans-summary { text-align: center; }
.ans-sum-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; color: var(--c-ink-1); }
.ans-sum-row { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.ans-sum-row:last-of-type { border-bottom: none; margin-bottom: 12px; }
.ans-sum-row b { color: var(--c-primary); }

/* ===== 1V1 / 邀请对战 ===== */
.pk-scorebar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pk-side { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pk-side.right { flex-direction: row-reverse; text-align: right; }
.pk-side-info { display: flex; flex-direction: column; min-width: 0; }
.pk-side-info b { font-size: 13px; color: var(--c-ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-side-info span { font-size: 18px; font-weight: 800; color: var(--c-primary); }
.pk-vs { font-weight: 800; color: var(--c-ink-3); padding: 0 8px; }
.avatar.sm { width: 32px; height: 32px; flex: 0 0 32px; }
.pk-timer { color: var(--c-primary); font-weight: 700; }
.pk-opp-status { font-size: 12px; margin: 6px 0; }
.pk-fight { position: relative; }
.pk-center { text-align: center; padding: 28px 16px; }
.pk-spin { font-size: 34px; animation: pkpulse 1.1s infinite; }
@keyframes pkpulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.pk-big { font-size: 17px; font-weight: 800; margin: 10px 0; color: var(--c-ink-1); }
.pk-emoji { font-size: 44px; }
.pk-sum { margin: 14px 0; }
.pk-sum-row { display: flex; justify-content: space-between; padding: 7px 4px; font-size: 14px; border-bottom: 1px solid var(--c-line); }
.pk-sum-row:last-child { border-bottom: none; }
.pk-round-title { font-weight: 700; margin-bottom: 8px; color: var(--c-ink-1); }
.pk-correct { font-size: 13px; color: var(--c-ink-2); margin-bottom: 8px; }
.pk-correct b { color: #2e9e5b; }
.pk-result-rows { margin-top: 6px; }
.pk-result-row { display: flex; justify-content: space-between; padding: 6px 4px; font-size: 14px; border-bottom: 1px solid var(--c-line); }
.pk-result-row:last-child { border-bottom: none; }
.pk-result-row b.ok { color: #2e9e5b; }
.pk-result-row b.bad { color: var(--c-primary); }
.invite-code { font-size: 30px; letter-spacing: 6px; font-weight: 800; color: var(--c-primary); margin: 14px 0; font-family: monospace; }
.pk-code-actions { display: flex; gap: 10px; justify-content: center; }

/* ==================== 我的足迹 ==================== */
.int-item { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--c-line); cursor: pointer; }
.int-item:active { background: var(--c-paper-2); }
.int-main { flex: 1; min-width: 0; }
.int-title { font-weight: 600; color: var(--c-ink-1); line-height: 1.4; }
.int-sub { font-size: 12px; color: var(--c-ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.int-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.int-time { font-size: 11px; color: var(--c-ink-3); white-space: nowrap; }
.int-del { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--c-surface-2); color: var(--c-ink-2); font-size: 15px; line-height: 1; cursor: pointer; }
.int-del:active { background: var(--c-line); }

/* ==================== 设置 ==================== */
.list-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 4px; background: none; border: none; border-bottom: 1px solid var(--c-line); font-size: 15px; color: var(--c-ink-1); cursor: pointer; transition: background .15s var(--ease-standard); }
.list-row:hover { background: var(--c-surface-2); }
.list-row:last-child { border-bottom: none; }
.lr-arrow { color: var(--c-ink-3); font-size: 18px; }

/* ==================== 积分任务中心 ==================== */
.task-balance { display: flex; justify-content: space-around; text-align: center; }
.tb-stat { display: flex; flex-direction: column; align-items: center; }
.tb-stat b { font-size: 22px; color: var(--c-primary); }
.tb-stat span { font-size: 12px; color: var(--c-ink-2); margin-top: 2px; }
.task-card { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--c-line); }
.task-card:last-child { border-bottom: none; }
.task-ico { font-size: 26px; flex: 0 0 auto; width: 40px; text-align: center; }
.task-body { flex: 1; min-width: 0; }
.task-name { font-weight: 700; color: var(--c-ink-1); font-size: 14px; }
.task-pts { color: var(--c-primary); font-weight: 800; margin-left: 4px; }
.task-desc { font-size: 12px; color: var(--c-ink-2); margin-top: 2px; }
.task-prog { font-size: 11px; margin-top: 2px; }
.task-btn { flex: 0 0 auto; white-space: nowrap; }

/* ==================== 发帖补充信息 ==================== */
.pub-extra { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c-line); }
.pub-extra label { font-size: 12px; color: var(--c-ink-2); display: block; margin-bottom: 4px; }
.pub-extra-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--c-ink-1); }

/* 发帖：网盘资源 / 置顶 子块 */
.pub-block { margin-top: 12px; padding: 12px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 12px; }
.pub-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--c-ink-1); }
.pub-block-body { margin-top: 8px; }

/* 发帖：话题标签 */
.pub-tags-hint { font-size: 11px; font-weight: 400; color: var(--c-ink-3); }
.pub-tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pub-tag-list:empty { display: none; }
.pub-tag-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--c-primary); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.pub-tag-del { border: none; background: transparent; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.pub-tag-inputrow { display: flex; gap: 8px; align-items: center; }
.pub-tag-inputrow .ipt { flex: 1; }
.pub-tag-inputrow #pubTagAdd { flex: none; padding: 8px 16px; border-radius: 10px; }
.pub-tag-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pub-tag-suggest-label { font-size: 12px; color: var(--c-ink-3); }
.pub-tag-suggest-item { display: inline-flex; align-items: center; gap: 3px; background: var(--c-primary-weak); color: var(--c-primary); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; transition: transform var(--dur-fast, .15s) var(--ease-standard, ease); }
.pub-tag-suggest-item:active { transform: scale(.96); }
.pub-tag-hot { font-style: normal; font-size: 10px; background: #ff7043; color: #fff; border-radius: 6px; padding: 0 4px; line-height: 1.4; }


/* iOS 风格开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--c-switch-off); border-radius: 22px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--c-primary, #07c160); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 置顶卡选择器 */
.pin-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.pin-card { padding: 8px 12px; border: 1px solid var(--c-line); border-radius: 8px; font-size: 12px; cursor: pointer; background: #fff; color: var(--c-ink-1); transition: .15s; }
.pin-card:hover { border-color: var(--c-primary, #07c160); }
.pin-card.sel { border-color: var(--c-primary, #07c160); background: #e8f8ee; color: var(--c-primary, #07c160); font-weight: 700; }
.pin-empty { font-size: 12px; color: var(--c-ink-2); padding: 4px 0; }
.pin-empty a { text-decoration: none; }

/* ==================== 分享选帖弹窗 ==================== */
.share-panel { max-width: 420px; max-height: 70vh; display: flex; flex-direction: column; }
.share-panel .panel-head { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--c-ink-1); }
.share-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.share-row { padding: 12px; background: var(--c-surface-2); border-radius: 10px; font-size: 14px; color: var(--c-ink-1); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-row:active { background: var(--c-line); }

/* ==================== 投票模块 ==================== */
.poll-list { display: flex; flex-direction: column; gap: 10px; }
.poll-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.poll-cat {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--c-surface-2, #f2efe9); color: var(--c-ink-2, #8a8170);
}
.poll-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.poll-voted { font-size: 11px; color: var(--c-primary, #07c160); font-weight: 700; }
.poll-card-title { font-size: 15px; font-weight: 700; color: var(--c-ink-1, #2b2b2b); line-height: 1.4; margin-bottom: 8px; }
.pm-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.pm-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--c-ink-2, #8a8170); }
.pm-pct { color: var(--c-ink-1, #2b2b2b); font-weight: 600; }
.poll-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--c-ink-2, #8a8170); }
.poll-author { display: flex; align-items: center; gap: 5px; }
.poll-author .avatar.xs { width: 20rpx; height: 20rpx; }

/* 详情 */
.poll-detail { padding: 16px; }
.poll-question { font-size: 18px; font-weight: 800; color: var(--c-ink-1, #2b2b2b); line-height: 1.4; margin: 4px 0 6px; }
.poll-desc { font-size: 14px; color: var(--c-ink-2, #8a8170); line-height: 1.6; margin-bottom: 10px; }
.poll-meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--c-ink-2, #8a8170); margin-bottom: 12px; }
.poll-meta-row .poll-author { color: var(--c-ink-1, #2b2b2b); font-weight: 600; cursor: pointer; }
.poll-opts { display: flex; flex-direction: column; gap: 8px; }
.poll-opt {
  position: relative; overflow: hidden; border: 1px solid var(--c-line, #e6e0d4);
  border-radius: 10px; padding: 11px 13px; cursor: pointer; background: #fff; transition: .15s;
}
.poll-opt.result { cursor: default; }
.poll-opt.sel { border-color: var(--c-primary, #07c160); background: #e8f8ee; }
.poll-opt.expanded { border-color: var(--c-primary, #07c160); }
.poll-opt-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(7,193,96,0.12); border-radius: 10px; transition: width .4s; z-index: 0; }
.poll-opt-inner { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.poll-opt-name { font-size: 14px; color: var(--c-ink-1, #2b2b2b); }
.poll-opt-pct { font-size: 13px; font-weight: 700; color: var(--c-primary, #07c160); }
.poll-opt-cnt { font-size: 12px; color: var(--c-ink-2, #8a8170); margin-left: 6px; }
.poll-voters { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--c-line, #e6e0d4); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.voter { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-ink-1, #2b2b2b); }
.voter .avatar.xs { width: 20px; height: 20px; }
.poll-status { text-align: center; font-size: 13px; color: var(--c-ink-2, #8a8170); padding: 10px; background: var(--c-surface-2, #f2efe9); border-radius: 10px; }
.poll-add-opt { display: flex; gap: 6px; margin-top: 10px; }
.poll-add-opt .opt-input { flex: 1; }
.poll-manage { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.poll-tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.poll-tag.on { background: #e8f8ee; color: var(--c-primary, #07c160); }
.poll-tag.off { background: #f4e9e9; color: #c0392b; }
.btn-ghost.danger { color: #c0392b; border-color: #f0c5c5; }

/* 发起投票表单 */
.poll-form { padding: 16px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--c-ink-1, #2b2b2b); }
.opt-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--c-line, #e6e0d4); border-radius: 10px; font-size: 14px;
  background: #fff; color: var(--c-ink-1, #2b2b2b); outline: none;
}
.opt-input:focus { border-color: var(--c-primary, #07c160); }
select.opt-input { appearance: none; }
.opt-row { display: flex; align-items: center; gap: 6px; }
.opt-row .opt-input { flex: 1; margin-top: 0; }
.poll-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-ink-1, #2b2b2b); margin-top: 10px; }

/* 我的投票 */
.poll-my-tabs { display: flex; gap: 8px; padding: 12px; }
.poll-row { padding: 14px; }
.poll-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.poll-row-title { font-size: 15px; font-weight: 700; color: var(--c-ink-1, #2b2b2b); line-height: 1.4; }
.poll-row-meta { font-size: 12px; color: var(--c-ink-2, #8a8170); margin-top: 6px; }
.poll-row-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ===== 圈子：建圈/管理/成员/发帖 ===== */
.img-add.square { width: 84px; height: 84px; border-radius: var(--radius-sm); font-size: 15px; color: var(--c-ink-2); }
.img-add.square img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.img-pick-row { display: flex; gap: 22px; justify-content: center; margin: 6px 0 4px; }
.img-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.member-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--c-surface); border-radius: var(--radius-sm); margin-bottom: 8px; box-shadow: var(--shadow-sm); cursor: pointer; }
.member-main { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--c-surface-2); color: var(--c-ink-2); }
.role-badge.r1 { background: #eaf2fb; color: var(--c-blue); }
.role-badge.r2 { background: var(--c-primary-weak); color: var(--c-primary); }
.muted-tag { font-size: 11px; color: #b06a00; background: #fff3e0; padding: 1px 7px; border-radius: 10px; }
.member-act { flex-shrink: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions .btn-sm.danger { color: var(--c-primary); border-color: var(--c-primary-weak); }
.row-actions .btn-sm.danger:active { background: var(--c-primary-weak); }
.manage-post { cursor: pointer; }

/* ===== 群聊专用 ===== */
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.group-actions .btn { flex: 1; min-width: 96px; }
.mention-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--c-surface); border-radius: var(--radius-sm); margin-bottom: 8px; box-shadow: var(--shadow-sm); cursor: pointer; }
.mention-row:active { background: var(--c-surface-2); }
.mention-main { flex: 1; min-width: 0; }
.mention-head { font-size: 13px; font-weight: 600; color: var(--c-ink); margin-bottom: 4px; }
.mention-content { font-size: 14px; color: var(--c-ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ===== 扫码登录弹窗 · 小程序码 ===== */
.mpqr-box { margin-top: 12px; padding: 12px; background: var(--c-surface-2); border-radius: var(--radius-sm); text-align: center; }
.mpqr-box img { display: block; margin: 0 auto; width: 168px; height: 168px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; padding: 6px; box-shadow: var(--shadow-sm); }
.mpqr-tip { font-size: 12px; color: var(--c-ink-2); margin: 10px 0 0; line-height: 1.6; text-align: left; }

/* ===== 网站底部信息 ===== */
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 18px 14px calc(var(--bottomnav-h) + 28px); background: var(--c-surface-2); border-top: 1px solid var(--c-line); color: var(--c-ink-2); font-size: 12px; line-height: 1.9; }
.sf-inner { text-align: center; }
.sf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.sf-links a { color: var(--c-ink-2); text-decoration: none; }
.sf-links a:active { color: var(--c-primary); }
.sf-sep { color: var(--c-line); }
.sf-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.sf-meta .sf-ph { color: var(--c-gold); font-weight: 600; }
.sf-copy { color: var(--c-ink-2); }
/* 底部小程序码（后台「站点设置」可配置） */
.sf-mpqr { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }
.sf-mpqr img { width: 116px; height: 116px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; padding: 6px; border: 1px solid var(--c-line); box-shadow: var(--shadow-sm); }
.sf-mpqr-tip { font-size: 11px; color: var(--c-ink-2); max-width: 220px; line-height: 1.6; }

/* ===== 帖子详情 · 所属圈子信息块 ===== */
.circle-block { cursor: pointer; }
.circle-block:active { background: var(--c-surface-2); }
.cb-head { font-size: 13px; font-weight: 700; color: var(--c-ink-2); margin-bottom: 10px; }
.cb-row { display: flex; align-items: center; gap: 12px; }
.cb-avatar { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: var(--c-surface-2); flex-shrink: 0; }
.cb-main { flex: 1; min-width: 0; }
.cb-name { font-size: 15px; font-weight: 700; color: var(--c-ink); margin-bottom: 3px; }
.cb-desc { font-size: 12px; color: var(--c-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-arrow { flex-shrink: 0; font-size: 13px; color: var(--c-primary); font-weight: 600; }

/* ============================================================
   UI 优化（系统性提升）：字体层级 / 对比度 / 微交互 / 入场动画
   ============================================================ */

/* 1) 标题衬线化：强化文史墨韵品牌气质（标题与正文区分，建立清晰层级） */
.brand, .post-title, .detail-title, .sec-title, .gated h2, .overlay h2,
.weekly-banner .wb-title, .profile-head .name, .circle-card h3,
.cb-name, .chance-num, .wc-time, .wp-timer, .wp-q {
  font-family: var(--font-display);
}

/* 2) 描金文字对比度修复：原 --c-gold(#c8a96a) 在浅底对比度约 2:1（不达标），
      文字场景改用 --c-gold-deep(#9a7b34，约 4.6:1，满足 AA） */
.post-foot .act.collected { color: var(--c-gold-deep); }
.rank-reward { color: var(--c-gold-deep); }
.sf-meta .sf-ph { color: var(--c-gold-deep); }

/* 3) 卡片 / 帖子：悬浮抬升 + 统一过渡 */
.card, .post, .circle-card, .weekly-hero, .weekly-panel,
.prize-item, .rank-row, .member-row, .mention-row, .comment {
  transition: transform var(--dur) var(--ease-standard),
              box-shadow var(--dur) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}
.card:hover, .post:hover, .circle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card:active, .post:active, .circle-card:active { transform: translateY(0); }

/* 4) 按钮：悬浮 / 按压 / 焦点（主按钮加轻微渐变与投影，避免廉价感） */
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary));
  box-shadow: 0 4px 14px rgba(168, 50, 45, .26);
  transition: transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard),
              filter var(--dur-fast) var(--ease-standard);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(168, 50, 45, .32); }
.btn-primary:active { transform: translateY(0); filter: brightness(.96); box-shadow: 0 2px 8px rgba(168, 50, 45, .3); }
.btn-ghost {
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.btn-ghost:hover { background: var(--c-surface); border-color: var(--c-primary); color: var(--c-primary); }
.btn-ghost:active { transform: scale(.98); }

/* 焦点环（无障碍）：键盘可达元素 */
.btn-primary:focus-visible, .btn-ghost:focus-visible,
.icon-btn:focus-visible, .nav-item:focus-visible,
.searchbar input:focus-visible, .post-foot .act:focus-visible,
.chip:focus-visible, .list-row:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* 5) 胶囊 / 标签 / 分段 / 底部导航：轻量过渡与按压反馈 */
.chip { transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard); }
.chip:active { transform: scale(.96); }
.tab { transition: color var(--dur-fast) var(--ease-standard); }
.tab:hover { color: var(--c-primary); }
.nav-item { transition: color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard); }
.nav-item:active { transform: scale(.92); }

/* 6) 可点击行 / 头像 / 加图按钮：反馈与微光 */
.list-row, .member-row, .mention-row, .comment, .rank-row,
.circle-card, .post, .card { cursor: pointer; }
.list-row:active, .member-row:active, .mention-row:active { background: var(--c-surface-2); }
.avatar { transition: transform var(--dur-fast) var(--ease-standard); }
.avatar:hover { transform: scale(1.04); }
.img-add { transition: border-color var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.img-add:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-weak); }

/* 7) 顶部 / 底部栏毛玻璃增强（更通透的高级感） */
.topbar, .bottom-nav { backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }

/* 8) 页面入场动画：每次路由渲染淡入上移（轻盈过渡，不干扰滚动） */
@keyframes appEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-content.enter-anim { animation: appEnter .32s var(--ease-standard); }

/* 尊重「减少动态效果」偏好（无障碍） */
@media (prefers-reduced-motion: reduce) {
  .app-content.enter-anim { animation: none; }
  .card, .post, .circle-card, .weekly-hero, .weekly-panel, .prize-item,
  .rank-row, .member-row, .mention-row, .comment, .btn-primary, .btn-ghost,
  .chip, .tab, .nav-item, .avatar, .img-add { transition: none; }
}

/* ============================================================
   深色模式「墨夜」主题：与浅色「宣纸」主题配套
   通过覆盖 :root 令牌实现全局换肤；仅少量硬编码亮色需额外覆写。
   ============================================================ */
[data-theme="dark"] {
  --c-bg: #16110d;            /* 深墨底色 */
  --c-surface: #221a14;       /* 卡片 / 表面 */
  --c-surface-2: #2e241c;     /* 次级表面（输入框底 / 区块底） */
  --c-paper-2: #2e241c;
  --c-ink: #ece3d6;           /* 主文字（暖白） */
  --c-ink-1: #ece3d6;
  --c-ink-2: #b3a892;         /* 次级文字 */
  --c-line: #3a2e24;          /* 描边 / 分割线 */
  --c-primary: #d6544c;       /* 印章红提亮（暗底更醒目） */
  --c-primary-2: #e0665d;
  --c-primary-weak: #3a241f;  /* 主色弱底（选中 / 未读） */
  --c-gold: #d8b876;
  --c-gold-deep: #d8b876;     /* 暗底描金用亮金，保证对比度 */
  --c-blue: #6fa8dc;
  --c-topbar-bg: rgba(28,21,16,.88);
  --c-bottomnav-bg: rgba(28,21,16,.92);
  --c-switch-off: #4a3b30;
  --shadow: 0 6px 22px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  --shadow-hover: 0 10px 30px rgba(0,0,0,.6);
}

/* 暗色模式：输入框/下拉/文本域文字与边框（表单控件不继承 body 颜色，必须显式声明） */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: var(--c-ink);
  background: var(--c-surface);
  border-color: var(--c-line);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--c-ink-2); opacity: 1; }
[data-theme="dark"] select option { background: var(--c-surface); color: var(--c-ink); }
/* 搜索框：暗底浅字，聚焦高亮 */
[data-theme="dark"] .searchbar input { background: var(--c-surface-2); border-color: var(--c-line); }
[data-theme="dark"] .searchbar input::placeholder { color: var(--c-ink-2); }

/* 骨架屏：暗底配色 */
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,#2a2019 25%,#332619 37%,#2a2019 63%);
}

/* 周赛 banner：暗底墨金，与红底发帖卡保持区分 */
[data-theme="dark"] .weekly-banner {
  background: linear-gradient(120deg, #1c120d, #3a231c);
  border-color: rgba(216, 184, 118, .25);
}

/* 答题中心 banner：暗底品牌绿 */
[data-theme="dark"] .answer-banner {
  background: linear-gradient(120deg, #064a2e, #0a7a44);
  border-color: rgba(7, 193, 96, .3);
}

/* 遗留绿色选中态（旧品牌残留）在暗底改为品牌红，保持统一 */
[data-theme="dark"] .pin-method-tab.sel,
[data-theme="dark"] .pin-day.sel,
[data-theme="dark"] .pin-card.sel,
[data-theme="dark"] .poll-tag.on {
  border-color: var(--c-primary);
  background: var(--c-primary-weak);
  color: var(--c-primary);
}

/* 登录二维码框保持浅底（扫码需要白底），但描边用暗线 */
[data-theme="dark"] .qr-box { border-color: var(--c-line); background: #faf9f6; }

/* ============================================================
   首页品牌 Hero 区（视觉化品牌头部）
   ============================================================ */
.home-hero {
  position: relative; overflow: hidden; margin-bottom: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #6e1f1a 0%, #a8322d 48%, #c8463a 100%);
  color: #fff; padding: 22px 18px 20px; box-shadow: var(--shadow-sm);
}
.home-hero__decor { position: absolute; inset: 0; pointer-events: none; }
.home-hero__decor svg { width: 100%; height: 100%; display: block; }
.home-hero__inner { position: relative; z-index: 1; }
.home-hero__kicker {
  display: inline-block; font-size: 12px; letter-spacing: 2px;
  color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 10px;
}
.home-hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(25px, 7vw, 33px); line-height: 1.16; margin: 0 0 6px;
  letter-spacing: 1px; text-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.home-hero__title span { color: var(--c-gold); }
.home-hero__sub { margin: 0 0 14px; font-size: 13px; color: rgba(255,255,255,.88); }
.home-hero__stats { display: flex; gap: 10px; }
.home-hero__stats .hs {
  flex: 1; text-align: center; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22); border-radius: 12px;
  padding: 8px 4px; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.home-hero__stats .hs b { display: block; font-size: 18px; font-family: var(--font-display); }
.home-hero__stats .hs span { font-size: 11px; color: rgba(255,255,255,.82); }

[data-theme="dark"] .home-hero {
  background: linear-gradient(135deg, #120c09 0%, #2a1b15 55%, #3a231c 100%);
  box-shadow: var(--shadow);
}

/* ===== 首页分栏：桌面双栏（信息流 + sticky 侧栏）/ 移动单栏（信息流优先） ===== */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.home-layout .home-hero { grid-column: 1 / -1; }
.home-side { position: sticky; top: calc(var(--topbar-h) + 16px); align-self: start; }
.home-main .feed-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-main .feed-bar .seg { flex: none; }
.home-main .feed-bar #circleFilter { flex: 1; min-width: 150px; margin-top: 0; }
/* 信息流视图切换（瀑布流 / 列表） */
.feed-view-toggle { display: inline-flex; gap: 6px; margin-left: auto; }
.feed-view-toggle .chip { cursor: pointer; padding: 5px 10px; }
/* 瀑布流：默认多列；卡片防断裂 */
.home-main #feed.feed-masonry { column-count: 2; column-gap: 14px; }
.home-main #feed.feed-masonry > .card { break-inside: avoid; width: 100%; margin: 0 0 14px; }
/* 列表：单列 */
.home-main #feed.feed-list { column-count: 1; }
/* 空状态在瀑布流下跨整列，避免被压进半栏 */
.home-main #feed .empty { column-span: all; }

@media (max-width: 620px) {
  .home-main #feed.feed-masonry { column-count: 1; }
}

@media (max-width: 860px) {
  .home-layout { grid-template-columns: 1fr; gap: 14px; }
  .home-hero { order: 2; }
  .home-main { order: 1; }
  .home-side { order: 3; position: static; }
}

/* 信息流分区标题 */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 8px; }
.sec-head > span:first-child { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--c-ink); }
.sec-head .sec-sub { font-size: 12px; color: var(--c-ink-2); }

/* 圈子筛选下拉：去除原生外观，统一圆角主题 */
.card select.chip { width: 100%; margin-top: 8px; -webkit-appearance: none; appearance: none; text-align: center; cursor: pointer; }
.card select.chip:focus { border-color: var(--c-primary); outline: none; }

/* 通用弹窗（投票弹窗等）：左对齐宽版面板，长表单可滚动 */
.overlay .panel.modal-wide {
  width: 480px; max-width: 92vw; text-align: left;
  max-height: 88vh; overflow-y: auto;
}
.overlay .panel.modal-wide h2 { font-family: var(--font-display); margin-bottom: 12px; }
.modal-body { text-align: left; }
/* 弹窗内的投票表单不再作为嵌套卡片，直接融入面板 */
.overlay .detail-topbar { display: none; }
.overlay .poll-form { background: transparent; border: none; box-shadow: none; padding: 0; margin: 0; }

/* ===== 举报弹窗（网页版） ===== */
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.report-reason {
  appearance: none;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-ink-2);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.report-reason:hover { border-color: var(--c-primary); color: var(--c-primary); }
.report-reason.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* 帖子详情页页脚的“举报”入口 */
.post-foot .act-report:hover { color: #c0392b; }

/* 评论区的“举报”文字链接 */
.c-report {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 0 6px;
  margin: 0;
  color: var(--c-ink-3);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.c-report:hover { color: #c0392b; }

/* 私信会话顶栏的“举报”按钮 */
.dm-report {
  appearance: none;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  color: var(--c-ink-2);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.dm-report:hover { border-color: #c0392b; color: #c0392b; }

/* 个人主页“举报”按钮（复用 btn-ghost 外观，补充间距） */
.user-actions .btn-ghost[data-action="open-report"] { color: var(--c-ink-2); }
