/* ============================================================
   Clara BBS — 前台样式（Claude 风格：暖米底色 / 赤陶点缀 / 衬线标题）
   ============================================================ */

:root {
  --bg: #FAF9F5;
  --card: #FFFFFF;
  --soft: #F0EEE6;
  --soft-2: #F5F4EE;
  --bd: #E8E6DC;
  --bd-2: #DDD9CB;
  --tx: #191817;
  --tx-2: #57544A;
  --tx-3: #8A8672;
  --ac: #D97757;
  --ac-2: #C4633F;
  --ac-soft: #F9E9E2;
  --ok: #2D7D46;
  --ok-soft: #E8F3EC;
  --warn: #B7791F;
  --warn-soft: #FBF3E4;
  --err: #C0392B;
  --err-soft: #FBEDEA;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(25,24,23,.04), 0 4px 16px rgba(25,24,23,.05);
  --shadow-lg: 0 4px 12px rgba(25,24,23,.08), 0 12px 32px rgba(25,24,23,.1);
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* 兜底：任何长内容都不允许撑出横向滚动（clip 不会破坏 sticky 头部） */
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.75 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ac-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ac); }
img { max-width: 100%; height: auto; }
code { background: var(--soft); border-radius: 4px; padding: 1px 6px; font-size: .9em; font-family: "SF Mono", Consolas, monospace; }
.ic { vertical-align: -3px; flex-shrink: 0; }
/* 实体自定义图标（版块/会员/勋章/礼物）：emoji 与图片共存，尺寸随容器字号自适应 */
.c-icon { height: 1.15em; width: 1.15em; object-fit: contain; vertical-align: -0.2em; margin-right: 2px; flex-shrink: 0; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ac); color: #FAF9F5; padding: 8px 16px; z-index: 999; }
.skip-link:focus { left: 0; }
.muted { color: var(--tx-3); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--err); }
.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* ---------------- 头像与头像框 ---------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.has-frame { padding: 3px; }
.avatar.has-frame img { border: 2px solid var(--fc, var(--bd-2)); }
.avatar.f-glow { box-shadow: 0 0 0 2px var(--fc), 0 0 10px 1px color-mix(in srgb, var(--fc) 55%, transparent); }
.avatar.f-glow img { border-color: var(--fc); }
.avatar.f-gradient { background: conic-gradient(var(--fc), var(--fc2, var(--fc)), var(--fc)); }
.avatar.f-gradient img { border-color: #fff; }
.avatar.f-animate { background: conic-gradient(var(--fc), var(--fc2, var(--fc)), var(--fc)); animation: frameSpin 4s linear infinite; }
.avatar.f-animate img { border-color: #fff; }
@keyframes frameSpin { to { transform: rotate(360deg); } }
.avatar.f-animate img { animation: frameSpinRev 4s linear infinite; }
@keyframes frameSpinRev { to { transform: rotate(-360deg); } }
/* 霓虹幻光：双层辉光，比 glow 更强更现代 */
.avatar.f-neon { box-shadow: 0 0 0 2px var(--fc), 0 0 8px 2px color-mix(in srgb, var(--fc) 65%, transparent), 0 0 20px 5px color-mix(in srgb, var(--fc) 40%, transparent); }
.avatar.f-neon img { border-color: var(--fc); }
/* 雅致虚线：外圈虚线环，手账风 */
.avatar.f-dashed::before { content: ''; position: absolute; inset: 0; border: 2px dashed var(--fc); border-radius: 50%; }
.avatar.f-dashed img { border-color: transparent; }
/* 星轨旋转：缓慢旋转的虚线环 */
.avatar.f-dashspin::before { content: ''; position: absolute; inset: 0; border: 2px dashed var(--fc); border-radius: 50%; animation: frameSpin 10s linear infinite; }
.avatar.f-dashspin img { border-color: transparent; }
/* 心跳呼吸：光环呼吸扩散 */
@keyframes framePulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--fc), 0 0 4px 0 color-mix(in srgb, var(--fc) 40%, transparent); }
  50% { box-shadow: 0 0 0 3px var(--fc), 0 0 14px 4px color-mix(in srgb, var(--fc) 65%, transparent); }
}
.avatar.f-pulse { animation: framePulse 2.6s ease-in-out infinite; }
.avatar.f-pulse img { border-color: var(--fc); }
/* 对角渐变：135° 双色 */
.avatar.f-diagonal { background: linear-gradient(135deg, var(--fc), var(--fc2, var(--fc))); }
.avatar.f-diagonal img { border-color: #fff; }
/* 彩虹光环：固定七色环（主副色不参与） */
.avatar.f-rainbow { background: conic-gradient(#D97757, #B08A3E, #5B8A72, #4E8D8B, #6A7BA2, #8B6BA2, #C0636C, #D97757); }
.avatar.f-rainbow img { border-color: #fff; }
/* 经典双环：主副色双圈 */
.avatar.f-double { box-shadow: 0 0 0 2px var(--fc), 0 0 0 4px var(--card), 0 0 0 6px var(--fc2, var(--fc)); }
.avatar.f-double img { border-color: transparent; }
/* 日冕光芒：放射条纹缓慢旋转 */
.avatar.f-rays { background: repeating-conic-gradient(var(--fc) 0deg 12deg, transparent 12deg 30deg); animation: frameSpin 18s linear infinite; }
.avatar.f-rays img { border-color: var(--card); animation: frameSpinRev 18s linear infinite; }
/* 双星环绕：两颗小圆点反向绕头像旋转（主副色各一） */
.avatar.f-orbit::before, .avatar.f-orbit::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle 3.5px at 50% 0%, var(--fc) 98%, transparent 100%);
  animation: frameSpin 3.2s linear infinite;
}
.avatar.f-orbit::after {
  background: radial-gradient(circle 2.5px at 50% 100%, var(--fc2, var(--fc)) 98%, transparent 100%);
  animation-duration: 4.7s; animation-direction: reverse;
}
.avatar.f-orbit img { border-color: var(--fc); }
/* 彗星拖尾：亮头长尾环绕 */
.avatar.f-comet {
  background: conic-gradient(var(--fc) 0deg, transparent 20deg, transparent 210deg, color-mix(in srgb, var(--fc) 12%, transparent) 270deg, color-mix(in srgb, var(--fc) 40%, transparent) 315deg, var(--fc) 350deg, transparent 360deg);
  animation: frameSpin 2.4s linear infinite;
}
.avatar.f-comet img { border-color: color-mix(in srgb, var(--fc) 25%, transparent); animation: frameSpinRev 2.4s linear infinite; }
/* 波纹荡漾：水波一圈圈扩散 */
@keyframes frameRipple {
  0% { transform: scale(1); opacity: .75; }
  100% { transform: scale(1.4); opacity: 0; }
}
.avatar.f-ripple::before, .avatar.f-ripple::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--fc); z-index: 1; pointer-events: none;
  animation: frameRipple 2.2s ease-out infinite;
}
.avatar.f-ripple::after { animation-delay: 1.1s; }
.avatar.f-ripple img { border-color: var(--fc); }
/* 流光溢彩：渐变色在环上往复流动 */
@keyframes gradFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.avatar.f-flow {
  background: linear-gradient(90deg, var(--fc), var(--fc2, var(--fc)), var(--fc), var(--fc2, var(--fc)), var(--fc));
  background-size: 300% 100%;
  animation: gradFlow 3.5s ease-in-out infinite;
}
.avatar.f-flow img { border-color: #fff; }
/* 星光闪烁：不规则明暗闪烁 */
@keyframes frameSparkle {
  0%, 100% { box-shadow: 0 0 0 2px var(--fc), 0 0 3px 0 color-mix(in srgb, var(--fc) 25%, transparent); }
  10% { box-shadow: 0 0 0 2px var(--fc), 0 0 12px 3px color-mix(in srgb, var(--fc) 60%, transparent); }
  22% { box-shadow: 0 0 0 2px var(--fc), 0 0 4px 1px color-mix(in srgb, var(--fc) 30%, transparent); }
  45% { box-shadow: 0 0 0 2px var(--fc), 0 0 14px 4px color-mix(in srgb, var(--fc) 65%, transparent); }
  58% { box-shadow: 0 0 0 2px var(--fc), 0 0 5px 1px color-mix(in srgb, var(--fc) 35%, transparent); }
  80% { box-shadow: 0 0 0 2px var(--fc), 0 0 10px 2px color-mix(in srgb, var(--fc) 55%, transparent); }
}
.avatar.f-sparkle { animation: frameSparkle 2.4s linear infinite; }
.avatar.f-sparkle img { border-color: var(--fc); }
/* 双色轮换：主副色缓慢交替 */
@keyframes colorSwap {
  0%, 100% { background: var(--fc); }
  50% { background: var(--fc2, var(--fc)); }
}
.avatar.f-swap { animation: colorSwap 3s ease-in-out infinite; }
.avatar.f-swap img { border-color: #fff; }
/* 珍珠圆点：圆点环绕 */
.avatar.f-dotted::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px dotted var(--fc); }
.avatar.f-dotted img { border-color: transparent; }
/* 立体贴纸：主色描边 + 副色错位硬阴影 */
.avatar.f-shadow { box-shadow: 3px 3px 0 0 var(--fc2, var(--fc)); }
.avatar.f-shadow img { border-color: var(--fc); }

/* ---------------- 徽章 ---------------- */
.group-badge, .vip-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; line-height: 1; padding: 3px 8px;
  border: 1px solid var(--bd-2); border-radius: 999px;
  color: var(--tx-2); background: var(--card);
  vertical-align: 2px; margin-left: 4px; white-space: nowrap;
}
.vip-badge { color: #B08A3E; border-color: #E2CFA4; background: #FBF6EA; }
/* AI 回复标识徽章（ai_reply 插件）：动态流光边框 + 图标呼吸，科技感识别 AI 内容 */
.ai-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; line-height: 1; padding: 3px 9px;
  border-radius: 999px;
  color: #6A5AC4; font-weight: 600;
  background: linear-gradient(115deg, #F3F1FC 0%, #EDEAFA 50%, #F3F1FC 100%);
  border: 1px solid #C9C2F0;
  vertical-align: 2px; margin-left: 4px; white-space: nowrap;
  position: relative;
}
/* 流光边框：只旋转渐变角度（--ai-angle），形状保持胶囊不动——此前对伪元素整体 transform 旋转会把胶囊转成"长方形边框在打转" */
@property --ai-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
  .ai-badge::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--ai-angle, 0deg), #A99BEB, #7C6CE0, #56CCF2, #A99BEB);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: aiFlow 3.5s linear infinite;
    pointer-events: none;
  }
}
/* 图标呼吸：轻微缩放律动 */
.ai-badge .c-icon {
  width: 1.15em; height: 1.15em; color: #7C6CE0;
  animation: aiPulse 2.2s ease-in-out infinite;
}
@keyframes aiFlow { to { --ai-angle: 360deg; } }
@keyframes aiPulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.18); opacity: 1; } }
/* 动效仅在用户允许动画时播放（无障碍：减少动效偏好） */
@media (prefers-reduced-motion: reduce) {
  .ai-badge::before { animation: none; }
  .ai-badge .c-icon { animation: none; }
}
.medal { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tx-2); background: var(--soft-2); border: 1px solid var(--bd); border-radius: 999px; padding: 3px 10px; }
.medal-icon { font-size: 14px; }

/* ---------------- 排行榜插件页 ---------------- */
.rank-hero { padding: 28px; background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%); }
.rank-hero h1 { font-family: var(--serif); font-size: 24px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.rank-hero p { color: var(--tx-2); font-size: 14px; }
.rank-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.rank-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--bd); border-radius: 999px; background: var(--card); color: var(--tx-2); font-size: 13.5px; }
.rank-tab:hover { border-color: var(--ac); color: var(--ac-2); }
.rank-tab.is-on { background: var(--ac); border-color: var(--ac); color: #FAF9F5; }
.rank-tab .rt-ic { display: inline-flex; }
.rank-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-name { font-weight: 600; color: var(--tx-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--tx-3); background: var(--soft); font-family: var(--serif); }
.rank-no.no-1 { color: #8A6B2F; background: #F6EBD2; }
.rank-no.no-2 { color: #6E6E6E; background: #ECECEA; }
.rank-no.no-3 { color: #8A5A3B; background: #F3E1D4; }
.rank-num { font-family: var(--serif); font-size: 16px; color: var(--ac-2); }
.rank-unit { margin-left: 4px; font-size: 12px; color: var(--tx-3); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--ac); color: #FAF9F5;
  border: 1px solid transparent; border-radius: var(--radius-s);
  padding: 9px 22px; font-size: 14px; font-weight: 600;
  font-family: var(--sans); cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--ac-2); color: #FAF9F5; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--soft); color: var(--tx); border-color: var(--bd); }
.btn-ghost:hover { background: var(--soft-2); border-color: var(--bd-2); color: var(--tx); }
.btn-danger-ghost { background: transparent; color: var(--err); border-color: var(--err-soft); }
.btn-danger-ghost:hover { background: var(--err); color: #FAF9F5; border-color: var(--err); }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #A93226; color: #FAF9F5; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: none; background: transparent; color: var(--tx-2);
  cursor: pointer; transition: background .15s, color .15s;
  position: relative;
}
.icon-btn:hover { background: var(--soft); color: var(--tx); }
.icon-btn.is-active { background: var(--ac-soft); color: var(--ac-2); }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  background: rgba(250,249,245,.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.nav-toggle { display: none; } /* 汉堡菜单仅手机端显示（见 720px 断点） */
.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ac); color: #FAF9F5;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .5px; color: var(--tx); }
.brand-name:hover { color: var(--tx); }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 14px; border-radius: var(--radius-s);
  color: var(--tx-2); font-size: 14.5px; font-weight: 500;
  background: none; border: none; cursor: pointer; font-family: var(--sans);
}
.nav-link:hover { background: var(--soft); color: var(--tx); }
.nav-checkin { color: var(--ac-2); }
.nav-drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; min-width: 200px; z-index: 110;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-drop:hover .drop-menu, .user-menu:hover .drop-menu, .nav-drop:focus-within .drop-menu, .user-menu:focus-within .drop-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
/* 点击展开（触屏设备没有 hover，点击切换与 hover 等效） */
.nav-drop.open .drop-menu, .user-menu.open .drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.drop-btn .ic { transition: transform .15s; }
.nav-drop.open .drop-btn .ic { transform: rotate(180deg); }
.drop-menu a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--tx-2); font-size: 14px; }
.drop-menu a:hover { background: var(--soft-2); color: var(--tx); }
.drop-group + .drop-group { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--bd); }
.drop-group-title { font-size: 11.5px; color: var(--tx-3); padding: 4px 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 999px; padding: 0 6px 0 14px; height: 38px;
  transition: border-color .15s, box-shadow .15s;
}
.header-search:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(217,119,87,.12); }
.header-search input[type=search] { border: none; outline: none; background: none; box-shadow: none; padding: 0; width: 170px; font-size: 13.5px; font-family: var(--sans); color: var(--tx); }
.header-search input[type=search]:focus { border: none; box-shadow: none; }
.header-search button { border: none; background: none; color: var(--tx-3); cursor: pointer; display: flex; padding: 6px; border-radius: 50%; }
.header-search button:hover { color: var(--ac-2); }
.auth-btns { display: flex; gap: 8px; }

/* 通知 */
.ntf-wrap { position: relative; }
.ntf-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--err); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.ntf-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 320px; background: var(--card);
  border: 1px solid var(--bd); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 120; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.ntf-wrap.open .ntf-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.ntf-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--bd); font-size: 14px; font-weight: 600; }
.ntf-head a { font-size: 12.5px; font-weight: 400; }
.ntf-list { max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bd-2) transparent; }
.ntf-list::-webkit-scrollbar { width: 6px; }
.ntf-list::-webkit-scrollbar-track { background: transparent; }
.ntf-list::-webkit-scrollbar-thumb { background: var(--bd-2); border-radius: 999px; }
.ntf-list::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }
.ntf-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--soft-2); color: var(--tx-2); }
.ntf-item:hover { background: var(--soft-2); }
.ntf-item .ntf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bd-2); margin-top: 8px; flex-shrink: 0; }
.ntf-item.unread .ntf-dot { background: var(--ac); }
.ntf-item.unread .ntf-title { color: var(--tx); font-weight: 600; }
.ntf-title { display: block; font-size: 13.5px; line-height: 1.5; }
.ntf-time { display: block; font-size: 12px; color: var(--tx-3); }
.ntf-foot { padding: 6px; border-top: 1px solid var(--bd); display: flex; justify-content: center; }
.ntf-foot button { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--tx-3); font-size: 12.5px; font-family: var(--sans); cursor: pointer; padding: 5px 12px; border-radius: 7px; }
.ntf-foot button:hover { background: var(--soft); color: var(--ac-2); }

/* 用户菜单 */
.user-menu { position: relative; }
.user-menu-btn { display: flex; border: none; background: none; cursor: pointer; padding: 2px; border-radius: 50%; }
.user-drop { left: auto; right: 0; min-width: 220px; }
.user-drop-head { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--bd); margin-bottom: 6px; }
.user-drop-name { font-weight: 600; font-size: 14.5px; }
.user-drop-sub { margin-top: 3px; }
.logout-btn { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: none; padding: 8px 12px; border-radius: 7px; color: var(--tx-2); font-size: 14px; cursor: pointer; font-family: var(--sans); }
.logout-btn:hover { background: var(--err-soft); color: var(--err); }
.admin-link { color: var(--ac-2) !important; font-weight: 600; }

/* 顶部横幅 */
.site-banner {
  background: linear-gradient(90deg, var(--ac-soft), #FBF6EA);
  border-bottom: 1px solid #F0DFD6;
  display: flex; align-items: center; position: relative;
}
.site-banner .wrap { display: flex; align-items: center; gap: 8px; padding: 9px 44px 9px 20px; color: var(--ac-2); font-size: 13.5px; }
.site-banner a { font-weight: 600; }
.banner-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--ac-2); cursor: pointer; opacity: .7; }
.banner-close:hover { opacity: 1; }

/* ---------------- 主区域 ---------------- */
.main-area { flex: 1; }
.content-wrap { max-width: 1400px; margin: 0 auto; padding: 30px 24px 56px; }
.alert { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: var(--radius-s); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--err-soft); color: var(--err); border: 1px solid #EAC7BC; }
.alert-success { background: var(--ok-soft); color: var(--ok); border: 1px solid #CBE5D3; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-family: var(--serif); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.more-link { font-size: 13px; color: var(--tx-3); }
.more-link:hover { color: var(--ac-2); }
.empty-box { text-align: center; color: var(--tx-3); padding: 42px 16px; font-size: 14px; }

/* ---------------- 首页 ---------------- */
.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%);
  padding: 36px 34px; flex-wrap: wrap;
}
.hero-text h1 { font-family: var(--serif); font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.hero-text p { color: var(--tx-2); font-size: 15px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-family: var(--serif); font-size: 24px; color: var(--ac-2); }
.hero-stat span { font-size: 12.5px; color: var(--tx-3); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.home-side { position: sticky; top: 80px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.cat-head h2 { font-family: var(--serif); font-size: 18px; display: inline-flex; align-items: center; gap: 7px; }
.cat-icon { display: inline-flex; align-items: center; color: var(--tx-3); }
.cat-icon .c-icon { height: 1.25em; width: 1.25em; }
.cat-desc { font-size: 13px; color: var(--tx-3); }
.cat-forums { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.forum-title-icon { display: inline-flex; align-items: center; margin-right: 8px; }
.forum-title-icon .c-icon { height: 1.2em; width: 1.2em; }
.forum-cell {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--bd); border-radius: var(--radius-s);
  color: var(--tx); transition: border-color .15s, background .15s, transform .15s;
}
.forum-cell:hover { border-color: var(--ac); background: var(--soft-2); transform: translateY(-1px); }
.forum-cell-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--ac-soft); color: var(--ac-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.forum-cell-main { flex: 1; min-width: 0; }
.forum-cell-name { display: block; font-weight: 600; font-size: 14.5px; }
.forum-cell-desc { display: block; font-size: 12.5px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-cell-count { text-align: center; flex-shrink: 0; }
.forum-cell-count strong { display: block; font-family: var(--serif); font-size: 17px; }
.forum-cell-count span { font-size: 11px; color: var(--tx-3); }
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--soft); font-size: 14px; align-items: baseline; }
.hot-list li:last-child { border-bottom: none; }
.hot-list a { color: var(--tx-2); line-height: 1.5; }
.hot-list a:hover { color: var(--ac-2); }
.hot-rank { font-family: var(--serif); font-size: 13px; color: var(--tx-3); width: 18px; text-align: center; flex-shrink: 0; font-style: italic; }
.hot-rank.is-top { color: var(--ac); font-weight: 700; }
.newest-user { font-size: 13.5px; color: var(--tx-2); margin-bottom: 12px; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.pwa-tip { font-size: 13px; color: var(--tx-2); margin-bottom: 12px; }

/* ---------------- 帖子行 ---------------- */
.thread-list { display: flex; flex-direction: column; }
.thread-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 4px; border-bottom: 1px solid var(--soft-2);
}
.thread-row:last-child { border-bottom: none; }
.tr-avatar { flex-shrink: 0; }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-size: 15.5px; font-weight: 600; line-height: 1.5; margin-bottom: 4px; font-family: var(--sans); }
.tr-title a { color: var(--tx); }
.tr-title a:hover { color: var(--ac-2); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; margin-right: 6px; vertical-align: 2px; font-weight: 600; }
.tag-top { background: var(--ac-soft); color: var(--ac-2); }
.tag-essence { background: var(--warn-soft); color: var(--warn); }
.tag-closed { background: var(--soft); color: var(--tx-3); }
.tag-chip { font-size: 12px; color: var(--tx-3); background: var(--soft-2); border: 1px solid var(--bd); border-radius: 999px; padding: 2px 10px; display: inline-block; margin: 0 4px 4px 0; }
.tag-chip:hover { color: var(--ac-2); border-color: var(--ac); }
.tag-chip.is-current { color: var(--ac-2); border-color: var(--ac); background: var(--ac-soft); }

/* 标签聚合页 */
.tag-head { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tag-title { font-size: 22px; display: flex; align-items: center; gap: 4px; margin: 0; }
.tag-group { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-top: 8px; }
.tag-group-label { font-size: 12px; color: var(--tx-3); margin-right: 6px; }
.tag-cloud-card { margin-top: 14px; }
.tag-cloud { padding: 6px 4px 10px; display: flex; flex-wrap: wrap; }
.tag-count { font-size: 11px; color: var(--tx-3); margin-left: 4px; opacity: .75; }

/* 发帖 / 编辑页热门标签快选 */
.tag-suggest { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.tag-add { cursor: pointer; font-family: inherit; }
.tag-add.is-current::after { content: ' ✓'; }
.tr-meta { font-size: 12.5px; color: var(--tx-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tr-meta a { color: var(--tx-3); }
.tr-meta a:hover { color: var(--ac-2); }
.dot { color: var(--bd-2); }
.tr-gifts { display: inline-flex; align-items: center; gap: 3px; color: #B08A3E; }
.tr-stats { display: flex; gap: 14px; flex-shrink: 0; }
.tr-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--tx-3); min-width: 44px; justify-content: center; }
.tr-last { width: 110px; text-align: right; flex-shrink: 0; }
.tr-last-user { display: block; font-size: 12.5px; color: var(--tx-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-last-time { font-size: 11.5px; color: var(--tx-3); }

/* ---------------- 面包屑 / 页头 ---------------- */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--tx-3); flex-wrap: wrap; }
.breadcrumb a { color: var(--tx-3); }
.breadcrumb a:hover { color: var(--ac-2); }
.breadcrumb .sep { color: var(--bd-2); display: flex; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.thread-tools { display: flex; gap: 6px; }

/* ---------------- 版块页 ---------------- */
.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%); }
.forum-head h1 { font-family: var(--serif); font-size: 26px; margin-bottom: 5px; }
.forum-head p { color: var(--tx-2); font-size: 14px; }
.forum-counts { display: flex; gap: 22px; }
.forum-counts span { font-size: 13px; color: var(--tx-3); }
.forum-counts strong { font-family: var(--serif); font-size: 18px; color: var(--tx); margin-right: 4px; }
/* 版主信息 */
.forum-mods { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.forum-mods-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--tx-3); }
.forum-mods-label .ic { stroke: var(--ac-2); }
.forum-mod { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 3px; border-radius: 4px; background: var(--card); border: 1px solid var(--bd); color: var(--tx-2); font-size: 12.5px; transition: border-color .15s, background .15s; }
.forum-mod:hover { border-color: var(--ac); background: var(--soft-2); color: var(--ac-2); }

/* 双栏版块布局（后台「显示与分页 → 版块列表布局」切换；结构与首页 home-grid 一致） */
.forum-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.forum-side { position: sticky; top: 80px; }
.forum-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.forum-side-head h2 { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.forum-side-desc { font-size: 13px; color: var(--tx-2); line-height: 1.7; margin-bottom: 12px; }
.forum-side-counts { display: flex; gap: 26px; padding: 12px 0 14px; border-top: 1px dashed var(--soft); margin-bottom: 14px; }
.forum-side-counts span { font-size: 12px; color: var(--tx-3); }
.forum-side-counts strong { display: block; font-family: var(--serif); font-size: 18px; color: var(--tx); }
.forum-side-mods { display: flex; flex-wrap: wrap; gap: 8px; }
/* 双栏侧栏版主：纯文本展示（去胶囊边框/背景/圆角），悬停仅变主题色 */
.forum-side-mods .forum-mod { padding: 1px 4px 1px 1px; border: none; background: none; border-radius: 0; }
.forum-side-mods .forum-mod:hover { background: none; color: var(--ac-2); }
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
/* 访客布局切换（后台开启后显示）：胶囊分段按钮，与筛选按钮同风格 */
.layout-switch { margin-left: auto; display: inline-flex; gap: 4px; padding: 3px; background: var(--card); border: 1px solid var(--bd); border-radius: 999px; }
.layout-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; border-radius: 999px; color: var(--tx-3); transition: color .15s, background .15s; }
.layout-btn:hover { color: var(--tx); background: var(--soft-2); }
.layout-btn.is-active { background: var(--ac); color: #FAF9F5; }
.filter-btn { padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--tx-2); background: var(--card); border: 1px solid var(--bd); }
.filter-btn:hover { border-color: var(--bd-2); color: var(--tx); }
.filter-btn.is-active { background: var(--ac); border-color: var(--ac); color: #FAF9F5; font-weight: 600; }

/* ---------------- 主题详情页 ---------------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; background: transparent; }
#readingProgressBar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ac), #E2A887); transition: width .1s linear; }
.thread-layout { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
/* 全文模式：侧栏整体隐藏，正文独占整行居中 */
.thread-layout.is-full { grid-template-columns: 1fr; }
.thread-layout.is-full .thread-side { display: none; }
.thread-layout.is-full .thread-main { width: 100%; }
.thread-layout.is-full .thread-card { padding: 36px 44px; }
.thread-layout.is-full .thread-content { font-size: 16.5px; line-height: 2; }
.thread-title { font-family: var(--serif); font-size: 26px; line-height: 1.45; font-weight: 700; margin-bottom: 14px; }
.thread-meta { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--soft); flex-wrap: wrap; }
.tm-info { flex: 1; min-width: 0; }
.tm-name { font-size: 14.5px; }
.tm-name a { font-weight: 600; color: var(--tx); }
.tm-sub { font-size: 12.5px; color: var(--tx-3); display: flex; gap: 5px; flex-wrap: wrap; }
.mod-bar { display: flex; gap: 6px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--bd); color: var(--tx-2); background: var(--card); white-space: nowrap; }
.chip.is-on { background: var(--ac); border-color: var(--ac); color: #FAF9F5; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: #CBE5D3; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #EAD9AE; }
.chip-off { background: var(--soft); color: var(--tx-3); border-color: var(--bd); }
.mod-bar .chip { cursor: pointer; font-family: var(--sans); }
.thread-tags { padding: 14px 0 0; }
.thread-content { padding-top: 18px; font-size: 15.5px; color: #29261B; }
/* 已隐藏主题（管理员预览态）：卡片半透明提示 */
.thread-card.is-hidden-post .thread-content, .thread-card.is-hidden-post .thread-gifts { opacity: .55; }
.thread-hidden-tip { margin-bottom: 16px; }
.thread-content.is-collapsed { max-height: 520px; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.content-expand { text-align: center; padding: 18px 0 6px; }
.thread-actions { display: flex; gap: 8px; padding: 18px 0 4px; border-top: 1px solid var(--soft); margin-top: 16px; flex-wrap: wrap; align-items: center; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--bd); background: var(--card); color: var(--tx-2);
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: var(--sans); transition: all .15s;
}
.action-btn:hover { border-color: var(--ac); color: var(--ac-2); }
.action-btn.is-on { background: var(--ac-soft); border-color: var(--ac); color: var(--ac-2); }
.action-btn.is-on .ic { fill: var(--ac-2); }
.action-btn.is-danger:hover { border-color: var(--err); color: #FAF9F5; background: var(--err); }
.action-btn.is-disabled { opacity: .55; cursor: not-allowed; }
.inline-form { display: inline; }
.thread-gifts { margin-top: 16px; padding: 14px 16px; background: var(--soft-2); border-radius: var(--radius-s); }
.tg-title { font-size: 13px; font-weight: 600; color: #B08A3E; margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.tg-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-item { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--bd); border-radius: 999px; padding: 3px 10px 3px 6px; font-size: 12.5px; }
/* 同一人重复送同一礼物的数量角标 */
.tg-count { background: var(--ac-soft); color: var(--ac-2); font-weight: 700; font-size: 11px; border-radius: 999px; padding: 1px 6px; line-height: 1.4; }
.tg-icon { font-size: 15px; }
.tg-name { color: var(--tx-3); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-nav { display: flex; gap: 10px; margin-top: 18px; }
.tn-item { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--bd); border-radius: var(--radius-s); font-size: 13.5px; color: var(--tx-2); min-width: 0; }
.tn-item span { font-size: 11.5px; color: var(--tx-3); }
.tn-item:hover { border-color: var(--ac); color: var(--ac-2); }
.tn-item.is-next { text-align: right; }
.tn-item.is-empty { visibility: hidden; }

/* 目录 */
.toc-list { list-style: none; font-size: 13.5px; max-height: 380px; overflow-y: auto; }
.toc-list li { padding: 2px 0; }
.toc-list a { display: block; padding: 5px 10px; border-left: 2px solid var(--bd); color: var(--tx-2); line-height: 1.5; border-radius: 0 6px 6px 0; }
.toc-list a:hover { color: var(--ac-2); background: var(--soft-2); }
.toc-list a.is-active { border-left-color: var(--ac); color: var(--ac-2); background: var(--ac-soft); font-weight: 600; }
.toc-l3 a { padding-left: 24px; font-size: 13px; }
.toc-l4 a { padding-left: 38px; font-size: 12.5px; color: var(--tx-3); }

/* 作者卡片 */
.author-card { text-align: center; }
.author-top { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 10px; }
.author-name { font-size: 15px; }
.author-name a { font-weight: 700; color: var(--tx); }
.author-sign { color: var(--tx-3); font-size: 13px; margin: 8px 0; font-style: italic; }
.author-medals { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.author-stats { display: flex; justify-content: center; gap: 18px; padding: 12px 0; border-top: 1px dashed var(--bd); border-bottom: 1px dashed var(--bd); margin-bottom: 12px; }
.author-stats span { font-size: 12px; color: var(--tx-3); display: flex; flex-direction: column; }
.author-stats strong { font-family: var(--serif); font-size: 17px; color: var(--tx); }
.author-btns { display: flex; flex-direction: column; gap: 8px; }
.side-list { list-style: none; font-size: 13.5px; }
.side-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--soft); }
.side-list li:last-child { border: none; }
.side-list a { color: var(--tx-2); line-height: 1.5; }
.side-list a:hover { color: var(--ac-2); }
.side-list span { color: var(--tx-3); font-size: 12px; flex-shrink: 0; }
.forum-mini-desc { font-size: 13px; color: var(--tx-3); margin-bottom: 12px; }

/* 回复 */
.count-badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; background: var(--ac-soft); color: var(--ac-2); border-radius: 999px; font-size: 12px; font-weight: 700; }
.post-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--soft-2); border-radius: var(--radius-s); }
.post-item:last-child { border-bottom: none; }
.post-item.is-target { animation: postFlash 2.5s ease; }
@keyframes postFlash { 0%, 55% { background: var(--ac-soft); } 100% { background: transparent; } }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.post-name a { font-weight: 600; color: var(--tx); font-size: 14px; }
.post-floor { font-size: 12px; color: var(--tx-3); background: var(--soft-2); padding: 1px 8px; border-radius: 4px; }
.post-time { font-size: 12px; color: var(--tx-3); }
.post-reply-to { font-size: 12px; color: var(--tx-3); display: inline-flex; align-items: center; gap: 3px; }
.post-quote { border-left: 3px solid var(--bd-2); background: var(--soft-2); padding: 8px 14px; margin-bottom: 10px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--tx-2); }
.post-quote img.md-em { display: inline-block; vertical-align: middle; height: 28px; width: auto; max-width: 56px; margin: 0 2px; }
.post-content { font-size: 14.5px; color: #29261B; }
.post-actions { display: flex; gap: 6px; margin-top: 10px; }
.pa-btn { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; color: var(--tx-3); font-size: 12.5px; cursor: pointer; padding: 4px 10px; border-radius: 6px; font-family: var(--sans); }
.pa-btn:hover { background: var(--soft); color: var(--tx); }
.pa-btn.is-on { color: var(--ac-2); }
.pa-btn.is-on .ic { fill: var(--ac-2); }
.pa-btn.is-danger:hover { color: #FAF9F5; background: var(--err); }
.reply-box .editor { margin-bottom: 12px; }
.reply-quote { display: flex; align-items: center; gap: 8px; background: var(--ac-soft); color: var(--ac-2); border-radius: var(--radius-s); padding: 8px 14px; font-size: 13px; margin-bottom: 10px; }
/* hidden 属性会被上面的 flex 覆盖，必须显式声明（否则打叉关闭无效、初始也会空显示） */
.reply-quote[hidden] { display: none !important; }
.quote-clear { border: none; background: none; cursor: pointer; color: var(--ac-2); display: flex; padding: 2px; }
.reply-login { display: flex; align-items: center; gap: 10px; color: var(--tx-3); font-size: 14px; padding: 20px; }

/* ---------------- 编辑器 ---------------- */
.editor { border: 1px solid var(--bd); border-radius: var(--radius-s); background: var(--card); overflow: hidden; }
.editor:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(217,119,87,.12); }
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 7px 10px; border-bottom: 1px solid var(--soft); background: var(--soft-2); flex-wrap: wrap; }
.ed-btn { border: none; background: none; cursor: pointer; padding: 5px 9px; border-radius: 6px; font-size: 13px; color: var(--tx-2); font-family: var(--sans); display: inline-flex; align-items: center; gap: 4px; }
.ed-btn:hover { background: var(--soft); color: var(--tx); }
.ed-sep { width: 1px; height: 16px; background: var(--bd); margin: 0 6px; }
.ed-tip { font-size: 11.5px; color: var(--tx-3); margin-left: auto; }
.editor-area { width: 100%; border: none; outline: none; resize: vertical; min-height: 180px; padding: 14px 16px; font-size: 14.5px; font-family: var(--sans); line-height: 1.8; color: transparent; caret-color: transparent; background: transparent; position: relative; z-index: 1; }
.editor-area::placeholder { color: var(--tx-3); opacity: 1; }
/* 选区底色（文字透明，仅显示色带；主题暖橙浅色） */
.editor-area::selection { background: var(--ac-soft); }
/* 镜像层内的自定义光标：原生光标按透明代码文本定位会偏离表情，改由镜像层绘制 */
.ed-caret { display: inline-block; width: 2px; height: 1.4em; background: var(--tx); vertical-align: -0.3em; margin: 0 -1px; animation: edCaretBlink 1.1s steps(1, end) infinite; }
@keyframes edCaretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* 镜像层：与 textarea 同字体同内边距，[em] 表情渲染为小图，文字颜色恢复可见 */
.editor-input-wrap { position: relative; background: var(--card); }
.editor-highlight {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 0;
  padding: 14px 16px; font-size: 14.5px; font-family: var(--sans); line-height: 1.8;
  color: var(--tx); white-space: pre-wrap; overflow-wrap: break-word;
  overflow: hidden; pointer-events: none;
}
.editor-highlight img.md-em { height: 25px; width: auto; max-width: 90px; object-fit: contain; vertical-align: -6px; margin: 0 1px; }
.editor-foot { display: flex; justify-content: flex-end; padding: 8px 10px; border-top: 1px solid var(--soft); background: var(--soft-2); }
.editor-preview { border-top: 1px solid var(--bd); padding: 16px; background: var(--soft-2); max-height: 400px; overflow-y: auto; }
.ed-file { display: none; }

/* 表情按钮锁定态（会员专属时非会员可见） */
.ed-btn.is-locked { color: var(--tx-3); }
/* 表情面板：网格首次展开时由 JS 构建 */
.ed-emoji-panel[hidden] { display: none; }
.ed-emoji-panel { border-bottom: 1px solid var(--soft); background: var(--soft-2); padding: 10px 12px 12px; }
.ed-emoji-locked { margin: 0 0 10px; }
.ed-emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px; max-height: 216px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--bd-2) transparent;
}
.ed-emoji-grid::-webkit-scrollbar { width: 6px; }
.ed-emoji-grid::-webkit-scrollbar-track { background: transparent; }
.ed-emoji-grid::-webkit-scrollbar-thumb { background: var(--bd-2); border-radius: 999px; }
.ed-emoji-grid::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }
.ed-emoji-grid img {
  width: 100%; height: 64px; object-fit: contain;
  background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius-s);
  padding: 3px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.ed-emoji-grid img:hover { border-color: var(--ac); transform: translateY(-1px); }
/* 锁定态预览：模糊不可点 */
.ed-emoji-grid.is-locked img { filter: blur(3px) saturate(.8); pointer-events: none; cursor: not-allowed; }

/* ---------------- 富文本内容 ---------------- */
.rich-text { word-break: break-word; }
.rich-text p { margin: 0 0 14px; }
.rich-text h2, .rich-text h3, .rich-text h4 { font-family: var(--serif); margin: 26px 0 12px; line-height: 1.5; scroll-margin-top: 90px; }
.rich-text h2 { font-size: 21px; border-bottom: 1px solid var(--soft); padding-bottom: 8px; }
.rich-text h3 { font-size: 17.5px; }
.rich-text h4 { font-size: 15.5px; }
.rich-text blockquote { border-left: 3px solid var(--ac); background: var(--soft-2); margin: 14px 0; padding: 10px 18px; border-radius: 0 8px 8px 0; color: var(--tx-2); }
.rich-text blockquote p:last-child { margin-bottom: 0; }
/* 代码块：深底浅字（与 toast 同源的暖黑），language 标签为左上角徽标（仅声明了语言的块显示） */
.rich-text pre.code-block {
  background: #27261F; color: #EDEAE0;
  border: 1px solid #3A362C; border-radius: var(--radius);
  padding: 40px 18px 16px; margin: 14px 0;
  font-size: 14px; line-height: 1.75;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  white-space: pre; word-break: normal; tab-size: 4;
  overflow-x: auto; position: relative;
}
/* 关键修复：重置全局行内 code 样式（浅底+内边距）对代码块的污染，否则浅色文字落在浅色背景上看不清 */
.rich-text pre.code-block code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; display: block; }
.rich-text pre.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 0; left: 0;
  padding: 5px 12px 4px; font-size: 11px; letter-spacing: .8px;
  color: #A8A48F; text-transform: uppercase;
  font-family: var(--sans);
  background: rgba(250,249,245,.07);
  border-right: 1px solid #3A362C; border-bottom: 1px solid #3A362C;
  border-radius: var(--radius) 0 var(--radius) 0;
}
/* 代码选中高亮（深底上默认选中色几乎不可见） */
.rich-text pre.code-block ::selection { background: rgba(217,119,87,.45); }
/* 复制按钮：默认仅微弱可见，悬停/触摸时清晰呈现，复制成功后变主题色 */
.code-copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: rgba(250,249,245,.08); color: #A8A48F;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; opacity: 0; transition: all .15s;
}
.rich-text pre.code-block:hover .code-copy-btn,
.code-copy-btn:focus-visible { opacity: 1; }
.code-copy-btn:hover { background: rgba(250,249,245,.16); color: #EDEAE0; }
.code-copy-btn.is-copied { opacity: 1; background: var(--ac); color: #FAF9F5; }
/* 触屏无悬停：常显（半透明，不抢视觉） */
@media (hover: none) {
  .code-copy-btn { opacity: .75; width: 34px; height: 34px; }
}
.rich-text img { border-radius: var(--radius-s); margin: 8px 0; border: 1px solid var(--bd); }
/* 正文表情（[em] 标签）：内联小尺寸，随内容流动 */
.rich-text img.md-em { display: inline-block; vertical-align: middle; height: 64px; width: auto; max-width: 120px; margin: 2px 4px; }
.rich-text hr { border: none; border-top: 1px solid var(--bd); margin: 22px 0; }
.rich-text a.img-link img, .rich-text p > img { display: block; max-width: 100%; }
.rich-text strong { color: var(--tx); }

/* ---------------- 表单 ---------------- */
.form-card { max-width: 1400px; }
.form-title { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.form-sub { color: var(--tx-3); font-size: 13.5px; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--tx-2); margin-bottom: 6px; }
.req { color: var(--err); }
.opt { color: var(--tx-3); font-weight: 400; font-size: 12px; margin-left: 6px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=url], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 13px; border: 1px solid var(--bd);
  border-radius: var(--radius-s); font-size: 14px; font-family: var(--sans);
  background: var(--card); color: var(--tx); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(217,119,87,.12); }
textarea { resize: vertical; line-height: 1.7; }
select { cursor: pointer; }
input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--bd); border-radius: var(--radius-s); background: var(--card); cursor: pointer; }
input[type=search] { border-radius: 999px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-hint { font-size: 12.5px; color: var(--tx-3); margin-top: 6px; line-height: 1.7; }
.form-sec { font-family: var(--serif); font-size: 16px; margin: 24px 0 14px; padding-top: 18px; border-top: 1px dashed var(--bd); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--tx-2); cursor: pointer; }
.check-label input[type=checkbox], .check-label input[type=radio] { width: auto; accent-color: var(--ac); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.switch-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx-2); cursor: pointer; padding: 4px 0; }
.switch-label input { width: 16px; height: 16px; accent-color: var(--ac); }

/* ---------------- 隐私设置 / 验证码 / 关注按钮 ---------------- */
.alert-warn { background: #FBF3E4; color: #A67C2E; border: 1px solid #EAD9B8; }
.privacy-item { padding: 12px 0; border-bottom: 1px dashed var(--soft); }
.privacy-item:last-of-type { border-bottom: none; }
.privacy-item .form-hint { margin: 4px 0 0 24px; }
/* 隐私保护会员专属锁定横幅（后台"会员权益 → 隐私保护为会员专属"开启时非会员可见） */
.member-locked {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 4px; padding: 13px 16px;
  background: var(--warn-soft); border: 1px solid #EAD9B8; border-radius: var(--radius-s);
  color: #A67C2E;
}
.member-locked > .ic { color: #B7791F; flex: 0 0 auto; }
.member-locked-text { flex: 1; min-width: 0; }
.member-locked-text strong { display: block; font-size: 14px; }
.member-locked-text span { display: block; font-size: 12.5px; opacity: .85; margin-top: 2px; }
/* 锁定态表单：整体淡化、禁止交互 */
.privacy-item.is-locked { opacity: .55; }
.privacy-item.is-locked .switch-label { cursor: not-allowed; }
.code-input-row { display: flex; gap: 10px; }
.code-input-row input { flex: 1; min-width: 0; }
.follow-btn.is-on { background: var(--soft-2); color: var(--tx-3); border-color: var(--bd); }
.author-social { margin-top: -6px; padding-top: 2px; }
/* 用户主页粉丝列表 */
.fans-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fan-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--radius-s); min-width: 0; transition: border-color .15s, background .15s; }
.fan-item:hover { border-color: var(--ac); background: var(--soft-2); }
.fan-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fan-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.fan-time { font-size: 12px; color: var(--tx-3); display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 720px) { .code-input-row { flex-direction: column; } }
.link { color: var(--ac-2); font-size: 13px; }
.check-row { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 16px; }
.money-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* ---------------- 认证页 ---------------- */
.auth-wrap { max-width: 440px; margin: 30px auto; padding: 34px 32px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-family: var(--serif); font-size: 25px; margin-bottom: 6px; }
.auth-head p { color: var(--tx-3); font-size: 13.5px; }
.auth-form .btn { margin-top: 6px; }
.auth-tip { font-size: 12px; color: var(--tx-3); text-align: center; margin-top: 12px; line-height: 1.7; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--tx-3); margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--bd); }

/* ---------------- 用户主页 ---------------- */
.user-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 26px; }
.uh-main { display: flex; gap: 18px; align-items: center; flex: 1; min-width: 260px; }
.uh-info h1 { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; display: flex; align-items: center; flex-wrap: wrap; }
.uh-badges { margin-bottom: 4px; }
.uh-sign { color: var(--tx-3); font-size: 13.5px; font-style: italic; margin-bottom: 4px; }
.uh-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--tx-3); flex-wrap: wrap; }
.uh-meta span { display: inline-flex; align-items: center; gap: 4px; }
.uh-meta a { color: var(--tx-3); word-break: break-all; }
.uh-meta a:hover { color: var(--ac-2); }
.user-bio { font-size: 14px; color: var(--tx-2); line-height: 1.9; word-break: break-word; }
.uh-stats { display: flex; gap: 20px; }
.uh-stats span { font-size: 12px; color: var(--tx-3); display: flex; flex-direction: column; text-align: center; }
.uh-stats strong { font-family: var(--serif); font-size: 20px; color: var(--tx); }
.uh-actions { display: flex; gap: 8px; }
.medals-wall { display: flex; flex-wrap: wrap; gap: 8px; }
.medal-earn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.medal-earn { display: flex; gap: 12px; align-items: center; background: var(--soft-2); border: 1px solid var(--bd); border-radius: var(--radius-s); padding: 12px 14px; }
.medal-earn-icon { font-size: 26px; }
.medal-earn-info strong { display: block; font-size: 14px; }
.medal-earn-info span { font-size: 12px; color: var(--tx-3); }
.gift-log-list { display: flex; flex-direction: column; }
.gift-log-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--soft); font-size: 13.5px; flex-wrap: wrap; }
.gift-log-row:last-child { border: none; }
.gl-icon { font-size: 20px; }
.gl-name { font-weight: 600; min-width: 80px; }
.gl-from { color: var(--tx-3); flex: 1; min-width: 140px; }
.gl-msg { color: var(--tx-2); font-style: italic; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-time { color: var(--tx-3); font-size: 12px; margin-left: auto; }

/* ---------------- Tab ---------------- */
/* 页签自动换行而非横向滚动：任何宽度下全部可见，杜绝导航滚动条 */
.tab-bar { display: flex; flex-wrap: wrap; gap: 6px 4px; border-bottom: 2px solid var(--soft); margin-bottom: 18px; }
.tab-bar-inline { border: none; margin: 0; }
.tab-btn { padding: 9px 18px; font-size: 14px; color: var(--tx-3); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: var(--sans); white-space: nowrap; }
.tab-btn:hover { color: var(--tx); }
.tab-btn.is-active { color: var(--ac-2); font-weight: 600; border-bottom-color: var(--ac); }

/* ---------------- 用户中心 ---------------- */
.uc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
/* min-width:0 防止长内容把 1fr 网格轨道撑破（整页横向溢出的根源） */
.uc-side, .uc-main { min-width: 0; }
.uc-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.uc-user-card { text-align: center; padding: 24px 18px; }
.uc-user-name { font-family: var(--serif); font-size: 17px; margin-top: 12px; }
.uc-user-badges { margin-top: 6px; }
.uc-bals { display: flex; justify-content: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--bd); flex-wrap: wrap; }
.uc-bal strong { font-family: var(--serif); font-size: 16px; color: var(--ac-2); margin-right: 3px; }
.uc-bal { font-size: 12px; color: var(--tx-3); }
.uc-nav { padding: 10px; }
.uc-nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-s); color: var(--tx-2); font-size: 14px; position: relative; }
.uc-nav-link:hover { background: var(--soft-2); color: var(--tx); }
.uc-nav-link.is-active { background: var(--ac-soft); color: var(--ac-2); font-weight: 600; }
.uc-nav-badge { margin-left: auto; background: var(--err); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.uc-overview-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 24px; background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%); flex-wrap: wrap; }
.uc-overview-head h1 { font-family: var(--serif); font-size: 22px; margin-bottom: 2px; }
.uc-overview-head p { color: var(--tx-3); font-size: 13.5px; }
.uc-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.uc-stat { text-align: center; padding: 18px 10px; }
.uc-stat strong { display: block; font-family: var(--serif); font-size: 24px; color: var(--ac-2); }
.uc-stat span { font-size: 12.5px; color: var(--tx-3); }
/* 经验等级卡片（用户中心概览） */
.exp-card { padding: 16px 20px; margin-bottom: 18px; }
.exp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.exp-level { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ac-2); background: var(--ac-soft); border: 1px solid var(--bd-2); border-radius: 999px; padding: 3px 12px; }
.exp-level .ic { color: var(--ac); }
.exp-num { font-size: 12.5px; color: var(--tx-3); }
.exp-bar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.exp-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ac), var(--ac-2)); transition: width .4s ease; }
.uc-vip-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 22px; background: linear-gradient(135deg, #FBF6EA, #F5F0E4); border-color: #EADFC4; flex-wrap: wrap; }
.uc-vip-card.is-plain { background: var(--card); }
.vip-info { display: flex; align-items: center; gap: 12px; color: #B08A3E; }
.vip-info strong { display: block; font-size: 15px; color: #8A6B2F; }
.vip-info span { font-size: 12.5px; color: var(--tx-3); }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.quick-links a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--bd); border-radius: var(--radius-s); color: var(--tx-2); font-size: 13px; }
.quick-links a:hover { border-color: var(--ac); color: var(--ac-2); background: var(--soft-2); }
.uc-ntf-list { display: flex; flex-direction: column; }
.uc-ntf { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--soft); font-size: 14px; color: var(--tx-2); }
.uc-ntf:last-child { border: none; }
.uc-ntf.unread span:first-child { font-weight: 600; color: var(--tx); }
.uc-ntf time { font-size: 12px; color: var(--tx-3); flex-shrink: 0; }
.avatar-edit-row { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.avatar-form .form-hint { margin-top: 8px; }
.upload-btn { position: relative; overflow: hidden; cursor: pointer; }
.uc-balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.uc-balance { padding: 20px; background: linear-gradient(135deg, #FFFFFF, #F7EFE7); }
.bal-name { font-size: 13px; color: var(--tx-3); display: block; }
.bal-num { font-family: var(--serif); font-size: 28px; color: var(--ac-2); }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.frame-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--bd); border-radius: var(--radius-s); background: var(--card); }
.frame-cell.is-wearing { border-color: var(--ac); background: var(--ac-soft); }
/* 头像框选择器折叠：手机默认收起（app.js 控制），桌面默认展开 */
.fp-toggle { display: inline-flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; padding: 4px 2px 10px; font-size: 14px; font-weight: 600; color: var(--tx-1); cursor: pointer; }
.fp-toggle .ic { margin-left: auto; color: var(--tx-3); transition: transform .25s ease; }
.fp-toggle:hover .fp-toggle-state { color: var(--ac-2); }
.fp-toggle-state { font-size: 12.5px; font-weight: 400; color: var(--tx-3); }
.frame-picker-wrap.is-folded .frame-grid { display: none; }
.frame-picker-wrap.is-folded .fp-toggle .ic { transform: rotate(180deg); }
.frame-name { font-size: 13.5px; font-weight: 600; }
.frame-cond { font-size: 12px; color: var(--tx-3); }
.all-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.all-medal { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 8px; border: 1px dashed var(--bd); border-radius: var(--radius-s); text-align: center; opacity: .55; }
.all-medal.is-owned { opacity: 1; border-style: solid; background: var(--soft-2); }
.all-medal-icon { font-size: 26px; }
.all-medal-name { font-size: 13.5px; font-weight: 600; }
.all-medal-cond { font-size: 11.5px; color: var(--tx-3); }
.invite-code { font-size: 14px; letter-spacing: 1px; background: var(--soft-2); padding: 2px 8px; border-radius: 4px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--tx-3); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--bd); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--soft-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--soft-2); }
.cell-user { display: flex; align-items: center; gap: 8px; }

/* ---------------- 签到 ---------------- */
.checkin-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 26px; background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%); flex-wrap: wrap; }
.checkin-hero h1 { font-family: var(--serif); font-size: 24px; margin-bottom: 6px; }
.checkin-hero p { color: var(--tx-2); font-size: 14px; }
.checkin-hero strong { color: var(--ac-2); font-family: var(--serif); font-size: 18px; }
.ch-vip { display: inline-flex; align-items: center; gap: 5px; color: #B08A3E; font-size: 13px; margin-top: 6px; }
.ch-side { text-align: center; }
.ch-reward { margin-top: 10px; font-size: 13px; color: var(--tx-2); }
.checkin-btn { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,87,.35); } 50% { box-shadow: 0 0 0 10px rgba(217,119,87,0); } }
.checkin-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.cal-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 4px; }
.cal-quota { font-size: 12px; color: var(--tx-3); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cal-layout { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.calendar { flex: 0 1 336px; max-width: 336px; user-select: none; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11.5px; color: var(--tx-3); font-weight: 600; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--tx-2); background: var(--soft-2); border-radius: 7px; position: relative; border: 1.5px solid transparent; padding: 0; font-family: inherit; }
.cal-day.is-empty { background: none; }
.cal-day.is-today { border-color: var(--ac); color: var(--ac-2); font-weight: 700; }
.cal-day.is-checked { background: var(--ac); color: #FAF9F5; font-weight: 600; }
.cal-mark { position: absolute; top: 2px; right: 4px; font-size: 9px; font-style: normal; }
.cal-day.is-missed { background: none; border: 1.5px dashed var(--ac); color: var(--tx-3); cursor: pointer; }
.cal-day.is-missed:hover { background: var(--ac-soft); border-style: solid; color: var(--ac-2); }
.cal-badge { position: absolute; bottom: 2px; right: 4px; font-size: 9px; font-style: normal; line-height: 1; color: var(--ac); }
.cal-day.is-missed:hover .cal-badge { color: var(--ac-2); }
.cal-aside { flex: 1 1 200px; min-width: 190px; }
.cal-aside h3 { font-size: 13.5px; margin: 0 0 8px; display: flex; align-items: center; gap: 5px; }
.cal-aside h3:not(:first-child) { margin-top: 18px; }
.cal-rules { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--tx-3); line-height: 1.9; }
.cal-rules li { padding-left: 13px; position: relative; }
.cal-rules li::before { content: '·'; position: absolute; left: 2px; color: var(--bd-2); }
.cal-status { color: var(--tx-2); font-weight: 600; padding-left: 0 !important; }
.cal-status::before { content: none !important; }
.cal-status .ic { margin-right: 3px; }
.cal-status.is-ok { color: #5B8A72; }
.cal-status.is-warn { color: #C0636C; }
.checkin-rank { list-style: none; }
.checkin-rank li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--soft); font-size: 13.5px; }
.checkin-rank li:last-child { border: none; }
.ck-rank { font-family: var(--serif); font-style: italic; color: var(--tx-3); width: 20px; text-align: center; }
.ck-rank.is-top { color: var(--ac); font-weight: 700; }
.ck-user { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--tx-2); }
.ck-user:hover { color: var(--ac-2); }
.ck-days, .ck-total { color: var(--tx-3); font-size: 12px; white-space: nowrap; }

/* ---------------- 商城 ---------------- */
.shop-hero { padding: 28px; background: linear-gradient(135deg, #FFFFFF 0%, #F7EFE7 100%); }
.shop-hero h1 { font-family: var(--serif); font-size: 24px; margin-bottom: 6px; }
.shop-hero p { color: var(--tx-2); font-size: 14px; }
.vip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.vip-grid .vip-card { border: 1px solid var(--bd); border-radius: var(--radius); background: var(--card); padding: 24px; text-align: center; margin: 0; box-shadow: none; display: flex; flex-direction: column; gap: 4px; }
.vip-grid .vip-card.is-current { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(217,119,87,.14); }
.vip-header { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--soft); margin-bottom: 12px; }
.vip-icon { display: flex; align-items: center; justify-content: center; height: 80px; }
.vip-icon .c-icon { height: 72px !important; width: 72px !important; object-fit: contain; }
.vip-icon .ic { font-size: 58px; line-height: 1; }
.vip-header h3 { font-family: var(--serif); font-size: 18px; margin: 0; }
.vip-price { font-family: var(--serif); font-size: 26px; color: var(--ac-2); margin: 0; }
.vip-perks { list-style: none; text-align: left; font-size: 13px; color: var(--tx-2); margin: 0 0 16px; flex: 1; }
.vip-perks li { padding: 5px 0; border-bottom: 1px dashed var(--soft); }
.vip-perks li:last-child { border: none; }
.shop-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
/* 「去获取」等入口跳转 shop.html#frames：区块标题不被 sticky 导航遮挡 */
#frames { scroll-margin-top: 80px; }
/* 锚点跳转（购买后 #frame-{id}）：目标卡片完整落入视口而非贴边截断，上下留呼吸空间 */
.shop-frame { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px; border: 1px solid var(--bd); border-radius: var(--radius-s); scroll-margin-top: 90px; scroll-margin-bottom: 60px; }
/* 锚点跳转后的目标卡片高亮（购买/定位头像框时） */
.shop-frame:target { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(217,119,87,.14); }
@media (prefers-reduced-motion: no-preference) {
  .shop-frame:target { animation: frameFlash 1.6s ease 3; }
  @keyframes frameFlash { 0%,100% { box-shadow: 0 0 0 3px rgba(217,119,87,.14); } 50% { box-shadow: 0 0 0 6px rgba(217,119,87,.28); } }
}
.sf-name { font-weight: 600; font-size: 14px; }
.sf-desc { font-size: 12.5px; color: var(--tx-3); }
.shop-balances { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ---------------- 卡密 ---------------- */
.redeem-hero { display: flex; gap: 18px; align-items: center; }
.rh-icon { width: 60px; height: 60px; border-radius: 14px; background: var(--ac-soft); color: var(--ac-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.redeem-hero h1 { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.redeem-hero p { color: var(--tx-3); font-size: 13.5px; }
.code-input { font-family: "SF Mono", Consolas, monospace; letter-spacing: 2px; font-size: 17px; text-align: center; text-transform: uppercase; padding: 13px; }

/* ---------------- 礼物 ---------------- */
.gifts-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.gift-catalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gift-catalog-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; background: var(--soft-2); border-radius: var(--radius-s); font-size: 12px; color: var(--tx-3); }
.gift-catalog-item span { font-size: 22px; }
.gift-catalog-item em { font-style: normal; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gift-item { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1.5px solid var(--bd); border-radius: var(--radius-s); padding: 12px 6px; cursor: pointer; transition: border-color .15s, background .15s; }
.gift-item:hover { border-color: var(--ac); }
.gift-item:has(input:checked) { border-color: var(--ac); background: var(--ac-soft); }
.gift-item input { display: none; }
.gift-icon { font-size: 26px; }
.gift-name { font-size: 13px; font-weight: 600; }
.gift-price { font-size: 11.5px; color: var(--tx-3); }

/* ---------------- 搜索 ---------------- */
.search-big { display: flex; align-items: center; gap: 10px; padding: 10px; }
.search-big input { border: none; background: none; font-size: 16px; flex: 1; padding: 6px 8px; border-radius: 8px; }
.search-big input:focus { box-shadow: none; }
.search-tips ul { margin-left: 20px; color: var(--tx-2); font-size: 14px; }
.search-tips h2 { margin-bottom: 10px; }

/* ---------------- 公告 ---------------- */
.ann-list { display: flex; flex-direction: column; }
.ann-row { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px dashed var(--soft); color: var(--tx); }
.ann-row:last-child { border: none; }
.ann-row:hover .ann-title { color: var(--ac-2); }
.ann-icon { color: var(--ac); display: flex; }
.ann-title { flex: 1; font-weight: 500; }
.ann-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--tx-3); flex-shrink: 0; }
.ann-detail-title { font-family: var(--serif); font-size: 26px; line-height: 1.5; margin: 8px 0 10px; }
.ann-detail-meta { display: flex; gap: 16px; color: var(--tx-3); font-size: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--soft); margin-bottom: 18px; }
.ann-detail-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- 通知页 ---------------- */
.ntf-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ntf-tools .filter-bar { margin-bottom: 0; }
.ntf-full-list { display: flex; flex-direction: column; }
.ntf-full { display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--soft-2); border-radius: var(--radius-s); transition: background .15s; }
.ntf-full:last-child { border-bottom: none; }
.ntf-full-link { display: flex; gap: 14px; padding: 14px 8px 14px 6px; color: var(--tx-2); flex: 1; min-width: 0; border-radius: var(--radius-s); }
.ntf-full-link:hover { background: var(--soft-2); }
.ntf-full.unread strong { color: var(--tx); }
.ntf-full-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ac); flex-shrink: 0; margin-top: 7px; }
.ntf-full-icon { color: var(--tx-3); display: flex; margin-top: 3px; }
.ntf-full.unread .ntf-full-icon { color: var(--ac); }
.ntf-full-body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; flex: 1; min-width: 0; }
.ntf-full-body span { color: var(--tx-3); font-size: 13px; }
.ntf-full-body time { font-size: 12px; color: var(--tx-3); }
.ntf-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0; align-self: center;
  border: none; background: none; color: var(--bd-2); cursor: pointer;
  border-radius: 50%; opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
}
.ntf-full:hover .ntf-del, .ntf-del:focus-visible { opacity: 1; }
.ntf-del:hover { background: var(--err-soft); color: var(--err); }
.ntf-del:active { transform: scale(.92); }
/* 触屏设备没有 hover，删除按钮常显 */
@media (hover: none) {
  .ntf-del { opacity: .55; }
}

/* ---------------- 错误页 ---------------- */
.error-page { text-align: center; padding: 70px 16px; }
.error-code { font-family: var(--serif); font-size: 80px; color: var(--ac-soft); font-weight: 700; line-height: 1; margin-bottom: 10px; -webkit-text-stroke: 2px var(--ac); }
.error-page h1 { font-family: var(--serif); font-size: 24px; margin-bottom: 8px; }
.error-page p { color: var(--tx-3); margin-bottom: 24px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; margin: 20px 0 8px; flex-wrap: wrap; justify-content: center; }
.pager-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border: 1px solid var(--bd); border-radius: 8px; font-size: 13.5px; color: var(--tx-2); background: var(--card); }
.pager-btn:hover { border-color: var(--ac); color: var(--ac-2); }
.pager-btn.is-current { background: var(--ac); border-color: var(--ac); color: #FAF9F5; font-weight: 600; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-ellipsis { align-self: center; color: var(--tx-3); padding: 0 2px; }

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--bd); background: var(--soft-2); margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 20px 14px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-name { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.footer-desc { font-size: 12.5px; color: var(--tx-3); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--tx-3); }
.footer-links a:hover { color: var(--ac-2); }
.footer-bottom { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding: 14px 20px 22px; border-top: 1px solid var(--bd); font-size: 12.5px; color: var(--tx-3); }
.footer-bottom a { color: var(--tx-3); }

/* 页面加载耗时徽标（后台"基本设置 → 显示页面加载耗时"开关） */
.perf-badge {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--tx-3); font-size: 12px; cursor: pointer;
  position: relative; user-select: none; -webkit-user-select: none;
}
.perf-badge:hover { color: var(--tx-2); }
.perf-badge .ic { color: var(--ac); }
.perf-detail {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 120;
  min-width: 168px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; color: var(--tx-2);
  cursor: default; animation: fadeIn .15s ease;
}
/* hidden 属性会被上面的 flex 覆盖，必须显式声明 */
.perf-detail[hidden] { display: none !important; }
.perf-detail div { display: flex; justify-content: space-between; gap: 18px; }
.perf-detail b { color: var(--tx); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- 悬浮组件 ---------------- */
.back-top {
  position: fixed; right: 22px; bottom: 26px;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--bd); color: var(--tx-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden;
  transform: translateY(8px); transition: all .2s; z-index: 90;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { color: var(--ac-2); border-color: var(--ac); }

/* PWA 安装浮窗卡片（后台"PWA 应用 → 安装引导样式"选择"浮窗卡片"时启用） */
.pwa-float {
  position: fixed; left: 50%; bottom: 26px; z-index: 95;
  width: min(calc(100vw - 44px), 400px);
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 16px;
  transform: translateX(-50%) translateY(12px); opacity: 0; visibility: hidden;
  animation: pwaFloatIn .3s ease forwards;
}
.pwa-float[hidden] { display: none; }
/* 关键：类样式（.btn 的 inline-flex / .pwa-float-ios 的 flex）会覆盖 hidden 属性的 UA 默认 display:none，
   导致"一键安装"按钮与 iOS 引导同时显示，必须显式禁止 */
.pwa-float [hidden] { display: none !important; }
@keyframes pwaFloatIn { to { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); } }
.pwa-float-head { display: flex; align-items: center; gap: 12px; }
.pwa-float-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ac); color: #FAF9F5;
  display: flex; align-items: center; justify-content: center;
}
.pwa-float-title { flex: 1 1 auto; min-width: 0; }
.pwa-float-title strong { display: block; font-size: 15px; color: var(--tx); }
.pwa-float-title span { display: block; font-size: 12.5px; color: var(--tx-3); margin-top: 2px; }
.pwa-float-close { flex: 0 0 auto; color: var(--tx-3); }
.pwa-float-close:hover { color: var(--tx); }
.pwa-float-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pwa-float-guide { display: flex; flex-direction: column; gap: 8px; }
.pwa-float-guide p { margin: 0; }
.guide-label { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--tx-3); }
.guide-label::before, .guide-label::after { content: ""; flex: 1; height: 1px; background: var(--bd); }
.pwa-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--tx-2);
  background: var(--bg); border: 1px solid var(--bd); border-radius: 10px;
  padding: 8px 12px;
}
.pwa-step svg { color: var(--ac); flex: 0 0 auto; }

.toast-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); }
.toast { background: #27261F; color: #FAF9F5; border-radius: 10px; padding: 11px 20px; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 100%; text-align: center; }
.toast.toast-ok { background: #1F4A30; }
.toast.toast-err { background: #5C221A; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 弹窗 ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(25,24,23,.45);
  backdrop-filter: blur(3px); z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .18s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 86vh; display: flex; flex-direction: column; animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--bd); }
.modal-head h3 { font-family: var(--serif); font-size: 17px; display: flex; align-items: center; gap: 7px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--bd); }

/* 统一确认弹窗 */
.confirm-box { max-width: 420px; }
.confirm-msg { font-size: 14.5px; color: var(--tx-2); line-height: 1.8; word-break: break-word; white-space: pre-line; }
.confirm-box.is-danger #confirmTitle { color: var(--err); }
.confirm-box.is-danger #confirmTitle .ic { fill: none; stroke: var(--err); }
.confirm-box.is-danger .modal-head h3 { gap: 8px; }

/* 友情链接（首页侧栏卡片） */
.friend-links { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 13px;
  color: var(--tx-2);
  border: 1px solid transparent; border-radius: var(--radius-s);
  transition: color .15s, border-color .15s;
}
.friend-link .ic { color: var(--tx-3); }
.friend-link:hover { color: var(--ac-2); border-color: var(--ac); }
.friend-link:hover .ic { color: var(--ac); }

/* 帖子分享面板 */
.share-box { max-width: 430px; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row input { flex: 1; min-width: 0; background: var(--soft); }
.share-link-row .btn { flex: 0 0 auto; }
.share-sites { display: flex; gap: 10px; margin-top: 14px; }
.share-site {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border: 1px solid var(--bd); border-radius: var(--radius);
  font-size: 12.5px; color: var(--tx-2); background: var(--card);
  transition: border-color .15s, color .15s;
}
.share-site svg { color: var(--ac); }
.share-site:hover { border-color: var(--ac); color: var(--ac-2); }
.share-qrcode {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--bd);
}
/* 隐藏时必须显式覆盖 display（flex 类样式会使 hidden 属性失效） */
.share-qrcode[hidden] { display: none !important; }
.share-qrcode img { width: 148px; height: 148px; padding: 6px; background: #fff; border: 1px solid var(--bd); border-radius: var(--radius); }
.share-qrcode p { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--tx-3); }
.share-qrcode p svg { color: var(--ac); }

/* ---------------- 移动端目录抽屉 ---------------- */
.toc-drawer-overlay { position: fixed; inset: 0; background: rgba(25,24,23,.4); z-index: 240; animation: fadeIn .18s ease; }
.toc-drawer { position: fixed; left: 0; top: 0; bottom: 0; width: min(78vw, 320px); background: var(--card); z-index: 245; padding: 18px; overflow-y: auto; box-shadow: var(--shadow-lg); animation: drawerIn .2s ease; }
@keyframes drawerIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toc-drawer h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .home-grid, .checkin-grid, .gifts-grid, .forum-layout { grid-template-columns: 1fr; }
  .home-side, .forum-side { position: static; }
  .thread-layout { grid-template-columns: 1fr; }
  .thread-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .tr-last { display: none; }
  .uc-layout { grid-template-columns: 1fr; }
  .uc-side { position: static; }
  /* 小屏：页签改为自动换行的胶囊，全部可见、杜绝横向溢出 */
  .uc-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .uc-nav-link { background: var(--soft-2); border-radius: 999px; white-space: nowrap; }
  .uc-nav-badge { margin-left: 4px; }
  .uc-user-card { display: none; }
  .uc-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  /* 代码块小屏：字号与内边距收紧，横向滚动查看长行 */
  .rich-text pre.code-block { font-size: 13px; padding: 36px 12px 12px; line-height: 1.7; }
  .wrap { padding: 0 14px; }
  .content-wrap { padding: 16px 14px 36px; }
  .card { padding: 16px; }
  .nav-toggle { display: inline-flex; }
  /* 手机端主导航隐藏后，通知/头像组靠 margin-left:auto 推到右侧，品牌标识绝对定位居中（锚定 sticky 顶栏，不干扰主导航下拉的定位锚点），形成「☰ ··· 品牌 ··· 🔔 头像」布局 */
  .header-right { margin-left: auto; }
  .brand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin-right: 0; }
  .main-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--bd);
    flex-direction: column; align-items: stretch; padding: 10px 14px 14px;
    gap: 2px; box-shadow: var(--shadow-lg); z-index: 105;
  }
  .main-nav.open { display: flex; }
  /* 手机端分类列表默认收起，点击“版块”按钮展开/收起 */
  .nav-drop .drop-menu { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; border-top: 1px dashed var(--bd); border-radius: 0; margin-top: 4px; }
  .nav-drop.open .drop-menu { display: block; }
  .drop-btn { width: 100%; justify-content: space-between; }
  .header-search input[type=search] { width: 100px; }
  .brand-name { display: none; }
  .home-hero { padding: 22px 18px; }
  .hero-text h1 { font-size: 24px; }
  .hero-stats { gap: 16px; }
  .cat-forums { grid-template-columns: 1fr; }
  .forum-head { padding: 18px; }
  .forum-head h1 { font-size: 21px; }
  .thread-row { gap: 10px; padding: 13px 2px; }
  .tr-stats { display: none; }
  .thread-card { padding: 16px; }
  .thread-title { font-size: 21px; }
  .thread-layout.is-full .thread-card { padding: 18px; }
  .thread-side { grid-template-columns: 1fr; }
  .thread-nav { flex-direction: column; }
  /* 竖排后上下篇统一左对齐（原“下一篇”右对齐在竖排下呈错位观感），空占位不占行高 */
  .thread-nav .tn-item.is-next { text-align: left; }
  .thread-nav .tn-item.is-empty { display: none; }
  /* 发布者信息：头像缩小，管理按钮独占一行，时间信息内联自然排列 */
  .thread-meta { align-items: flex-start; gap: 10px; }
  .tm-author .avatar { width: 36px; height: 36px; }
  .mod-bar { flex-basis: 100%; margin-top: 2px; }
  .tm-sub { display: block; line-height: 1.75; }
  .tm-sub > span { display: inline; margin-right: 12px; }
  .tm-sub .dot { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  /* thread-tools 隐藏后 page-head 只剩面包屑，去掉 space-between 右侧空白 */
  .page-head { justify-content: flex-start; }
  /* 页脚换行后耗时徽标位置偏左，绝对定位弹层会超出视口左缘；改为 fixed 屏幕居中保证完整可见 */
  .perf-detail {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    min-width: 0;
  }
  .uh-stats { gap: 12px; }
  .user-hero { padding: 18px; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-box { max-height: 82vh; border-radius: 16px 16px 0 0; }
  .editor-area { min-height: 140px; }
  .ed-tip { display: none; }
  .gift-grid { grid-template-columns: repeat(2, 1fr); }
  /* 通知下拉：固定定位铺满屏宽（锚定铃铛会让面板左缘超出屏幕导致显示不全） */
  .ntf-panel {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
  }
  /* 矮屏/横屏下列表高度自适应，面板不超出屏幕底部 */
  .ntf-list { max-height: min(360px, 56vh); }
  /* 通知页小屏：工具栏换行铺满，按钮等宽 */
  .ntf-tools { width: 100%; }
  .ntf-tools .filter-bar { flex: 1; }
  .ntf-tools .btn { flex: 1; }
  .ntf-full-link { padding: 12px 4px 12px 2px; gap: 10px; }
  .ntf-full-body { font-size: 13.5px; }
  .ntf-full-body span { font-size: 12.5px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .vip-grid { grid-template-columns: 1fr; }
  .auth-wrap { padding: 24px 20px; margin: 12px auto; }
  .checkin-hero { flex-direction: column; align-items: flex-start; }
  .cal-layout { flex-direction: column; gap: 18px; }
  .calendar { flex: 1 1 auto; max-width: none; width: 100%; }
  .cal-day { font-size: 12px; height: 34px; }
  .back-top { right: 14px; bottom: 18px; }
  /* 浮窗上移避开回到顶部按钮，缩小左右留白 */
  .pwa-float { bottom: 78px; width: calc(100vw - 32px); }

  /* ---- 用户中心小屏优化 ---- */
  /* 顶部页签：换行胶囊更紧凑 */
  .uc-nav { gap: 5px; padding: 8px; }
  .uc-nav-link { padding: 7px 11px; font-size: 13px; gap: 5px; }
  /* 卡片密度 */
  .uc-main .card { padding: 16px; }
  .uc-main .card-head { margin-bottom: 12px; }
  /* 概览 */
  .uc-overview-head { padding: 18px 16px; }
  .uc-overview-head h1 { font-size: 19px; }
  .uc-overview-head .btn { width: 100%; }
  .uc-stat { padding: 14px 8px; }
  .uc-stat strong { font-size: 20px; }
  .uc-vip-card { padding: 14px 16px; }
  .uc-vip-card .btn { width: 100%; }
  .quick-links { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .quick-links a { padding: 12px 4px; font-size: 12px; gap: 6px; }
  .uc-balance { padding: 14px 16px; }
  .bal-num { font-size: 24px; }
  /* 表单主按钮铺满，方便点按 */
  .uc-main .form-actions .btn { width: 100%; }
  /* 财富明细 / 邀请码表格：转卡片式堆叠排版，免横向滚动 */
  .uc-main .table-wrap { overflow-x: visible; }
  .uc-main .table, .uc-main .table tbody { display: block; }
  .uc-main .table thead { display: none; }
  .uc-main .table tr { display: block; border: 1px solid var(--bd); border-radius: var(--radius-s); padding: 2px 12px; margin-bottom: 10px; }
  .uc-main .table tr:last-child { margin-bottom: 0; }
  .uc-main .table tr:hover td { background: none; }
  .uc-main .table td { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--soft); }
  .uc-main .table td:last-child { border-bottom: none; }
  .uc-main .table td::before { content: attr(data-label); flex-shrink: 0; font-size: 12px; color: var(--tx-3); }
  /* 礼物记录：首行图标+名称+时间，下来两行对象与留言 */
  .gift-log-row { flex-wrap: wrap; align-items: flex-start; row-gap: 3px; }
  .gl-name { min-width: 0; }
  .gl-time { order: 2; margin-left: auto; }
  .gl-from { order: 3; flex: 1 1 100%; min-width: 0; margin-left: 32px; }
  .gl-msg { order: 4; flex: 1 1 100%; max-width: none; margin-left: 32px; white-space: normal; overflow: visible; text-overflow: clip; }
  /* 收藏列表：回复/浏览换行到第二行展示（与正文对齐） */
  .uc-main .thread-row { flex-wrap: wrap; row-gap: 6px; }
  .uc-main .tr-stats { display: flex; order: 3; flex-basis: 100%; gap: 16px; padding-left: 54px; }
  .uc-main .tr-stat { min-width: 0; justify-content: flex-start; }
  /* 长串内容（长标题/邀请码/链接等）允许在任意字符处断行，防止撑破容器 */
  .uc-main .tr-title, .uc-main .tr-meta, .gl-from, .gl-msg,
  .uc-main .table td, .invite-code { overflow-wrap: anywhere; }
  /* 会员商城卡片适配 */
  .vip-grid { grid-template-columns: 1fr; }
  .vip-grid .vip-card { padding: 20px; }
  .vip-icon { height: 64px; }
  .vip-icon .c-icon { height: 56px !important; width: 56px !important; }
  .vip-icon .ic { font-size: 44px; }
  .vip-header h3 { font-size: 17px; }
  .vip-price { font-size: 24px; }
}
@media (max-width: 480px) {
  .header-search { display: none; }
  .hero-stats { width: 100%; justify-content: space-between; }
  .tr-avatar { display: none; }
  .grid5 { grid-template-columns: 1fr 1fr; }
  .uc-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .gift-catalog { grid-template-columns: repeat(2, 1fr); }
  /* 小屏收藏行头像隐藏，统计不再缩进 */
  .uc-main .tr-stats { padding-left: 0; }
}

/* 打印 */
@media print {
  .site-header, .site-footer, .thread-actions, .reply-section, .reply-box, .thread-side, .back-top, .pager, .site-banner, .pwa-float, .code-copy-btn { display: none !important; }
  body { background: #fff; }
  /* 代码块打印：深底改为白底黑字细边框（浏览器默认不打印背景色，需显式覆盖文字颜色） */
  .rich-text pre.code-block { background: #fff; color: #191817; border-color: #DDD9CB; padding: 12px 14px; }
  .rich-text pre.code-block[data-lang]::before { color: #8A8672; background: none; border-color: #DDD9CB; }
}
