/* ============================================================
   forum.css — 中文代码论坛
   风格：纸光（Paperlight）
   —— 浅色、低对比、细边框、留白优先；动效是第一设计目标，
      不是装饰。参照 ibelick/motion-primitives 的动效语言：
      AnimatedGroup（交错入场）、TextEffect（逐字）、
      Spotlight（卡片光斑跟随）、Magnetic（按钮磁吸）、
      GlowEffect（聚焦光晕）。全部用原生 CSS/JS 实现，
      不引入框架，站点仍可零构建部署。

   动效开关：系统的 "减少动态效果" 打开时全部退化为淡入。
   ============================================================ */

:root {
  --f-paper: #fcfcfa;
  --f-card: #ffffff;
  --f-ink: #17181a;
  --f-ink-soft: #3c3f44;
  --f-muted: #6f7378;
  --f-soft: #f5f5f2;
  --f-line: #e8e8e4;
  --f-line-strong: #d8d8d2;
  --f-teal: #dceee9;
  --f-teal-dark: #0f766a;
  --f-coral: #fbeaea;
  --f-yellow: #fbf3dd;
  --f-red: #b02a33;
  --f-amber: #b0791a;
  --f-shadow-sm: 0 1px 2px rgba(20, 24, 28, .05);
  --f-shadow-md: 0 1px 2px rgba(20, 24, 28, .05), 0 10px 24px -14px rgba(20, 24, 28, .18);
  --f-shadow-lg: 0 2px 6px rgba(20, 24, 28, .06), 0 24px 60px -28px rgba(20, 24, 28, .26);
  --f-radius: 13px;
  --f-radius-sm: 9px;
  --f-ease: cubic-bezier(.22, 1, .36, 1);
  --f-ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--f-paper);
  color: var(--f-ink);
  font: 15px/1.72 "Inter", "Microsoft YaHei", system-ui, -apple-system, "PingFang SC", sans-serif;
  font-feature-settings: "cv05" 1, "ss01" 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------- 背景 ----------------
   整页一层极淡的色团，三团各自漂 38~52 秒，只动 transform / opacity，
   在合成器里跑，不引起重排。它就是被删掉的那些信息所换来的"空"。 */
.f-aurora {
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none; overflow: hidden;
}
.f-aurora i {
  position: absolute; display: block;
  border-radius: 50%;
  filter: blur(88px);
  opacity: .78;
  will-change: transform;
}
.f-aurora i:nth-child(1) {
  width: 48vw; height: 48vw; min-width: 380px; min-height: 380px;
  top: -14vh; left: -8vw;
  background: radial-gradient(circle, rgba(15, 118, 106, .26), transparent 64%);
  animation: fAuroraA 38s ease-in-out infinite alternate;
}
.f-aurora i:nth-child(2) {
  width: 40vw; height: 40vw; min-width: 320px; min-height: 320px;
  top: -10vh; right: -10vw;
  background: radial-gradient(circle, rgba(176, 121, 26, .19), transparent 66%);
  animation: fAuroraB 52s ease-in-out infinite alternate;
}
.f-aurora i:nth-child(3) {
  width: 44vw; height: 44vw; min-width: 340px; min-height: 340px;
  bottom: -18vh; left: 26vw;
  background: radial-gradient(circle, rgba(60, 92, 168, .16), transparent 66%);
  animation: fAuroraC 44s ease-in-out infinite alternate;
}
@keyframes fAuroraA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.18); }
}
@keyframes fAuroraB {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-5vw, 7vh, 0) scale(.94); }
}
@keyframes fAuroraC {
  from { transform: translate3d(0, 0, 0) scale(.96); }
  to   { transform: translate3d(-7vw, -4vh, 0) scale(1.14); }
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--f-teal-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: #cdeae2; color: var(--f-ink); }

/* 纸面极淡的纹理：一层几乎看不见的网点，让大面积白不显得"塑料" */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(23, 24, 26, .035) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------------- 顶部栏 ---------------- */

.f-header {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: 60px;
  background: rgba(252, 252, 250, .78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--f-ease), background .3s var(--f-ease);
}
.f-header.scrolled {
  border-bottom-color: var(--f-line);
  background: rgba(252, 252, 250, .92);
}

.f-head-inner {
  max-width: 1040px; margin: 0 auto; height: 100%;
  padding: 0 24px;
  display: flex; align-items: center; gap: 10px;
}

.f-brand {
  font-size: 15.5px; font-weight: 640; letter-spacing: -.02em;
  transition: opacity .2s var(--f-ease);
}
.f-brand:hover { opacity: .72; }
.f-brand span { color: var(--f-muted); font-weight: 520; }
.f-sep { color: var(--f-line-strong); font-weight: 400; font-size: 13px; }
.f-crumb {
  font-size: 13.5px; font-weight: 520; color: var(--f-muted);
  transition: color .2s var(--f-ease);
}
.f-crumb:hover { color: var(--f-ink); }

.f-head-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.f-ext {
  font-size: 13px; font-weight: 520; color: var(--f-muted);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color .2s var(--f-ease);
}
.f-ext:hover { color: var(--f-ink); }
.f-ext span { transition: transform .3s var(--f-ease); }
.f-ext:hover span { transform: translate(2px, -2px); }

.f-user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--f-line);
  border-radius: 999px;
  background: var(--f-card);
  box-shadow: var(--f-shadow-sm);
  font-size: 13px; font-weight: 520;
  transition: border-color .2s var(--f-ease), transform .2s var(--f-ease), box-shadow .2s var(--f-ease);
}
.f-user-chip:hover {
  border-color: var(--f-line-strong);
  transform: translateY(-1px);
  box-shadow: var(--f-shadow-md);
}

.f-avatar {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font: 600 12px/1 "Inter", Consolas, monospace;
  color: var(--f-ink);
  border-radius: 50%;
  background: var(--f-teal);
  flex: none;
  transition: transform .35s var(--f-ease);
}
.f-user-chip:hover .f-avatar { transform: rotate(-8deg) scale(1.06); }
.f-avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------------- 按钮 ---------------- */

.f-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius-sm);
  box-shadow: var(--f-shadow-sm);
  padding: 9px 16px;
  font-size: 13.5px; font-weight: 540;
  white-space: nowrap;
  transition:
    transform .28s var(--f-ease),
    box-shadow .28s var(--f-ease),
    border-color .2s var(--f-ease),
    background .2s var(--f-ease);
}
.f-btn:hover {
  transform: translateY(-1px);
  border-color: var(--f-line-strong);
  box-shadow: var(--f-shadow-md);
}
.f-btn:active { transform: translateY(0) scale(.975); transition-duration: .09s; }

.f-btn-primary {
  background: var(--f-ink);
  border-color: var(--f-ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 28, .18), 0 8px 20px -10px rgba(20, 24, 28, .55);
}
.f-btn-primary:hover {
  background: #26282b;
  border-color: #26282b;
  box-shadow: 0 2px 4px rgba(20, 24, 28, .2), 0 14px 30px -12px rgba(20, 24, 28, .58);
}
/* 按钮里的加号：hover 时微微放大（旋转十字视觉不变，改用 scale） */
.f-btn .f-ico { transition: transform .35s var(--f-ease); }
.f-btn:hover .f-ico { transform: scale(1.15); }

.f-btn-ghost {
  background: transparent; border-color: transparent; box-shadow: none;
  color: var(--f-muted);
}
.f-btn-ghost:hover {
  background: var(--f-soft); border-color: transparent;
  box-shadow: none; transform: none; color: var(--f-ink);
}

.f-btn-danger { color: var(--f-red); }
.f-btn-danger:hover { background: var(--f-coral); border-color: #f0d3d3; color: var(--f-red); }
.f-btn-danger.f-btn-outline { background: var(--f-card); }

.f-btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }

/* ---------------- 主体 ---------------- */

.f-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1000px; margin: 0 auto; padding: 132px 24px 120px;
}

/* 背景光：整页铺一层极慢漂移的色团（见 .f-aurora），
   hero 不再自己画光斑，否则两层叠在一起就脏了 */
.f-hero {
  position: relative;
  padding: 0 0 56px;
}

/* eyebrow：替换原来的黄色贴纸 */
.f-sticker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0;
  background: none; border: 0; box-shadow: none;
  font: 520 11.5px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--f-teal-dark);
  margin-bottom: 24px;
}
.f-sticker::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--f-teal-dark);
  box-shadow: 0 0 0 0 rgba(15, 118, 106, .4);
  animation: fPulseDot 2.6s ease-out infinite;
}
@keyframes fPulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(15, 118, 106, .38); }
  70%  { box-shadow: 0 0 0 8px rgba(15, 118, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 106, 0); }
}

.f-hero h1 {
  font-size: clamp(40px, 6.2vw, 64px);
  font-weight: 640;
  letter-spacing: -.05em;
  line-height: 1.06;
  color: var(--f-ink);
}
/* 逐字入场由 JS 拆成 span；没有 JS 时就是普通文字 */
.f-hero h1 .f-ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px) rotate(2deg);
  animation: fCharIn .78s var(--f-ease-out) forwards;
  animation-delay: calc(var(--i) * 46ms);
}
@keyframes fCharIn {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.f-hero p {
  color: var(--f-muted); margin-top: 22px; font-size: 17px;
  max-width: 430px; line-height: 1.85;
  text-wrap: balance;
}

.f-hero-bar {
  margin-top: 44px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.f-hero-bar > .f-btn { height: 48px; padding-inline: 22px; border-radius: 11px; }

/* 搜索：聚焦时青色光晕从内向外扩散 */
.f-search {
  position: relative;
  flex: 0 1 420px; min-width: 220px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 15px; height: 48px;
  border: 1px solid var(--f-line);
  border-radius: 11px;
  background: var(--f-card);
  box-shadow: var(--f-shadow-sm);
  transition: border-color .25s var(--f-ease), box-shadow .3s var(--f-ease);
}
.f-search:hover { border-color: var(--f-line-strong); }
.f-search:focus-within {
  border-color: rgba(15, 118, 106, .55);
  box-shadow: 0 0 0 4px rgba(15, 118, 106, .1), var(--f-shadow-sm);
}
.f-search svg {
  flex: none; color: var(--f-muted);
  transition: transform .4s var(--f-ease), color .25s var(--f-ease);
}
.f-search:focus-within svg { color: var(--f-teal-dark); transform: scale(1.08); }
.f-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 14px; min-width: 0;
}
.f-search input::placeholder { color: #a3a6aa; }

.f-hero-hint {
  margin-top: 18px; font-size: 13px; color: #9a9ea3;
}
.f-hero-hint a {
  color: var(--f-ink-soft);
  text-decoration: underline;
  text-decoration-color: #cfd2d0;
  text-underline-offset: 3px;
  transition: text-decoration-color .25s var(--f-ease), color .2s var(--f-ease);
}
.f-hero-hint a:hover { color: var(--f-teal-dark); text-decoration-color: currentColor; }

/* 统计从三枚胶囊压成页脚一行 */
.f-footnote {
  margin-top: 64px; padding-top: 22px;
  border-top: 1px solid var(--f-line);
  font: 500 12px/1.6 "Inter", Consolas, monospace;
  letter-spacing: .04em; color: #9a9ea3;
}
.f-footnote b {
  font-weight: 600; color: var(--f-ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 区块标题 ---------------- */

.f-section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 72px 0 22px;
}
.f-section-head h2 {
  font-size: 17px; font-weight: 600; letter-spacing: -.02em;
  color: var(--f-ink);
}
.f-section-head .f-muted {
  font-size: 12px; color: var(--f-muted);
  font-family: "Inter", Consolas, monospace;
  letter-spacing: .02em;
}
.f-section-head .f-more {
  margin-left: auto; font-size: 12.5px; font-weight: 520;
  color: var(--f-muted);
  display: inline-flex; align-items: center; gap: 3px;
  transition: color .2s var(--f-ease), gap .25s var(--f-ease);
}
.f-section-head .f-more:hover { color: var(--f-ink); gap: 7px; }

/* ---------------- 板块卡片（Spotlight） ---------------- */

.f-cats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.f-cat {
  position: relative;
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px 26px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  overflow: hidden;
  transition:
    transform .4s var(--f-ease),
    box-shadow .4s var(--f-ease),
    border-color .3s var(--f-ease);
}
/* 光斑：跟随鼠标（JS 写 --mx/--my），没有鼠标时停在左上角外 */
.f-cat::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(
    320px circle at var(--mx, -40%) var(--my, -40%),
    rgba(15, 118, 106, .085),
    transparent 62%
  );
  opacity: 0;
  transition: opacity .45s var(--f-ease);
}
.f-cat:hover {
  transform: translateY(-3px);
  border-color: var(--f-line-strong);
  box-shadow: var(--f-shadow-md);
}
.f-cat:hover::before { opacity: 1; }

/* 图标统一成一种底：浅灰方片 + 描边图标，不按板块换颜色。
   彩色底配表情符号看着热闹，实际不成体系；换成单色线条后整页安静很多。 */
.f-cat-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--f-ink-soft);
  background: var(--f-soft);
  border: 1px solid var(--f-line);
  transition: color .3s var(--f-ease), background .3s var(--f-ease), border-color .3s var(--f-ease);
}
.f-cat-icon svg { display: block; }
.f-cat:hover .f-cat-icon {
  color: var(--f-teal-dark);
  background: var(--f-card);
  border-color: var(--f-line-strong);
}

.f-cat-name {
  display: block; font-size: 16px; font-weight: 600;
  letter-spacing: -.018em; color: var(--f-ink);
}
.f-cat-desc {
  display: block; font-size: 13px; color: var(--f-muted);
  margin-top: 7px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.f-cat-count {
  flex: none; padding-top: 2px;
  font: 500 12px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #b3b6ba;
  transition: color .25s var(--f-ease);
}
.f-cat:hover .f-cat-count { color: var(--f-ink-soft); }

/* ---------------- 工具栏 / 分页标签 ---------------- */

.f-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.f-toolbar > .f-btn { order: 4; }
.f-tabs {
  display: inline-flex; gap: 2px;
  padding: 3px;
  border: 1px solid var(--f-line);
  border-radius: 9px;
  background: var(--f-soft);
}
.f-tab {
  padding: 5px 14px; border: 0; border-radius: 7px;
  background: transparent;
  font-size: 12.5px; font-weight: 520; color: var(--f-muted);
  transition: background .25s var(--f-ease), color .2s var(--f-ease), box-shadow .25s var(--f-ease);
}
.f-tab + .f-tab { border-left: 0; }
.f-tab:hover { color: var(--f-ink); }
.f-tab.active {
  background: var(--f-card);
  color: var(--f-ink);
  box-shadow: var(--f-shadow-sm);
}
.f-toolbar .f-count {
  margin-left: auto; order: 3; margin-right: 14px; font: 500 12px "Inter", Consolas, monospace;
  color: var(--f-muted); font-variant-numeric: tabular-nums;
}

/* ---------------- 主题列表 ---------------- */

/* 一整张清单，行与行之间只有一条细线：
   比七张各自带边框和阴影的卡片安静得多，滚动时也不晃眼。 */
.f-threads {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--f-line);
  border-bottom: 1px solid var(--f-line);
}

.f-thread {
  position: relative;
  display: flex; gap: 18px; align-items: center;
  /* 右侧留 8px：回复数贴着容器边会显得被切掉 */
  padding: 21px 8px 21px 2px;
  border-top: 1px solid var(--f-line);
  transition: padding-left .38s var(--f-ease), background .3s var(--f-ease);
}
.f-threads > .f-thread:first-child { border-top: 0; }
.f-thread:hover { padding-left: 10px; background: rgba(255, 255, 255, .55); }

.f-thread-main { min-width: 0; flex: 1; display: block; color: inherit; text-decoration: none; }
.f-thread-title {
  font-size: 16px; font-weight: 520; line-height: 1.5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--f-ink);
  transition: color .25s var(--f-ease);
}
.f-thread:hover .f-thread-title { color: var(--f-teal-dark); }
.f-thread-meta {
  margin-top: 8px; font-size: 12px; color: #979ba0;
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: "Inter", "Microsoft YaHei", system-ui, sans-serif;
}
.f-thread-replies {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  min-width: 34px; justify-content: flex-end;
  font: 500 12.5px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #a2a6ab;
  transition: color .25s var(--f-ease);
}
.f-thread-replies svg { flex: none; margin-top: -1px; }
.f-thread:hover .f-thread-replies { color: var(--f-teal-dark); }

/* 点赞：主题行、正文元信息、回复元信息共用。未登录也能看见别人点过几次。 */
.f-like {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; padding: 4px 8px;
  color: #a2a6ab; cursor: pointer;
  font: 500 12px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  transition: color .2s var(--f-ease), background .2s var(--f-ease),
    border-color .2s var(--f-ease), transform .2s var(--f-ease);
}
.f-like:hover { color: var(--f-red); background: var(--f-coral); }
.f-like.is-liked {
  color: var(--f-red); background: var(--f-coral);
  border-color: rgba(176, 42, 51, .14);
}
.f-like:active { transform: scale(.94); }
.f-like:disabled { opacity: .5; cursor: wait; }
.f-like svg { flex: none; }
.f-article-meta .f-like { margin-left: -6px; }

.f-badge {
  font: 500 10.5px/1.8 "Inter", "Microsoft YaHei", sans-serif;
  padding: 0 7px; border-radius: 5px;
  letter-spacing: .02em;
  background: var(--f-soft); color: var(--f-muted);
}
.f-badge.pin { background: var(--f-yellow); color: var(--f-amber); }
.f-badge.lock { background: var(--f-soft); color: var(--f-muted); }

.f-empty {
  padding: 52px 24px; text-align: center; color: var(--f-muted);
  border: 1px dashed var(--f-line-strong);
  border-radius: var(--f-radius);
  font-size: 13.5px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(15, 118, 106, .04), transparent 70%);
}
.f-empty b {
  display: block; color: var(--f-ink); font-size: 17px; font-weight: 600;
  margin-bottom: 8px; letter-spacing: -.015em;
}
.f-empty a {
  font-weight: 520; color: var(--f-teal-dark);
  border-bottom: 1px solid rgba(15, 118, 106, .35);
  transition: border-color .2s var(--f-ease);
}
.f-empty a:hover { border-bottom-color: var(--f-teal-dark); }

/* ---------------- 分页 ---------------- */

.f-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 26px;
}
.f-pager .f-page-info {
  font: 500 12px "Inter", Consolas, monospace;
  color: var(--f-muted); padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 主题详情 ---------------- */

.f-crumbrow {
  font-size: 12.5px; color: var(--f-muted);
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
  font-weight: 460;
}
.f-crumbrow-narrow { max-width: 800px; margin: 0 auto 20px; }
.f-crumbrow a { transition: color .2s var(--f-ease); }
.f-crumbrow a:hover { color: var(--f-ink); }
.f-crumbrow .f-sepc { color: var(--f-line-strong); }

.f-article {
  position: relative;
  max-width: 800px; margin: 0 auto;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: 18px;
  box-shadow: var(--f-shadow-md);
  padding: 40px 44px 46px;
  overflow: hidden;
}
/* 顶部一条细渐变：说明这是正文，而不是又一张卡片 */
.f-article::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(
    90deg,
    var(--f-teal-dark),
    rgba(15, 118, 106, .22) 42%,
    rgba(15, 118, 106, .06) 72%,
    transparent
  );
  opacity: .8;
}

.f-article-head { display: flex; gap: 14px; align-items: flex-start; }
.f-article-head .f-avatar { margin-top: 3px; }
.f-article-title {
  font-size: clamp(23px, 2.8vw, 30px);
  line-height: 1.34; font-weight: 640; letter-spacing: -.032em;
  color: var(--f-ink);
}
.f-article-meta {
  font-size: 12px; color: var(--f-muted); margin-top: 9px;
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: "Inter", "Microsoft YaHei", system-ui, sans-serif;
}
.f-article-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.f-divider {
  height: 1px; background: var(--f-line); margin: 22px 0;
}

/* Markdown 正文 */
.f-md {
  font-size: 16px; line-height: 1.95; color: #2c2f33;
  word-wrap: break-word;
}
.f-md > *:first-child { margin-top: 0; }
.f-md h1, .f-md h2, .f-md h3, .f-md h4 {
  color: var(--f-ink); line-height: 1.42;
  margin: 2.1em 0 .6em; font-weight: 640; letter-spacing: -.02em;
}
.f-md h1 { font-size: 22px; }
.f-md h2 { font-size: 19px; }
.f-md h3 { font-size: 16.5px; }
.f-md h4 { font-size: 15px; }
.f-md p { margin: 1.05em 0; }
.f-md a {
  color: var(--f-teal-dark);
  border-bottom: 1px solid rgba(15, 118, 106, .3);
  transition: border-color .2s var(--f-ease);
}
.f-md a:hover { border-bottom-color: var(--f-teal-dark); }
.f-md ul, .f-md ol { margin: 1.05em 0; padding-left: 1.4em; }
.f-md li { margin: .5em 0; }
.f-md blockquote {
  margin: 1.1em 0; padding: 12px 18px;
  border-left: 3px solid var(--f-teal-dark);
  border-radius: 0 8px 8px 0;
  background: #f4faf8;
  color: var(--f-ink-soft);
}
.f-md code {
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: .89em;
  padding: 2px 6px;
  background: #f6f8f7;
  border: 1px solid #e3e9e7;
  border-radius: 5px;
  color: #0b5f56;
}
.f-md pre {
  margin: 1.1em 0; overflow: auto;
  /* 内边距放在 pre 上：高亮库对不认识的语言（中文代码的 chp）不会加 .hljs，
     挂在 code.hljs 上的padding就会消失，代码块塌成一条细黑带。 */
  padding: 18px 20px;
  border: 1px solid #2b3036;
  border-radius: 11px;
  background: #23272e;
  box-shadow: var(--f-shadow-sm);
  /* 不设行高会继承正文的 1.95，代码块每行之间空出半行，看着像漏行。
     字号一起钉到 13px：pre 的 strut 按自身字号算，不钉的话行距还是按 16px 撑开。 */
  line-height: 1.68;
  font-size: 13px;
}
.f-md pre code {
  background: transparent; border: 0; padding: 0; border-radius: 0;
  font-size: 13px; line-height: 1.68;
  color: #c3cad3;
}
.f-md pre code.hljs { padding: 0; }

/* 代码块右上角：在编辑器里打开。
   按钮默认隐身，鼠标进到代码块才出现——始终挂在那里会盖住第一行代码。 */
.f-code { position: relative; }
.f-code:first-child > pre { margin-top: 0; }
.f-code:last-child > pre { margin-bottom: 0; }
.f-code-open {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(35, 39, 46, .78);
  color: #cbd2da;
  font: 500 11.5px/1 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  cursor: pointer;
  opacity: 0; transform: translateY(-2px);
  transition:
    opacity .22s var(--f-ease),
    transform .22s var(--f-ease),
    background .2s var(--f-ease),
    border-color .2s var(--f-ease),
    color .2s var(--f-ease);
}
.f-code:hover .f-code-open,
.f-code.is-open .f-code-open,
.f-code-open:focus-visible { opacity: 1; transform: none; }
.f-code-open:hover {
  background: var(--f-teal-dark);
  border-color: var(--f-teal-dark);
  color: #fff;
}
.f-code-open svg { flex: none; opacity: .9; }

/* 系统要求减少动效时，按钮直接出现，不做位移 */
@media (prefers-reduced-motion: reduce) {
  .f-code-open { transition: none; transform: none; }
}
/* ---------------- 完整文件模块 ----------------
   正文里的片段讲思路，能跑的整份源码收在这一块：
   只报文件名、行数、体积，点开进编辑器看实现。
   这样做不是为了省字数，是为了让帖子读完还是文章，而不是变成源码仓库。 */
.f-files {
  max-width: 800px; margin: 14px auto 0;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: 14px;
  box-shadow: var(--f-shadow-sm);
  padding: 16px 18px 18px;
}
.f-files-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.f-files-title {
  font: 600 13px/1 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--f-ink);
}
.f-files-note {
  font: 400 11.5px/1.4 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--f-muted);
}
.f-file {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius-sm);
  background: var(--f-soft);
}
.f-file + .f-file { margin-top: 8px; }
.f-file-icon { flex: none; display: inline-flex; color: var(--f-teal-dark); }
.f-file-body { min-width: 0; flex: 1; }
.f-file-name {
  font: 600 13.5px/1.4 "JetBrains Mono", Consolas, "Courier New", monospace;
  color: var(--f-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.f-file-meta {
  margin-top: 3px;
  font: 400 11.5px/1 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--f-muted); font-variant-numeric: tabular-nums;
}
.f-file-open {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 0; border-radius: 8px;
  background: var(--f-teal-dark); color: #fff;
  font: 500 12px/1 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  cursor: pointer;
  transition: filter .18s var(--f-ease), transform .18s var(--f-ease);
}
.f-file-open:hover { filter: brightness(1.08); transform: translateY(-1px); }
.f-file-open:active { transform: none; }
.f-file-open svg { flex: none; opacity: .9; }

.f-md img {
  max-width: 100%; display: block; margin: 1.2em auto;
  border: 1px solid var(--f-line); border-radius: 10px;
}
.f-md table { border-collapse: collapse; width: 100%; margin: 1.1em 0; font-size: 13.5px; }
.f-md th, .f-md td {
  border: 1px solid var(--f-line); padding: 9px 12px; text-align: left;
}
.f-md th { background: var(--f-soft); font-weight: 600; }
.f-md hr { border: 0; border-top: 1px solid var(--f-line); margin: 1.7em 0; }
.f-md input[type="checkbox"] { margin-right: 6px; accent-color: var(--f-teal-dark); }

/* ---------------- 回复 ---------------- */

.f-replies { max-width: 800px; margin: 40px auto 0; }
.f-replies-head {
  font-size: 13.5px; font-weight: 560; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--f-ink);
}
.f-replies-head span {
  font: 500 12px "Inter", Consolas, monospace;
  color: var(--f-muted); font-variant-numeric: tabular-nums;
}
.f-reply {
  display: flex; gap: 12px;
  padding: 16px 18px 17px;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  margin-bottom: 9px;
  transition: border-color .25s var(--f-ease), box-shadow .3s var(--f-ease);
}
.f-reply:hover { border-color: var(--f-line-strong); box-shadow: var(--f-shadow-sm); }
.f-reply-body { min-width: 0; flex: 1; }
/* 回复比正文收一档：一段话的密度比一整篇高，16px 连排五六条会显得吵。
   行高保持不变，读起来仍然松。 */
.f-reply .f-md { font-size: 15px; line-height: 1.85; }
.f-reply .f-md p { margin: .75em 0; }
.f-reply .f-md > :first-child { margin-top: 0; }
.f-reply .f-md > :last-child { margin-bottom: 0; }
.f-reply .f-md pre { margin: .8em 0; }
.f-reply .f-md ul, .f-reply .f-md ol { margin: .75em 0; }
.f-reply-meta {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--f-muted);
  font-family: "Inter", "Microsoft YaHei", system-ui, sans-serif;
}
.f-reply-meta b {
  color: var(--f-ink); font-size: 13px; font-weight: 560;
  font-family: inherit;
}
.f-reply-meta .f-floor {
  padding: 1px 6px; border-radius: 5px;
  font-size: 10px; font-weight: 500;
  background: var(--f-soft); color: var(--f-muted);
  font-variant-numeric: tabular-nums;
}
.f-reply-actions {
  margin-left: auto; display: flex; gap: 4px;
  opacity: 0; transform: translateX(4px);
  transition: opacity .22s var(--f-ease), transform .28s var(--f-ease);
}
.f-reply:hover .f-reply-actions,
.f-reply:focus-within .f-reply-actions {
  opacity: 1; transform: none;
}
.f-reply .f-md { margin-top: 9px; font-size: 14.2px; line-height: 1.8; }

/* ---------------- 编辑器 / 弹层 ---------------- */

.f-compose {
  margin-top: 26px; padding: 20px;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  box-shadow: var(--f-shadow-sm);
}
.f-compose textarea {
  width: 100%; min-height: 130px; resize: vertical;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius-sm);
  background: #fdfdfc; padding: 13px 15px;
  font-size: 14px; line-height: 1.78; outline: none;
  transition: border-color .25s var(--f-ease), box-shadow .3s var(--f-ease);
}
.f-compose textarea:focus {
  border-color: rgba(15, 118, 106, .55);
  box-shadow: 0 0 0 4px rgba(15, 118, 106, .09);
}
.f-compose-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.f-hint {
  font-size: 11.5px; color: var(--f-muted); margin-right: auto;
  font-family: "Inter", "Microsoft YaHei", sans-serif;
}

.f-login-gate {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 20px;
}
.f-login-gate-text b {
  display: block; font-size: 13.5px; font-weight: 560;
  color: var(--f-ink); letter-spacing: -.01em;
}
.f-login-gate-text span {
  display: block; margin-top: 3px; font-size: 12px; color: var(--f-muted);
}

.f-modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 22, 24, .34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 84px 18px 32px; overflow-y: auto;
  animation: fFade .2s var(--f-ease-out);
}
.f-modal {
  width: 100%; max-width: 660px;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  border-radius: 16px;
  box-shadow: var(--f-shadow-lg);
  animation: fRise .32s var(--f-ease-out);
  overflow: hidden;
}
.f-modal.narrow { max-width: 420px; }
.f-modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--f-line);
  background: #fdfdfc;
}
.f-modal-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.f-modal-close {
  margin-left: auto;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  font: 400 17px/1 "Inter", system-ui, sans-serif;
  color: var(--f-muted);
  background: transparent; border: 0;
  transition: background .2s var(--f-ease), color .2s var(--f-ease), transform .35s var(--f-ease);
}
.f-modal-close:hover {
  background: var(--f-soft); color: var(--f-ink);
  transform: rotate(90deg);
}
.f-modal-body { padding: 20px 20px 6px; }
.f-modal-foot {
  display: flex; gap: 10px; padding: 16px 20px 20px; align-items: center;
  border-top: 1px solid var(--f-line); margin-top: 16px;
}
.f-modal-foot .f-grow { margin-right: auto; }

@keyframes fFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fRise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.f-field { margin-bottom: 17px; }
.f-field label {
  display: block; font-size: 12.5px; font-weight: 520;
  margin-bottom: 7px; color: var(--f-ink-soft);
}
.f-input, .f-select, .f-textarea {
  width: 100%; min-width: 0;
  border: 1px solid var(--f-line); border-radius: var(--f-radius-sm);
  background: #fdfdfc; padding: 10px 13px;
  font-size: 14px; outline: none;
  transition: border-color .25s var(--f-ease), box-shadow .3s var(--f-ease);
}
.f-input:focus, .f-select:focus, .f-textarea:focus {
  border-color: rgba(15, 118, 106, .55);
  box-shadow: 0 0 0 4px rgba(15, 118, 106, .09);
}
.f-textarea {
  min-height: 210px; resize: vertical; line-height: 1.78;
  font-family: inherit;
}
.f-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--f-muted) 50%),
    linear-gradient(135deg, var(--f-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.f-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--f-line); border-radius: 9px;
  background: var(--f-soft);
}
.f-toggle button {
  border: 0; border-radius: 7px; background: transparent;
  padding: 5px 14px; font-size: 12.5px; font-weight: 500; color: var(--f-muted);
  transition: background .25s var(--f-ease), color .2s var(--f-ease), box-shadow .25s var(--f-ease);
}
.f-toggle button + button { border-left: 0; }
.f-toggle button:hover { color: var(--f-ink); }
.f-toggle button.active {
  background: var(--f-card); color: var(--f-ink);
  box-shadow: var(--f-shadow-sm);
}

.f-preview {
  min-height: 210px; padding: 16px;
  border: 1px dashed var(--f-line-strong);
  border-radius: var(--f-radius-sm);
  background: #fdfdfc;
}

.f-form-error {
  font-size: 12.8px; font-weight: 500; color: var(--f-red);
  margin-bottom: 13px; padding: 9px 13px;
  border: 1px solid #f0d5d7; border-radius: 8px;
  background: #fdf4f4;
  display: none;
  animation: fShake .32s var(--f-ease);
}
.f-form-error.show { display: block; }
@keyframes fShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  65% { transform: translateX(3px); }
}

.f-switch {
  font-size: 12.5px; color: var(--f-muted);
  text-align: center; margin: 6px 0 0;
}
.f-switch button {
  background: none; border: 0;
  font-size: 12.5px; font-weight: 520;
  color: var(--f-teal-dark);
  border-bottom: 1px solid rgba(15, 118, 106, .3);
  transition: border-color .2s var(--f-ease);
}
.f-switch button:hover { border-bottom-color: var(--f-teal-dark); }

/* ---------------- Toast ---------------- */

.f-toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 300;
  transform: translateX(-50%) translateY(14px) scale(.97);
  padding: 11px 18px;
  background: var(--f-ink);
  border: 1px solid var(--f-ink);
  border-radius: 10px;
  box-shadow: 0 10px 30px -10px rgba(20, 24, 28, .5);
  color: #fff;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .24s var(--f-ease), transform .32s var(--f-ease);
}
.f-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.f-toast.err { background: var(--f-red); border-color: var(--f-red); }

/* ---------------- 加载态：shimmer 而不是呼吸 ---------------- */

.f-skeleton { padding: 12px 0; }
.f-sk-row {
  position: relative;
  height: 64px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--f-card);
  margin-bottom: 9px;
  overflow: hidden;
}
.f-sk-row::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(23, 24, 26, .045) 45%,
    rgba(23, 24, 26, .06) 50%,
    rgba(23, 24, 26, .045) 55%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: fShimmer 1.5s var(--f-ease) infinite;
}
@keyframes fShimmer { to { transform: translateX(100%); } }

.f-spinner {
  width: 12px; height: 12px;
  border: 1.6px solid rgba(255, 255, 255, .35);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block; animation: fSpin .65s linear infinite;
  vertical-align: -1px;
}
/* 白底按钮里的 spinner 用深色 */
.f-btn:not(.f-btn-primary) .f-spinner,
.f-compose .f-spinner {
  border-color: rgba(23, 24, 26, .18);
  border-top-color: var(--f-ink);
}
@keyframes fSpin { to { transform: rotate(360deg); } }

/* ---------------- 入场：交错揭示 ---------------- */

/* 用 animation + backwards 而不是 transition：
   动画只写 from、结束即释放，卡片 hover 的 transform 不会被残留值顶掉 */
.f-reveal { opacity: 0; }
.f-reveal.in {
  opacity: 1;
  animation: fReveal .62s var(--f-ease-out) backwards;
  animation-delay: var(--d, 0ms);
}
@keyframes fReveal {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------------- 板块页标题 ---------------- */

.f-hero-cat { padding-bottom: 30px; }
.f-hero-cat-head { display: flex; gap: 16px; align-items: center; }
.f-cat-icon-lg {
  width: 52px; height: 52px;
  border-radius: 14px;
}
.f-hero-cat-text { min-width: 0; }
.f-hero-cat-text h1 {
  font-size: clamp(23px, 2.9vw, 29px);
  font-weight: 640;
  letter-spacing: -.032em;
  line-height: 1.25;
  color: var(--f-ink);
}
.f-hero-cat-text p {
  margin-top: 7px; font-size: 13.8px; color: var(--f-muted);
  max-width: 600px; line-height: 1.7;
}

/* ---------------- 页脚 ---------------- */

.f-footer {
  flex: none;
  margin-top: 48px;
  border-top: 1px solid var(--f-line);
  padding: 26px 24px 40px;
}
.f-foot-inner {
  max-width: 1040px; margin: 0 auto;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--f-muted);
}
.f-foot-inner a { transition: color .2s var(--f-ease); }
.f-foot-inner a:hover { color: var(--f-ink); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 760px) {
  .f-main { padding: 104px 18px 76px; }
  .f-hero { padding-bottom: 40px; }
  .f-hero h1 { font-size: 38px; letter-spacing: -.04em; }
  .f-hero p { font-size: 15.5px; margin-top: 18px; max-width: 300px; }
  .f-hero-bar { margin-top: 32px; flex-wrap: nowrap; gap: 8px; }
  .f-search { flex: 1 1 auto; min-width: 0; height: 46px; }
  .f-hero-bar > .f-btn { padding-inline: 16px; height: 46px; }
  .f-head-inner { padding: 0 16px; gap: 8px; }
  .f-crumb, .f-sep { display: none; }
  .f-ext { font-size: 12px; }
  .f-brand { font-size: 14.5px; }
  .f-article { padding: 22px 18px 26px; border-radius: 13px; }
  .f-files { padding: 14px; border-radius: 13px; }
  .f-file { flex-wrap: wrap; }
  .f-file-open { width: 100%; justify-content: center; }
  .f-article-head { flex-wrap: wrap; }
  .f-article-actions { margin-left: 0; width: 100%; }
  .f-thread { padding: 18px 2px; gap: 12px; }
  .f-thread:hover { padding-left: 2px; }
  .f-thread-title { font-size: 15.2px; }
  .f-cat { padding: 20px; }
  .f-cats { grid-template-columns: 1fr; }
  .f-modal-mask { padding: 28px 12px 24px; }
  .f-reply-actions { opacity: 1; transform: none; }
  .f-section-head { margin: 52px 0 18px; }
  .f-footnote { margin-top: 44px; }
  .f-aurora i { filter: blur(56px); }
}

/* 超窄屏：搜索框与按钮改为上下两行，避免 320px 上被压扁 */
@media (max-width: 380px) {
  .f-hero-bar { flex-wrap: wrap; }
  .f-hero-bar > .f-btn { width: 100%; }
  .f-cats { grid-template-columns: 1fr; }
}

/* ---------------- 减少动态效果 ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .f-reveal { opacity: 1; transform: none; }
  .f-hero::before, .f-hero::after { animation: none; }
  .f-hero h1 .f-ch { opacity: 1; transform: none; animation: none; }
  .f-sticker::before { animation: none; }
  .f-sk-row::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   三栏社区版式（v15）
   —— 左导航 / 中内容 / 右数据。参照掘金、V2EX、GitHub Discussions
      的版面共识：导航负责「去哪」，中栏负责「读」，右栏负责
      「这里有多热闹」。颜色与圆角沿用上面的纸光变量，不另起一套。
   ============================================================ */

.f-main {
  max-width: 1400px;
  padding: 118px 32px 96px;
}

/* 中栏是主战场：两侧栏位收紧到刚好够用（导航一行文字 + 榜单数字），
   把余下的宽度全给列表与正文，避免「大屏却挤在中间一小条」。 */
.f-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 288px;
  gap: 28px;
  align-items: start;
}

/* ---------------- 左导航 ---------------- */

.f-side { position: sticky; top: 96px; }

.f-nav-group { margin-bottom: 22px; }
.f-nav-group:last-of-type { margin-bottom: 0; }

.f-nav-label {
  display: block;
  padding: 0 10px;
  margin-bottom: 8px;
  font: 600 10.5px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a2a6ab;
}

.f-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--f-ink-soft);
  transition: background .22s var(--f-ease), color .22s var(--f-ease),
    border-color .22s var(--f-ease);
}
.f-nav-item:hover { background: rgba(255, 255, 255, .72); color: var(--f-ink); }
.f-nav-item.active {
  background: var(--f-card);
  border-color: var(--f-line);
  color: var(--f-teal-dark);
  font-weight: 600;
  box-shadow: var(--f-shadow-sm);
}
.f-nav-ic { display: grid; place-items: center; flex: none; color: #a2a6ab; }
.f-nav-item.active .f-nav-ic { color: var(--f-teal-dark); }
.f-nav-text {
  min-width: 0; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.f-nav-count {
  font: 500 11px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #b3b6ba;
}

.f-side-foot {
  margin-top: 26px;
  padding: 14px 12px 0;
  border-top: 1px solid var(--f-line);
}
.f-side-foot p { font-size: 11.5px; line-height: 1.7; color: #a2a6ab; }
.f-side-meta {
  display: block; margin-top: 8px;
  font: 500 10.5px/1 "Inter", Consolas, monospace;
  letter-spacing: .08em;
  color: #c0c3c6;
}

/* ---------------- 中栏 ---------------- */

.f-feed { min-width: 0; }

/* 详情页正文不再单独限 800px：它和上面的列表同宽对齐，
   否则大屏上会出现「列表宽、正文缩在中间」的错位。 */
.f-shell .f-article, .f-shell .f-replies, .f-shell .f-files { max-width: none; }

.f-feed-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  padding: 4px 0 22px;
}
.f-feed-head-sm { padding-bottom: 18px; }

.f-kicker {
  display: inline-block;
  font: 600 10.5px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--f-teal-dark);
  margin-bottom: 8px;
}

.f-feed-title h1 {
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -.035em;
  line-height: 1.2;
  color: var(--f-ink);
}
.f-feed-title p {
  margin-top: 8px;
  max-width: 46em;
  font-size: 13.5px;
  color: var(--f-muted);
}

.f-feed-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.f-feed-actions .f-search { width: 232px; height: 40px; }
.f-feed-actions .f-btn { height: 40px; border-radius: 10px; padding-inline: 16px; }

.f-toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  margin-bottom: 14px;
  border-top: 1px solid var(--f-line);
  border-bottom: 1px solid var(--f-line);
}
.f-tabs {
  display: inline-flex; gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--f-soft);
}
.f-tab {
  display: inline-block;
  padding: 6px 13px;
  border: 0; border-radius: 7px;
  background: transparent;
  font-size: 12.5px; font-weight: 500;
  color: var(--f-muted);
  transition: background .22s var(--f-ease), color .22s var(--f-ease), box-shadow .22s var(--f-ease);
}
.f-tab:hover { color: var(--f-ink); }
.f-tab.active {
  background: var(--f-card);
  color: var(--f-ink);
  font-weight: 600;
  box-shadow: var(--f-shadow-sm);
}
.f-count {
  margin-left: auto;
  font: 500 12px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #a2a6ab;
}

/* 卡片式主题：中柱需要边界，否则一长串标题会糊成一片 */
.f-threads {
  display: flex; flex-direction: column; gap: 10px;
  border: 0;
}
.f-thread {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--f-line);
  border-radius: 13px;
  transition: transform .3s var(--f-ease), box-shadow .3s var(--f-ease),
    border-color .3s var(--f-ease), background .3s var(--f-ease);
}
.f-threads > .f-thread:first-child { border-top: 1px solid var(--f-line); }
.f-thread:hover {
  padding-left: 18px;
  transform: translateY(-1px);
  background: var(--f-card);
  border-color: var(--f-line-strong);
  box-shadow: var(--f-shadow-md);
}
.f-thread > .f-avatar { margin-top: 1px; }

.f-thread-main { min-width: 0; flex: 1; display: block; }
.f-thread-title {
  display: block;
  text-wrap: balance;
  font-size: 15.5px; font-weight: 600; line-height: 1.5;
  letter-spacing: -.012em;
  color: var(--f-ink);
  transition: color .22s var(--f-ease);
}
.f-thread:hover .f-thread-title { color: var(--f-teal-dark); }
.f-thread-excerpt {
  margin-top: 6px;
  font-size: 12.5px; line-height: 1.68;
  color: #83878c;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.f-thread-meta {
  margin-top: 10px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 11.5px; color: #9a9ea3;
}
.f-thread-meta .f-dot { color: #c6c9cc; }
.f-thread-by { color: #7d8186; transition: color .2s var(--f-ease); }
.f-thread-by:hover { color: var(--f-teal-dark); }
.f-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--f-line);
  border-radius: 6px;
  background: var(--f-soft);
  font-size: 11px; font-weight: 500;
  color: var(--f-ink-soft);
  transition: border-color .2s var(--f-ease), color .2s var(--f-ease);
}
.f-tag:hover { border-color: var(--f-line-strong); color: var(--f-teal-dark); }
.f-tag svg { flex: none; }

.f-thread-stats {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 12px;
  font: 500 11.5px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #a8acb1;
}
.f-thread-stats > span { display: inline-flex; align-items: center; gap: 4px; }
.f-thread-stats svg { flex: none; }
.f-thread-side { flex: none; align-self: center; }

/* ---------------- 右栏 ---------------- */

.f-rail {
  position: sticky; top: 96px;
  display: grid; gap: 12px;
}

.f-rail-card {
  padding: 16px 18px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--f-line);
  border-radius: 13px;
}
.f-rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.f-rail-head h3 { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.f-rail-head span {
  font: 500 10px/1 "Inter", Consolas, monospace;
  letter-spacing: .06em;
  color: #b3b6ba;
}

.f-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-stat {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--f-soft);
}
.f-stat b {
  display: block;
  font: 600 17px/1.25 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--f-ink);
}
.f-stat span { font-size: 11px; color: var(--f-muted); }

.f-rank { list-style: none; }
.f-rank li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
}
.f-rank-no {
  width: 14px; flex: none;
  font: 600 11px/1 "Inter", Consolas, monospace;
  color: #c0c3c6;
}
.f-rank .f-avatar { width: 26px; height: 26px; font-size: 12px; }
.f-rank-name {
  min-width: 0; flex: 1;
  font-size: 12.5px; color: var(--f-ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .2s var(--f-ease);
}
.f-rank-name:hover { color: var(--f-teal-dark); }
.f-rank-val {
  font: 500 11px/1 "Inter", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #a8acb1;
}

.f-hot { list-style: none; }
.f-hot li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0;
}
.f-hot-no {
  width: 14px; flex: none; margin-top: 1px;
  font: 600 11px/1.6 "Inter", Consolas, monospace;
  color: #c0c3c6;
}
.f-hot-no.top { color: var(--f-teal-dark); }
.f-hot a {
  min-width: 0; flex: 1;
  font-size: 12.5px; line-height: 1.55;
  color: var(--f-ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s var(--f-ease);
}
.f-hot a:hover { color: var(--f-teal-dark); }
.f-hot-like {
  flex: none; margin-top: 1px;
  display: inline-flex; align-items: center; gap: 3px;
  font: 500 10.5px/1.6 "Inter", Consolas, monospace;
  color: #b3b6ba;
}

.f-rail-cta b { display: block; font-size: 13px; font-weight: 600; }
.f-rail-cta p { margin: 7px 0 12px; font-size: 12px; line-height: 1.65; color: var(--f-muted); }
.f-rail-cta .f-btn { width: 100%; }

/* 详情页作者卡 */
.f-author-row { display: flex; align-items: center; gap: 12px; }
.f-author-id b { display: block; font-size: 14px; font-weight: 600; }
.f-author-id span { font-size: 11.5px; color: var(--f-muted); }
.f-author-stats {
  display: flex; gap: 20px;
  margin: 14px 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--f-line);
  border-bottom: 1px solid var(--f-line);
}
.f-author-stats span { font-size: 11.5px; color: var(--f-muted); }
.f-author-stats b {
  font: 600 15px/1 "Inter", Consolas, monospace;
  color: var(--f-ink);
  margin-right: 4px;
}
.f-author-cat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--f-ink-soft);
  transition: color .2s var(--f-ease);
}
.f-author-cat:hover { color: var(--f-teal-dark); }

/* ---------------- 板块页头 ---------------- */

.f-cat-head {
  display: flex; align-items: center; gap: 16px;
  padding: 2px 0 20px;
}
.f-cat-head-text { min-width: 0; flex: 1; }
.f-cat-head-text h1 {
  font-size: 26px; font-weight: 620; letter-spacing: -.03em;
  line-height: 1.25;
}
.f-cat-head-text p { margin-top: 5px; font-size: 13px; color: var(--f-muted); }

/* 详情页正文头部：板块标签单独一行，标题不被挤 */
.f-article-headtext { min-width: 0; flex: 1; }
.f-article-tagrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.f-article-headtext .f-article-title { margin-bottom: 10px; }
.f-meta-author { color: var(--f-ink-soft); font-weight: 500; }

.f-replies-head h2 { font-size: 15px; font-weight: 600; display: inline; }
.f-replies-count {
  display: inline-block; margin-left: 8px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--f-soft);
  font: 500 11.5px/1.6 "Inter", Consolas, monospace;
  color: var(--f-muted);
}

.f-compose-locked {
  text-align: center;
  font-size: 13px;
  color: var(--f-muted);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .f-shell { grid-template-columns: 168px minmax(0, 1fr) 264px; gap: 22px; }
  .f-main { padding-inline: 24px; }
  .f-feed-actions .f-search { width: 200px; }
}

@media (max-width: 1040px) {
  .f-shell { grid-template-columns: 168px minmax(0, 1fr); }
  .f-rail { display: none; }
  .f-feed-actions .f-search { width: 240px; }
}

@media (max-width: 820px) {
  .f-main { padding: 82px 16px 72px; }
  .f-shell { display: block; }

  /* 左栏变横向 chip 条：手机上纵向导航会把内容推到一屏以外 */
  .f-side { position: static; margin-bottom: 16px; }
  .f-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .f-nav::-webkit-scrollbar { display: none; }
  .f-nav-group { display: contents; }
  .f-nav-label, .f-side-foot, .f-nav-count { display: none; }
  .f-nav-item {
    flex: none;
    padding: 6px 11px;
    border-color: var(--f-line);
    background: rgba(255, 255, 255, .7);
    font-size: 12.5px;
  }

  .f-feed-head { display: block; padding-bottom: 16px; }
  .f-feed-title h1 { font-size: 24px; }
  .f-feed-actions { margin-top: 14px; }
  .f-feed-actions .f-search { flex: 1; width: auto; }
  .f-feed-actions .f-btn { flex: none; }

  .f-thread { padding: 14px; }
  .f-thread:hover { padding-left: 14px; }
  .f-thread-stats { margin-left: 0; width: 100%; }
  .f-thread-side { align-self: flex-start; }
  .f-cat-head { align-items: flex-start; flex-wrap: wrap; }
  .f-cat-head .f-btn { order: 3; }
}

@media (max-width: 520px) {
  .f-thread-excerpt { -webkit-line-clamp: 3; }
  .f-thread > .f-avatar { display: none; }
  .f-feed-actions .f-btn span,
  .f-feed-actions .f-btn svg + * { display: none; }
}

/* ---------------- 顶栏全局搜索 ---------------- */

/* 搜索放顶栏是社区类产品的通行做法：无论滚到哪一屏，
   想搜随时能搜，不必回到首页。手机上让位给页面内搜索。 */
.f-head-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 auto;
  max-width: 340px;
  height: 34px;
  margin-left: 28px;
  padding: 0 12px;
  border: 1px solid var(--f-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .62);
  transition: border-color .25s var(--f-ease), box-shadow .3s var(--f-ease), background .25s var(--f-ease);
}
.f-head-search:hover { border-color: var(--f-line-strong); background: var(--f-card); }
.f-head-search:focus-within {
  border-color: rgba(15, 118, 106, .5);
  background: var(--f-card);
  box-shadow: 0 0 0 3px rgba(15, 118, 106, .1);
}
.f-head-search svg { flex: none; color: #a2a6ab; }
.f-head-search:focus-within svg { color: var(--f-teal-dark); }
.f-head-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 13px;
}
.f-head-search input::placeholder { color: #a8acb1; }

@media (max-width: 820px) {
  .f-head-search { display: none; }
}

@media (min-width: 821px) {
  /* 桌面端顶栏已经有搜索，页面里不再重复一个 */
  .f-feed-actions .f-search { display: none; }
  .f-feed-actions { gap: 0; }
}

/* 页头留足固定顶栏的高度（手机上竖屏空间紧，用 96px） */
@media (min-width: 821px) { .f-main { padding-top: 132px; } }

/* 置顶 / 锁定徽标与标题之间要留缝，否则挤成一个词 */
.f-thread-title .f-badge { margin-right: 6px; }

/* 顶栏内容与正文同宽，搜索框才和下面的栏位对齐 */
.f-head-inner { max-width: 1400px; padding: 0 32px; }
@media (max-width: 1180px) { .f-head-inner { padding: 0 24px; } }
@media (max-width: 820px) { .f-head-inner { padding: 0 16px; } }

/* 两行标题均分，避免末行只剩两三个字 */
.f-feed-title h1, .f-article-title, .f-cat-head-text h1 { text-wrap: balance; }

/* 面包屑：详情页的路径导航，字太小会读不出层级 */
.f-crumbrow { font-size: 12.5px; color: #8b8f94; }
.f-crumbrow a { color: #8b8f94; }
.f-crumbrow a:hover { color: var(--f-teal-dark); }

/* ---------------- 发新帖页（#/new） ----------------
   发帖是长动作：挑板块、写标题、贴代码、来回预览。
   给它一整页，中间栏从「读」切成「写」，但左右栏不动 ——
   写的时候还能瞄一眼热门主题，不必开第二个标签页。 */

.f-cp-card {
  padding: 26px 28px 20px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--f-card);
  box-shadow: var(--f-shadow-sm);
}

.f-cp-card .f-field { margin-bottom: 20px; }
.f-cp-card .f-field label { font-size: 13px; font-weight: 560; color: var(--f-ink); }

.f-cp-hint {
  margin-left: 7px;
  font-size: 11.5px; font-weight: 400;
  color: #a2a6ab;
}
.f-cp-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--f-soft);
  font: 500 10.5px/1.6 Consolas, monospace;
  color: var(--f-ink-soft);
}

/* 板块选择：一眼看全 6 个，比下拉菜单少一次点击 */
.f-catpick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.f-catpick {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius-sm);
  background: #fdfdfc;
  font-size: 13px; color: var(--f-ink-soft);
  transition: border-color .22s var(--f-ease), background .22s var(--f-ease),
    color .22s var(--f-ease), transform .18s var(--f-ease);
}
.f-catpick svg { color: #a2a6ab; transition: color .22s var(--f-ease); }
.f-catpick:hover { border-color: var(--f-line-strong); background: var(--f-card); color: var(--f-ink); }
.f-catpick:active { transform: scale(.97); }
.f-catpick.active {
  border-color: rgba(15, 118, 106, .42);
  background: rgba(15, 118, 106, .065);
  color: var(--f-teal-dark);
  font-weight: 560;
}
.f-catpick.active svg { color: var(--f-teal-dark); }

.f-input-lg { padding: 12px 14px; font-size: 16.5px; font-weight: 520; letter-spacing: -.01em; }
.f-textarea-lg { min-height: 340px; }
.f-textarea-lg:focus { min-height: 400px; }

.f-cp-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 9px;
}
.f-cp-toolbar .f-hint { font-variant-numeric: tabular-nums; }

.f-cp-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-top: 2px; padding-top: 18px;
  border-top: 1px solid var(--f-line);
}
.f-cp-kbd { font-size: 11.5px; color: #a8acb1; }
.f-cp-foot-btns { display: flex; gap: 8px; }

/* 发帖须知：常驻在表单下方，不弹窗、不挡写作 */
.f-cp-tips {
  margin-top: 18px; padding: 18px 20px;
  border: 1px dashed var(--f-line-strong);
  border-radius: var(--f-radius);
  background: rgba(255, 255, 255, .5);
}
.f-cp-tips h2 {
  margin-bottom: 8px;
  font: 600 10.5px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .14em; text-transform: uppercase;
  color: #a2a6ab;
}
.f-cp-tips li {
  margin-left: 15px;
  font-size: 12.8px; line-height: 1.9;
  color: var(--f-muted);
  list-style: disc;
}

/* 未登录：不在表单里填完才被拦，进页面就说清楚 */
.f-cp-gate {
  padding: 60px 28px 64px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--f-card);
  box-shadow: var(--f-shadow-sm);
  text-align: center;
}
.f-cp-gate-ic {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; margin-bottom: 16px;
  border-radius: 50%;
  background: rgba(15, 118, 106, .08);
  color: var(--f-teal-dark);
}
.f-cp-gate h1 { font-size: 23px; font-weight: 620; letter-spacing: -.01em; }
.f-cp-gate p {
  max-width: 420px; margin: 12px auto 22px;
  font-size: 13.6px; line-height: 1.8; color: var(--f-muted);
}
.f-cp-gate-actions { display: flex; justify-content: center; gap: 10px; }

@media (max-width: 820px) {
  .f-cp-card { padding: 18px 16px 16px; }
  .f-textarea-lg { min-height: 240px; }
  .f-textarea-lg:focus { min-height: 240px; }
  .f-cp-foot { flex-wrap: wrap; }
  .f-cp-foot-btns { width: 100%; }
  .f-cp-foot-btns .f-btn { flex: 1; }
  .f-cp-kbd { order: 2; }
  .f-cp-gate { padding: 40px 18px 44px; }
  .f-cp-gate h1 { font-size: 20px; }
}

/* ---------------- 作品帖：完整文件入口 ----------------
   文件卡原来只挂在正文末尾，读到的人不多；作品展示这种「来就是为了跑一下」
   的板块，把入口提到正文上方，第一屏就能看见。 */

.f-file-cta {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 24px; padding: 13px 15px;
  border: 1px solid rgba(15, 118, 106, .18);
  border-radius: var(--f-radius-sm);
  background: linear-gradient(180deg, rgba(15, 118, 106, .065), rgba(15, 118, 106, .028));
}
.f-file-cta-ic {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--f-card); color: var(--f-teal-dark);
  box-shadow: var(--f-shadow-sm);
}
.f-file-cta-text { min-width: 0; flex: 1; }
.f-file-cta-text b { display: block; font-size: 13.4px; font-weight: 600; color: var(--f-ink); }
.f-file-cta-text span {
  display: block; margin-top: 3px;
  font-size: 12.2px; color: var(--f-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.f-file-cta .f-btn { flex: none; }

/* 只有片段时，把「为什么没有按钮」写在正文末尾 */
.f-snippet-note {
  margin-top: 22px; padding: 12px 15px;
  border-left: 3px solid var(--f-line-strong);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, .55);
  font-size: 12.6px; line-height: 1.85; color: var(--f-muted);
}
.f-snippet-note b { color: var(--f-ink-soft); font-weight: 600; }
.f-snippet-note code {
  padding: 1px 5px; border-radius: 4px;
  background: var(--f-soft);
  font: 500 11px/1.6 Consolas, monospace;
  color: var(--f-ink-soft);
}

/* 列表里的「可运行」：作品展示一眼能认出哪几篇点进去就有得跑 */
.f-badge.run { background: rgba(15, 118, 106, .1); color: var(--f-teal-dark); }

@media (max-width: 820px) {
  .f-file-cta { flex-wrap: wrap; }
  .f-file-cta-text { flex-basis: calc(100% - 46px); }
  .f-file-cta .f-btn { width: 100%; }
}

/* ---------------- 附件：预览 / 下载 / 添加 ----------------
   作品帖的附件区要回答一个问题：这文件我能不能现在就看？
   能看的给「预览」，看不了的只给「下载」——不要让人点了才知道是压缩包。 */

.f-files { margin-top: 14px; }
.f-files-head { align-items: center; }
.f-files-title { display: inline-flex; align-items: center; gap: 7px; }
.f-files-count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 118, 106, .09);
  font: 600 11px/1 "Inter", system-ui, sans-serif;
  color: var(--f-teal-dark);
  font-variant-numeric: tabular-nums;
}
.f-files-head .f-btn { margin-left: auto; }

.f-file { flex-wrap: wrap; row-gap: 9px; }
.f-file-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(15, 118, 106, .08);
  color: var(--f-teal-dark);
}
.f-file-icon.k-image { background: rgba(214, 138, 42, .12); color: #a9701d; }
.f-file-icon.k-video,
.f-file-icon.k-audio { background: rgba(102, 92, 204, .1); color: #5850a8; }
.f-file-icon.k-pdf { background: rgba(200, 72, 60, .1); color: #b0453b; }
.f-file-icon.k-archive,
.f-file-icon.k-office { background: rgba(120, 128, 138, .12); color: #5f6670; }
.f-file-icon.k-text,
.f-file-icon.k-chp { background: rgba(15, 118, 106, .08); color: var(--f-teal-dark); }

.f-file-actions {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; justify-content: flex-end;
}
.f-file-actions .f-btn { height: 28px; padding: 0 10px; font-size: 11.5px; }
.f-file-actions .f-btn-danger { color: #b0453b; border-color: rgba(176, 69, 59, .25); }
.f-file-actions .f-btn-danger:hover { background: rgba(176, 69, 59, .07); }

/* 列表里的「附文件」：有附件但网页打不开（压缩包 / 文档） */
.f-badge.file { background: rgba(120, 128, 138, .12); color: #5f6670; }

/* 作品展示板块页的作品库入口 */
.f-works-link {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 13px 16px;
  border: 1px solid rgba(15, 118, 106, .16);
  border-radius: var(--f-radius-sm);
  background: linear-gradient(180deg, rgba(15, 118, 106, .055), rgba(15, 118, 106, .02));
  transition: border-color .22s var(--f-ease), transform .18s var(--f-ease);
}
.f-works-link:hover { border-color: rgba(15, 118, 106, .34); transform: translateY(-1px); }
.f-works-link-ic {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--f-card); color: var(--f-teal-dark);
  box-shadow: var(--f-shadow-sm);
}
.f-works-link-text { flex: 1; min-width: 0; }
.f-works-link-text b { display: block; font-size: 13.2px; font-weight: 600; color: var(--f-ink); }
.f-works-link-text i {
  display: block; margin-top: 3px;
  font-size: 12.2px; font-style: normal; line-height: 1.6; color: var(--f-muted);
}
.f-works-link-go {
  flex: none; font: 500 12px/1 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--f-teal-dark);
}

/* 预览弹层：网页 / 图片 / 视频 / 文本都在这里看，不再跳走 */
.f-modal.wide { max-width: 1080px; }
.f-pv-head { align-items: flex-start; }
.f-pv-title { min-width: 0; }
.f-pv-title b {
  display: block;
  font: 600 14.5px/1.4 "JetBrains Mono", Consolas, monospace;
  color: var(--f-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.f-pv-title span {
  display: block; margin-top: 3px;
  font: 400 11.8px/1.5 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--f-muted);
}
.f-pv-body {
  padding: 0;
  background: #f4f5f3;
  max-height: 76vh;
  overflow: auto;
}
.f-pv-frame {
  display: block; width: 100%; height: 76vh;
  border: 0; background: #fff;
}
.f-pv-img {
  display: block; max-width: 100%; margin: 0 auto;
  max-height: 76vh; object-fit: contain;
}
.f-pv-video { display: block; width: 100%; max-height: 76vh; background: #000; }
.f-pv-audio { display: block; width: 100%; margin: 48px 0; padding: 0 24px; }
.f-pv-text {
  margin: 0; padding: 18px 22px;
  font: 400 12.8px/1.75 "JetBrains Mono", Consolas, "Courier New", monospace;
  color: #2b3036; white-space: pre-wrap; word-break: break-word;
  background: #fbfbfa;
}
.f-pv-missing { padding: 48px 24px; text-align: center; font-size: 13.2px; color: var(--f-muted); }
.f-pv-foot { flex-wrap: wrap; }
.f-pv-foot .f-btn-primary { margin-left: auto; }

/* 发帖页的附件选择 */
.f-cp-drop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed var(--f-line-strong);
  border-radius: var(--f-radius-sm);
  background: #fdfdfc;
  transition: border-color .2s var(--f-ease), background .2s var(--f-ease);
}
.f-cp-drop.dragging { border-color: var(--f-teal-dark); background: rgba(15, 118, 106, .05); }
.f-cp-drop.has-files { border-style: solid; }
.f-cp-drop-text { font-size: 12.2px; color: var(--f-muted); }

.f-cp-attach-list { margin-top: 8px; }
.f-cp-attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--f-line);
  border-radius: 8px;
  background: var(--f-soft);
}
.f-cp-attach-item + .f-cp-attach-item { margin-top: 6px; }
.f-cp-attach-name {
  flex: 1; min-width: 0;
  font: 500 12.5px/1.4 "JetBrains Mono", Consolas, monospace;
  color: var(--f-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.f-cp-attach-size {
  flex: none; font-size: 11.5px; color: var(--f-muted);
  font-variant-numeric: tabular-nums;
}
.f-cp-attach-del {
  flex: none; width: 22px; height: 22px;
  border: 0; border-radius: 6px; background: transparent;
  font: 400 15px/1 "Inter", system-ui, sans-serif; color: #9aa0a6;
  cursor: pointer;
}
.f-cp-attach-del:hover { background: rgba(176, 69, 59, .09); color: #b0453b; }

@media (max-width: 820px) {
  .f-file { align-items: flex-start; }
  .f-file-body { flex-basis: calc(100% - 46px); }
  .f-file-actions { width: 100%; justify-content: flex-start; }
  .f-files-head .f-btn { margin-left: 0; }
  .f-pv-frame { height: 64vh; }
  .f-pv-body { max-height: 64vh; }
  .f-pv-foot .f-btn-primary { margin-left: 0; }
}
