/* ============================================================
   AI 贴吧 全局样式
   设计语言参考 moonshot.cn：深色玻璃拟态 / 蓝紫渐变 / 大圆角胶囊按钮
   响应式：流式网格 + clamp() 流式字号，适配 320px ~ 2560px
   ============================================================ */

/* ==================== 基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; }
:root {
  /* 基础配色 = 默认主题「薄荷手账」（可爱风） */
  color-scheme: light;
  --bg: #f1faf5;
  --card: #ffffff;
  --line: #d8ece1;
  --text: #2c4a3e;
  --text-2: #5d8775;
  --muted: #83a99a;
  --brand: #3fae7c;
  --brand-2: #7cc9a3;
  --brand-grad: linear-gradient(135deg, #3fae7c, #7cc9a3);
  --brand-soft: #e2f6ec;
  --brand-soft-2: #f2fcf7;
  --hot: #f78b8b;
  --hot-soft: #ffefef;
  --ok: #2f9e63;
  --ok-soft: #e5f8ee;
  --chip-bg: #eef8f2;
  --chip-text: #4e7a66;
  --hover-bg: #f2faf6;
  --radius: 20px;
  --radius-pill: 999px;
  --shadow: 0 2px 8px rgba(63,174,124,.10), 0 10px 26px rgba(63,174,124,.08);
  --shadow-hover: 0 6px 16px rgba(63,174,124,.16), 0 16px 34px rgba(63,174,124,.12);
  --header-bg: linear-gradient(135deg, rgba(111,201,155,.48), rgba(165,227,195,.48));
  --header-text: #17402f;
  --header-nav-btn-bg: rgba(255,255,255,.55);
  --header-nav-btn-text: #17402f;
  --header-nav-btn-border: rgba(255,255,255,.85);
  --header-nav-btn-hover-bg: rgba(255,255,255,.9);
  --nav-link: #1c4f3a;
  --nav-link-hover-bg: rgba(255,255,255,.35);
  --footer-bg: #e2f4ea;
  --footer-text: #35634f;
  --footer-muted: #83a99a;
  --footer-border: #cbe9d9;
  --footer-chip-bg: rgba(255,255,255,.8);
  --footer-chip-border: #cbe9d9;
  --footer-chip-text: #35634f;
  --footer-chip-hover: rgba(255,255,255,1);
  --code-bg: #e9f8f0;
  --code-text: #23513e;
  --toast-bg: #2f8f63;
  /* 玻璃拟态参数（透明度 + 模糊度）：默认值 = 薄荷手账；主题数据可覆盖，编辑器可调 */
  --glass-mask: .55;              /* 弹窗遮罩透明度 */
  --glass-footer: .7;             /* 页脚悬浮卡片透明度 */
  --glass-blur-header: 10px;      /* 顶栏 */
  --glass-blur-dropdown: 20px;    /* 头像下拉菜单 */
  --glass-blur-mega: 24px;        /* AI 直达大面板 */
  --glass-blur-search: 16px;      /* 搜索框 */
  --glass-blur-card: 16px;        /* 卡片 / 侧栏 / 提示卡 / 统计卡 */
  --glass-blur-input: 12px;       /* 输入框 */
  --glass-blur-modal: 28px;       /* 弹窗 */
  --glass-blur-mask: 6px;         /* 弹窗遮罩 */
  --glass-blur-footer: 12px;      /* 页脚悬浮卡片 */
  --font-display: "Comic Sans MS", "Chalkboard SE", "Marker Felt", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "MiSans", "PingFang SC", -apple-system, "Segoe UI", "Roboto", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Courier New", monospace;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: var(--font-size, 15px);
  /* 注：横向裁剪与滚动条占位已上移至 html，body 不可再设 overflow，否则会自成滚动容器、破坏顶栏 sticky */
  padding-bottom: 64px; /* 底部悬浮面板的触发条常驻，正文底部留出空间 */
}
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }
img, video, iframe, svg { max-width: 100%; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
::placeholder { color: var(--muted); opacity: .8; }
/* 标题字体跟随主题 */
.hero h1, .page-title, .post-title, .comm-banner-info h2, .user-name,
.section-title, .modal h2, .dd-head { font-family: var(--font-display); letter-spacing: -.3px; }

/* ==================== 顶栏（玻璃拟态） ==================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(var(--glass-blur-header)); -webkit-backdrop-filter: blur(var(--glass-blur-header));
  border-bottom: 1px solid var(--footer-border);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 28px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 58px; gap: 10px;
}
.header-left { display: flex; align-items: center; min-width: 0; justify-self: start; }
.header-center { display: flex; align-items: center; gap: 4px; justify-self: center; }
.header-right { display: flex; align-items: center; gap: 4px; justify-self: end; }

/* 圆形登录/注册按钮 */
.circle-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(107,123,255,.35); transition: transform .15s, box-shadow .15s;
}
.circle-btn:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 6px 20px rgba(107,123,255,.5); }
.avatar-chip {
  position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 2px; border-radius: 50%; transition: background .15s;
}
.avatar-chip:hover { background: var(--header-nav-btn-hover-bg); }
.avatar-chip.open .avatar-dropdown { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.avatar-dropdown {
  /* 右对齐：按钮贴视口右缘时菜单不会溢出屏幕 */
  position: absolute; top: 46px; left: auto; right: 0; min-width: 160px;
  background: var(--card); backdrop-filter: blur(var(--glass-blur-dropdown)); -webkit-backdrop-filter: blur(var(--glass-blur-dropdown));
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-hover);
  padding: 6px; z-index: 200;
  /* 隐藏时延迟消失，给鼠标滑入面板的缓冲时间（不设 pointer-events，缓冲期内面板仍可被悬停接住） */
  display: block; visibility: hidden; opacity: 0;
  transition: visibility 0s linear .25s, opacity .12s ease;
}
/* 桥接区：覆盖按钮与面板之间的空隙，移动鼠标时不丢悬停 */
.avatar-dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.avatar-chip:hover .avatar-dropdown, .avatar-chip.open .avatar-dropdown, .avatar-dropdown:hover {
  visibility: visible; opacity: 1; transition-delay: 0s;
}
.avatar-dropdown a, .avatar-dropdown button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 12px; font-size: 14px; color: var(--text); border-radius: 10px; cursor: pointer;
}
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: var(--hover-bg); }

/* 右导航 */
.nav-link {
  color: var(--nav-link); font-size: 14px; padding: 7px 12px; border-radius: 10px;
  transition: background .15s; white-space: nowrap;
}
.nav-link:hover { background: var(--nav-link-hover-bg); color: var(--header-text); opacity: 1; }
.nav-link.home-link { font-weight: 600; }
/* 当前板块的导航项突出展示（由 app.js 在路由切换时挂 .active） */
.nav-link.active {
  background: var(--nav-link-hover-bg); color: var(--header-text);
  font-weight: 700; opacity: 1;
  box-shadow: inset 0 0 0 1px var(--footer-border);
}

/* ==================== 主内容 ==================== */
.main {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: clamp(16px, 2.5vw, 30px) clamp(12px, 2.5vw, 28px) 48px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: clamp(30px, 5.5vw, 64px) 0 8px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px; margin-bottom: clamp(14px, 2.5vw, 22px);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--ok-soft); }
  70% { box-shadow: 0 0 0 9px rgba(61,220,151,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); }
}
.hero h1 {
  font-size: clamp(26px, 4.8vw, 50px); line-height: 1.28; font-weight: 800;
  letter-spacing: -.5px;
}
.hero h1 .grad {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.sub { color: var(--muted); margin: clamp(10px, 1.8vw, 18px) 0 clamp(18px, 3vw, 30px); font-size: clamp(14px, 1.4vw, 16px); }
.search-box {
  width: min(680px, 100%); margin: 0 auto; display: flex; align-items: center; gap: 8px;
  background: var(--card); backdrop-filter: blur(var(--glass-blur-search)); -webkit-backdrop-filter: blur(var(--glass-blur-search));
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 7px 7px 7px clamp(16px, 2.5vw, 24px);
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.search-box input {
  flex: 1; min-width: 0; border: none; outline: none; font-size: clamp(14px, 1.4vw, 16px);
  background: none; color: var(--text);
}
.search-box .search-btn {
  background: var(--brand-grad); color: #fff; border: none; border-radius: var(--radius-pill);
  padding: 10px clamp(18px, 3vw, 30px); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .15s, box-shadow .15s; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(107,123,255,.35);
}
.search-box .search-btn:hover { transform: scale(1.03); box-shadow: 0 6px 20px rgba(107,123,255,.5); }
.hot-tags { margin-top: 14px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center; }
.hot-tags > span { color: var(--muted); font-size: 13px; line-height: 28px; }
.tag-link {
  display: inline-block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 4px 14px; font-size: 13px;
  color: var(--text-2); cursor: pointer; transition: all .15s;
}
.tag-link:hover { border-color: var(--brand); color: var(--brand); opacity: 1; }

/* ---------- 三栏网格（流式） ---------- */
/* 两侧固定窄栏，中间栏占满剩余宽度：把屏幕中间的空间让给推荐内容 */
.home-grid {
  display: grid;
  grid-template-columns: minmax(232px, 260px) minmax(0, 1fr) minmax(232px, 260px);
  gap: clamp(12px, 1.6vw, 20px);
  margin-top: clamp(20px, 3vw, 36px); align-items: start;
}
.col { min-width: 0; }
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px; font-size: clamp(14px, 1.3vw, 15px); font-weight: 700;
}
.col-head .col-icon { margin-right: 6px; }
.col-head .col-more { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* 卡片基座：玻璃拟态（卡片透明度 --glass-card-alpha 只作用于卡片，不影响弹窗/输入框等） */
.feed-card, .side-card, .comm-card, .card, .tool-card, .search-user-item:hover {
  background: var(--card); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--card) calc(var(--glass-card-alpha) * 100%), transparent);
  backdrop-filter: blur(var(--glass-blur-card)); -webkit-backdrop-filter: blur(var(--glass-blur-card));
}

/* 侧栏卡片 */
.side-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 12px; }
.side-post { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.side-post:last-child { border-bottom: none; }
.side-post:hover .side-title { color: var(--brand); }
.side-avatar { flex-shrink: 0; }
.side-main { min-width: 0; flex: 1; }
.side-title { font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.side-meta { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 「查看全部」：与条目同款文字行，仅内容居中（悬停同条目变品牌色） */
.side-post.follow-more { justify-content: center; }

/* 中间列推荐卡片 */
.feed-card {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(13px, 1.7vw, 20px) clamp(14px, 2vw, 22px); margin-bottom: 14px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.feed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--brand-soft); }
.feed-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; }
.feed-author { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.feed-time { font-size: 12px; color: var(--muted); }
.feed-title { font-size: clamp(15px, 1.6vw, 18px); font-weight: 700; line-height: 1.5; margin-bottom: 6px; color: var(--text); word-break: break-word; }
.feed-title:hover { color: var(--brand); }
.feed-excerpt { font-size: clamp(13px, 1.1vw, 14.5px); color: var(--text-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; word-break: break-word; }
.feed-bottom { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.feed-stat { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* 热榜 */
.rank-item { display: flex; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.rank-item:last-child { border-bottom: none; }
.rank-no { font-size: 17px; font-weight: 800; width: 24px; text-align: center; flex-shrink: 0; font-style: italic; }
.rank-item:nth-child(1) .rank-no, .rank-item:nth-child(2) .rank-no, .rank-item:nth-child(3) .rank-no { color: var(--hot); }
.rank-main { min-width: 0; }
.rank-title { font-size: 13.5px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.rank-item:hover .rank-title { color: var(--brand); }
.rank-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rank-heat { color: var(--hot); font-weight: 600; }

/* 中间栏：卡片网格按分辨率自适应列数（≥300px/张，中屏双列、窄屏单列） */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(10px, 1.4vw, 14px);
}
.feed-card.compact { padding: 12px 14px; margin-bottom: 0; }
.feed-card.compact .feed-top { margin-bottom: 8px; }
.feed-card.compact .feed-title { font-size: 14.5px; -webkit-line-clamp: 2; }
.feed-card.compact .feed-excerpt { -webkit-line-clamp: 2; font-size: 13px; margin-bottom: 8px; }
.feed-card.compact .feed-bottom { margin-top: 6px; gap: 10px; }

/* ---------- 历史浏览记录：纵向时间轴 ---------- */
.history-timeline { max-width: 860px; }
.timeline-item { position: relative; padding-left: 26px; padding-bottom: 14px; break-inside: avoid; }
/* 时间轴连接线：从圆点延伸到下一条记录（跨过卡片间距），最后一条止于卡片底部 */
.timeline-item::before {
  content: ""; position: absolute; left: 6px; top: 13px; bottom: 0;
  width: 2px; background: var(--line); border-radius: 2px;
}
.timeline-item:last-child::before { bottom: 14px; }
.timeline-dot {
  position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand-grad); border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--brand-soft), var(--shadow); z-index: 1;
}
.timeline-card {
  background: var(--card); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--card) calc(var(--glass-card-alpha) * 100%), transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.timeline-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--brand-soft); }
.timeline-top { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* 宽屏（≥1000px）：时间轴纵向排列不变，横向并排两列 */
@media (min-width: 1000px) {
  .history-timeline { columns: 2; column-gap: clamp(16px, 2vw, 28px); margin: 0 auto; }
}

/* ---------- 我的关注：按日期分组的纵向时间轴（单列，保持时间顺序） ---------- */
.follow-timeline { position: relative; max-width: 860px; }
/* 贯穿整条时间轴的纵向轴线：圆点与日期节点都落在其上 */
.follow-timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 14px;
  width: 2px; background: var(--line); border-radius: 2px;
}
/* 日期节点：落在时间轴线上的圆点 + 日期文案，作为当天的分组标题 */
.tl-date {
  position: relative; padding-left: 26px; margin: 14px 0 12px;
  font-size: 13px; font-weight: 700; color: var(--brand);
}
.tl-date::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft); z-index: 1;
}

/* 提示卡 */
.hint-card {
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-soft-2));
  backdrop-filter: blur(var(--glass-blur-card)); -webkit-backdrop-filter: blur(var(--glass-blur-card));
  border: 1px dashed var(--brand); border-radius: var(--radius);
  padding: clamp(14px, 2vw, 18px); text-align: center; margin-bottom: 14px;
}
.hint-card .hint-title { font-weight: 700; margin-bottom: 6px; }
.hint-card .hint-sub { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.hint-card .btn { margin: 0 4px; }

/* ==================== 通用组件 ==================== */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; user-select: none;
}
.avatar.sm { width: 30px; height: 30px; font-size: 14px; }
.avatar.lg { width: clamp(52px, 6vw, 64px); height: clamp(52px, 6vw, 64px); font-size: clamp(24px, 3vw, 28px); }
.avatar .emoji { font-size: inherit; }

.chip {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; padding: 2px 9px; border-radius: var(--radius-pill); font-weight: 600;
  white-space: nowrap;
}
.tag-chip {
  display: inline-block; background: var(--chip-bg); color: var(--chip-text);
  font-size: 12px; padding: 2px 10px; border-radius: var(--radius-pill); margin-right: 6px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--radius-pill); padding: 9px 18px; font-size: 14px;
  cursor: pointer; font-weight: 600; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--brand-grad); color: #fff; }
.btn-primary:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 18px var(--brand-soft); }
.btn-ghost { background: var(--card); color: var(--text-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--card); color: var(--hot); border: 1px solid var(--hot-soft); }
.btn-danger:hover { background: var(--hot-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; outline: none; background: var(--card);
  backdrop-filter: blur(var(--glass-blur-input)); -webkit-backdrop-filter: blur(var(--glass-blur-input));
  color: var(--text); font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 160px; line-height: 1.7; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: clamp(20px, 3vw, 28px); font-weight: 800; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(14px, 2.2vw, 22px); }
.section-title { font-size: clamp(16px, 2vw, 18px); font-weight: 800; margin-bottom: 14px; }

/* ==================== 社区广场 ==================== */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 6px 16px; font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.cat-tab:hover { border-color: var(--brand); color: var(--brand); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(248px, 100%), 1fr)); gap: clamp(12px, 1.6vw, 16px); }
.comm-card {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(14px, 2vw, 18px); cursor: pointer; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.comm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--brand-soft); }
.comm-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.comm-icon {
  font-size: clamp(26px, 3.4vw, 34px); width: clamp(44px, 5vw, 52px); height: clamp(44px, 5vw, 52px);
  background: var(--brand-soft); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comm-name { font-size: clamp(15px, 1.7vw, 17px); font-weight: 700; word-break: break-word; }
.comm-category { font-size: 11.5px; }
.comm-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comm-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.comm-card .btn { align-self: flex-end; }
.comm-card:hover .comm-name { color: var(--brand); }

/* ==================== 工具导航页 ==================== */
.tools-page { display: flex; flex-direction: column; gap: 28px; }
.tool-cat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tool-cat-title { font-size: 17px; font-weight: 800; }
.tool-cat-desc { font-size: 12.5px; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(216px, 100%), 1fr)); gap: clamp(10px, 1.4vw, 12px); }
.tool-card {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--brand-soft); color: var(--text); }
.tool-emoji { font-size: 22px; flex-shrink: 0; }
.tool-info { min-width: 0; flex: 1; }
.tool-name { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-card:hover .tool-name { color: var(--brand); }
.tool-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-go { flex-shrink: 0; color: var(--brand); font-size: 15px; opacity: 0; transform: translateX(-3px); transition: opacity .15s, transform .15s; }
.tool-card:hover .tool-go { opacity: 1; transform: translateX(0); }

/* ==================== 社区详情 ==================== */
.comm-banner { display: flex; gap: clamp(12px, 2vw, 18px); align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.comm-banner .comm-icon { width: clamp(56px, 7vw, 72px); height: clamp(56px, 7vw, 72px); font-size: clamp(32px, 4.5vw, 42px); }
.comm-banner-info { flex: 1; min-width: 200px; }
.comm-banner-info h2 { font-size: clamp(20px, 2.8vw, 24px); font-weight: 800; }
.comm-banner-desc { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.comm-banner-meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ==================== 帖子详情 ==================== */
.post-page { max-width: min(880px, 100%); margin: 0 auto; }
.post-head { margin-bottom: 6px; }
.post-title { font-size: clamp(20px, 3.2vw, 28px); font-weight: 800; line-height: 1.45; margin-bottom: 12px; word-break: break-word; }
.post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.post-content { font-size: clamp(14.5px, 1.2vw, 15.5px); line-height: 1.9; color: var(--text); overflow-wrap: break-word; word-break: break-word; }
.post-content p { margin-bottom: 12px; }
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  margin: 18px 0 10px; line-height: 1.4; font-weight: 800;
}
.post-content h1 { font-size: 22px; }
.post-content h2 { font-size: 19px; }
.post-content h3 { font-size: 17px; }
.post-content code.inline { background: var(--chip-bg); border-radius: 6px; padding: 1px 7px; font-size: 13.5px; font-family: "SF Mono", Consolas, monospace; }
.post-content pre {
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--line);
  border-radius: 12px; padding: clamp(12px, 2vw, 16px) clamp(12px, 2vw, 18px);
  overflow-x: auto; margin: 12px 0; font-size: 13.5px; line-height: 1.7;
  font-family: "SF Mono", Consolas, monospace; max-width: 100%;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content strong { color: var(--brand); }
.post-content a { text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 22px; margin-bottom: 12px; }
.post-actions { display: flex; gap: 12px; align-items: center; margin: 20px 0; flex-wrap: wrap; }
.like-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 22px; }
.like-btn.liked { background: var(--hot-soft); color: var(--hot); border: 1px solid var(--hot); }

.comments-section { margin-top: 26px; }
/* 「默认不显示评论」折叠态：标题行可点击展开/收起 */
.comments-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; padding: 0; cursor: pointer; color: inherit;
}
.comments-toggle .toggle-hint {
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 2px 10px; white-space: nowrap;
}
.comments-section.collapsed .comments-body { display: none; }
.comments-section.collapsed .comments-toggle { margin-bottom: 14px; }
.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-size: 13.5px; font-weight: 700; }
.comment-time { font-size: 12px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.comment-content { font-size: 14.5px; margin-top: 4px; line-height: 1.7; color: var(--text-2); word-break: break-word; }
.comment-form { display: flex; gap: 10px; margin: 16px 0; align-items: flex-start; }
.comment-form textarea { flex: 1; min-height: 70px; }

/* ==================== 用户主页 ==================== */
.user-head { display: flex; gap: clamp(14px, 2.4vw, 20px); align-items: center; flex-wrap: wrap; }
.user-head-info { flex: 1; min-width: 200px; }
.user-name { font-size: clamp(20px, 3vw, 24px); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.user-bio { color: var(--text-2); margin-top: 4px; }
.user-stats { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.user-stats b { color: var(--text); font-size: 16px; }
.interests-row { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ==================== 表单 ==================== */
.form-card { max-width: min(640px, 100%); margin: 0 auto; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.emoji-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.emoji-opt {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.emoji-opt:hover { border-color: var(--brand); }
.emoji-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.tag-input-hint { font-size: 12px; color: var(--muted); }

/* ==================== 搜索页 ==================== */
/* 两栏布局：左栏帖子列表，右侧栏上社区、下用户 */
.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(252px, 300px);
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}
.search-side { display: flex; flex-direction: column; min-width: 0; }
.search-side-list { display: flex; flex-direction: column; gap: 12px; }
.search-side .comm-card { padding: 14px; gap: 8px; }
.search-side .comm-icon { width: 40px; height: 40px; font-size: 24px; border-radius: 12px; }
.search-side .comm-name { font-size: 15px; }
.search-side .search-user-item { padding: 10px 8px; gap: 8px; }
.search-side .search-user-item b { font-size: 13.5px; }
.search-side .search-user-item .muted { font-size: 12px; }
@media (max-width: 860px) {
  .search-layout { grid-template-columns: 1fr; }
}
.search-layout-single { grid-template-columns: 1fr; }
.search-result-section { margin-bottom: 26px; }
.search-result-section h3 { font-size: clamp(15px, 1.8vw, 17px); font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.search-user-item { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; border-radius: 12px; }
.search-user-item:hover { background: var(--hover-bg); }

/* ==================== 弹窗 ==================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, var(--glass-mask));
  display: flex; align-items: center; justify-content: center; z-index: 500; padding: 16px;
  backdrop-filter: blur(var(--glass-blur-mask)); -webkit-backdrop-filter: blur(var(--glass-blur-mask));
}
.modal {
  background: var(--card); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--card) calc(var(--glass-modal-alpha) * 100%), transparent);
  backdrop-filter: blur(var(--glass-blur-modal)); -webkit-backdrop-filter: blur(var(--glass-blur-modal));
  border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 28px);
  width: min(400px, 100%); position: relative; box-shadow: var(--shadow-hover);
  max-height: 90dvh; overflow-y: auto;
}
/* 三个小弹窗（登录 / 兴趣选择 / 设置网站）：虚线边框；主题编辑器工作台保持原样 */
.modal:not(.theme-editor-modal) { border: 1.5px dashed var(--line); }
.modal h2 { font-size: 21px; font-weight: 800; margin-bottom: 14px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; border: none; background: none;
  font-size: 16px; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
}
.modal-close:hover { background: var(--hover-bg); }
.auth-tabs { display: flex; gap: 6px; background: var(--chip-bg); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tab { flex: 1; border: none; background: none; padding: 8px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); }
.auth-tab.active { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.form-error { background: var(--hot-soft); color: var(--hot); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 12px 0; }
.auth-tip { margin-top: 16px; font-size: 12.5px; color: var(--muted); background: var(--hover-bg); border-radius: 10px; padding: 10px 12px; }
.interest-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.interest-tag {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill);
  padding: 7px 16px; font-size: 14px; cursor: pointer; transition: all .12s; color: var(--text-2);
}
.interest-tag.selected { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ==================== Toast ==================== */
.toast {
  position: fixed; bottom: clamp(16px, 4vh, 28px); left: 50%; transform: translateX(-50%);
  background: var(--toast-bg); color: #fff; padding: 11px 22px; border-radius: var(--radius-pill);
  font-size: 14px; z-index: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  border: 1px solid var(--line); max-width: min(90vw, 480px); text-align: center;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty-box { text-align: center; padding: clamp(28px, 5vw, 40px) 20px; color: var(--muted); }
.empty-box .empty-emoji { font-size: 42px; display: block; margin-bottom: 10px; }

/* ==================== 管理后台 ==================== */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 8px 18px; font-size: 14px; cursor: pointer; font-weight: 600; transition: all .15s;
}
.admin-tab:hover { border-color: var(--brand); color: var(--brand); }
.admin-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 1fr)); gap: clamp(10px, 1.4vw, 12px); }
.stat-card {
  background: var(--card); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--card) calc(var(--glass-card-alpha) * 100%), transparent);
  border: 1px solid var(--line); backdrop-filter: blur(var(--glass-blur-card));
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 14px; text-align: center;
}
.stat-num { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; color: var(--brand); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.admin-table th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: var(--hover-bg); }
.td-limit { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions { white-space: nowrap; }
.badge {
  display: inline-block; font-size: 11.5px; padding: 2px 10px; border-radius: var(--radius-pill);
  background: var(--chip-bg); color: var(--chip-text); font-weight: 600; white-space: nowrap;
}
.badge-admin { background: rgba(196,122,16,.15); color: #e0a44c; }
.badge-ban { background: var(--hot-soft); color: var(--hot); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }

/* ==================== 站点分析（管理后台概览） ==================== */
.analytics-title-row { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; }
.analytics-title { font-size: clamp(17px, 2vw, 20px); margin: 0; }
.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px; align-items: stretch;
}
.analytics-grid .chart-wide { grid-column: 1 / -1; }
.chart-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart-head { font-size: 14.5px; font-weight: 700; color: var(--text); }
.chart-sub { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.chart-foot { font-size: 12.5px; }
.chart-empty {
  display: flex; align-items: center; justify-content: center; min-height: 110px;
  color: var(--muted); font-size: 13px; text-align: center; padding: 12px;
}
.sys-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-chip {
  display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px;
  background: var(--chip-bg); border: 1px solid var(--line); color: var(--chip-text);
  border-radius: var(--radius-pill); padding: 5px 12px; white-space: nowrap;
}
.sys-chip b { color: var(--text); font-size: 13px; }
.charts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.chart-box { min-width: 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-ylab { font-size: 10px; fill: var(--muted); text-anchor: end; }
.chart-xlab { font-size: 10px; fill: var(--muted); }
.chart-dot { fill: var(--card); stroke: inherit; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut {
  width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.donut-hole {
  width: 62px; height: 62px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted); line-height: 1.3;
}
.donut-hole b { font-size: 16px; color: var(--text); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 130px; }
.donut-legend li {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--text-2); padding: 3px 0;
}
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend .dl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend b { color: var(--text); font-weight: 700; }
.donut-legend .dl-pct { color: var(--muted); width: 40px; text-align: right; }

/* 热力图 */
.hm-scroll { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.heatmap { display: grid; grid-template-columns: 46px repeat(24, minmax(20px, 1fr)); gap: 3px; min-width: 640px; }
.hm-head, .hm-row { display: contents; }
.hm-day { display: flex; align-items: center; font-size: 11.5px; color: var(--muted); height: 20px; white-space: nowrap; }
.hm-hour { font-size: 10px; color: var(--muted); text-align: center; }
.hm-cell { height: 20px; border-radius: 3px; background: transparent; border: 1px solid var(--line); cursor: default; }
.hm-legend { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.hm-legend i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--line); }

/* 排行榜 */
.rank-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.rank-item:last-child { border-bottom: none; }
.rank-no {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; background: var(--chip-bg);
  color: var(--chip-text); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rank-no.top { background: var(--brand); color: #fff; }
.rank-body { flex: 1; min-width: 0; }
.rank-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-size: 12px; font-weight: 700; color: var(--brand); flex-shrink: 0; }

/* 最新动态 / 操作日志 */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.recent-list li:last-child { border-bottom: none; }
.recent-list .rt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.log-list li:last-child { border-bottom: none; }
.log-action {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: var(--radius-pill); padding: 2px 10px;
}
.log-target { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.log-who { color: var(--text-2); flex-shrink: 0; }

@media (max-width: 767px) {
  .charts-2col { grid-template-columns: 1fr; }
}

/* ==================== 发布编辑器（富文本 / Markdown / 导入） ==================== */
.editor-shell { margin-top: 6px; }
.editor-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.editor-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 6px 16px; font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.editor-tab:hover { border-color: var(--brand); color: var(--brand); }
.editor-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.editor-import {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  border: 1.5px dashed var(--brand); color: var(--brand); background: var(--brand-soft);
  border-radius: var(--radius-pill); padding: 6px 16px; font-size: 13.5px; font-weight: 600; transition: all .15s;
}
.editor-import:hover { background: var(--brand); color: #fff; }
.rich-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 12px 12px 0 0; background: var(--chip-bg);
}
.rich-toolbar button {
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--text-2);
  cursor: pointer; font-size: 13px; line-height: 1; transition: all .12s;
}
.rich-toolbar button:hover { background: var(--card); border-color: var(--line); color: var(--brand); }
.toolbar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; align-self: center; }
.rich-editor {
  min-height: 230px; border: 1px solid var(--line); border-radius: 0 0 12px 12px;
  padding: 14px 16px; font-size: 15px; line-height: 1.8; background: var(--card);
  outline: none; overflow-wrap: break-word;
}
.rich-editor:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rich-editor pre {
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.6;
  font-family: "SF Mono", Consolas, monospace; margin: 8px 0;
}
.rich-editor code { background: var(--chip-bg); border-radius: 4px; padding: 1px 5px; font-family: "SF Mono", Consolas, monospace; }
.rich-editor pre code { background: none; padding: 0; }
.rich-editor h2, .rich-editor h3 { margin: 10px 0 6px; line-height: 1.4; }
.rich-editor ul, .rich-editor ol { padding-left: 22px; margin: 6px 0; }
.rich-editor a { color: var(--brand); text-decoration: underline; }
.md-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.md-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 4px 14px; font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.md-tab:hover { border-color: var(--brand); color: var(--brand); }
.md-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.md-textarea { min-height: 230px; font-family: "SF Mono", Consolas, "Courier New", monospace; font-size: 13.5px; line-height: 1.7; }
.md-preview {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: var(--card); min-height: 230px;
}

/* 发布编辑器响应式：中等屏（<1600px）压缩工具栏与模式标签，避免挤成多行；
   超宽屏（≥1600px）加宽表单与编辑器；小屏（<480px）进一步收紧并降低编辑区高度 */
@media (max-width: 1599px) {
  .editor-tab, .editor-import { padding: 5px 13px; font-size: 12.5px; }
  .rich-toolbar { gap: 3px; padding: 7px 8px; }
  .rich-toolbar button { min-width: 28px; padding: 0 5px; font-size: 12px; }
  .toolbar-sep { margin: 0 3px; }
}
@media (max-width: 767px) {
  .rich-editor, .md-textarea.input, .md-preview { min-height: 180px; }
}
@media (max-width: 479px) {
  .editor-tab, .editor-import { padding: 4px 9px; font-size: 12px; }
  .rich-toolbar { gap: 2px; padding: 6px 6px; }
  .rich-toolbar button { min-width: 24px; padding: 0 4px; font-size: 11.5px; }
  .toolbar-sep { margin: 0 2px; }
}
@media (min-width: 1600px) {
  .form-card { max-width: min(720px, 100%); }
}

/* ==================== 发布页：两栏布局（主编辑器 + 边栏设置卡片） ==================== */
.publish-page { max-width: min(1240px, 100%); margin: 0 auto; }
.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
  margin-top: 18px;
}
.publish-main { min-width: 0; }
.publish-side { min-width: 0; }
.publish-side .side-inner {
  position: sticky; top: 76px;   /* 顶栏 58px + 间距，滚动编辑时设置卡片保持可见 */
}
.publish-side-title {
  font-family: var(--font-display); letter-spacing: -.2px;
  font-size: 16px; font-weight: 800;
}
.pub-title-input { font-size: 18px; font-weight: 600; padding: 12px 14px; border-radius: 14px; }
/* 宽屏下主编辑器更高，突出编辑核心区 */
@media (min-width: 1024px) {
  .publish-main .rich-editor, .publish-main .md-textarea.input, .publish-main .md-preview { min-height: 300px; }
}
/* 平板及以下：恢复单列，设置卡片置于编辑器下方 */
@media (max-width: 1023px) {
  .publish-layout { grid-template-columns: 1fr; }
  .publish-side .side-inner { position: static; }
}

/* 管理预览页顶栏 */
.admin-preview-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 6px 2px 2px; font-size: 13.5px;
}

/* ==================== 底部悬浮面板（抽屉式） ==================== */
/* 面板默认收起，只保留底部一条固定触发条；悬停时浮现圆角胶囊与空心宽箭头，箭头若隐若现地跳动提示点击 */
.dock-trigger {
  position: fixed; left: 0; right: 0; bottom: 8px; height: 52px;
  width: min(1240px, calc(100% - 24px)); margin: 0 auto; /* 与面板同宽同位，弹起时被面板完全包含 */
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  z-index: 95; -webkit-tap-highlight-color: transparent;
  padding: 0;
}
/* 悬停时浮现的圆角胶囊：半透明底色 + 描边，把整个触发区域包围起来 */
.dock-hit {
  display: flex; align-items: center; justify-content: center;
  width: min(340px, 92vw); height: 46px;
  box-sizing: border-box;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  transition: background .25s ease, box-shadow .25s ease;
}
.dock-trigger:hover .dock-hit,
.dock-trigger:focus-visible .dock-hit {
  background: rgba(127,160,140,.16); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--footer-bg) 78%, transparent);
  box-shadow: 0 8px 20px rgba(0,0,0,.12), inset 0 0 0 1.5px var(--footer-border);
}
/* 空心宽箭头：描边 + 投影增强立体感 */
.dock-arrow {
  color: var(--footer-text);
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.28));
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
/* 悬停时箭头若隐若现地上下跳动，提示点击 */
@keyframes dock-arrow-bob {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(3px); }
}
.dock-trigger:hover .dock-arrow,
.dock-trigger:focus-visible .dock-arrow {
  animation: dock-arrow-bob 1.2s ease-in-out infinite;
}
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 8px; z-index: 90;
  width: min(1240px, calc(100% - 24px)); margin: 0 auto;
  background: var(--footer-bg); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--footer-bg) calc(var(--glass-footer) * 100%), transparent);
  backdrop-filter: blur(var(--glass-blur-footer)); -webkit-backdrop-filter: blur(var(--glass-blur-footer));
  color: var(--footer-text);
  border: 1px solid var(--footer-border);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(0,0,0,.16);
  max-height: 82vh; overflow-y: auto;
  padding-bottom: 56px; /* 面板打开时底部被触发条遮住，留出空间 */
  transform: translateY(103%);
  transition: transform .32s cubic-bezier(.22, .85, .3, 1);
}
.dock.open .site-footer { transform: translateY(0); }
.dock.open .dock-arrow { opacity: 1; transform: rotate(180deg); animation: none; }
.footer-grid {
  max-width: 1240px; margin: 0 auto; padding: clamp(24px, 4vw, 32px) clamp(12px, 2.5vw, 28px) 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(20px, 3vw, 28px);
}
.footer-col h4 { color: var(--footer-text); font-size: 15px; margin-bottom: 12px; }
.footer-col h4 .history-all {
  font-size: 12px; font-weight: 400; color: var(--footer-chip-text);
  margin-left: 6px; transition: color .15s;
}
.footer-col h4 .history-all:hover { color: var(--brand); }
.footer-history { display: flex; flex-wrap: wrap; gap: 8px; }
.history-chip {
  background: var(--footer-chip-bg); border: 1px solid var(--footer-chip-border);
  color: var(--footer-chip-text); font-size: 12.5px; border-radius: var(--radius-pill); padding: 4px 12px; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .15s;
}
.history-chip:hover { background: var(--footer-chip-hover); color: var(--footer-text); }
.footer-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; }
.footer-stats li { padding: 3px 0; font-size: 13.5px; white-space: nowrap; }
.footer-stats b { color: var(--footer-text); }
.footer-about { font-size: 13px; line-height: 1.8; }
.footer-ai-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.footer-ai-links a {
  color: var(--footer-chip-text); font-size: 12.5px; border: 1px solid var(--footer-chip-border);
  border-radius: var(--radius-pill); padding: 3px 11px; transition: all .15s;
}
.footer-ai-links a:hover { background: var(--footer-chip-hover); color: var(--footer-text); }

/* ==================== 页侧前进 / 后退箭头（样式参考底部面板触发条） ==================== */
/* 左右两侧各一枚空心宽箭头：默认半透明常驻，悬停浮现与底部触发条一致的圆角胶囊并左右轻摆提示点击 */
.side-arrow {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 52px; height: 192px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  border: none;
  background: transparent; cursor: pointer;
  border-radius: 26px; color: var(--footer-text);
  z-index: 85; -webkit-tap-highlight-color: transparent;
  transition: background .25s ease, box-shadow .25s ease;
}
.side-back { left: 14px; }
.side-forward { right: 14px; }
/* 与底部触发条一致：默认不可见（仅保留热区），鼠标悬浮时才浮现胶囊与箭头 */
.side-arrow-icon {
  width: 46px; height: 42px;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.28));
  transition: opacity .2s ease;
  pointer-events: none;
}
/* 悬停 / 聚焦时：浮现胶囊（半透明底色 + 描边），箭头摆向对应方向 */
@keyframes side-arrow-bob-l {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50%      { opacity: .7; transform: translateX(-3px); }
}
@keyframes side-arrow-bob-r {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50%      { opacity: .7; transform: translateX(3px); }
}
.side-arrow:not(:disabled):hover,
.side-arrow:not(:disabled):focus-visible {
  background: rgba(127,160,140,.16); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--footer-bg) 78%, transparent);
  box-shadow: 0 8px 20px rgba(0,0,0,.12), inset 0 0 0 1.5px var(--footer-border);
}
.side-arrow:not(:disabled):hover .side-arrow-icon,
.side-arrow:not(:disabled):focus-visible .side-arrow-icon { opacity: 1; }
.side-back:not(:disabled):hover .side-arrow-icon,
.side-back:not(:disabled):focus-visible .side-arrow-icon { animation: side-arrow-bob-l 1.2s ease-in-out infinite; }
.side-forward:not(:disabled):hover .side-arrow-icon,
.side-forward:not(:disabled):focus-visible .side-arrow-icon { animation: side-arrow-bob-r 1.2s ease-in-out infinite; }
/* 无历史可前进 / 后退时：悬浮也仅露出淡淡的轮廓提示不可用，平时完全不可见 */
.side-arrow:disabled { cursor: default; }
.side-arrow:disabled .side-arrow-icon { opacity: 0; }
.side-arrow:disabled:hover .side-arrow-icon,
.side-arrow:disabled:focus-visible .side-arrow-icon { opacity: .2; }
/* 手机：缩小并贴边，避免遮挡内容 */
@media (max-width: 767px) {
  .side-arrow { width: 44px; height: 144px; }
  .side-back { left: 8px; }
  .side-forward { right: 8px; }
}

/* ==================== 设置网站：栏目（常用 / 主题横向并排）与常用选项 ==================== */
.modal-wide { width: min(680px, 100%); }
.settings-cols { display: grid; grid-template-columns: 1fr 1.2fr; }
.settings-col { min-width: 0; }
.settings-col + .settings-col {
  border-left: 1px dashed var(--line);
  padding-left: clamp(18px, 3vw, 28px);
}
.settings-col-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 800;
  margin-bottom: 10px; letter-spacing: -.3px;
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px dashed var(--line);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-info { min-width: 0; }
.setting-title { font-size: 14.5px; font-weight: 700; }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
/* 开关（iOS 风格） */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; background: var(--chip-bg); border: 1px solid var(--line);
  border-radius: var(--radius-pill); cursor: pointer; transition: all .18s;
}
.switch-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: all .18s;
}
.switch input:checked + .switch-slider { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
/* 窄屏：保持两栏横向并排，仅微调字号保证可读性 */
@media (max-width: 480px) {
  .settings-col-title { font-size: 14.5px; }
  .setting-title { font-size: 13.5px; }
  .setting-desc { font-size: 11px; }
}

/* ==================== 设置网站：主题风格选择 ==================== */
.settings-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 16px 0; }
.theme-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); cursor: pointer; color: var(--text); text-align: left;
  transition: all .15s; position: relative;
}
.theme-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.theme-card.active { border-color: var(--brand); background: var(--brand-soft); }
.theme-card .theme-name { font-size: 13.5px; font-weight: 600; }
.theme-card .theme-check {
  position: absolute; top: 10px; right: 10px; color: var(--brand); font-weight: 800;
}
.theme-swatch { display: inline-flex; gap: 4px; }
.theme-swatch i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

/* ==================== 设置网站：主题操作（新建 / 导出 / 导入） ==================== */
.theme-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.theme-actions .btn { flex: 1; min-width: 0; padding: 7px 10px; font-size: 12.5px; }
/* 自定义主题卡片：虚线边框 + 编辑角标 + 标记 */
.theme-card.custom { border-style: dashed; }
.theme-card.add-card { align-items: center; justify-content: center; gap: 6px; color: var(--text-2); border-style: dashed; }
.theme-card.add-card .theme-add { font-size: 26px; line-height: 1; color: var(--brand); font-weight: 400; }
.theme-card.add-card .theme-name { font-size: 12.5px; }
.theme-card .theme-tag {
  position: absolute; bottom: 8px; left: 14px; font-size: 10px; color: var(--muted);
  background: var(--chip-bg); border-radius: var(--radius-pill); padding: 1px 7px;
}
.theme-card .theme-edit {
  position: absolute; bottom: 6px; right: 8px; font-size: 12px; color: var(--brand);
  background: var(--card); border: 1px solid var(--line); border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: all .12s;
}
.theme-card .theme-edit:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ==================== 主题编辑器（自定义主题工作台） ==================== */
.theme-editor-modal { width: min(1120px, 100%); }
/* 头部：标题在左，取消/导出/删除/保存按钮在右（避让右上角 ✕） */
.te-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-right: 32px;
}
.te-head h2 { margin: 0; font-size: 21px; font-weight: 800; }
.te-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .te-head { flex-direction: column; align-items: flex-start; padding-right: 24px; }
}
.theme-editor-body { display: flex; flex-direction: column; gap: 12px; }
/* 两栏：最左侧宏观设置面板 + 主体（直观式预览点选编辑） */
.te-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.te-macro { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.te-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.te-stack { display: flex; flex-direction: column; gap: 10px; }
/* 选中元素参数区：左侧品牌色条提示 */
.te-sel-sec { border-left: 3px solid var(--brand); }
.te-sel-sec .te-sec-title b { color: var(--brand); }
#te-sel-params { display: flex; flex-direction: column; gap: 10px; }
.te-sec {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--card); box-shadow: var(--shadow);
}
.te-sec-title { font-weight: 700; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.te-grid { display: grid; gap: 10px 16px; }
.te-grid-3 { grid-template-columns: repeat(3, 1fr); }
.te-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); min-width: 0; }
.te-field > span { font-size: 12px; }
.te-ctrl-text, .te-ctrl-select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 13.5px; outline: none; background: var(--card); color: var(--text); font-family: inherit;
}
.te-ctrl-text:focus, .te-ctrl-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.te-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 14px; }
.te-color { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.te-color input[type="color"] {
  width: 36px; height: 28px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px;
  padding: 2px; background: var(--card); cursor: pointer;
}
.te-slider { display: grid; grid-template-columns: 1fr 56px; align-items: center; gap: 4px 12px; }
.te-slider > span { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.te-slider input[type="range"] { grid-column: 1; width: 100%; accent-color: var(--brand); cursor: pointer; }
.te-slider .te-val { grid-column: 2; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.te-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.te-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.te-actions .btn { padding: 9px 16px; }
.te-hint { flex: 1; min-width: 180px; }
#te-bg-params { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.te-bg-pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.te-bg-preview {
  min-height: 96px; max-height: 170px; border: 1px dashed var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--hover-bg); font-size: 12px; padding: 6px;
}
.te-bg-preview img { max-width: 100%; max-height: 160px; border-radius: 8px; display: block; object-fit: contain; }
@media (max-width: 560px) {
  .te-grid-3 { grid-template-columns: 1fr; }
}

/* ==================== 主题编辑器：迷你主页预览画布（16:9，点选元素改参数） ==================== */
.te-pv-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
/* 16:9 固定比例容器；内部画布按 800×450 设计尺寸布局并整体缩放，内容完整包含 */
.te-pv-wrap {
  position: relative; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); background: var(--bg);
}
.te-pv {
  position: absolute; top: 0; left: 0; width: 800px; height: 450px;
  transform-origin: top left; transform: scale(var(--pv-scale, 1));
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5; cursor: default;
}
/* 可点选元素：hover 提示 + 选中高亮 + 角标（角标置于画布内，避免被 16:9 容器裁切） */
.te-pv [data-te-el] { cursor: pointer; transition: box-shadow .12s; position: relative; }
.te-pv [data-te-el]:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.te-pv [data-te-el].sel { box-shadow: inset 0 0 0 2px var(--brand); }
.te-pv [data-te-el].sel::after {
  content: attr(data-el-name); position: absolute; top: 3px; right: 6px; z-index: 6;
  background: var(--brand); color: #fff; font-size: 12px; border-radius: 6px;
  padding: 0 8px; line-height: 20px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
/* 顶栏 */
.te-pv-header {
  display: flex; align-items: center; gap: 12px; padding: 7px 18px;
  background: var(--header-bg);
  backdrop-filter: blur(var(--glass-blur-header)); -webkit-backdrop-filter: blur(var(--glass-blur-header));
  border-bottom: 1px solid var(--footer-border);
}
.te-pv-navbtn {
  background: var(--header-nav-btn-bg); color: var(--header-nav-btn-text);
  border: 1px solid var(--header-nav-btn-border); border-radius: var(--radius-pill);
  padding: 4px 14px; font-size: 12px; white-space: nowrap;
}
.te-pv-navlink { color: var(--nav-link); font-size: 13px; }
.te-pv-circle {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-grad); color: #fff; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Hero */
.te-pv-hero { text-align: center; padding: 6px 24px 4px; }
.te-pv-badge {
  display: inline-block; background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text-2); border-radius: var(--radius-pill); padding: 1px 10px; font-size: 10px;
}
.te-pv-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 2px 0 0;
  color: var(--text); letter-spacing: -.3px;
}
.te-pv-title .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: normal; }
.te-pv-sub { color: var(--muted); font-size: 11.5px; margin: 1px 0 0; }
.te-pv-search {
  display: flex; align-items: center; gap: 8px; margin: 4px auto 0; max-width: 74%;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur-search)); -webkit-backdrop-filter: blur(var(--glass-blur-search));
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 6px 3px 12px;
  box-shadow: var(--shadow); color: var(--muted); font-size: 13px;
}
.te-pv-searchbtn {
  margin-left: auto; flex-shrink: 0; background: var(--brand-grad); color: #fff;
  border-radius: var(--radius-pill); padding: 6px 18px; font-size: 12px;
}
.te-pv-tags { margin-top: 3px; color: var(--muted); font-size: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.te-pv-tags i {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 1px 10px; font-style: normal; color: var(--text-2);
}
/* 内容：三栏（关注 / 推荐 / 热榜） */
.te-pv-body {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) 210px;
  gap: 10px; padding: 8px 18px 10px; align-items: stretch;
}
.te-pv-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.te-pv-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.te-pv-card {
  background: var(--card); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--card) calc(var(--glass-card-alpha) * 100%), transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px 12px;
  backdrop-filter: blur(var(--glass-blur-card)); -webkit-backdrop-filter: blur(var(--glass-blur-card));
  display: flex; flex-direction: column; gap: 2px;
}
.te-pv-card .t {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.te-pv-card .e {
  color: var(--text-2); font-size: 11px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.te-pv-card .m { color: var(--muted); font-size: 10px; display: flex; gap: 12px; margin-top: 0; }
.te-pv-card .m b { font-weight: 600; }
.te-pv-mini .t { font-size: 12.5px; }
.te-pv-mini .e { font-size: 10.5px; -webkit-line-clamp: 1; }
.te-pv-ranks { gap: 6px; }
.te-pv-ranks .e { -webkit-line-clamp: 1; }
.te-pv-ranks .e b { color: var(--hot); font-weight: 800; margin-right: 3px; }
.te-pv-ranks .e .heat { color: var(--hot); font-weight: 700; float: right; }
/* 页脚悬浮条 */
.te-pv-footer {
  margin: 0 18px 10px; border-radius: 12px;
  background: var(--footer-bg); /* 兜底：不支持 color-mix 的旧浏览器 */
  background: color-mix(in srgb, var(--footer-bg) calc(var(--glass-footer) * 100%), transparent);
  backdrop-filter: blur(var(--glass-blur-footer)); -webkit-backdrop-filter: blur(var(--glass-blur-footer));
  border: 1px solid var(--footer-border); box-shadow: 0 4px 14px rgba(0,0,0,.10);
  color: var(--footer-text); font-size: 11.5px; padding: 8px 14px;
  display: flex; justify-content: space-between; gap: 8px;
}
/* 编辑器两栏：窄屏单列堆叠（宏观设置在前，预览点选在后） */
@media (max-width: 899px) {
  .te-layout { grid-template-columns: 1fr; }
  .te-macro { order: -1; }
}

/* ==================== 主题：薄荷手账可爱风 🍃（默认） ==================== */
/* 配色 / 玻璃参数即 :root 默认值（基础即薄荷手账），背景波点由 theme.js 按主题数据注入，
   此处只保留各主题的专属装饰规则 */
body[data-theme="mint"] .feed-card,
body[data-theme="mint"] .side-card,
body[data-theme="mint"] .comm-card,
body[data-theme="mint"] .tool-card,
body[data-theme="mint"] .timeline-card { border: 2px solid #e2f6ec; }
body[data-theme="mint"] .tag-chip { border: 1.5px dashed #b9e3cd; }
body[data-theme="mint"] .feed-title { color: #25513f; }
body[data-theme="mint"] .btn-primary { box-shadow: 0 4px 12px rgba(63,174,124,.35); }
body[data-theme="mint"] .post-content pre { border: 1px solid #d8ece1; }
body[data-theme="mint"] .site-header { border-bottom-color: rgba(203,233,217,.65); }

/* ==================== 主题：暖白书信风 ✉️ ==================== */
body[data-theme="letter"] .feed-card,
body[data-theme="letter"] .side-card,
body[data-theme="letter"] .tool-card,
body[data-theme="letter"] .timeline-card { border: 1px solid #e9dcc2; }
body[data-theme="letter"] .post-title,
body[data-theme="letter"] .feed-title { color: #3f3628; }
body[data-theme="letter"] .hero h1 { letter-spacing: 2px; }
body[data-theme="letter"] .comm-icon { border-radius: 8px; background: #f3e7cf; }
body[data-theme="letter"] .btn-primary { box-shadow: 0 2px 8px rgba(168,111,63,.3); }
body[data-theme="letter"] .site-header { border-bottom-color: rgba(220,203,168,.65); }

/* ==================== 主题：暗夜代码风 🌙 ==================== */
body[data-theme="code"] .feed-title,
body[data-theme="code"] .rank-title { font-family: var(--font-mono); }
body[data-theme="code"] .feed-card,
body[data-theme="code"] .side-card,
body[data-theme="code"] .comm-card,
body[data-theme="code"] .tool-card,
body[data-theme="code"] .timeline-card { border: 1px solid #21262d; }
body[data-theme="code"] .tag-chip { font-family: var(--font-mono); font-size: 11.5px; }
body[data-theme="code"] .chip { color: #58a6ff; }
body[data-theme="code"] .post-content pre { border: 1px solid #30363d; }
body[data-theme="code"] .input, body[data-theme="code"] textarea.input {
  background: #0d1117; color: #e6edf3;
}
body[data-theme="code"] .hero h1 { letter-spacing: 1px; }

/* ==================== 响应式断点 ====================
   1240px+ : 桌面三栏
   1200px  : 三栏 → 两栏（中栏置顶全宽），AI 导航收进「🧭 AI 导航」菜单
   768px   : 两栏 → 单栏，顶栏纵向堆叠
   480px   : 小屏微调
   ==================================================== */

/* 平板及以下：三栏 → 两栏（中栏置顶全宽） */
@media (max-width: 1199px) {
  .home-grid { grid-template-columns: minmax(272px, 340px) minmax(0, 1fr); }
  .col-center { grid-column: 1 / -1; order: -1; }
}

/* 手机：单栏 + 顶栏两行堆叠 */
@media (max-width: 767px) {
  .home-grid { grid-template-columns: 1fr; }
  .col-center { order: 0; }
  .header-inner {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 10px 12px;
  }
  .header-left { grid-column: 1; grid-row: 1; }
  .header-right { grid-column: 2; grid-row: 1; }
  .header-center { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .search-box { flex-direction: column; border-radius: 18px; padding: 12px; }
  .search-box .search-btn { width: 100%; }
  .feed-card { padding: 14px; }
  .comment-form { flex-wrap: wrap; }
  .comment-form .btn { width: 100%; }
  .post-page { padding: 0; }
  .admin-table { min-width: 640px; }
}

/* 小屏手机 */
@media (max-width: 479px) {
  .main { padding-inline: 10px; }
  .hero-badge { font-size: 12px; padding: 6px 12px; }
  .hot-tags > span { display: none; }
  .feed-stat { font-size: 12px; }
  .comm-banner-info { min-width: 100%; }
  .user-head-info { min-width: 100%; }
}

/* 超宽屏（16:9 大屏 1920/2560 等）：加宽内容容器，中间推荐区呈 3 列，充分利用横向空间 */
@media (min-width: 1600px) {
  .header-inner, .main, .footer-grid { max-width: 1600px; }
  .site-footer, .dock-trigger { width: min(1600px, calc(100% - 24px)); }
}
/* 2K 及以上（2560×1440 等）：再放宽一档，中间卡片更舒展 */
@media (min-width: 2000px) {
  .header-inner, .main, .footer-grid { max-width: 1760px; }
  .site-footer, .dock-trigger { width: min(1760px, calc(100% - 24px)); }
}

/* 16:9 短屏高（720p / 768p 笔记本）：压缩 Hero，让推荐内容进入首屏 */
@media (min-width: 768px) and (max-height: 820px) {
  .header-inner { min-height: 52px; }
  .main { padding-top: 16px; }
  .hero { padding: 22px 0 4px; }
  .hero-badge { margin-bottom: 10px; padding: 5px 13px; font-size: 12px; }
  .hero h1 { font-size: clamp(22px, 3vw, 34px); }
  .hero p.sub { margin: 6px 0 10px; font-size: 13.5px; }
  .search-box { padding: 5px 5px 5px clamp(14px, 2vw, 20px); }
  .search-box .search-btn { padding: 8px clamp(16px, 2.4vw, 22px); font-size: 14px; }
  .hot-tags { margin-top: 8px; }
  .home-grid { margin-top: 14px; }
}
