/*!
 * app.css —— ThinkForum 站点样式层
 * 依赖：zui.min.css（基础组件与工具类）、theme.css（多套配色）
 *
 * 响应式断点对齐 ZUI 屏幕配置（https://openzui.com/guide/config/base/screens.html）：
 *   xs < 640 | sm ≥ 640(--screen-sm) | md ≥ 768(--screen-md)
 *   lg ≥ 1024(--screen-lg) | xl ≥ 1280(--screen-xl) | 2xl ≥ 1536(--screen-2xl)
 * 说明：CSS 规范不允许在 @media 条件中使用 var()，因此这里使用与变量同值的字面量，
 *      并在注释中标注对应变量，保证与 ZUI 断点定义始终一致。
 */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  --tf-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --tf-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 文字层级 */
  --tf-text: #1e293b;
  --tf-text-2: #475569;
  --tf-text-3: #64748b;
  --tf-text-4: #94a3b8;

  /* 背景层级 */
  --tf-canvas: #f4f6fa;
  --tf-card: #ffffff;
  --tf-card-2: #f8fafc;
  --tf-mask: rgba(15, 23, 42, .45);

  /* 阴影 */
  --tf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --tf-shadow-md: 0 2px 6px -1px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .16);
  --tf-shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, .28);

  /* 布局节奏（由 data-density 覆写） */
  --tf-gap: 16px;
  --tf-card-pad: 16px;
  --tf-list-gap: 10px;
  --tf-header-h: 56px;

  /* 卡片圆角（由 data-radius 覆写） */
  --tf-radius-card: 14px;
  --tf-radius-pill: 999px;

  --tf-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ZUI 语义变量微调：让画布更干净、卡片更亮 */
:root {
  --color-canvas: #f4f6fa;
  --color-canvas-rgb: 244, 246, 250;
  --color-border: #e4eaf2;
  --color-border-rgb: 228, 234, 242;
  --color-border-strong: #cfd8e6;
  --color-border-strong-rgb: 207, 216, 230;
  --color-border-light: #eff3f8;
  --color-border-light-rgb: 239, 243, 248;
}

html.dark {
  --tf-text: #e6ecf7;
  --tf-text-2: #b8c4d6;
  --tf-text-3: #8b98ab;
  --tf-text-4: #657184;

  --tf-canvas: #0a0e15;
  --tf-card: #131a26;
  --tf-card-2: #1a2231;
  --tf-mask: rgba(0, 0, 0, .62);

  --tf-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --tf-shadow-md: 0 2px 6px -1px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .7);
  --tf-shadow-lg: 0 16px 48px -16px rgba(0, 0, 0, .8);

  --color-canvas: #0a0e15;
  --color-canvas-rgb: 10, 14, 21;
  --color-surface: #1c2637;
  --color-surface-rgb: 28, 38, 55;
  --color-surface-light: #161f2d;
  --color-surface-light-rgb: 22, 31, 45;
  --color-surface-strong: #27334a;
  --color-surface-strong-rgb: 39, 51, 74;
  --color-border: #232e40;
  --color-border-rgb: 35, 46, 64;
  --color-border-strong: #33405a;
  --color-border-strong-rgb: 51, 64, 90;
  --color-border-light: #1a2231;
  --color-border-light-rgb: 26, 34, 49;
}

/* 圆角档位 */
html[data-radius="sharp"] {
  --radius: 2px;
  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 4px;
  --radius-xl: 6px;
  --radius-2xl: 8px;
  --radius-3xl: 10px;
  --tf-radius-card: 6px;
}

html[data-radius="soft"] {
  --radius: 6px;
  --radius-sm: 4px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 20px;
  --tf-radius-card: 14px;
}

html[data-radius="round"] {
  --radius: 10px;
  --radius-sm: 8px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 22px;
  --radius-3xl: 26px;
  --tf-radius-card: 20px;
}

/* 密度档位 */
html[data-density="compact"] {
  --tf-gap: 12px;
  --tf-card-pad: 12px;
  --tf-list-gap: 6px;
}

html[data-density="cozy"] {
  --tf-gap: 16px;
  --tf-card-pad: 16px;
  --tf-list-gap: 10px;
}

html[data-density="loose"] {
  --tf-gap: 20px;
  --tf-card-pad: 22px;
  --tf-list-gap: 14px;
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--tf-font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--tf-text);
  background: var(--tf-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark a:hover { color: rgb(var(--color-primary-400-rgb)); }

img { max-width: 100%; }

::selection { background: rgb(var(--color-primary-500-rgb)); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--tf-text-4); background-clip: content-box; }

/* 功能性 Web Component 未升级时的占位（登录弹窗 / 友链申请 / 主题面板 / 回到顶部 默认隐藏） */
tf-auth, tf-flink, tf-theme-panel, tf-backtop { display: none; }
tf-auth:defined, tf-flink:defined, tf-theme-panel:defined, tf-backtop:defined { display: block; }

/* ==========================================================================
   3. 布局
   ========================================================================== */
.tf-wrap {
  width: 100%;
  max-width: 1280px;   /* ≈ --screen-xl */
  margin: 0 auto;
  padding-left: 12px;
  padding-right: 12px;
}
@media (min-width: 640px) {  /* --screen-sm */
  .tf-wrap { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 1024px) { /* --screen-lg */
  .tf-wrap { padding-left: 24px; padding-right: 24px; }
}

.tf-main { min-height: 60vh; padding: var(--tf-gap) 0 32px; }

/* 主内容 + 侧栏 */
.tf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tf-gap);
  align-items: start;
}
@media (min-width: 1024px) { /* --screen-lg：侧栏从 lg 起出现 */
  .tf-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .tf-layout--wide { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (min-width: 1280px) { /* --screen-xl */
  .tf-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .tf-layout--wide { grid-template-columns: minmax(0, 1fr) 340px; }
}

.tf-side { display: flex; flex-direction: column; gap: var(--tf-gap); position: sticky; top: calc(var(--tf-header-h) + 12px); }
@media (max-width: 1023.98px) { .tf-side { position: static; } }

.tf-stack { display: flex; flex-direction: column; gap: var(--tf-gap); }
.tf-row { display: flex; align-items: center; gap: 8px; }
.tf-row--between { justify-content: space-between; }
.tf-center { display: flex; align-items: center; justify-content: center; }
.tf-spacer { flex: 1 1 auto; }
.tf-full { width: 100%; }

/* ==========================================================================
   4. 卡片 / 面板
   ========================================================================== */
.tf-card {
  background: var(--tf-card);
  border: 1px solid var(--color-border);
  border-radius: var(--tf-radius-card);
  box-shadow: var(--tf-shadow);
  overflow: hidden;
}
.tf-card--pad { padding: var(--tf-card-pad); }
/* 卡片内含下拉浮层（如版块两级选择）时取消裁切 */
.tf-card--dropdown { overflow: visible; }
.tf-card--hover { transition: box-shadow .22s var(--tf-ease), transform .22s var(--tf-ease), border-color .22s var(--tf-ease); }
.tf-card--hover:hover {
  box-shadow: var(--tf-shadow-md);
  border-color: rgb(var(--color-primary-300-rgb));
  transform: translateY(-2px);
}
html.dark .tf-card--hover:hover { border-color: rgb(var(--color-primary-700-rgb)); }

.tf-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
}
.tf-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--tf-text);
  letter-spacing: .2px;
}
.tf-card__title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
}
.tf-card__body { padding: var(--tf-card-pad); }
.tf-card__foot {
  padding: 10px var(--tf-card-pad);
  border-top: 1px solid var(--color-border-light);
  background: var(--tf-card-2);
}

/* ==========================================================================
   5. 文本工具
   ========================================================================== */
.tf-t { color: var(--tf-text); }
.tf-t2 { color: var(--tf-text-2); }
.tf-t3 { color: var(--tf-text-3); }
.tf-t4 { color: var(--tf-text-4); }
.tf-primary { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-primary { color: rgb(var(--color-primary-400-rgb)); }
.tf-fs12 { font-size: 12px; }
.tf-fs13 { font-size: 13px; }
.tf-fs15 { font-size: 15px; }
.tf-fs18 { font-size: 18px; }
.tf-b { font-weight: 600; }
.tf-num { font-variant-numeric: tabular-nums; }
.tf-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tf-clamp3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ==========================================================================
   6. 徽标 / 标签
   ========================================================================== */
.tf-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--tf-radius-pill);
  font-size: 12px;
  line-height: 1;
  background: rgb(var(--color-surface-rgb));
  color: var(--tf-text-3);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tf-tag--primary { background: rgb(var(--color-primary-50-rgb)); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-tag--primary { background: rgba(var(--color-primary-500-rgb), .16); color: rgb(var(--color-primary-300-rgb)); }
.tf-tag--danger  { background: rgb(var(--color-danger-50-rgb));  color: rgb(var(--color-danger-600-rgb)); }
.tf-tag--warning { background: rgb(var(--color-warning-50-rgb)); color: rgb(var(--color-warning-600-rgb)); }
.tf-tag--success { background: rgb(var(--color-success-50-rgb)); color: rgb(var(--color-success-600-rgb)); }
html.dark .tf-tag--danger  { background: rgba(var(--color-danger-500-rgb), .16);  color: rgb(var(--color-danger-400-rgb)); }
html.dark .tf-tag--warning { background: rgba(var(--color-warning-500-rgb), .16); color: rgb(var(--color-warning-400-rgb)); }
html.dark .tf-tag--success { background: rgba(var(--color-success-500-rgb), .16); color: rgb(var(--color-success-400-rgb)); }
a.tf-tag { transition: filter .16s var(--tf-ease); }
a.tf-tag:hover { filter: brightness(.96); }
html.dark a.tf-tag:hover { filter: brightness(1.25); }

.tf-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgb(var(--color-primary-500-rgb));
  display: inline-block; flex: none;
}

/* ==========================================================================
   7. 头像
   ========================================================================== */
.tf-avatar { border-radius: var(--tf-radius-pill); overflow: hidden; flex: none; background: var(--color-surface); }
.tf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-avatar--24 { width: 24px; height: 24px; }
.tf-avatar--32 { width: 32px; height: 32px; }
.tf-avatar--40 { width: 40px; height: 40px; }
.tf-avatar--48 { width: 48px; height: 48px; }
.tf-avatar--72 { width: 72px; height: 72px; }
.tf-avatar--96 { width: 96px; height: 96px; }
.tf-avatar--ring { box-shadow: 0 0 0 2px var(--tf-card), 0 0 0 3px rgb(var(--color-primary-500-rgb)); }

/* ==========================================================================
   8. 按钮增强
   ========================================================================== */
.btn { transition: filter .16s var(--tf-ease), background-color .16s var(--tf-ease), box-shadow .16s var(--tf-ease); font-size: 13px; }
.btn:active { transform: translateY(.5px); }
.tf-btn-pill { border-radius: var(--tf-radius-pill); }
.tf-btn-icon { width: 32px; padding: 0; flex: none; }

/* ==========================================================================
   9. 版块快捷入口（横向 chips）
   ========================================================================== */
.tf-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.tf-chips::-webkit-scrollbar { display: none; }
.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--tf-radius-pill);
  background: var(--tf-card);
  border: 1px solid var(--color-border);
  color: var(--tf-text-2);
  font-size: 13px;
  transition: all .18s var(--tf-ease);
}
.tf-chip:hover {
  border-color: rgb(var(--color-primary-400-rgb));
  color: rgb(var(--color-primary-600-rgb));
  background: rgb(var(--color-primary-50-rgb));
}
html.dark .tf-chip:hover { background: rgba(var(--color-primary-500-rgb), .14); color: rgb(var(--color-primary-300-rgb)); }
.tf-chip.is-active {
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px -4px rgb(var(--color-primary-500-rgb));
}
.tf-chip__icon {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; flex: none;
}
/* 上传的图片图标：铺满容器 */
.tf-chip__icon img,
.tf-subforum__icon img,
.tf-forum-hero__icon img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}

/* ==========================================================================
   10. 筛选条
   ========================================================================== */
.tf-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
}
.tf-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--color-surface);
  border-radius: var(--tf-radius-pill);
}
.tf-seg__item {
  border: 0; background: transparent; cursor: pointer;
  height: 28px; padding: 0 14px; border-radius: var(--tf-radius-pill);
  font-size: 13px; color: var(--tf-text-3);
  transition: all .18s var(--tf-ease);
}
.tf-seg__item:hover { color: var(--tf-text); }
.tf-seg__item.is-active {
  background: var(--tf-card); color: rgb(var(--color-primary-600-rgb));
  font-weight: 600; box-shadow: var(--tf-shadow);
}
html.dark .tf-seg__item.is-active { background: var(--tf-card-2); color: rgb(var(--color-primary-300-rgb)); }

/* ==========================================================================
   11. 帖子列表
   ========================================================================== */
.tf-list { display: flex; flex-direction: column; }

.tf-topic {
  display: flex;
  gap: 12px;
  padding: 14px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color .18s var(--tf-ease);
  position: relative;
}
.tf-topic:last-child { border-bottom: 0; }
.tf-topic:hover { background: var(--tf-card-2); }
.tf-topic__main { flex: 1 1 auto; min-width: 0; }
.tf-topic__title {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 0 5px; font-size: 15px; font-weight: 600; line-height: 1.5;
}
.tf-topic__title a { color: var(--tf-text); }
.tf-topic__title a:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-topic__title a:hover { color: rgb(var(--color-primary-400-rgb)); }
.tf-topic__desc {
  margin: 0 0 8px; font-size: 13px; color: var(--tf-text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tf-topic__meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--tf-text-4);
}
.tf-topic__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.tf-topic__stat {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--tf-text-4); flex: none;
}
.tf-topic__stat b { font-weight: 600; color: var(--tf-text-2); font-variant-numeric: tabular-nums; }
.tf-topic__cover {
  width: 108px; height: 72px; border-radius: 10px; overflow: hidden; flex: none;
}
.tf-topic__cover img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 639.98px) { /* < --screen-sm */
  .tf-topic__cover { display: none; }
  .tf-topic { padding: 12px; }
  .tf-topic__stat { display: none; }
}

.tf-flag {
  display: inline-flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 1; flex: none;
  background: rgb(var(--color-danger-50-rgb)); color: rgb(var(--color-danger-600-rgb));
}
.tf-flag--elite { background: rgb(var(--color-warning-50-rgb)); color: rgb(var(--color-warning-600-rgb)); }
.tf-flag--top { background: rgb(var(--color-primary-50-rgb)); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-flag { background: rgba(var(--color-danger-500-rgb), .18); color: rgb(var(--color-danger-400-rgb)); }
html.dark .tf-flag--elite { background: rgba(var(--color-warning-500-rgb), .18); color: rgb(var(--color-warning-400-rgb)); }
html.dark .tf-flag--top { background: rgba(var(--color-primary-500-rgb), .18); color: rgb(var(--color-primary-300-rgb)); }

/* 空态 */
.tf-empty { padding: 48px 16px; text-align: center; color: var(--tf-text-4); }
.tf-empty i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .55; }

/* ==========================================================================
   12. 分页
   ========================================================================== */
.tf-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 14px 0 4px; }
.tf-pager__btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--color-border);
  background: var(--tf-card); color: var(--tf-text-2);
  font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: all .16s var(--tf-ease);
}
.tf-pager__btn:hover { border-color: rgb(var(--color-primary-400-rgb)); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-pager__btn:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-pager__btn.is-active {
  background: rgb(var(--color-primary-500-rgb)); border-color: rgb(var(--color-primary-500-rgb)); color: #fff; font-weight: 600;
}
.tf-pager__btn[disabled] { opacity: .45; cursor: not-allowed; }
.tf-pager__ellipsis { color: var(--tf-text-4); padding: 0 2px; }
.tf-pager__info { font-size: 12px; color: var(--tf-text-4); margin-left: 6px; }

/* ==========================================================================
   13. 侧栏小部件
   ========================================================================== */
.tf-rank { display: flex; flex-direction: column; }
.tf-rank__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--tf-card-pad);
  transition: background-color .16s var(--tf-ease);
}
.tf-rank__item:hover { background: var(--tf-card-2); }
.tf-rank__no {
  width: 20px; height: 20px; flex: none; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--tf-text-4);
  background: var(--color-surface); font-variant-numeric: tabular-nums;
}
.tf-rank__item:nth-child(1) .tf-rank__no { background: rgb(var(--color-danger-500-rgb)); color: #fff; }
.tf-rank__item:nth-child(2) .tf-rank__no { background: rgb(var(--color-warning-500-rgb)); color: #fff; }
.tf-rank__item:nth-child(3) .tf-rank__no { background: rgb(var(--color-primary-500-rgb)); color: #fff; }
.tf-rank__title { flex: 1 1 auto; min-width: 0; font-size: 13px; }

.tf-user-row { display: flex; align-items: center; gap: 10px; padding: 8px var(--tf-card-pad); }
.tf-user-row__info { flex: 1 1 auto; min-width: 0; }

.tf-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--color-border-light); }
.tf-stat-grid__cell { background: var(--tf-card); padding: 12px 10px; text-align: center; }
.tf-stat-grid__cell b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-stat-grid__cell span { font-size: 12px; color: var(--tf-text-4); }

/* 签到卡 */
.tf-signin {
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
  color: #fff; border: 0; border-radius: var(--tf-radius-card); padding: 16px;
}
.tf-signin__btn {
  background: rgba(255, 255, 255, .22); color: #fff; border: 1px solid rgba(255, 255, 255, .4);
  backdrop-filter: blur(4px);
}
.tf-signin__btn:hover { background: rgba(255, 255, 255, .34); color: #fff; }

/* ==========================================================================
   14. 版块页
   ========================================================================== */
.tf-forum-hero {
  position: relative;
  border-radius: var(--tf-radius-card);
  overflow: hidden;
  padding: 22px;
  color: #fff;
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
}
.tf-forum-hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 200px at 88% -20%, rgba(255, 255, 255, .28), transparent 70%),
    radial-gradient(400px 180px at 10% 120%, rgba(255, 255, 255, .16), transparent 70%);
  pointer-events: none;
}
.tf-forum-hero > * { position: relative; z-index: 1; }
.tf-forum-hero__icon {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3);
}
.tf-forum-hero h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.tf-forum-hero p { margin: 0; font-size: 13px; opacity: .92; max-width: 640px; }
.tf-forum-hero__stats { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.tf-forum-hero__stats div b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-forum-hero__stats div span { font-size: 12px; opacity: .85; }
.tf-forum-hero__btn {
  background: #fff; color: rgb(var(--color-primary-600-rgb)); border: 0;
  height: 34px; padding: 0 18px; border-radius: var(--tf-radius-pill);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .16s var(--tf-ease), box-shadow .16s var(--tf-ease);
}
.tf-forum-hero__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45); }
.tf-forum-hero__btn.is-on { background: rgba(255, 255, 255, .24); color: #fff; border: 1px solid rgba(255, 255, 255, .5); }

@media (max-width: 767.98px) { /* < --screen-md */
  .tf-forum-hero { padding: 16px; }
  .tf-forum-hero h1 { font-size: 18px; }
  .tf-forum-hero__icon { width: 44px; height: 44px; font-size: 20px; }
}

/* 子版块 */
.tf-subforums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { /* --screen-md */
  .tf-subforums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { /* --screen-lg */
  .tf-subforums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.tf-subforum {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px;
  background: var(--tf-card-2); border: 1px solid var(--color-border-light);
  transition: all .18s var(--tf-ease);
}
.tf-subforum:hover { border-color: rgb(var(--color-primary-300-rgb)); background: var(--tf-card); }
.tf-subforum__icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
}

/* ==========================================================================
   15. 帖子详情
   ========================================================================== */
.tf-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tf-text-4); flex-wrap: wrap; margin-bottom: 10px; }
.tf-crumb a:hover { color: rgb(var(--color-primary-600-rgb)); }
.tf-crumb .sep { opacity: .5; }

.tf-post__head { padding: 20px var(--tf-card-pad) 14px; border-bottom: 1px solid var(--color-border-light); }
.tf-post__title { margin: 0 0 10px; font-size: 22px; line-height: 1.4; font-weight: 700; }
@media (max-width: 639.98px) { .tf-post__title { font-size: 18px; } }
.tf-post__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--tf-text-4); }
.tf-post__bar > span { display: inline-flex; align-items: center; gap: 4px; }

.tf-post__body { padding: var(--tf-card-pad); font-size: 15px; line-height: 1.85; color: var(--tf-text); }
.tf-post__body p { margin: 0 0 14px; }
.tf-post__body h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 700; }
.tf-post__body ul, .tf-post__body ol { margin: 0 0 14px; padding-left: 22px; }
.tf-post__body li { margin-bottom: 6px; }
.tf-post__body blockquote {
  margin: 0 0 14px; padding: 10px 14px;
  border-left: 3px solid rgb(var(--color-primary-400-rgb));
  background: var(--tf-card-2); border-radius: 0 8px 8px 0; color: var(--tf-text-2);
}
.tf-post__body pre {
  margin: 0 0 14px; padding: 14px; overflow: auto;
  background: #0f172a; color: #e2e8f0; border-radius: 10px;
  font-family: var(--tf-font-mono); font-size: 13px; line-height: 1.7;
}
html:not(.dark) .tf-post__body pre { background: #101827; }
.tf-post__body code {
  padding: 1px 5px; border-radius: 4px; font-family: var(--tf-font-mono); font-size: 13px;
  background: rgba(var(--color-primary-500-rgb), .1); color: rgb(var(--color-primary-600-rgb));
}
html.dark .tf-post__body code { color: rgb(var(--color-primary-300-rgb)); }
.tf-post__body pre code { background: transparent; color: inherit; padding: 0; }
.tf-post__body img { border-radius: 10px; margin: 0 0 14px; }
.tf-post__body hr { border: 0; border-top: 1px solid var(--color-border); margin: 20px 0; }

.tf-post__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px var(--tf-card-pad); border-top: 1px solid var(--color-border-light); }
.tf-act {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px; border-radius: var(--tf-radius-pill);
  border: 1px solid var(--color-border); background: var(--tf-card);
  color: var(--tf-text-3); font-size: 13px; cursor: pointer;
  transition: all .16s var(--tf-ease);
}
.tf-act:hover { border-color: rgb(var(--color-primary-400-rgb)); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-act:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-act.is-on {
  background: rgb(var(--color-primary-50-rgb)); border-color: rgb(var(--color-primary-300-rgb));
  color: rgb(var(--color-primary-600-rgb)); font-weight: 600;
}
html.dark .tf-act.is-on { background: rgba(var(--color-primary-500-rgb), .16); border-color: rgb(var(--color-primary-700-rgb)); color: rgb(var(--color-primary-300-rgb)); }

/* 回复楼层 */
.tf-reply { display: flex; gap: 12px; padding: 14px var(--tf-card-pad); border-bottom: 1px solid var(--color-border-light); }
.tf-reply:last-child { border-bottom: 0; }
.tf-reply__body { flex: 1 1 auto; min-width: 0; }
.tf-reply__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.tf-reply__floor {
  font-size: 11px; color: var(--tf-text-4); background: var(--color-surface);
  padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.tf-reply__content { font-size: 14px; line-height: 1.8; color: var(--tf-text); }
.tf-reply__content p { margin: 0 0 8px; }
.tf-reply__content p:last-child { margin-bottom: 0; }
.tf-reply__foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--tf-text-4); }
.tf-reply__foot button {
  border: 0; background: transparent; cursor: pointer; color: var(--tf-text-4);
  font-size: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 0;
}
.tf-reply__foot button:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-reply__foot button:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-reply__foot button.tf-reply__report:hover { color: #f43f5e; }
.tf-reply--op { background: rgba(var(--color-primary-500-rgb), .035); }

/* 举报弹窗 */
.tf-report__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-report__chip {
  border: 1px solid var(--color-border); background: var(--tf-card-2); color: var(--tf-text-3);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer;
  transition: border-color .18s var(--tf-ease), color .18s var(--tf-ease), background .18s var(--tf-ease);
}
.tf-report__chip:hover { border-color: rgb(var(--color-primary-400-rgb)); color: rgb(var(--color-primary-600-rgb)); }
.tf-report__chip.is-on {
  border-color: rgb(var(--color-primary-500-rgb)); color: rgb(var(--color-primary-600-rgb));
  background: rgba(var(--color-primary-500-rgb), .08); font-weight: 500;
}
.tf-report__tip { font-size: 12px; color: var(--tf-text-4); margin: 0 0 4px; }

/* 回复编辑器 */
.tf-editor { border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; background: var(--tf-card); }
.tf-editor__bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--color-border-light); background: var(--tf-card-2); flex-wrap: wrap; }
.tf-editor__btn {
  width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer;
  border-radius: 6px; color: var(--tf-text-3); display: inline-flex; align-items: center; justify-content: center;
}
.tf-editor__btn:hover { background: var(--color-surface); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-editor__btn:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-editor textarea {
  width: 100%; min-height: 110px; border: 0; outline: 0; resize: vertical;
  padding: 12px; font-family: inherit; font-size: 14px; line-height: 1.7;
  background: var(--tf-card); color: var(--tf-text); display: block; box-sizing: border-box;
}
.tf-editor__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--color-border-light); background: var(--tf-card-2); }
/* 未登录时的回复提示框：点击弹出登录窗 */
.tf-editor-guest {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 12px; cursor: pointer; user-select: none;
  border: 1px dashed var(--color-border); border-radius: 12px;
  background: var(--tf-card-2); color: var(--tf-text-4); font-size: 14px;
  transition: border-color .16s var(--tf-ease), color .16s var(--tf-ease), background .16s var(--tf-ease);
}
.tf-editor-guest:hover, .tf-editor-guest:focus-visible {
  border-color: rgb(var(--color-primary-400-rgb));
  background: rgba(var(--color-primary-500-rgb), .04);
  color: rgb(var(--color-primary-600-rgb));
  outline: none;
}
html.dark .tf-editor-guest:hover, html.dark .tf-editor-guest:focus-visible { color: rgb(var(--color-primary-300-rgb)); }

/* ==========================================================================
   16. 搜索页
   ========================================================================== */
.tf-search-hero {
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
  border-radius: var(--tf-radius-card); padding: 26px 20px; color: #fff; position: relative; overflow: hidden;
}
.tf-search-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 180px at 80% 0%, rgba(255, 255, 255, .25), transparent 70%);
}
.tf-search-hero > * { position: relative; z-index: 1; }
.tf-search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: var(--tf-radius-pill); padding: 5px 5px 5px 18px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .4);
}
.tf-search-box input {
  flex: 1 1 auto; border: 0; outline: 0; background: transparent; height: 38px;
  font-size: 15px; color: #0f172a; min-width: 0;
}
.tf-search-box input::placeholder { color: #94a3b8; }
.tf-search-box .btn { height: 38px; padding: 0 22px; border-radius: var(--tf-radius-pill); }
.tf-search-hero__hot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.tf-search-hero__hot a {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28);
  padding: 3px 12px; border-radius: var(--tf-radius-pill); color: #fff; font-size: 12px;
}
.tf-search-hero__hot a:hover { background: rgba(255, 255, 255, .32); color: #fff; }

mark.tf-hl { background: rgba(var(--color-warning-300-rgb), .85); color: #451a03; border-radius: 2px; padding: 0 2px; }
html.dark mark.tf-hl { background: rgba(var(--color-warning-500-rgb), .5); color: #fde68a; }

.tf-select {
  height: 30px; padding: 0 26px 0 10px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--tf-card); color: var(--tf-text-2);
  font-size: 13px; outline: 0; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.tf-select:focus { border-color: rgb(var(--color-primary-400-rgb)); }

/* ==========================================================================
   17. 个人中心
   ========================================================================== */
.tf-profile-cover {
  height: 148px; border-radius: var(--tf-radius-card) var(--tf-radius-card) 0 0; position: relative; overflow: hidden;
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
}
.tf-profile-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(400px 160px at 20% 10%, rgba(255, 255, 255, .25), transparent 70%),
    radial-gradient(300px 140px at 85% 110%, rgba(255, 255, 255, .18), transparent 70%);
}
@media (max-width: 639.98px) { .tf-profile-cover { height: 108px; } }
.tf-profile-head { padding: 0 var(--tf-card-pad) var(--tf-card-pad); }
.tf-profile-head__top { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 16px; margin-top: -40px; flex-wrap: wrap; }
.tf-profile-name { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.tf-profile-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--tf-text-3); }
.tf-profile-meta b { color: var(--tf-text); font-variant-numeric: tabular-nums; }

.tf-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tf-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: var(--tf-radius-pill); font-size: 12px;
  background: rgb(var(--color-primary-50-rgb)); color: rgb(var(--color-primary-600-rgb));
}
html.dark .tf-badge { background: rgba(var(--color-primary-500-rgb), .16); color: rgb(var(--color-primary-300-rgb)); }

/* 设置项 */
.tf-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--tf-card-pad); border-bottom: 1px solid var(--color-border-light); }
.tf-setting:last-child { border-bottom: 0; }
.tf-setting__label { font-size: 14px; font-weight: 500; }
.tf-setting__desc { font-size: 12px; color: var(--tf-text-4); margin-top: 2px; }
@media (max-width: 639.98px) {
  .tf-setting { flex-direction: column; align-items: stretch; }
}

/* 配色选择器 */
.tf-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .tf-swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.tf-swatch {
  border: 2px solid transparent; background: transparent; cursor: pointer; padding: 0;
  border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .16s var(--tf-ease);
}
.tf-swatch:hover { transform: translateY(-2px); }
.tf-swatch__color {
  width: 100%; height: 38px; border-radius: 9px; box-shadow: var(--tf-shadow);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
}
.tf-swatch.is-active { border-color: rgb(var(--color-primary-500-rgb)); }
.tf-swatch__name { font-size: 12px; color: var(--tf-text-3); }
.tf-swatch.is-active .tf-swatch__name { color: rgb(var(--color-primary-600-rgb)); font-weight: 600; }
html.dark .tf-swatch.is-active .tf-swatch__name { color: rgb(var(--color-primary-300-rgb)); }

.tf-switch {
  position: relative; width: 42px; height: 23px; border-radius: 999px; flex: none;
  background: var(--color-border-strong); border: 0; cursor: pointer; transition: background .2s var(--tf-ease);
}
.tf-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s var(--tf-ease);
}
.tf-switch.is-on { background: rgb(var(--color-primary-500-rgb)); }
.tf-switch.is-on::after { transform: translateX(19px); }

/* 页面级对话框（设置页账号安全等） */
.tf-dialog-mask {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start;
  justify-content: center; padding: 8vh 16px 16px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px);
  animation: tf-fade-in .18s var(--tf-ease);
}
.tf-dialog {
  width: 100%; max-width: 420px; background: var(--tf-card);
  border-radius: var(--tf-radius-card); box-shadow: var(--tf-shadow-lg, 0 20px 50px rgba(0,0,0,.25));
  animation: tf-dialog-in .22s var(--tf-ease);
  max-height: 84vh; display: flex; flex-direction: column;
}
@keyframes tf-dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.tf-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.tf-dialog__title { font-size: 16px; font-weight: 600; margin: 0; }
.tf-dialog__close { border: 0; background: transparent; cursor: pointer; color: var(--tf-text-4); font-size: 16px; width: 28px; height: 28px; border-radius: 8px; }
.tf-dialog__close:hover { background: var(--color-border-light); color: var(--tf-text); }
.tf-dialog__body { padding: 14px 20px 4px; overflow-y: auto; }
.tf-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.tf-field { margin-bottom: 14px; }
.tf-field__label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.tf-field__row { display: flex; gap: 8px; }
.tf-field__row .form-control { flex: 1; min-width: 0; }
.tf-field__hint { font-size: 12px; color: var(--tf-text-4); margin-top: 5px; }
.tf-field__hint.is-ok { color: #10b981; }
.tf-field__hint.is-err { color: #f43f5e; }
.tf-pwd-meter { height: 4px; border-radius: 999px; background: var(--color-border-light); margin-top: 8px; overflow: hidden; }
.tf-pwd-meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: #f43f5e; transition: width .25s var(--tf-ease), background-color .25s var(--tf-ease); }
.form-control.is-error { border-color: #f43f5e; box-shadow: 0 0 0 2px rgba(244, 63, 94, .12); }

/* 轻提示永远置顶：zui Messager 容器默认 z-index 1900，会被对话框（2000）与
   登录弹窗 tf-auth（3000）盖住导致"接口提示看不清"。压到 3100 高于所有浮层 */
.messagers { z-index: 3100; }

/* ==========================================================================
   17b. 账号设置 / 消息中心
   ========================================================================== */
.tf-set { padding: 4px 20px 20px; }
.tf-set__title {
  display: flex; align-items: center; gap: 8px;
  margin: 22px 0 4px; padding-left: 10px;
  font-size: 15px; font-weight: 600; color: var(--tf-text);
  border-left: 3px solid rgb(var(--color-primary-500-rgb)); line-height: 1.3;
}
.tf-set__row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 10px; border-bottom: 1px solid var(--color-border-light);
}
.tf-set__row:last-child { border-bottom: 0; }
.tf-set__info { min-width: 0; }
.tf-set__label { font-size: 14px; font-weight: 500; color: var(--tf-text); }
.tf-set__desc { font-size: 12px; color: var(--tf-text-4); margin-top: 4px; }
.tf-set__link {
  border: 0; background: transparent; cursor: pointer; flex: none;
  color: rgb(var(--color-primary-600-rgb)); font-size: 13px; padding: 4px 2px;
}
.tf-set__link:hover { opacity: .8; }
.tf-set__action--avatar { display: flex; align-items: center; gap: 10px; }
.tf-set__row--form { align-items: center; }
.tf-set__input { max-width: 420px; width: 100%; }
.tf-set__foot { display: flex; justify-content: flex-end; padding: 14px 10px 0; }
html.dark .tf-set__label { color: var(--tf-text); }
html.dark .tf-set__desc { color: var(--tf-text-4); }

/* 弹窗内验证码行 */
.tf-code-row { display: flex; gap: 10px; align-items: center; }
.tf-code-row .form-control { flex: 1; min-width: 0; }
.tf-code-send {
  border: 0; background: transparent; cursor: pointer; flex: none;
  color: rgb(var(--color-primary-600-rgb)); font-size: 13px; white-space: nowrap;
  padding: 4px 2px;
}
.tf-code-send:disabled { color: var(--tf-text-4); cursor: not-allowed; }
.tf-dialog__hint { font-size: 12px; color: var(--tf-text-4); margin-top: 6px; }
.tf-pwd-bar { height: 3px; border-radius: 999px; background: var(--color-border-light); margin-top: 6px; overflow: hidden; }
.tf-pwd-bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .25s var(--tf-ease), background-color .25s var(--tf-ease); }

/* 消息中心（静态） */
.tf-notice__filter { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--color-border-light); flex-wrap: wrap; }
.tf-notice__chip {
  border: 1px solid var(--color-border); background: transparent; cursor: pointer;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; color: var(--tf-text-3);
}
.tf-notice__chip:hover { border-color: rgb(var(--color-primary-500-rgb)); color: rgb(var(--color-primary-600-rgb)); }
.tf-notice__chip.is-on { background: rgb(var(--color-primary-500-rgb)); border-color: rgb(var(--color-primary-500-rgb)); color: #fff; }
.tf-notice__list { min-height: 200px; }
.tf-notice__item {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--color-border-light); cursor: default;
}
.tf-notice__item:last-child { border-bottom: 0; }
.tf-notice__icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tf-card-2); color: rgb(var(--color-primary-600-rgb)); font-size: 16px;
}
.tf-notice__body { flex: 1; min-width: 0; }
.tf-notice__text { font-size: 13px; color: var(--tf-text); }
.tf-notice__time { font-size: 12px; color: var(--tf-text-4); margin-top: 3px; }
.tf-notice__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; }
.tf-notice__item.is-unread .tf-notice__text { font-weight: 500; }
html.dark .tf-notice__text { color: var(--tf-text); }
html.dark .tf-notice__time { color: var(--tf-text-4); }
html.dark .tf-notice__icon { background: var(--tf-card-2); }
html.dark .tf-notice__item { border-bottom-color: var(--color-border-light); }
html.dark .tf-notice__filter { border-bottom-color: var(--color-border-light); }

/* ==========================================================================
   18. 广告位
   ========================================================================== */
.tf-ad {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--tf-radius-card); background: var(--tf-card-2);
  border: 1px dashed var(--color-border-strong);
}
.tf-ad__inner { position: relative; width: 100%; overflow: hidden; }
.tf-ad__label {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 3px;
  color: var(--tf-text-4); background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(2px);
}
html.dark .tf-ad__label { background: rgba(0, 0, 0, .35); }
.tf-ad__img { width: 100%; display: block; object-fit: cover; }
.tf-ad__text { padding: 12px; }
.tf-ad__title { font-size: 13px; font-weight: 600; margin: 0 0 4px; color: var(--tf-text); }
.tf-ad__desc { font-size: 12px; color: var(--tf-text-4); margin: 0; }

/* ==========================================================================
   19. 区块标题
   ========================================================================== */
.tf-section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 10px; font-size: 16px; font-weight: 700;
}
.tf-section-title .tf-more { font-size: 12px; font-weight: 400; color: var(--tf-text-4); }

/* ==========================================================================
   20. 杂项
   ========================================================================== */
.tf-hr { height: 1px; background: var(--color-border-light); margin: 12px 0; border: 0; }
.tf-divider-v { width: 1px; height: 14px; background: var(--color-border); }

.tf-scroll-x { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tf-scroll-x::-webkit-scrollbar { display: none; }

.tf-skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-strong) 37%, var(--color-surface) 63%);
  background-size: 400% 100%; animation: tf-skeleton 1.4s ease infinite; border-radius: 8px;
}
@keyframes tf-skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.tf-fade-in { animation: tf-fade-in .28s var(--tf-ease) both; }
@keyframes tf-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   21. 个人中心（Tab / 消息 / 成就）
   ========================================================================== */
.tf-tabs {
  display: flex;
  gap: 2px;
  padding: 0 var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  scrollbar-width: none;
}
.tf-tabs::-webkit-scrollbar { display: none; }
.tf-tabs__item {
  border: 0; background: transparent; cursor: pointer;
  padding: 12px 14px; font-size: 14px; color: var(--tf-text-3);
  position: relative; white-space: nowrap;
  transition: color .16s var(--tf-ease);
}
.tf-tabs__item:hover { color: var(--tf-text); }
.tf-tabs__item.is-active { color: rgb(var(--color-primary-600-rgb)); font-weight: 600; }
html.dark .tf-tabs__item.is-active { color: rgb(var(--color-primary-300-rgb)); }
.tf-tabs__item.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  border-radius: 2px; background: rgb(var(--color-primary-500-rgb));
}

.tf-msg {
  display: flex; gap: 12px; padding: 14px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color .16s var(--tf-ease);
}
.tf-msg:last-child { border-bottom: 0; }
.tf-msg:hover { background: var(--tf-card-2); }
.tf-msg__icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.tf-msg__body { flex: 1 1 auto; min-width: 0; }
.tf-msg__title { font-size: 14px; margin: 0 0 3px; }
.tf-msg__text { font-size: 13px; color: var(--tf-text-3); margin: 0; }
.tf-msg__time { font-size: 12px; color: var(--tf-text-4); flex: none; }
.tf-msg.is-unread { background: rgba(var(--color-primary-500-rgb), .045); }

.tf-achieve { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tf-achieve__item {
  display: flex; align-items: center; gap: 8px; padding: 10px;
  border-radius: 10px; background: var(--tf-card-2); border: 1px solid var(--color-border-light);
}
.tf-achieve__item i { font-size: 18px; color: rgb(var(--color-warning-500-rgb)); }
.tf-achieve__item b { display: block; font-size: 12px; font-weight: 600; }
.tf-achieve__item span { font-size: 11px; color: var(--tf-text-4); }

.tf-timeline { display: flex; flex-direction: column; gap: 0; }
.tf-timeline__item { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--tf-text-2); }
.tf-timeline__dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none;
  background: rgb(var(--color-primary-500-rgb)); box-shadow: 0 0 0 3px rgba(var(--color-primary-500-rgb), .16);
}
.tf-timeline__line { flex: none; width: 1px; background: var(--color-border-light); margin: 0 4px; }

.tf-follow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: var(--tf-card-pad); }
@media (min-width: 768px) { .tf-follow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tf-follow-card {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 12px; background: var(--tf-card-2); border: 1px solid var(--color-border-light);
}
.tf-follow-card__info { flex: 1 1 auto; min-width: 0; }

/* 隐藏但可访问 */
.tf-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   19. 站点头部（静态 DOM，利于 SEO）
   ========================================================================== */
.tf-hd {
  position: sticky; top: 0; z-index: 900;
  background: var(--tf-card); border-bottom: 1px solid var(--color-border);
  transition: box-shadow .2s var(--tf-ease), background-color .2s var(--tf-ease);
}
.tf-hd.is-stuck { box-shadow: var(--tf-shadow-md); }
@media (min-width: 1024px) { /* --screen-lg */
  .tf-hd { background: color-mix(in srgb, var(--tf-card) 88%, transparent); backdrop-filter: saturate(180%) blur(12px); }
}
.tf-hd__inner {
  display: flex; align-items: center; gap: 12px; height: var(--tf-header-h);
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 12px;
}
@media (min-width: 640px) { .tf-hd__inner { padding: 0 16px; } }
@media (min-width: 1024px) { .tf-hd__inner { padding: 0 24px; } }

.tf-brand { display: flex; align-items: center; gap: 9px; flex: none; color: var(--tf-text); }
.tf-brand:hover { color: var(--tf-text); }
.tf-brand__mark {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  background: var(--tf-brand-gradient, linear-gradient(135deg, rgb(var(--color-primary-500-rgb)), rgb(var(--color-secondary-500-rgb))));
  box-shadow: 0 4px 12px -4px rgb(var(--color-primary-500-rgb));
}
.tf-brand__text { font-size: 16px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.tf-brand__text em { font-style: normal; color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-brand__text em { color: rgb(var(--color-primary-400-rgb)); }
@media (max-width: 419.98px) { .tf-brand__text { display: none; } }

.tf-hd__nav { display: none; align-items: center; gap: 2px; margin-left: 6px; min-width: 0; overflow: hidden; }
@media (min-width: 768px) { .tf-hd__nav { display: flex; } } /* --screen-md */
@media (max-width: 1023.98px) { .tf-hd__nav a { padding: 0 8px; } .tf-hd__nav a i { display: none; } }
.tf-hd__nav a {
  position: relative; padding: 0 12px; height: 34px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 8px; font-size: 14px; color: var(--tf-text-2); white-space: nowrap;
  transition: all .16s var(--tf-ease);
}
.tf-hd__nav a:hover { background: var(--color-surface); color: var(--tf-text); }
.tf-hd__nav a.is-active { color: rgb(var(--color-primary-600-rgb)); font-weight: 600; background: rgb(var(--color-primary-50-rgb)); }
html.dark .tf-hd__nav a.is-active { color: rgb(var(--color-primary-300-rgb)); background: rgba(var(--color-primary-500-rgb), .16); }

.tf-hd__search { flex: 1 1 auto; min-width: 0; display: none; max-width: 400px; margin: 0 8px; }
@media (min-width: 768px) { .tf-hd__search { display: block; } }
.tf-hd__search form {
  display: flex; align-items: center; height: 34px; border-radius: 999px; background: var(--color-surface);
  border: 1px solid transparent; padding: 0 4px 0 12px; transition: all .18s var(--tf-ease);
}
.tf-hd__search form:focus-within {
  background: var(--tf-card); border-color: rgb(var(--color-primary-400-rgb));
  box-shadow: 0 0 0 3px rgba(var(--color-primary-500-rgb), .12);
}
.tf-hd__search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; font-size: 13px; color: var(--tf-text); }
.tf-hd__search input::placeholder { color: var(--tf-text-4); }
.tf-hd__search button {
  width: 28px; height: 28px; border: 0; border-radius: 999px; background: transparent;
  color: var(--tf-text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tf-hd__search button:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-hd__search button:hover { color: rgb(var(--color-primary-300-rgb)); }

.tf-hd__right { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.tf-iconbtn {
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--tf-text-3);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative;
  transition: all .16s var(--tf-ease);
}
.tf-iconbtn:hover { background: var(--color-surface); color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-iconbtn:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-iconbtn__badge {
  position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
  background: rgb(var(--color-danger-500-rgb)); color: #fff; font-size: 10px; line-height: 14px; text-align: center;
}
.tf-only-mobile { display: inline-flex; }
@media (min-width: 768px) { .tf-only-mobile { display: none; } }

.tf-me { position: relative; }
.tf-me__btn {
  display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 2px 6px 2px 2px; border-radius: 999px;
}
.tf-me__btn:hover { background: var(--color-surface); }
.tf-me__name { font-size: 13px; color: var(--tf-text-2); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023.98px) { .tf-me__name { display: none; } }
.tf-me__menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 186px; background: var(--tf-card);
  border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--tf-shadow-lg);
  padding: 6px; display: none; z-index: 20;
}
.tf-me__menu.is-open { display: block; animation: tf-fade-in .16s var(--tf-ease) both; }
.tf-me__menu a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--tf-text-2); }
.tf-me__menu a:hover { background: var(--color-surface); color: var(--tf-text); }
.tf-me__menu hr { border: 0; border-top: 1px solid var(--color-border-light); margin: 5px 0; }

.tf-burger {
  display: inline-flex; width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: transparent; color: var(--tf-text-2); cursor: pointer; align-items: center; justify-content: center;
}
@media (min-width: 768px) { .tf-burger { display: none; } }

.tf-drawer { position: fixed; inset: var(--tf-header-h) 0 0 0; background: var(--tf-canvas); padding: 14px; overflow: auto; display: none; z-index: 890; }
.tf-drawer.is-open { display: block; animation: tf-fade-in .18s var(--tf-ease) both; }
@media (min-width: 768px) { .tf-drawer { display: none !important; } }
.tf-drawer a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 15px;
  color: var(--tf-text); background: var(--tf-card); margin-bottom: 8px; border: 1px solid var(--color-border);
}
.tf-drawer a.is-active { color: rgb(var(--color-primary-600-rgb)); border-color: rgb(var(--color-primary-300-rgb)); background: rgb(var(--color-primary-50-rgb)); }
html.dark .tf-drawer a.is-active { color: rgb(var(--color-primary-300-rgb)); background: rgba(var(--color-primary-500-rgb), .14); }
.tf-drawer__search { display: flex; gap: 8px; margin-bottom: 12px; }
.tf-drawer__search input {
  flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--color-border);
  background: var(--tf-card); padding: 0 12px; font-size: 14px; color: var(--tf-text); outline: 0;
}

/* ==========================================================================
   20. 站点底部（友情链接申请 + 版权统计）
   ========================================================================== */
.tf-ft { display: block; margin-top: 28px; background: var(--tf-card); border-top: 1px solid var(--color-border); }
.tf-ft__inner { width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px 12px 20px; }
@media (min-width: 640px) { .tf-ft__inner { padding: 30px 16px 22px; } }
@media (min-width: 1024px) { .tf-ft__inner { padding: 34px 24px 26px; } }

/* 友情链接区 */
.tf-ft__flink { padding-bottom: 18px; }
.tf-ft__flink-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tf-ft__flink-head .t { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--tf-text); }
.tf-ft__flink-head .t i { color: rgb(var(--color-primary-500-rgb)); }
.tf-ft__flink-head .apply { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--tf-text-4); }
.tf-ft__flink-head .apply:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-ft__flink-head .apply:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-ft__flink-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 13px; }
.tf-ft__flink-body a { color: var(--tf-text-3); }
.tf-ft__flink-body a:hover { color: rgb(var(--color-primary-600-rgb)); text-decoration: underline; }
html.dark .tf-ft__flink-body a:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-ft__flink-empty { font-size: 12px; color: var(--tf-text-4); }

/* 底栏：版权备案 + 社区统计 */
.tf-ft__bottom {
  padding-top: 16px; border-top: 1px solid var(--color-border-light);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  font-size: 12px; color: var(--tf-text-4);
}
.tf-ft__copy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tf-ft__copy a { color: var(--tf-text-4); }
.tf-ft__copy a:hover { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-ft__copy a:hover { color: rgb(var(--color-primary-300-rgb)); }
.tf-ft__copy .sep { opacity: .4; }
.tf-ft__stats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tf-ft__stats b { font-weight: 600; color: var(--tf-text-3); }
@media (max-width: 639.98px) { .tf-ft__flink-body { gap: 8px 14px; } }
.tf-ad__go { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-ad__go { color: rgb(var(--color-primary-300-rgb)); }

/* ==========================================================================
   21. 富文本编辑器（wangEditor-next）与站点风格对齐
   ========================================================================== */
.tf-editor .w-e-toolbar {
  border: 0 !important; border-bottom: 1px solid var(--color-border-light) !important;
  background: var(--tf-card-2) !important; border-radius: 0 !important; flex-wrap: wrap;
}
/* 工具栏紧凑化：收窄图标按钮内边距、分隔符间距与下拉宽度，争取一行放下 */
.tf-editor .w-e-bar-item { padding: 2px; }
.tf-editor .w-e-bar-item button { padding: 0 6px; }
.tf-editor .w-e-bar-divider { margin: 0 3px; }
.tf-editor .w-e-bar-item .select-button { width: 64px !important; padding: 0 4px; }
.tf-editor .w-e-bar-item button[data-menu-key="fontFamily"] { width: 80px !important; }
/* 附件图标为回形针线性图标：vendor 会剥掉 path 上的 fill 属性，需用 CSS 强制描边 */
.tf-editor .w-e-bar-item button[data-menu-key="insertAttachment"] svg { fill: none; }
.tf-editor .w-e-bar-item button[data-menu-key="insertAttachment"] svg path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* 对齐下拉组：图标列对齐 + 文字左对齐（vendor 按钮内容居中，3 字/4 字行图标错位）；
   面板加宽并提高 z-index（避免被 DOM 靠后的「字体」等按钮盖住透字） */
.tf-editor .w-e-bar-item-group .w-e-bar-item-menus-container { min-width: 120px; z-index: 10; }
.tf-editor .w-e-bar-item-group .w-e-bar-item-menus-container .w-e-bar-item { text-align: left; }
.tf-editor .w-e-bar-item-group .w-e-bar-item-menus-container .w-e-bar-item button { display: flex; justify-content: flex-start; width: 100%; }
.tf-editor .w-e-bar-item-group .w-e-bar-item-menus-container .w-e-bar-item button svg { flex: none; }
.tf-editor .w-e-bar-item-group .w-e-bar-item-menus-container .w-e-bar-item button .title { flex: 1; margin-left: 8px; text-align: left; }
.tf-editor .w-e-text-container {
  border: 0 !important; border-radius: 0 !important; min-height: 178px;
  background: var(--tf-card) !important; color: var(--tf-text);
  /* flex 列布局：容器内唯一在流元素是 .w-e-scroll，让它撑满容器，
     可编辑区再撑满 .w-e-scroll，整块区域都可点击聚焦（修复仅顶部一条可点的问题） */
  display: flex; flex-direction: column;
}
.tf-editor .w-e-text-container > .w-e-scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tf-editor .w-e-text-container > .w-e-scroll > [data-slate-editor] { flex: 1 1 auto; padding: 10px 12px; font-size: 14px; line-height: 1.7; }
/* 发帖编辑器初始高度 440px（内容增多时自动长高；回帖编辑器保持紧凑，不在此列） */
#post-editor .w-e-text-container { min-height: 440px; }
/* 占位符与站点其他输入框统一（原 #d4d4d4 过浅，打开页面显得发灰） */
.tf-editor .w-e-text-placeholder { color: #94a3b8; }
html.dark .tf-editor .w-e-text-placeholder { color: #d4d4d4; }
.tf-editor .w-e-text-container [data-slate-editor] p { margin: 0 0 6px; }
.tf-editor .w-e-text-container blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid rgb(var(--color-primary-400-rgb));
  background: var(--tf-card-2); color: var(--tf-text-3); font-size: 13px;
}
.tf-editor .w-e-text-container pre > code {
  display: block; padding: 12px 14px; border-radius: 10px; background: var(--tf-card-2);
  font-size: 13px; overflow: auto;
}
/* 深色模式下把编辑器的主题变量映射到本站令牌 */
html.dark .tf-editor {
  --w-e-toolbar-bg-color: var(--tf-card-2);
  --w-e-toolbar-color: var(--tf-text-2);
  --w-e-toolbar-border-color: var(--color-border);
  --w-e-toolbar-active-bg-color: rgba(var(--color-primary-500-rgb), .18);
  --w-e-toolbar-active-color: rgb(var(--color-primary-300-rgb));
  --w-e-textarea-bg-color: var(--tf-card);
  --w-e-textarea-color: var(--tf-text);
  --w-e-textarea-border-color: var(--color-border);
  --w-e-textarea-slight-bg-color: var(--tf-card-2);
  --w-e-textarea-slight-border-color: var(--color-border);
  --w-e-textarea-slight-color: var(--tf-text-3);
}

/* 头部「发帖」按钮 */
.tf-hd__post {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; flex: none;
  border-radius: 9px; font-size: 13px; font-weight: 500; color: #fff;
  background: rgb(var(--color-primary-500-rgb));
  box-shadow: 0 6px 14px -8px rgb(var(--color-primary-500-rgb));
  transition: filter .16s var(--tf-ease);
}
.tf-hd__post:hover { filter: brightness(1.07); color: #fff; }
@media (max-width: 639.98px) { /* --screen-sm */
  .tf-hd__post { padding: 0 9px; }
  .tf-hd__post span { display: none; }
}

/* 发帖页 */
.tf-post-form__field { margin-bottom: 16px; }
.tf-post-form__label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.tf-post-form__label i { color: #f43f5e; font-style: normal; margin-left: 3px; }
.tf-post-form__hint { font-size: 12px; color: var(--tf-text-4); margin-top: 6px; }
.tf-post-form__counter { font-size: 12px; color: var(--tf-text-4); }
.tf-taginput { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tf-taginput__chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px;
  background: rgb(var(--color-primary-50-rgb)); color: rgb(var(--color-primary-600-rgb)); font-size: 12px;
}
html.dark .tf-taginput__chip { background: rgba(var(--color-primary-500-rgb), .16); color: rgb(var(--color-primary-300-rgb)); }
.tf-taginput__chip button { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 11px; }

/* ==========================================================================
   发帖页 · 版块两级联动选择（先选一级、再选二级）
   ========================================================================== */
.tf-cascader { position: relative; }
.tf-cascader__select { display: none !important; }

.tf-cascader__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 2rem; padding: 0 .5rem; cursor: pointer; user-select: none;
  border-radius: var(--form-control-radius);
  background-color: rgba(var(--color-canvas-rgb), 1);
  outline: 1px solid transparent; outline-offset: -1px;
  box-shadow: 0 0 0 1px var(--form-control-border);
  font-size: 14px; color: var(--tf-text-1);
  transition: box-shadow .15s var(--tf-ease);
}
.tf-cascader__trigger:hover { box-shadow: 0 0 0 1px var(--color-border-strong); }
.tf-cascader.is-open .tf-cascader__trigger,
.tf-cascader__trigger:focus-visible {
  outline-color: var(--form-control-focus);
  box-shadow: 0 0 0 1px var(--form-control-focus), 0 0 0 3px rgba(var(--color-focus-rgb), .3);
}
.tf-cascader__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-cascader__value.is-empty { color: var(--tf-text-4); }
.tf-cascader__arrow { flex: none; font-size: 12px; color: var(--tf-text-4); transition: transform .2s var(--tf-ease); }
.tf-cascader.is-open .tf-cascader__arrow { transform: rotate(180deg); }

.tf-cascader__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  display: none; padding: 4px;
  background: var(--tf-card); border: 1px solid var(--color-border-light);
  border-radius: 10px; box-shadow: var(--tf-shadow-lg);
}
.tf-cascader.is-open .tf-cascader__panel { display: flex; }

.tf-cascader__col {
  margin: 0; padding: 0; list-style: none;
  width: 138px; max-height: 224px; overflow-y: auto; overscroll-behavior: contain;
}
.tf-cascader__col:empty { display: none; }
.tf-cascader__col:empty + .tf-cascader__col { border-left: 0; }
.tf-cascader__col + .tf-cascader__col { border-left: 1px solid var(--color-border-light); }

.tf-cascader__item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; line-height: 1.4; color: var(--tf-text-2);
}
.tf-cascader__item:hover { background: var(--tf-card-2); color: rgb(var(--color-primary-600-rgb)); }
.tf-cascader__item.is-active {
  background: rgba(var(--color-primary-500-rgb), .12);
  color: rgb(var(--color-primary-600-rgb)); font-weight: 500;
}
.tf-cascader__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-cascader__caret { flex: none; font-size: 10px; color: var(--tf-text-4); }
.tf-cascader__item:hover .tf-cascader__caret,
.tf-cascader__item.is-active .tf-cascader__caret { color: inherit; }
.tf-cascader__empty { padding: 16px 12px; font-size: 12px; color: var(--tf-text-4); text-align: center; }

html.dark .tf-cascader__item:hover { color: rgb(var(--color-primary-300-rgb)); }
html.dark .tf-cascader__item.is-active { color: rgb(var(--color-primary-300-rgb)); }

@media (max-width: 640px) {
  .tf-cascader__col { width: 116px; max-height: 196px; }
  .tf-cascader__panel { max-width: calc(100vw - 48px); }
}
.tf-preview { margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--tf-card-2); border: 1px solid var(--color-border-light); }
.tf-preview__title { font-size: 18px; font-weight: 600; margin: 0 0 10px; }
.tf-preview__body { font-size: 14px; line-height: 1.8; color: var(--tf-text-2); }
.tf-preview__body img { max-width: 100%; border-radius: 8px; }
.tf-preview__body pre { padding: 12px; border-radius: 10px; background: var(--tf-card); overflow: auto; }
.tf-preview__body blockquote {
  margin: 10px 0; padding: 6px 12px; border-left: 3px solid rgb(var(--color-primary-400-rgb));
  color: var(--tf-text-3); background: var(--tf-card);
}

/* ==========================================================================
   21. 版块总览页（/forum 一二级分区展示）
   ========================================================================== */
.tf-fsec__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
}
.tf-fsec__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tf-text-1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tf-fsec__name::before {
  content: '';
  width: 4px; height: 14px;
  border-radius: 2px;
  background: currentColor;
  opacity: .85;
}
.tf-fsec__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.tf-fsec__desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-fsec__meta { display: inline-flex; gap: 12px; flex: none; }
.tf-fsec__today { color: rgb(var(--color-primary-600-rgb)); font-weight: 600; }
html.dark .tf-fsec__today { color: rgb(var(--color-primary-400-rgb)); }

.tf-fgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tf-fcell {
  display: flex;
  gap: 12px;
  padding: 16px var(--tf-card-pad);
  border-bottom: 1px solid var(--color-border-light);
  border-right: 1px solid var(--color-border-light);
  transition: background-color .16s var(--tf-ease);
  min-width: 0;
}
.tf-fgrid .tf-fcell:nth-child(3n) { border-right: 0; }
.tf-fgrid .tf-fcell:nth-last-child(-n+3) { border-bottom: 0; }
.tf-fcell:hover { background: var(--color-surface); }
.tf-fcell__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex: none;
  box-shadow: inset 0 -6px 12px -6px rgba(0, 0, 0, .25);
}
.tf-fcell__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tf-fcell__name {
  font-size: 14px; font-weight: 600; color: var(--tf-text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tf-fcell__name em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--tf-text-3); margin-left: 2px; }
.tf-fcell:hover .tf-fcell__name { color: rgb(var(--color-primary-600-rgb)); }
html.dark .tf-fcell:hover .tf-fcell__name { color: rgb(var(--color-primary-400-rgb)); }
.tf-fcell__desc {
  font-size: 12px; color: var(--tf-text-3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tf-fcell__meta { font-size: 12px; color: var(--tf-text-4); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .tf-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-fgrid .tf-fcell:nth-child(3n) { border-right: 1px solid var(--color-border-light); }
  .tf-fgrid .tf-fcell:nth-child(2n) { border-right: 0; }
  .tf-fgrid .tf-fcell:nth-last-child(-n+3) { border-bottom: 1px solid var(--color-border-light); }
  .tf-fgrid .tf-fcell:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 560px) {
  .tf-fgrid { grid-template-columns: minmax(0, 1fr); }
  .tf-fgrid .tf-fcell { border-right: 0 !important; }
  .tf-fgrid .tf-fcell:nth-last-child(-n+2) { border-bottom: 1px solid var(--color-border-light); }
  .tf-fgrid .tf-fcell:last-child { border-bottom: 0; }
  .tf-fcell { padding: 13px var(--tf-card-pad); gap: 10px; }
  .tf-fcell__icon { width: 38px; height: 38px; font-size: 17px; }
  .tf-fsec__meta { display: none; }
}


/* 富文本附件下载链接（编辑器插入 / 详情页渲染通用，按 download=1 命中） */
a[href*="download=1"] {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 4px 8px 4px 0; padding: 5px 6px;
  background: var(--tf-card-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--tf-text);
  font-size: 13px; font-weight: 500; line-height: 1.5;
  text-decoration: none;
  transition: border-color .18s var(--tf-ease), color .18s var(--tf-ease);
  word-break: break-all;
}
a[href*="download=1"]:hover {
  border-color: rgb(var(--color-primary-500-rgb));
  color: rgb(var(--color-primary-600-rgb));
}
/* 附件芯片间距逻辑：宽度自适应内容（inline-flex，非固定宽）；内部 padding 六面统一 6px，
   芯片之间的距离只由 margin-right: 8px 决定——不按相邻关系做特殊处理，
   因此每片芯片的内外边距完全一致。编辑器内 slate 在附件间插入的零宽文本节点
   不占宽度，同样不影响间距，无需额外规则 */
/* 旧版附件（无徽标 class）保留回形针图标；新版用彩色徽标（见下） */
a[href*="download=1"]:not(.tf-att)::before {
  content: "\1F4CE";
  font-size: 14px; flex: none;
}
/* 新版附件徽标：彩色圆角小块 + 大写扩展名，配色按文件类型区分 */
a.tf-att .tf-att-badge {
  flex: none;
  display: inline-block;
  min-width: 32px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #64748b;
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px;
  text-align: center; letter-spacing: .3px;
}
a.tf-att-zip  .tf-att-badge { background: #8b5cf6; } /* rar/zip/7z/tar 紫 */
a.tf-att-doc  .tf-att-badge { background: #3b82f6; } /* doc/docx 蓝 */
a.tf-att-pdf  .tf-att-badge { background: #ef4444; } /* pdf 红 */
a.tf-att-xls  .tf-att-badge { background: #22c55e; } /* xls/xlsx/csv 绿 */
a.tf-att-ppt  .tf-att-badge { background: #f97316; } /* ppt/pptx 橙 */
a.tf-att-txt  .tf-att-badge { background: #94a3b8; } /* txt/md/log 灰 */
a.tf-att-img  .tf-att-badge { background: #14b8a6; } /* 图片 青 */
a.tf-att-aud  .tf-att-badge { background: #ec4899; } /* 音频 粉 */
a.tf-att-vid  .tf-att-badge { background: #6366f1; } /* 视频 靛 */
a.tf-att-code .tf-att-badge { background: #06b6d4; } /* 代码/数据 蓝绿 */
/* 附件大小后缀：文件名后以半角括号显示（4.7 KB），弱化色 */
a.tf-att .tf-att-size { color: var(--tf-text-4); font-size: 12px; white-space: nowrap; }
a.tf-att:hover .tf-att-size { color: inherit; }

/* ==========================================================================
   投票：发帖页形式单选 + 配置面板 / 详情页投票与结果
   ========================================================================== */
/* 形式单选行（默认主题 / 回帖奖励 / 设置悬赏 / 付费内容 / 开启投票） */
.tf-post-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 4px 0 2px; }
.tf-post-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--tf-text); cursor: pointer; user-select: none; }
.tf-post-mode input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: rgb(var(--color-primary-500-rgb)); cursor: pointer; }
.tf-post-mode--soon { color: var(--tf-text-4); cursor: not-allowed; }
.tf-post-mode--soon input { cursor: not-allowed; opacity: .55; }

/* 投票配置面板（发帖页，参考图：虚线框 + 浅底） */
.tf-poll-editor {
  margin-top: 12px;
  padding: 14px 16px 15px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 10px;
  background: var(--tf-card-2);
}
.tf-poll-editor__row { display: flex; gap: 16px; }
.tf-poll-editor__row > div { flex: 1; min-width: 0; }
.tf-poll-editor__label { display: block; font-size: 13px; font-weight: 600; color: var(--tf-text-2); margin: 0 0 8px; }
.tf-poll-editor__row .form-control { height: 38px; }
.tf-poll-editor__opt { display: flex; gap: 10px; margin-bottom: 10px; }
.tf-poll-editor__opt .form-control { flex: 1; min-width: 0; height: 38px; }
.tf-poll-editor__del { flex: none; }
.tf-poll-editor__hint { font-size: 12px; color: var(--tf-text-4); margin: 12px 0 0; }

/* 详情页投票块 */
.tf-poll {
  margin: 4px 0 18px;
  padding: 16px 18px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
  background: var(--tf-card-2);
}
.tf-poll__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.tf-poll__title { font-size: 14px; font-weight: 600; color: var(--tf-text); }
.tf-poll__meta { font-size: 12px; color: var(--tf-text-4); }
.tf-poll__opt {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px; color: var(--tf-text);
  cursor: pointer; user-select: none;
}
.tf-poll__opt:hover { color: rgb(var(--color-primary-600-rgb)); }
.tf-poll__opt input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: rgb(var(--color-primary-500-rgb)); cursor: pointer; }
.tf-poll__foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.tf-poll__submit { height: 32px; padding: 0 18px; }
.tf-poll__tip { font-size: 12px; color: var(--tf-text-4); }
.tf-poll__join { font-size: 12px; color: var(--tf-text-4); margin-top: 12px; }

/* 结果态：选项行 + 紫色进度条 */
.tf-poll__res { padding: 12px 2px 4px; border-bottom: 1px solid var(--color-border-light); }
.tf-poll__res-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.tf-poll__res-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--tf-text); overflow-wrap: anywhere; }
.tf-poll__res-text.is-mine { color: #7c5cfc; }
.tf-poll__res-text.is-mine::after { content: '· 我的选择'; font-size: 11px; font-weight: 400; color: var(--tf-text-4); margin-left: 6px; }
.tf-poll__res-stat { flex: none; font-size: 12px; color: var(--tf-text-3); }
.tf-poll__res-stat b { font-weight: 600; color: var(--tf-text-2); margin-left: 4px; }
.tf-poll__bar { height: 6px; border-radius: 999px; background: var(--color-border-light); overflow: hidden; }
.tf-poll__bar i { display: block; height: 100%; border-radius: 999px; background: #7c5cfc; transition: width .35s var(--tf-ease); }
.tf-poll__res:last-of-type { border-bottom: none; padding-bottom: 0; }

html.dark .tf-poll__bar { background: #232e40; }
html.dark .tf-poll__bar i { background: #8b6dff; }
html.dark .tf-poll__res-text.is-mine { color: #a78bff; }
