/* =========================================================
   自研论坛全局样式
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);

  /* ===== 通用组件变量（主题可覆盖，用于适配控件） ===== */
  --subtle-bg: #f8fafc;
  --subtle-text: #94a3b8;
  --input-bg: #ffffff;
  --danger-dark: #b91c1c;
  --flash-success-bg: #f0fdf4; --flash-success-border: #bbf7d0; --flash-success-color: #166534;
  --flash-warning-bg: #fffbeb; --flash-warning-border: #fde68a; --flash-warning-color: #92400e;
  --flash-error-bg: #fef2f2;   --flash-error-border: #fecaca;   --flash-error-color: #991b1b;
  --form-error-bg: #fef2f2;
  --notice-bg: #eff6ff; --notice-border: #bfdbfe; --notice-color: #1e40af;
  --code-bg: #eef2f7; --code-color: #c0263d;
  --blockquote-bg: #f5f7fb; --blockquote-color: #475569;
  --tag-top-bg: #fef3c7; --tag-top-color: #92400e;
  --tag-essence-bg: #fee2e2; --tag-essence-color: #991b1b;
  --badge-green-bg: #dcfce7; --badge-green-color: #166534;
  --badge-red-bg: #fee2e2; --badge-red-color: #991b1b;
  --badge-blue-bg: #dbeafe; --badge-blue-color: #1e40af;
  --badge-gray-bg: #f1f5f9; --badge-gray-color: #475569;
  --role-badge-bg: #f1f5f9;
  --disabled-color: #cbd5e1;
  --ud-hover-bg: #f1f5f9; --ud-danger-hover-bg: #fef2f2;
  --fmt-bg: #f8fafc;
  --ad-bg: #ffffff; --ad-footer-bg: #fafbfc;
  --rank-no-bg: #f1f5f9; --rank-top-bg: #fef3c7; --rank-top-color: #b45309;
  --notice-tag-bg: #fef3c7; --notice-tag-color: #b45309;
  --btn-signin-bg: #fff3e0; --btn-signin-color: #e8590c; --btn-signin-border: #ffe0b2;
  --btn-signin-hover-bg: #fef3c7; --btn-signin-hover-border: #f59e0b;
  --toast-bg: #ffffff; --toast-border: #e2e8f0; --toast-title: #b91c1c; --toast-text: #334155;
  --reward-claimed-bg: #e8f5e9; --reward-claimed-color: #2e7d32;
  --reward-expired-bg: #f5f5f5; --reward-expired-color: #9e9e9e;

  /* ===== 设置页（Edge 风格）变量 ===== */
  --se-bg: #ffffff; --se-border: #e5e7eb; --se-row-border: #f3f4f6;
  --se-title: #111827; --se-label: #374151; --se-hint: #6b7280; --se-text: #1f2937;
  --se-nav-hover-bg: #f3f4f6; --se-nav-active-bg: #eef2ff; --se-accent: #2563eb;
  --se-accent-soft: rgba(37, 99, 235, .12);
  --se-search-bg: #f3f4f6;
  --se-input-bg: #ffffff; --se-input-border: #d1d5db; --se-input-color: #1f2937;
  --se-alert-err-bg: #fef2f2; --se-alert-err-color: #b91c1c; --se-alert-err-border: #fecaca;
  --se-alert-ok-bg: #f0fdf4; --se-alert-ok-color: #15803d; --se-alert-ok-border: #bbf7d0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 34px; height: 64px; }
/* 顶栏防挤压：品牌/导航文字禁止竖排，导航不收缩，搜索框弹性伸缩 */
.header-inner { flex-wrap: nowrap; }
.header-inner .brand,
.site-header .main-nav a,
.site-header .user-menu-name { white-space: nowrap; }
.site-header .main-nav { flex-shrink: 0; }
.site-header .search-form { flex: 1 1 150px; min-width: 90px; }
.site-header .search-form input { min-width: 0; }
.site-header .search-form button { flex-shrink: 0; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.brand:hover { color: var(--primary); }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.admin-brand-logo { width: 22px; height: 22px; border-radius: 6px; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { color: var(--text-muted); font-weight: 500; padding: 8px 12px; border-radius: 6px; transition: background .15s, color .15s; }
.main-nav a:hover { color: var(--primary); background: rgba(74, 124, 247, .08); }
/* 搜索框占据导航与右区之间的弹性空间 */
.search-form { margin-left: auto; }
.header-right { display: flex; align-items: center; gap: 10px; }
/* 消息铃铛 */
.bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--text-muted);
  text-decoration: none; transition: background .15s, color .15s;
}
.bell:hover { background: rgba(15, 23, 42, .05); color: var(--text); }
.bell-dot {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 600; line-height: 17px;
  border-radius: 9px; text-align: center; border: 2px solid var(--card, #fff);
}
.search-form { display: flex; }
.search-form input {
  width: 220px; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 6px 0 0 6px; outline: none; font-size: 13px;
}
.search-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 124, 247, .12); }
.search-form button {
  padding: 7px 14px; border: 1px solid var(--primary); background: var(--primary);
  color: #fff; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 13px;
}
.user-box { display: flex; align-items: center; gap: 16px; }
.user-name { font-weight: 600; color: var(--text); }

/* ---------- 用户区：头像 + 下拉菜单 ---------- */
.user-menu { position: relative; display: flex; align-items: center; }
.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 5px 8px; border-radius: 8px; color: var(--text); font: inherit;
  transition: background .15s;
}
.user-menu-trigger:hover { background: rgba(15, 23, 42, .05); }
.user-menu-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(15, 23, 42, .08); flex-shrink: 0; font-size: 14px;
}
.user-menu-name { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1; }
.user-menu-caret { color: var(--text-muted); transition: transform .18s; }
.user-menu-trigger[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 300;
  min-width: 224px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
  padding: 6px;
}
.user-dropdown-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.ud-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(15, 23, 42, .08); flex-shrink: 0; font-size: 15px; }
.ud-head-text { min-width: 0; }
.ud-name { font-weight: 600; font-size: 14px; color: var(--text); }
.ud-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ud-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 6px; color: var(--text);
  font-size: 14px; text-decoration: none;
}
.ud-item svg { color: var(--text-muted); flex-shrink: 0; }
.ud-item:hover { background: var(--ud-hover-bg); color: var(--text); }
.ud-item.ud-danger { color: #dc2626; }
.ud-item.ud-danger svg { color: #dc2626; }
.ud-item.ud-danger:hover { background: var(--ud-danger-hover-bg); }

/* ---------- 公告 & Flash ---------- */
.notice-bar { background: var(--notice-bg); border-bottom: 1px solid var(--notice-border); color: var(--notice-color); padding: 8px 0; font-size: 13px; }
.notice-bar .container { display: flex; align-items: center; }
.notice-bar .notice-icon { display: inline-flex; align-items: center; margin-right: 8px; color: #ef4444; }

.flash { padding: 12px 16px; border-radius: var(--radius); margin: 14px 0; font-size: 14px; }
.flash-success { background: var(--flash-success-bg); border: 1px solid var(--flash-success-border); color: var(--flash-success-color); }
.flash-warning { background: var(--flash-warning-bg); border: 1px solid var(--flash-warning-border); color: var(--flash-warning-color); }
.flash-error   { background: var(--flash-error-bg); border: 1px solid var(--flash-error-border); color: var(--flash-error-color); }

/* ---------- 按钮 ---------- */
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 16px; }
.card-body { padding: 18px; }

/* ---------- 版块网格 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cat-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
/* App 风格圆形图标横向滚动 */
.cat-scroll { display: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; width: 68px; }
.cat-circle { width: 54px; height: 54px; border-radius: 50%; background: var(--cat-circle-bg, #eff6ff); display: flex; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s; }
.cat-item:hover .cat-circle { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cat-item:active .cat-circle { transform: scale(.92); }
.cat-circle img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cat-circle .cat-icon-text { font-size: 20px !important; }
.cat-item-name { font-size: 12px; color: var(--text, #333); text-align: center; line-height: 1.3; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 暗色主题圆形背景适配 */
body.theme-dark .cat-circle, body.theme-cyber .cat-circle, body.theme-forest .cat-circle, body.theme-vapor .cat-circle { background: rgba(255,255,255,.08); }
body.theme-dark .cat-item:hover .cat-circle, body.theme-cyber .cat-item:hover .cat-circle { box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.cat-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--subtle-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
  overflow: hidden; white-space: nowrap;
}
.cat-icon-text {
  display: inline-block; max-width: 100%; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; letter-spacing: -.2px;
}
.cat-card h3 { font-size: 15px; margin-bottom: 4px; }
.cat-card p { color: var(--text-muted); font-size: 13px; }
.cat-meta { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

/* ---------- 帖子列表 ---------- */
.post-list { list-style: none; }
.post-list li {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; }
.post-list li:hover { background: var(--subtle-bg); }
.post-list li { position: relative; cursor: pointer; }
.post-list li .post-title::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.post-list li .post-sub { position: relative; z-index: 1; }
.post-list li .post-actions-inline { position: relative; z-index: 1; }
.post-list li .list-avatar { position: relative; z-index: 1; }
.post-list li .list-avatar a { display: block; line-height: 0; }
.post-list li .post-sub a { padding: 5px 7px; margin: -5px -7px; border-radius: 4px; display: inline-block; }
.post-list li .post-sub a:hover { background: var(--subtle-bg); }
.post-main { flex: 1; min-width: 0; }
.post-title { font-size: 15px; font-weight: 600; color: var(--text); }
.post-title:hover { color: var(--primary); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.tag-top { background: var(--tag-top-bg); color: var(--tag-top-color); }
.tag-essence { background: var(--tag-essence-bg); color: var(--tag-essence-color); }
.post-sub { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
.post-stat { text-align: center; min-width: 64px; color: var(--text-muted); font-size: 12px; }
.post-stat strong { display: block; font-size: 15px; color: var(--text); }

/* ---------- 头像 ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 18px;
}

/* ---------- 帖子详情 ---------- */
.post-header { padding: 20px 20px 14px; }
.post-header h1 { font-size: 22px; margin-bottom: 8px; }
.post-header .meta { color: var(--text-muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-content { padding: 6px 20px 20px; font-size: 15px; word-break: break-word; overflow-x: hidden; }
.post-content p { margin: 8px 0; }
.post-actions { padding: 0 20px 18px; display: flex; gap: 10px; }

/* ---------- 回复 ---------- */
.floor-list { list-style: none; }
.floor-list li { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.floor-list li:last-child { border-bottom: none; }
.floor-body { flex: 1; min-width: 0; }
.floor-head { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.floor-head .floor-user { font-size: 13px; font-weight: 600; color: var(--text); }
.floor-content { word-break: break-word; overflow-x: hidden; }
.floor-content img { max-width: calc(100% - 16px); max-height: 200px; width: auto; height: auto; border-radius: 6px; margin: 6px auto; display: block; cursor: zoom-in; object-fit: contain; }
.role-badge { font-size: 11px; background: var(--role-badge-bg); color: var(--primary); border-radius: 4px; padding: 0 6px; margin-left: 6px; }

/* ---------- 回复表单 ---------- */
.reply-form { padding: 18px; }
.reply-form textarea, .form-textarea {
  width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; resize: vertical;
}
.reply-form textarea:focus { border-color: var(--primary); }

/* ---------- 表单 ---------- */
.auth-card { max-width: 420px; margin: 40px auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; font-family: inherit;
}
.form-control:focus { border-color: var(--primary); }
.form-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; background: var(--form-error-bg); padding: 8px 12px; border-radius: 6px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 16px 18px; flex-wrap: wrap; }
.pg-btn { padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; }
.pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn.disabled { color: var(--disabled-color); cursor: not-allowed; }
.pg-info { margin-left: auto; color: var(--text-muted); font-size: 12px; }

/* ---------- 用户主页 ---------- */
.profile-header { display: flex; gap: 16px; align-items: center; padding: 24px; }
.profile-header .avatar { width: 64px; height: 64px; font-size: 28px; }
.profile-header h2 { font-size: 20px; }
.profile-stats { display: flex; gap: 24px; margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.profile-stats a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.profile-stats a:hover { color: var(--primary); }
.profile-stats strong { color: var(--text); }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 后台 ---------- */
.admin-body { background: var(--bg, #f8fafc); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #0f172a; color: #cbd5e1; padding: 20px 0; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand { display: block; color: #fff; font-size: 17px; font-weight: 700; padding: 6px 24px 20px; }
.admin-nav a { display: block; padding: 11px 24px; color: #94a3b8; font-size: 14px; }
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.admin-nav a.active { color: #fff; background: var(--primary); }
.admin-nav-sep { border-top: 1px solid #1e293b; margin: 12px 16px; }
.admin-main { flex: 1; min-width: 0; padding: 0 24px 40px; }
.admin-topbar { padding: 20px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.admin-topbar h1 { font-size: 20px; }
.admin-content { max-width: 1200px; }

/* 后台表格 */
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { background: var(--subtle-bg); color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.data-table tr:hover td { background: var(--subtle-bg); }
.data-table .actions { white-space: nowrap; }
/* 后台已删除（软删）帖子的行样式 */
.data-table tr.row-deleted td { background: var(--subtle-bg); }
.data-table tr.row-deleted td:not(.actions) { color: var(--subtle-text); }
/* 彻底删除按钮（硬删除，描边红，区别于软删除实心红） */
.btn-hard { background: var(--input-bg); color: var(--danger); border: 1px solid var(--danger); }
.btn-hard:hover { background: var(--danger); color: #fff; }
/* 前台帖子作者操作：彻底删除描边红 */
.btn-user-hard { color: var(--danger) !important; border-color: var(--danger) !important; }
.btn-user-hard:hover { background: var(--danger) !important; color: #fff !important; }
/* 我的帖子列表内联操作 */
.post-actions-inline a { color: var(--text-muted); margin-left: 12px; font-size: 12px; }
.post-actions-inline a:hover { color: var(--danger); }
.post-actions-inline a:first-child { margin-left: 4px; }
/* 已屏蔽帖子标题置灰 */
li.post-hidden .post-title { color: var(--subtle-text); }
li.post-hidden { background: var(--subtle-bg); }

/* 后台统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-green { background: var(--badge-green-bg); color: var(--badge-green-color); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-color); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-color); }
.badge-gray { background: var(--badge-gray-bg); color: var(--badge-gray-color); }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar .form-control { width: auto; }
.muted { color: var(--text-muted); }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }

.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* ---------- 响应式：平板 & 手机 ---------- */
@media (max-width: 768px) {
  /* 头部：品牌+操作一行，导航+搜索一行 */
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px 12px; }
  .brand { font-size: 18px; }
  .main-nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
  .header-right { margin-left: auto; }
  .search-form { flex: 1; }
  .search-form input { width: auto; flex: 1; min-width: 0; }
  .user-box .user-name { display: none; }
  .user-menu-name, .user-menu-caret { display: none; }
  .user-menu-trigger { padding: 2px; }
  /* 卡片/间距收紧 */
  .container { padding: 0 10px; }
  .card-body { padding: 14px; }
  .card-head { padding: 12px 14px; }
  .card-head h2 { font-size: 15px; }
  /* 帖子列表：统计列压缩 */
  .post-list li { padding: 11px 14px; gap: 8px; }
  .post-title { font-size: 14px; }
  .post-stat { min-width: 40px; font-size: 11px; }
  .post-stat strong { font-size: 13px; }
  /* 排行榜手机端 */
  .rank-item { gap: 10px; padding: 10px 4px; }
  .rank-no { width: 24px; height: 24px; font-size: 12px; }
  .rank-title { font-size: 14px; }
  .rank-sub { font-size: 11px; gap: 4px; }
  .rank-stats { gap: 12px; }
  .rank-stat strong { font-size: 14px; }
  .rank-stat { font-size: 10px; }
  /* 版块网格 */
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card { padding: 12px; }
  /* 帖子详情 */
  .post-header { padding: 14px 14px 10px; }
  .post-header h1 { font-size: 18px; }
  .post-content { padding: 4px 14px 14px; font-size: 14px; }
  .post-actions { padding: 0 14px 14px; }
  .post-header .meta { gap: 8px; font-size: 12px; }
  /* 回复 */
  .floor-list li { padding: 12px 14px; gap: 8px; }
  .floor-head { flex-direction: column; gap: 2px; }
  .reply-form { padding: 14px; }
  /* 表单纵向 */
  .form-row { flex-direction: column; gap: 0; }
  .form-row .form-group { margin-bottom: 12px; }
  /* 分页 */
  .pagination { padding: 12px 14px; }
  .pg-info { margin-left: 0; width: 100%; margin-top: 4px; }
  /* 用户主页 */
  .profile-header { padding: 16px 14px; }
  .profile-header .avatar { width: 52px; height: 52px; font-size: 24px; }
  .profile-header h2 { font-size: 17px; }
  .profile-stats { flex-wrap: wrap; gap: 10px 18px; }
  .tabs { padding: 0 10px; overflow-x: auto; white-space: nowrap; }
  .tabs a { padding: 10px 12px; font-size: 14px; }
  /* 工具条 */
  .toolbar .form-control { width: 100%; }
  .toolbar { gap: 8px; }
  /* 广告 */
  .ad-slot { padding: 8px 0; }
}
@media (max-width: 480px) {
  /* 极小屏：按钮与输入触摸友好 */
  .btn { padding: 8px 14px; }
  .btn-sm { padding: 6px 10px; }
  .search-form button { padding: 6px 10px; }
  .auth-card { margin: 20px auto; }
  .post-stat { min-width: 34px; }
  .floor-list li .avatar { width: 32px; height: 32px; }
  .fmt-toggle label { padding: 6px 12px; font-size: 12px; }
  .fmt-toggle { width: 100%; }
  .fmt-toggle label { flex: 1; text-align: center; }
}

/* ---------- 个人设置页 ---------- */
.settings-title { font-size: 15px; font-weight: 600; margin: 18px 0 10px; color: var(--text-primary, #333); }
.settings-divider { border: none; border-top: 1px solid var(--border, #e2e8f0); margin: 24px 0; }

/* ---------- 发帖格式切换 ---------- */
.fmt-toggle { display: inline-flex; gap: 0; border: 1px solid var(--border, #d8dee9); border-radius: 6px; overflow: hidden; margin-bottom: 8px; background: var(--fmt-bg); }
.fmt-toggle label { padding: 6px 16px; font-size: 13px; color: var(--text-muted, #64748b); cursor: pointer; border-right: 1px solid var(--border, #d8dee9); user-select: none; }
.fmt-toggle label:last-child { border-right: none; }
.fmt-toggle label.on { background: var(--primary, #4a7cf7); color: #fff; }
.fmt-toggle input[type="radio"] { display: none; }

/* ---------- Markdown 内容渲染 ---------- */
.post-content h1, .post-content h2, .post-content h3, .post-content h4,
.post-content h5, .post-content h6 { margin: 18px 0 8px; font-weight: 600; line-height: 1.4; }
.post-content h1 { font-size: 22px; }
.post-content h2 { font-size: 19px; }
.post-content h3 { font-size: 17px; }
.post-content h4, .post-content h5, .post-content h6 { font-size: 15px; }
.post-content ul, .post-content ol { margin: 8px 0 8px 22px; padding: 0; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin: 4px 0; }
.post-content blockquote { margin: 10px 0; padding: 8px 14px; border-left: 4px solid var(--primary, #4a7cf7); background: var(--blockquote-bg); color: var(--blockquote-color); }
.post-content blockquote p { margin: 4px 0; }
.post-content pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 12px 0; font-size: 13px; line-height: 1.6; }
.post-content pre code { background: transparent; color: inherit; padding: 0; font-size: 13px; }
.post-content code { background: var(--code-bg); color: var(--code-color); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: "SFMono-Regular", Consolas, Menlo, monospace; }
.post-content img { max-width: calc(100% - 16px); height: auto; border-radius: 6px; margin: 8px auto; display: block; }
.post-content hr { border: none; border-top: 1px solid var(--border, #e2e8f0); margin: 20px 0; }
.post-content strong { font-weight: 600; }
.post-content del { color: var(--text-muted, #64748b); }

/* ---------- 图标上传/预览 ---------- */
.cat-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.cat-icon .cat-icon-img { display: block; }
.data-table .cat-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; overflow: hidden; }
.data-table .cat-icon .cat-icon-text { font-size: 12px !important; max-width: 100%; }
.avatar-preview { width: 56px; height: 56px; }

/* ---------- 广告位 ---------- */
.ad-slot { background: var(--ad-bg); }
.ad-header { border-bottom: 1px solid var(--border, #e2e8f0); padding: 10px 0; }
.ad-footer { border-top: 1px solid var(--border, #e2e8f0); padding: 10px 0; background: var(--ad-footer-bg); }
.ad-slot img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.ad-slot .container { text-align: center; overflow: hidden; }

/* ---------- 发帖按钮（醒目） ---------- */
.main-nav .btn-post,
.btn-post {
  display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 4px;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff !important; font-weight: 600; font-size: 14px; line-height: 1.5;
  box-shadow: 0 1px 3px rgba(239, 68, 68, .28); transition: all .18s;
  margin-right: 16px;
}
.main-nav .btn-post:hover,
.btn-post:hover { color: #fff !important; opacity: .92; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(239, 68, 68, .35); }
.btn-post:active { transform: translateY(0); }
/* ---------- 列表头像 ---------- */
.list-avatar { flex-shrink: 0; }
.list-avatar .avatar { width: 38px; height: 38px; font-size: 17px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 480px) {
  .list-avatar .avatar { width: 32px; height: 32px; font-size: 15px; }
}

/* ---------- 排行榜 ---------- */
.rank-list { list-style: none; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border, #eef2f6); position: relative; cursor: pointer;
}
.rank-item:last-child { border-bottom: none; }
.rank-no {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--rank-no-bg); color: var(--text-muted); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rank-no.rank-top { background: var(--rank-top-bg); color: var(--rank-top-color); }
.rank-content { flex: 1; min-width: 0; }
.rank-title { display: block; color: var(--text, #1e293b); font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title:hover { color: var(--primary, #2563eb); }
.rank-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted, #94a3b8); margin-top: 4px; }
.rank-cat { color: var(--primary, #2563eb); text-decoration: none; }
.rank-cat:hover { text-decoration: underline; }
.rank-dot { color: var(--border, #cbd5e1); }
.rank-stats { display: flex; gap: 16px; flex-shrink: 0; }
.rank-stat { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-muted, #94a3b8); }
.rank-stat strong { color: #e85d04; font-weight: 600; font-size: 15px; }
/* 整行可点击进入帖子 */
.rank-title::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.rank-sub, .rank-stats { position: relative; z-index: 1; }
/* ---------- 消息中心 ---------- */
.notice-list { list-style: none; }
.notice-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border, #eef2f6); position: relative;
}
.notice-item:last-child { border-bottom: none; }
.notice-avatar { flex-shrink: 0; }
.notice-body { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.notice-content { color: var(--text, #1e293b); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-item:not(.notice-read) .notice-content { font-weight: 600; }
.notice-time { color: var(--text-muted, #94a3b8); font-size: 12px; }
.notice-tag { display:inline-block; background:var(--notice-tag-bg); color:var(--notice-tag-color); font-size:11px; padding:1px 6px; border-radius:8px; margin-right:6px; vertical-align:1px; }
.notice-unread-dot {
  flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}
.notice-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--border, #eef2f6); background: var(--subtle-bg, #f8fafc);
}
.notice-toolbar .notice-tool-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-muted, #64748b); cursor: pointer; }
.notice-toolbar .notice-tool-spacer { flex: 1; }
.notice-check { display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.notice-check input { cursor: pointer; }
.notice-del-one { flex-shrink: 0; }
.btn-danger-ghost { color: var(--danger); border-color: var(--flash-error-border); }
.btn-danger-ghost:hover { background: var(--form-error-bg); color: var(--danger-dark); border-color: var(--flash-error-border); }
/* ---------- 帮助中心 ---------- */
.help-body h3 { font-size: 15px; margin: 18px 0 8px; color: var(--text, #1e293b); }
.help-body h3:first-child { margin-top: 0; }
.help-body p { margin: 6px 0; color: var(--text-muted); line-height: 1.8; }
.help-body ul { margin: 8px 0 8px 22px; }
.help-body li { margin: 5px 0; color: var(--text-muted); line-height: 1.8; }
.help-body code { background: var(--code-bg); border-radius: 4px; padding: 1px 6px; font-size: 13px; color: var(--code-color); }

/* ===== 等级称号徽章 ===== */
.lv-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
  border-radius: 3px;
  background: var(--btn-signin-bg);
  color: var(--btn-signin-color);
  border: 1px solid var(--btn-signin-border);
  vertical-align: 1px;
  white-space: nowrap;
}
/* 深色主题下的等级徽章 */
[data-theme="cyber"] .lv-badge,
body.theme-cyber .lv-badge {
  background: rgba(255, 165, 0, 0.12);
  color: #ffb347;
  border-color: rgba(255, 165, 0, 0.35);
}

/* ===== 顶栏每日签到按钮 ===== */
.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #b45309;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.btn-signin:hover { background: var(--btn-signin-hover-bg); border-color: var(--btn-signin-hover-border); }
.btn-signin.signed {
  border-color: var(--border, #e5e7eb);
  background: var(--subtle-bg, #f3f4f6);
  color: var(--disabled-color, #9ca3af);
  cursor: default;
}
.btn-signin:disabled { opacity: .75; cursor: default; }
.btn-signin.btn-signin-locked { background: var(--muted-bg,#f1f3f5); color: var(--muted,#868e96); border-color: var(--border,#e5e7eb); cursor: not-allowed; }
.btn-signin.btn-signin-locked:hover { background: var(--muted-bg,#f1f3f5); color: var(--muted,#868e96); border-color: var(--border,#e5e7eb); }
/* 深色主题适配 */
.theme-cyber .btn-signin {
  background: rgba(255, 165, 0, .10);
  border-color: rgba(255, 165, 0, .40);
  color: #ffb347;
}
.theme-cyber .btn-signin:hover { background: rgba(255, 165, 0, .18); }
.theme-cyber .btn-signin.signed {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .15);
  color: #7aa2c9;
}

/* 消息中心：积分领取 */
.notice-claim { margin-left: 8px; flex-shrink: 0; }
.notice-reward { margin-left: 8px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.notice-reward-claimed { background: var(--reward-claimed-bg); color: var(--reward-claimed-color); }
.notice-reward-expired { background: var(--reward-expired-bg); color: var(--reward-expired-color); }

/* 用户名链接（查看他人主页） */
.user-link { color: inherit; text-decoration: none; font-weight: 600; }
.user-link:hover { color: var(--primary); text-decoration: underline; }

/* 未读消息轮询提示 toast */
.notice-toast {
  position: fixed;
  top: 74px;
  right: 16px;
  z-index: 9999;
  max-width: 320px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  padding: 10px 14px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
}
.notice-toast.show { opacity: 1; transform: translateY(0); }
.notice-toast .nt-title { font-size: 13px; font-weight: 700; color: var(--toast-title); margin-bottom: 3px; }
.notice-toast .nt-body {
  font-size: 13px; color: var(--toast-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all;
}

/* v1.1.4 消息中心轮询新增项高亮 */
.notice-item.notice-new { animation: notice-flash 1.2s ease 3; }
@keyframes notice-flash {
  0%, 100% { background: transparent; }
  50% { background: #fff7cc; }
}

/* v1.2.0 桌面通知：设置页开关 + 顶栏引导气泡 */
.notify-switch-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-weight: 500; margin-bottom: 4px;
}
.notify-switch-row input { display: none; }
.notify-switch-ui {
  position: relative; width: 42px; height: 22px; flex: none;
  background: #d1d5db; border-radius: 999px; transition: background .2s;
}
.notify-switch-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--input-bg);
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s;
}
.notify-switch-row input:checked + .notify-switch-ui { background: var(--primary); }
.notify-switch-row input:checked + .notify-switch-ui::after { transform: translateX(20px); }

.bell-hint {
  position: fixed; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  max-width: 320px; padding: 10px 12px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  font-size: 13px; color: #374151;
  opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.bell-hint.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bell-hint .bell-hint-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: #9ca3af; font-size: 16px; line-height: 1; padding: 2px 4px;
}
.bell-hint .bell-hint-close:hover { color: #4b5563; }


/* v1.2.1 设置页桌面通知三态引导 */
.notify-state {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 16px;
}
.notify-state-off { border-left: 3px solid #3b82f6; background: #eff6ff; }
.notify-state-on { border-left: 3px solid #22c55e; background: #f0fdf4; }
.notify-state-denied { border-left: 3px solid #f59e0b; background: #fffbeb; }
.notify-guide-title { font-weight: 600; font-size: 14px; margin: 0; }
.notify-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: #22c55e; color: #fff; border-radius: 999px; font-size: 12px; font-weight: 500;
  vertical-align: middle;
}

/* ===== v1.2.2 Edge 风格分类设置页 ===== */
.settings-edge {
  display: flex; gap: 20px; align-items: flex-start;
  max-width: 980px; margin: 0 auto;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--se-text);
}
.settings-edge-side {
  width: 240px; flex: none;
  background: var(--se-bg); border: 1px solid var(--se-border); border-radius: 10px;
  padding: 16px 12px; position: sticky; top: 84px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.se-side-head h2 { font-size: 20px; font-weight: 600; margin: 0 6px 12px; }
.se-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--se-search-bg); border: 1px solid var(--se-border); border-radius: 6px;
  padding: 7px 10px; margin: 0 6px 12px;
}
.se-search-ico { font-size: 14px; opacity: .6; }
.se-search input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 13px; color: var(--se-input-color);
}
.se-nav { display: flex; flex-direction: column; }
.se-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0; border-radius: 6px;
  color: var(--se-label); font-size: 14px; text-decoration: none;
  border-left: 3px solid transparent; transition: background .15s;
}
.se-nav-item:hover { background: var(--se-nav-hover-bg); color: var(--se-title); text-decoration: none; }
.se-nav-item.active { background: var(--se-nav-active-bg); color: var(--se-accent); border-left-color: var(--se-accent); font-weight: 600; }
.se-ico { font-size: 16px; width: 20px; text-align: center; }
.se-side-foot {
  border-top: 1px solid var(--se-row-border); margin: 12px 6px 0; padding-top: 12px;
}
.se-user-mini { display: flex; align-items: center; gap: 10px; }
.se-user-name { font-size: 13px; font-weight: 600; }
.se-user-role { font-size: 12px; color: var(--se-hint); }

.settings-edge-main { flex: 1; min-width: 0; }
.se-panel { display: none; }
.se-panel.active { display: block; }
.se-panel-title {
  font-size: 20px; font-weight: 600; margin-bottom: 16px; color: var(--se-title);
}
.se-group {
  background: var(--se-bg); border: 1px solid var(--se-border); border-radius: 10px;
  padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 16px;
}
.se-group-title {
  font-size: 13px; font-weight: 600; color: var(--se-hint);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px;
}
.se-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--se-row-border);
}
.se-row:last-child { border-bottom: none; }
/* 通知设置开关行（Edge 风格） */
.se-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 2px; border-bottom: 1px solid var(--se-row-border);
}
.se-switch-row:last-child { border-bottom: none; }
.se-switch-info { min-width: 0; }
.se-switch-info .se-label { width: auto; flex: none; padding: 0; font-size: 14px; font-weight: 500; color: var(--se-label); }
.se-switch-info .se-hint { margin-top: 3px; }
@media (max-width: 640px) {
  .se-switch-row { flex-direction: row; }
}
.se-label { width: 120px; flex: none; padding-top: 8px; font-size: 14px; color: var(--se-label); }
.se-control { flex: 1; min-width: 0; }
.se-control-action { padding-top: 4px; }
.se-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--se-input-border); border-radius: 6px; padding: 8px 10px;
  font-size: 14px; color: var(--se-input-color); background: var(--se-input-bg);
}
.se-input:focus { outline: none; border-color: var(--se-accent); box-shadow: 0 0 0 3px var(--se-accent-soft); }
.se-input[type="file"] { padding: 6px; }
.se-hint { font-size: 12px; color: var(--se-hint); margin: 6px 0 0; }
.se-avatar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.se-alert {
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px;
}
.se-alert-error { background: var(--se-alert-err-bg); color: var(--se-alert-err-color); border: 1px solid var(--se-alert-err-border); }
.se-alert-success { background: var(--se-alert-ok-bg); color: var(--se-alert-ok-color); border: 1px solid var(--se-alert-ok-border); }

/* 主题卡片 */
.se-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.se-theme-card {
  position: relative; display: block; cursor: pointer;
  border: 1px solid var(--se-border); border-radius: 10px; padding: 12px;
  transition: border-color .15s, box-shadow .15s; overflow: hidden;
}
.se-theme-card:hover { border-color: var(--se-accent); }
.se-theme-card.active { border-color: var(--se-accent); box-shadow: 0 0 0 3px var(--se-accent-soft); }
.se-theme-preview { display: block; height: 46px; border-radius: 6px; margin-bottom: 10px; opacity: .85; }
.se-theme-name { display: block; font-size: 14px; font-weight: 600; color: var(--se-title); }
.se-theme-desc { display: block; font-size: 12px; color: var(--se-hint); margin-top: 3px; }
.se-theme-check {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--se-accent); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.6); transition: .15s;
}
.se-theme-card.active .se-theme-check { opacity: 1; transform: scale(1); }

/* 移动端：侧栏变顶部横向导航 */
@media (max-width: 768px) {
  .settings-edge { flex-direction: column; }
  .settings-edge-side {
    width: 100%; position: static; padding: 12px;
  }
  .se-side-head h2 { display: none; }
  .se-search { margin-bottom: 10px; }
  .se-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .se-nav-item { padding: 8px 10px; border-left: none; border-bottom: 2px solid transparent; border-radius: 6px; }
  .se-nav-item.active { border-bottom-color: var(--se-accent); }
  .se-side-foot { display: none; }
  .se-row { flex-direction: column; gap: 6px; }
  .se-label { width: auto; padding-top: 0; }
}

/* ---------- 手机端底栏导航 ---------- */
.mobile-tabbar { display: none; }
@media (max-width: 768px) {
  body { padding-bottom: 62px; }
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg, #fff);
    border-top: 1px solid var(--border, #e2e8f0);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 7px 0 5px; color: var(--text-muted, #64748b);
    font-size: 11px; text-decoration: none; position: relative;
  }
  .tabbar-item svg { width: 22px; height: 22px; }
  .tabbar-item:active { color: var(--primary, #4a7cf7); }
  .tabbar-post { position: relative; top: -18px; }
  .tabbar-post svg {
    width: 46px; height: 46px; padding: 11px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 50%; color: #fff;
    box-shadow: 0 4px 14px rgba(239,68,68,.4);
  }
  .tabbar-post span { margin-top: 2px; }
  .tabbar-dot {
    position: absolute; top: 3px; right: calc(50% - 20px);
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 600;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
  }
  /* 顶栏搜索图标：手机端显示 */
  .header-search-icon { display: none; }
  /* 手机端顶栏精简 */
  .site-header .main-nav { display: none !important; }
  .site-header .search-form { display: none !important; }
  .header-search-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-muted, #64748b); margin-left: auto; }
  .header-search-icon:active { background: rgba(0,0,0,.06); color: var(--text); }
  .header-search-icon svg { width: 20px; height: 20px; }
  .site-header .btn-post { display: none !important; }
  .site-header .btn-signin { display: none !important; }
  .site-header .user-menu-name { display: none; }
  .site-header .user-menu-caret { display: none; }
  .site-header .header-inner { height: 52px; gap: 10px; }
  .site-header .brand { font-size: 17px; }
  .site-header .brand-logo { width: 26px; height: 26px; }
  /* 帖子列表手机端：隐藏统计列，给内容更多空间 */
  .post-list .post-stat { display: none; }
  .post-list li { padding: 12px 14px; gap: 10px; }
  .post-list .list-avatar .avatar { width: 36px; height: 36px; font-size: 16px; }
  /* 版块卡片手机端：图标缩小 */
  .cat-card { display: flex; align-items: center; gap: 12px; }
  .cat-card .cat-icon { width: 40px; height: 40px; flex-shrink: 0; }
  .cat-card .cat-icon-img { border-radius: 8px; }
  .cat-card .cat-info { flex: 1; min-width: 0; }
  /* 底栏激活态 */
  .tabbar-item.active { color: var(--primary, #4a7cf7); }
  /* 个人主页手机端：百度贴吧风格 */
  .profile-header { flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding: 16px; gap: 12px 14px; }
  .profile-header .avatar { width: 58px !important; height: 58px !important; font-size: 24px !important; border-radius: 50%; border: 2px solid var(--card, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.1); flex-shrink: 0; }
  .profile-header > div:nth-of-type(1) { flex: 1; min-width: 0; }
  .profile-header h2 { font-size: 17px; justify-content: flex-start; flex-wrap: wrap; margin: 0 0 4px; gap: 6px; }
  /* 统计：只保留关注/粉丝，发帖/回复隐藏 */
  .profile-stats { display: flex; flex-wrap: wrap; align-items: center; width: 100%; gap: 0; margin: 0; font-size: 12px; }
  .profile-stats span:nth-child(1), .profile-stats span:nth-child(2) { display: none; }
  .profile-stats span:nth-child(3) { padding-right: 12px; border-right: 1px solid var(--border, #e2e8f0); margin-right: 12px; color: var(--text-muted, #64748b); }
  .profile-stats span:nth-child(3) strong, .profile-stats span:nth-child(4) strong { color: var(--text, #1e293b); font-weight: 600; }
  .profile-stats span:nth-child(4) { color: var(--text-muted, #64748b); }
  .profile-stats span:last-child { flex-basis: 100%; font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 4px; }
  /* 邀请链接：紧凑一行 */
  .invite-box { width: 100%; background: var(--bg, #f8fafc); border-radius: 8px; padding: 7px 10px; gap: 6px !important; align-items: center !important; flex-direction: row !important; box-sizing: border-box; overflow: hidden; }
  .invite-box > .muted:first-child { font-size: 11px; font-weight: 600; color: var(--text, #333); white-space: nowrap; flex-shrink: 0; }
  .invite-box code { flex: 1 1 0; min-width: 0; max-width: 50%; box-sizing: border-box; font-size: 10px; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; text-align: left; }
  .invite-box .btn { width: auto !important; padding: 4px 10px; font-size: 11px; flex-shrink: 0; }
  .invite-box > .muted:last-child { display: none; }
  /* 等级进度条：紧凑一行 */
  .level-box { width: 100%; align-items: center !important; gap: 8px !important; flex-wrap: nowrap; justify-content: flex-start; }
  .level-box .level-name { font-size: 13px; white-space: nowrap; }
  .level-box > .muted { font-size: 11px; white-space: nowrap; }
  .level-box span[style*="width:120px"] { flex: 1; min-width: 60px; max-width: none !important; width: auto !important; }
  .level-box span[style*="width:120px"] .muted { display: none; }
  /* 签到/设置按钮：底部全宽 */
  .profile-header > div[style*="margin-left"] { order: 10; margin-left: 0 !important; width: 100%; gap: 10px; }
  .profile-header > div[style*="margin-left"] .btn { flex: 1; padding: 9px; font-size: 13px; border-radius: 8px; font-weight: 600; }
  .profile-header > div[style*="margin-left"] { margin-left: 0 !important; width: 100%; gap: 10px; }
  .profile-header > div[style*="margin-left"] .btn { flex: 1; padding: 11px; font-size: 14px; border-radius: 10px; font-weight: 600; }
  /* 版块手机端：圆形图标横向滚动，隐藏电脑端大卡片 */
  .cat-grid { display: none !important; }
  .cat-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 6px 0 10px 18px; margin: 0 -18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cat-scroll::-webkit-scrollbar { display: none; }
  .cat-scroll .cat-item:last-child { margin-right: 18px; }
  .cat-item { width: 60px; gap: 5px; }
  .cat-circle { width: 48px; height: 48px; }
  .cat-circle img { width: 32px; height: 32px; }
  .cat-circle .cat-icon-text { font-size: 18px !important; }
  .cat-item-name { font-size: 11px; max-width: 60px; }
}
@media (max-width: 480px) {
  body { padding-bottom: 58px; }
  .tabbar-item { font-size: 10px; padding: 6px 0 4px; }
  .tabbar-item svg { width: 20px; height: 20px; }
  .tabbar-post svg { width: 42px; height: 42px; padding: 10px; }
  .tabbar-post { top: -16px; }
}

/* 搜索页搜索栏 */
.search-page-bar { margin-bottom: 14px; }
.search-page-bar .search-form { display: flex; width: 100%; margin: 0; }
.search-page-bar .search-form input { flex: 1; min-width: 0; padding: 10px 14px; font-size: 14px; }
.search-page-bar .search-form button { padding: 10px 20px; font-size: 14px; white-space: nowrap; }
@media (max-width: 768px) {
  .search-page-bar .search-form input { padding: 9px 12px; font-size: 13px; }
  .search-page-bar .search-form button { padding: 9px 14px; font-size: 13px; }
  /* 发帖页手机端适配 */
  .card[style*="max-width:860px"] { max-width: 100% !important; }
  .card[style*="max-width:860px"] .card-body { padding: 14px; }
  .card[style*="max-width:860px"] .form-group { margin-bottom: 12px; }
  .card[style*="max-width:860px"] .form-group[style*="flex:0 0 220px"] { flex: 1 !important; }
  .card[style*="max-width:860px"] .form-control { padding: 10px 12px; font-size: 15px; }
  .card[style*="max-width:860px"] .form-textarea { min-height: 200px; font-size: 15px; padding: 12px; }
  .card[style*="max-width:860px"] .fmt-toggle { width: 100%; margin-bottom: 8px; }
  .card[style*="max-width:860px"] .fmt-toggle label { flex: 1; text-align: center; padding: 8px; font-size: 13px; }
  .card[style*="max-width:860px"] .md-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .card[style*="max-width:860px"] .md-toolbar .btn { padding: 6px 10px; font-size: 12px; }
  .card[style*="max-width:860px"] form > .btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; border-radius: 8px; }
  .card[style*="max-width:860px"] form > .btn-ghost { margin-top: 8px; }
  .card[style*="max-width:860px"] .form-hint { font-size: 11px; line-height: 1.5; }
}
.md-body { overflow-x: hidden; }

/* 图片灯箱 */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 92%; max-height: 92%; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 28px; cursor: pointer; opacity: .8; }
.lightbox-close:hover { opacity: 1; }

/* ===== 极简浅色页脚 ===== */
.site-footer { margin-top: 48px; padding: 20px 0; color: #94a3b8; font-size: 12px; text-align: center; border-top: 1px solid #f1f5f9; }
.site-footer strong { color: #64748b; font-weight: 600; }

.site-footer { margin-top: 48px; padding: 20px 0; color: #94a3b8; font-size: 13px; text-align: center; }
.site-footer strong { color: #64748b; font-weight: 600; }
