/* ==========================================================================
   zc520 — 技术论坛界面
   参考：GitHub Dark / V2EX / Arch BBS 的信息密度与克制美学
   原则：中性冷灰底 · 单一焦橙强调 · 小圆角 · 高密度 · 微交互不喧哗
   ========================================================================== */

:root {
  --bg-0: #08090a;
  --bg-1: #0f1113;
  --bg-2: #16191c;
  --bg-3: #1d2125;
  --bg-4: #252a2e;

  --bd:   #1f2428;
  --bd-2: #2d3339;
  --bd-3: #3d444c;

  --fg:   #e6e8ea;
  --fg-2: #a9b0b6;
  --fg-3: #737b82;
  --fg-4: #4e555b;

  --ac:     #e8590c;
  --ac-2:   #ff6b35;
  --ac-dim: rgba(232,89,12,.12);
  --ac-bd:  rgba(232,89,12,.32);

  --ok:      #4c9a6a;
  --ok-dim:  rgba(76,154,106,.12);
  --warn:    #c99a2e;
  --warn-dim: rgba(201,154,46,.12);
  --err:     #d1534a;
  --err-dim: rgba(209,83,74,.12);
  --info:    #5b8bb5;
  --info-dim: rgba(91,139,181,.12);
  --purple:  #8b6fa8;
  --link:    #86a8c4;

  --r:  3px;
  --r2: 4px;
  --r3: 6px;

  --e-snap: cubic-bezier(.2,.9,.3,1);
  --e-out:  cubic-bezier(.16,1,.3,1);
  --e-back: cubic-bezier(.34,1.56,.64,1);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  --w: 1240px;
  --h-top: 52px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--h-top) + 16px);
}

body {
  font: 13.5px/1.62 var(--sans);
  color: var(--fg);
  background: var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; transition: color .12s var(--e-snap); }
a:hover { color: var(--ac-2); }

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--ac-dim); color: var(--fg); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: 6px;
  border: 3px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover { background: var(--bd-3); }

:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
  border-radius: var(--r);
}

.shell { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 20px; }

#progressBar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--ac), var(--ac-2));
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--h-top);
  background: rgba(8,9,10,.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--bd);
  transition: transform .3s var(--e-out), background .25s, box-shadow .25s;
  will-change: transform;
}
.topbar.hide { transform: translateY(-100%); }
.topbar.condensed {
  background: rgba(8,9,10,.95);
  box-shadow: 0 1px 0 var(--bd), 0 6px 20px rgba(0,0,0,.45);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--h-top);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.2px;
}
.brand:hover { color: var(--fg); }
.brand-mark {
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  background: var(--ac);
  color: #fff;
  border-radius: var(--r);
  font: 700 11px/1 var(--mono);
  letter-spacing: -.5px;
  transition: transform .35s var(--e-back), box-shadow .3s;
}
.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.1);
  box-shadow: 0 0 0 3px var(--ac-dim), 0 2px 12px rgba(232,89,12,.4);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-item {
  position: relative;
  padding: 6px 11px;
  font-size: 13px;
  color: var(--fg-3);
  border-radius: var(--r);
  white-space: nowrap;
  transition: color .13s var(--e-snap), background .13s;
}
.nav-item:hover { color: var(--fg-2); background: var(--bg-2); }
.nav-item.on { color: var(--fg); font-weight: 500; }
.nav-item.on::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px; bottom: -1px;
  height: 2px;
  background: var(--ac);
  border-radius: 2px 2px 0 0;
  animation: navSlide .26s var(--e-out);
  transform-origin: center;
}
@keyframes navSlide {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.search {
  position: relative;
  width: 210px;
  flex-shrink: 0;
  transition: width .3s var(--e-out);
}
.search:focus-within { width: 280px; }
.search input {
  width: 100%;
  height: 30px;
  padding: 0 34px 0 10px;
  background: var(--bg-1);
  border: 1px solid var(--bd-2);
  border-radius: var(--r2);
  color: var(--fg);
  font-size: 12.5px;
  outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--fg-4); }
.search input:focus {
  background: var(--bg-2);
  border-color: var(--ac-bd);
  box-shadow: 0 0 0 3px var(--ac-dim);
}
.search-key {
  position: absolute;
  right: 7px; top: 50%;
  transform: translateY(-50%);
  font: 600 9.5px/1 var(--mono);
  color: var(--fg-4);
  background: var(--bg-3);
  border: 1px solid var(--bd-2);
  border-radius: 2px;
  padding: 2px 4px;
  pointer-events: none;
  transition: opacity .2s;
}
.search:focus-within .search-key { opacity: 0; }

.top-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.icon-btn {
  position: relative;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--r2);
  color: var(--fg-3);
  font-size: 14px;
  cursor: pointer;
  transition: color .13s, background .13s, transform .12s var(--e-snap);
}
.icon-btn:hover { color: var(--fg); background: var(--bg-2); }
.icon-btn:active { transform: scale(.92); }

.dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 0 2px var(--bg-0);
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: .75; }
}

.num-badge {
  position: absolute;
  top: 1px; right: 0;
  min-width: 15px; height: 14px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  background: var(--ac);
  color: #fff;
  font: 700 9px/1 var(--mono);
  border-radius: 7px;
  box-shadow: 0 0 0 2px var(--bg-0);
  animation: badgeIn .34s var(--e-back);
}
@keyframes badgeIn {
  from { transform: scale(0) rotate(-30deg); }
  to   { transform: scale(1) rotate(0); }
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s var(--e-snap);
}
.user-btn:hover {
  background: var(--bg-2);
  border-color: var(--bd-2);
  color: var(--fg);
}

.av {
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: var(--bg-3);
  color: var(--fg-2);
  font: 600 11px/1 var(--mono);
  flex-shrink: 0;
  transition: transform .25s var(--e-back);
  user-select: none;
}
.av.xs { width: 18px; height: 18px; font-size: 9px; border-radius: 2px; }
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.av.md { width: 34px; height: 34px; font-size: 14px; }
.av.lg { width: 64px; height: 64px; font-size: 24px; border-radius: var(--r3); }
.user-btn:hover .av { transform: scale(1.08); }

.av.owner { background: var(--ac); color: #fff; }
.av.admin { background: var(--purple); color: #fff; }
.av.guest { background: var(--bg-3); color: var(--fg-4); }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--bd-2);
  border-radius: var(--r2);
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s var(--e-snap), border-color .14s, color .14s,
              transform .1s var(--e-snap), box-shadow .14s;
}
.btn:hover { background: var(--bg-3); border-color: var(--bd-3); color: var(--fg); }
.btn:active { transform: scale(.97); }

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  transform: scale(0);
  animation: ripple .5s var(--e-out) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

.btn-primary {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--ac-2);
  border-color: var(--ac-2);
  color: #fff;
  box-shadow: 0 2px 12px rgba(232,89,12,.35);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-3);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--fg); border-color: transparent; }

.btn-danger {
  background: transparent;
  border-color: rgba(209,83,74,.3);
  color: var(--err);
}
.btn-danger:hover {
  background: var(--err-dim);
  border-color: var(--err);
  color: var(--err);
}

.btn-sm { height: 24px; padding: 0 8px; font-size: 11.5px; }
.btn-lg { height: 38px; padding: 0 20px; font-size: 13.5px; border-radius: var(--r3); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none !important; }

/* ==========================================================================
   布局
   ========================================================================== */
.main { padding: 20px 0 56px; }

.layout {
  display: grid;
  grid-template-columns: 168px minmax(0,1fr) 232px;
  gap: 18px;
  align-items: start;
}
.layout.wide     { grid-template-columns: minmax(0,1fr) 232px; }
.layout.centered { grid-template-columns: minmax(0,1fr); max-width: 720px; margin: 0 auto; }
.layout.full     { grid-template-columns: minmax(0,1fr); }

/* ==========================================================================
   侧栏
   ========================================================================== */
.side {
  position: sticky;
  top: calc(var(--h-top) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sbox {
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  overflow: hidden;
}

.sbox-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-4);
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(180deg, rgba(255,255,255,.012), transparent);
}

.sbox-b { padding: 5px; }

.snav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6.5px 9px;
  border-radius: var(--r2);
  font-size: 12.5px;
  color: var(--fg-3);
  transition: color .13s var(--e-snap), background .13s;
}
.snav:hover { color: var(--fg); background: var(--bg-2); }
.snav.on { color: var(--ac-2); background: var(--ac-dim); font-weight: 500; }

.snav-ic {
  width: 13px;
  text-align: center;
  font-size: 10px;
  color: var(--fg-4);
  flex-shrink: 0;
}
.snav.on .snav-ic { color: var(--ac); }

.snav-n {
  margin-left: auto;
  font: 500 10px var(--mono);
  color: var(--fg-4);
  padding: 1px 5px;
  background: var(--bg-3);
  border-radius: 2px;
  transition: all .13s;
}
.snav.on .snav-n { background: rgba(232,89,12,.18); color: var(--ac-2); }

.stats { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.stats-r {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
}
.stats-r .k { color: var(--fg-4); }
.stats-r .v { font: 600 12px var(--mono); color: var(--fg-2); transition: color .2s; }

/* ==========================================================================
   页头
   ========================================================================== */
.phead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ptitle {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ptitle .n {
  font: 500 11px var(--mono);
  color: var(--fg-4);
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--bd);
  border-radius: 2px;
}

.segs {
  display: flex;
  gap: 1px;
  padding: 2px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  margin-left: auto;
}
.seg {
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 12px;
  color: var(--fg-3);
  transition: all .13s var(--e-snap);
}
.seg:hover { color: var(--fg-2); }
.seg.on { background: var(--bg-4); color: var(--fg); font-weight: 500; }

/* ==========================================================================
   帖子行
   ========================================================================== */
.feed { display: flex; flex-direction: column; gap: 6px; }

.topic {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  transition: background .15s var(--e-snap), border-color .15s, transform .18s var(--e-out);
  will-change: transform;
  animation: rowIn .34s var(--e-out) both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.feed .topic:nth-child(1) { animation-delay: .01s }
.feed .topic:nth-child(2) { animation-delay: .025s }
.feed .topic:nth-child(3) { animation-delay: .04s }
.feed .topic:nth-child(4) { animation-delay: .055s }
.feed .topic:nth-child(5) { animation-delay: .07s }
.feed .topic:nth-child(6) { animation-delay: .085s }
.feed .topic:nth-child(n+7) { animation-delay: .1s }

.topic:hover {
  background: var(--bg-2);
  border-color: var(--bd-2);
  transform: translateX(2px);
}
.topic.pinned {
  border-color: var(--ac-bd);
  background: linear-gradient(90deg, rgba(232,89,12,.045), var(--bg-1) 60%);
}
.topic.pinned::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--ac);
}

.topic-av { flex-shrink: 0; padding-top: 1px; }
.topic-body { flex: 1; min-width: 0; }

.t-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.t-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.45;
  overflow-wrap: anywhere;
  transition: color .13s;
}
.topic:hover .t-title { color: var(--ac-2); }

.t-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font: 11px var(--mono);
  color: var(--fg-4);
}
.t-meta .who { color: var(--fg-3); }
.t-meta .who.owner { color: var(--ac-2); }
.t-meta .who.admin { color: var(--purple); }
.t-meta .d { opacity: .35; }

.t-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  padding-left: 8px;
  font: 10.5px/1.4 var(--mono);
  color: var(--fg-4);
  text-align: right;
}
.t-stat b { color: var(--fg-2); font-weight: 600; }
.t-stat .fire { color: var(--warn); }

/* ==========================================================================
   角标
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 2px;
  font: 600 9.5px/1 var(--mono);
  letter-spacing: .2px;
  vertical-align: middle;
  white-space: nowrap;
}
.badge-pin  { background: var(--ac-dim); color: var(--ac-2); border: 1px solid var(--ac-bd); }
.badge-best { background: var(--ok-dim); color: var(--ok); border: 1px solid rgba(76,154,106,.3); }
.badge-lock { background: var(--bg-3); color: var(--fg-4); border: 1px solid var(--bd-2); }
.badge-role-owner { background: var(--ac-dim); color: var(--ac-2); border: 1px solid var(--ac-bd); }
.badge-role-admin { background: rgba(139,111,168,.14); color: var(--purple); border: 1px solid rgba(139,111,168,.32); }
.badge-err  { background: var(--err-dim); color: var(--err); border: 1px solid rgba(209,83,74,.3); }
.badge-warn { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(201,154,46,.3); }
.badge-tag  { background: var(--bg-2); color: var(--fg-3); border: 1px solid var(--bd); }
.badge-tag:hover { color: var(--ac-2); border-color: var(--ac-bd); }

/* ==========================================================================
   空态
   ========================================================================== */
.blank {
  padding: 56px 20px;
  text-align: center;
  border: 1px dashed var(--bd-2);
  border-radius: var(--r3);
  animation: rowIn .4s var(--e-out) both;
}
.blank-ic {
  font-size: 28px;
  opacity: .22;
  margin-bottom: 10px;
  line-height: 1;
}
.blank-t { font-size: 13.5px; color: var(--fg-3); margin-bottom: 3px; }
.blank-d { font-size: 12px; color: var(--fg-4); line-height: 1.7; }

/* ==========================================================================
   分页
   ========================================================================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.pager a, .pager span {
  min-width: 30px; height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r2);
  font: 12px var(--mono);
  background: var(--bg-1);
  border: 1px solid var(--bd);
  color: var(--fg-3);
  transition: all .14s var(--e-snap);
}
.pager a:hover {
  background: var(--bg-2);
  border-color: var(--bd-3);
  color: var(--fg);
  transform: translateY(-1px);
}
.pager .on {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
  font-weight: 600;
}
.pager .gap { border: 0; background: transparent; color: var(--fg-4); }

/* ==========================================================================
   搜索提示
   ========================================================================== */
.hintbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  margin-bottom: 10px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-left: 2px solid var(--ac);
  border-radius: var(--r2);
  font-size: 12px;
  color: var(--fg-3);
  flex-wrap: wrap;
  animation: rowIn .28s var(--e-out) both;
}
.hintbar b { color: var(--fg); font-weight: 600; }
.hintbar .clear {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--bd-2);
  font-size: 11px;
  color: var(--fg-4);
  transition: all .14s;
}
.hintbar .clear:hover { color: var(--fg); border-color: var(--bd-3); background: var(--bg-2); }

mark {
  background: rgba(232,89,12,.2);
  color: var(--ac-2);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ==========================================================================
   帖子详情
   ========================================================================== */
.post {
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  overflow: hidden;
  animation: rowIn .38s var(--e-out) both;
}
.post.is-op { border-color: var(--bd-2); }

.post-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(180deg, rgba(255,255,255,.014), transparent);
}

.post-title {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.42;
  letter-spacing: -.3px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-wrap: wrap;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font: 11px var(--mono);
  color: var(--fg-4);
}
.post-meta .who { color: var(--fg-2); font-weight: 500; }
.post-meta .who.owner { color: var(--ac-2); }
.post-meta .who.admin { color: var(--purple); }
.post-meta .d { opacity: .35; }

.post-body {
  padding: 18px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.post-body p { margin-bottom: 13px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body a {
  color: var(--link);
  border-bottom: 1px solid var(--bd-3);
  transition: border-color .14s;
}
.post-body a:hover { border-color: var(--ac); }

.post-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border-top: 1px solid var(--bd);
  background: var(--bg-0);
  flex-wrap: wrap;
}

/* 反应按钮 */
.react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--bd-2);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-3);
  font: 500 12px var(--sans);
  cursor: pointer;
  transition: all .16s var(--e-snap);
  -webkit-tap-highlight-color: transparent;
}
.react:hover {
  border-color: var(--bd-3);
  color: var(--fg-2);
  background: var(--bg-2);
  transform: translateY(-1px);
}
.react.on {
  border-color: var(--ac-bd);
  color: var(--ac-2);
  background: var(--ac-dim);
}
.react.pop { animation: reactPop .42s var(--e-back); }
@keyframes reactPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.react-ic { font-size: 11px; line-height: 1; }

/* 附件 */
.files {
  margin: 0 18px 16px;
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
}
.files-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 10px/1 var(--mono);
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 9px;
}
.file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  font-size: 12.5px;
  color: var(--fg-2);
  transition: all .16s var(--e-snap);
}
.file:last-child { margin-bottom: 0; }
.file:hover {
  border-color: var(--ac-bd);
  background: var(--ac-dim);
  color: var(--fg);
  transform: translateX(2px);
}
.file-ic {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--bg-3);
  border-radius: 2px;
  color: var(--link);
  font-size: 10px;
  flex-shrink: 0;
}
.file-n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-s { font: 10.5px var(--mono); color: var(--fg-4); flex-shrink: 0; }
.file.locked { border-style: dashed; opacity: .55; cursor: not-allowed; }
.file.locked:hover { transform: none; background: var(--bg-1); border-color: var(--bd); }
.file-lock {
  font: 9.5px var(--mono);
  color: var(--fg-4);
  padding: 2px 5px;
  border: 1px solid var(--bd-2);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ==========================================================================
   回复
   ========================================================================== */
.replies { margin-top: 14px; }

.replies-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 2px;
}
.replies-h h2 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.replies-h .cnt {
  font: 500 11px var(--mono);
  color: var(--fg-4);
  padding: 1px 5px;
  background: var(--bg-2);
  border-radius: 2px;
}

.rlist { display: flex; flex-direction: column; gap: 5px; }

.reply {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  transition: border-color .15s, background .15s;
  animation: rowIn .32s var(--e-out) both;
  scroll-margin-top: calc(var(--h-top) + 20px);
}
.reply:hover { border-color: var(--bd-2); background: var(--bg-2); }
.reply.hidden-op { opacity: .42; }
.reply:target {
  border-color: var(--ac-bd);
  animation: targetGlow 1.6s var(--e-out);
}
@keyframes targetGlow {
  0%, 40% { background: var(--ac-dim); }
  100%    { background: var(--bg-1); }
}

.reply-body { flex: 1; min-width: 0; }
.reply-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.reply-who {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--fg-2);
}
.reply-who.owner { color: var(--ac-2); }
.reply-who.admin { color: var(--purple); }
.reply-time {
  margin-left: auto;
  font: 10.5px var(--mono);
  color: var(--fg-4);
}
.reply-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--fg-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reply-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}
.reply-foot .react { height: 22px; padding: 0 8px; font-size: 11px; }

/* ==========================================================================
   表单
   ========================================================================== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  padding: 18px;
  animation: rowIn .34s var(--e-out) both;
}
.card.narrow { max-width: 400px; margin: 36px auto; }

.card-h {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-s {
  font-size: 12px;
  color: var(--fg-4);
  margin-bottom: 16px;
  line-height: 1.65;
}

.fr { margin-bottom: 13px; }
.fr > label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--fg-3);
  margin-bottom: 5px;
}
.fr .note {
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 4px;
  line-height: 1.6;
}

.inp, .ta, .sel {
  width: 100%;
  padding: 8px 11px;
  background: var(--bg-0);
  border: 1px solid var(--bd-2);
  border-radius: var(--r2);
  color: var(--fg);
  font-size: 13px;
  outline: none;
  transition: border-color .16s var(--e-snap), box-shadow .16s, background .16s;
}
.inp::placeholder, .ta::placeholder { color: var(--fg-4); }
.inp:focus, .ta:focus, .sel:focus {
  background: var(--bg-1);
  border-color: var(--ac-bd);
  box-shadow: 0 0 0 3px var(--ac-dim);
}
.ta { resize: vertical; min-height: 160px; line-height: 1.75; }

.sel {
  cursor: pointer;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6'><path d='M1 1l3.5 3L8 1' stroke='%23737b82' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.sel option { background: var(--bg-2); color: var(--fg); }

/* 复选 */
.cb {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}
.cb input {
  appearance: none;
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid var(--bd-3);
  border-radius: 2px;
  background: var(--bg-0);
  cursor: pointer;
  position: relative;
  transition: all .15s var(--e-snap);
}
.cb input:checked {
  background: var(--ac);
  border-color: var(--ac);
}
.cb input:checked::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='7'><path d='M1 3.5l2.2 2.2L8 1.5' stroke='%23fff' stroke-width='1.9' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/9px no-repeat;
}
.cb label {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.65;
  cursor: pointer;
}

/* 提示条 */
.msg {
  padding: 9px 12px;
  border-radius: var(--r2);
  margin-bottom: 13px;
  font-size: 12.5px;
  line-height: 1.65;
  border-left: 2px solid;
  animation: rowIn .26s var(--e-out) both;
}
.msg-err  { background: var(--err-dim);  border-color: var(--err);  color: #e8928b; }
.msg-ok   { background: var(--ok-dim);   border-color: var(--ok);   color: #7fc79c; }
.msg-warn { background: var(--warn-dim); border-color: var(--warn); color: #ddb85f; }
.msg-info { background: var(--info-dim); border-color: var(--info); color: var(--link); }

/* 上传区 */
.drop {
  border: 1.5px dashed var(--bd-3);
  border-radius: var(--r3);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-0);
  transition: all .2s var(--e-snap);
}
.drop:hover, .drop.over {
  border-color: var(--ac);
  background: var(--ac-dim);
}
.drop input[type=file] { display: none; }
.drop-t { font-size: 12.5px; color: var(--fg-2); margin-bottom: 4px; }
.drop-h { font-size: 11px; color: var(--fg-4); line-height: 1.6; }

.picks { margin-top: 8px; }
.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--bd);
  animation: rowIn .24s var(--e-out) both;
}
.pick:last-child { border-bottom: 0; }
.pick .sz { margin-left: auto; font: 10.5px var(--mono); color: var(--fg-4); }
.pick.bad .sz { color: var(--err); }

/* ==========================================================================
   个人主页
   ========================================================================== */
.profile {
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  animation: rowIn .36s var(--e-out) both;
}
.profile.vip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ac), transparent);
}

.profile-top { display: flex; gap: 15px; align-items: flex-start; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 190px; }

.profile-name {
  font-size: 18px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  letter-spacing: -.2px;
}

.profile-bio {
  font-size: 12.5px;
  color: var(--fg-3);
  line-height: 1.7;
  margin-bottom: 8px;
}

.profile-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font: 11px var(--mono);
  color: var(--fg-4);
}

.profile-nums {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
}
.pnum { min-width: 42px; }
.pnum .v {
  font: 600 16px/1.2 var(--mono);
  color: var(--fg);
  letter-spacing: -.5px;
}
.pnum .k { font-size: 10.5px; color: var(--fg-4); margin-top: 2px; }

/* ==========================================================================
   通知
   ========================================================================== */
.nlist { display: flex; flex-direction: column; gap: 5px; }

.nitem {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  transition: all .15s var(--e-snap);
  animation: rowIn .3s var(--e-out) both;
}
.nitem:hover { border-color: var(--bd-2); background: var(--bg-2); }
.nitem.new {
  border-color: var(--ac-bd);
  background: linear-gradient(90deg, rgba(232,89,12,.05), var(--bg-1) 70%);
}
.nitem.new::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ac);
  flex-shrink: 0;
  margin-top: 7px;
}
.nitem-body { flex: 1; min-width: 0; }
.nitem-t { font-size: 12.5px; color: var(--fg-2); line-height: 1.65; }
.nitem-t b { color: var(--fg); font-weight: 600; }
.nitem-t .pre { color: var(--fg-4); }
.nitem-time { font: 10.5px var(--mono); color: var(--fg-4); margin-top: 2px; }

/* ==========================================================================
   标签云
   ========================================================================== */
.tagcloud {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
}
.tagcloud a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--bg-2);
  border: 1px solid var(--bd);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--fg-2);
  transition: all .16s var(--e-snap);
}
.tagcloud a:hover {
  border-color: var(--ac-bd);
  background: var(--ac-dim);
  color: var(--ac-2);
  transform: translateY(-1px);
}
.tagcloud a .hash { color: var(--ac); font-weight: 600; }
.tagcloud a .n {
  font: 600 10px var(--mono);
  color: var(--fg-4);
  background: var(--bg-0);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ==========================================================================
   侧栏迷你项
   ========================================================================== */
.mini {
  display: block;
  padding: 7px 9px;
  border-radius: var(--r2);
  transition: background .13s;
}
.mini:hover { background: var(--bg-2); }
.mini-t {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini:hover .mini-t { color: var(--ac-2); }
.mini-m { font: 10px var(--mono); color: var(--fg-4); margin-top: 2px; }

.mini-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--r2);
  transition: background .13s;
}
.mini-user:hover { background: var(--bg-2); }
.mini-user-n { font-size: 12.5px; color: var(--fg-2); }
.mini-user:hover .mini-user-n { color: var(--ac-2); }
.mini-user-s { font: 10px var(--mono); color: var(--fg-4); }

/* ==========================================================================
   页脚
   ========================================================================== */
.footer {
  border-top: 1px solid var(--bd);
  background: var(--bg-1);
  padding: 22px 0 30px;
  margin-top: auto;
}
.footer-in {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; }
.footer-links a { color: var(--fg-4); }
.footer-links a:hover { color: var(--ac-2); }
.footer-note {
  font-size: 11px;
  color: var(--fg-4);
  line-height: 1.7;
  max-width: 520px;
  margin-top: 8px;
}
.footer-sig {
  font: 10.5px var(--mono);
  color: var(--fg-4);
  align-self: flex-end;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.toast {
  padding: 9px 15px;
  background: var(--bg-3);
  border: 1px solid var(--bd-3);
  border-radius: var(--r2);
  color: var(--fg);
  font-size: 12.5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.55);
  animation: toastIn .3s var(--e-back) both;
  pointer-events: auto;
}
.toast.ok  { border-left: 2px solid var(--ok); }
.toast.err { border-left: 2px solid var(--err); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.95); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   回到顶部
   ========================================================================== */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--bd-2);
  border-radius: var(--r2);
  color: var(--fg-3);
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all .24s var(--e-out);
  z-index: 300;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover {
  background: var(--bg-3);
  border-color: var(--ac-bd);
  color: var(--ac-2);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1120px) {
  .layout { grid-template-columns: 156px minmax(0,1fr); }
  .layout.wide { grid-template-columns: minmax(0,1fr); }
  .side-right { display: none; }
}

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .side-left { display: none; }
  .nav { display: none; }
  .search { width: 100%; max-width: 180px; }
  .search:focus-within { width: 100%; }
}

@media (max-width: 600px) {
  .shell { padding: 0 12px; }
  .main { padding: 14px 0 40px; }
  .t-stat { display: none; }
  .post-body { padding: 15px 14px; font-size: 14px; }
  .post-head { padding: 13px 14px 11px; }
  .post-title { font-size: 17px; }
  .files { margin: 0 14px 14px; }
  .post-foot { padding: 10px 14px; }
  .card { padding: 15px 14px; }
  .user-btn span:not(.av) { display: none; }
  .user-btn { padding: 0 2px; }
  .profile-nums { gap: 16px; }
  .footer-in { flex-direction: column; gap: 12px; }
  .footer-sig { align-self: flex-start; }
  .reply { padding: 10px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
