/* ============================================================
 * YouMakeBetter 社区样式 —— 全站唯一的样式底座
 * ------------------------------------------------------------
 * 自成体系：包含 reset、变量、全部组件。
 *
 * ★ 这里是**唯一**定义 :root 变量的地方。
 *   案卷页的样式在 assets/case.css，那个文件只有规则、不定义变量，
 *   全部引用下面这一套 —— 一个站点只许有一套变量。
 *   （旧落地页的 site.css 已退役，不再被任何页面引用。）
 *
 * 视觉决定：
 * - 主色用深蓝 + 橙色点缀。蓝代表"可信、工业"，橙代表"行动"。
 *   众筹类产品最怕显得轻浮，所以不用高饱和的糖果色。
 * - 卡片化 + 大留白。信息密度高的社区（微博那种）看起来热闹但很累，
 *   这里刻意把行高和间距放大一档。
 * - 涨跌色之类的金融约定本项目用不上，但**点赞/附议的高亮用红橙**，
 *   符合中文用户的直觉（红 = 正向）。
 * ============================================================ */

:root {
  --brand: #1e63ff;
  --brand-d: #1550d8;
  --brand-soft: #eaf0ff;
  --violet: #6b4dff;
  --accent: #ff6b35;
  --accent-soft: #fff1ea;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #171a20;
  --text-2: #3d434f;
  --muted: #6b7280;
  --muted-2: #9aa1ad;
  --line: #e6e9f0;
  --line-2: #f0f2f7;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .12);
  --tb-h: 60px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--tb-h);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button { font-family: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
small { font-size: 12px; }

/* ============================================================
 * 顶栏
 * ============================================================ */

#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--tb-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 60;
}

.tb-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
}

.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff; font-weight: 800; font-size: 17px;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(30, 99, 255, .3);
}
.brand-text { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.brand-text small {
  display: block; font-weight: 400; color: var(--muted-2);
  font-size: 10.5px; letter-spacing: .2px; margin-top: -3px;
}

.tb-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--line-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-icon { font-size: 15px; line-height: 1; }
.nav-item.nav-post { display: none; }
.nav-badge {
  font-style: normal; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 999px;
  min-width: 16px; text-align: center;
}

.tb-search { position: relative; flex: 1 1 auto; max-width: 340px; margin-left: auto; }
.tb-search input {
  width: 100%; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--line-2); font-size: 14px; outline: none;
  transition: background .15s, border-color .15s;
}
.tb-search input:focus { background: #fff; border-color: var(--brand); }
.search-drop {
  position: absolute; top: 46px; left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 380px; overflow: auto;
  z-index: 70;
}
.sd-group {
  font-size: 11px; font-weight: 700; color: var(--muted-2);
  padding: 8px 10px 4px; letter-spacing: .4px;
}
.sd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; font-size: 14px;
}
.sd-item:hover { background: var(--line-2); }
.sd-item span { display: flex; flex-direction: column; min-width: 0; }
.sd-item small { color: var(--muted-2); font-size: 11.5px; }
.sd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.sd-empty { padding: 16px; text-align: center; color: var(--muted-2); font-size: 13px; }

.tb-user { display: flex; align-items: center; gap: 8px; position: relative; }

.me-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line);
  transition: border-color .14s, background .14s;
}
.me-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.me-name { font-size: 13.5px; font-weight: 600; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-lv {
  font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 1px 6px; border-radius: 999px;
}

.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); font-size: 17px; cursor: pointer; line-height: 1;
  transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--line-2); color: var(--text); }

.me-menu {
  position: absolute; top: 46px; right: 0; width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 70;
}
.me-menu a, .me-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 11px;
  border: 0; background: transparent; border-radius: 9px;
  font-size: 14px; cursor: pointer; color: var(--text-2);
}
.me-menu a:hover, .me-menu button:hover { background: var(--line-2); color: var(--text); }
.me-menu .admin-link { color: var(--violet); font-weight: 600; }
.me-menu em { font-style: normal; color: var(--danger); font-weight: 700; }

.tb-burger {
  display: none; width: 38px; height: 38px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; font-size: 17px; cursor: pointer;
}

/* ============================================================
 * 按钮
 * ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 17px; border-radius: 10px;
  border: 1px solid transparent; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn.primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(30, 99, 255, .24);
}
.btn.primary:hover { background: var(--brand-d); color: #fff; }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--muted-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.block { width: 100%; }
.btn.tiny { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); }
.btn.tiny:hover { background: var(--brand); color: #fff; }
.btn.tiny[disabled] { background: var(--line-2); color: var(--muted-2); }
.link-btn {
  border: 0; background: transparent; color: var(--brand);
  font-size: 13px; cursor: pointer; padding: 0; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* ============================================================
 * 布局
 * ============================================================ */

#layout {
  max-width: var(--maxw); margin: 18px auto 60px; padding: 0 18px;
  display: grid; grid-template-columns: 190px minmax(0, 1fr) 296px;
  gap: 20px; align-items: start;
}

#left-nav { position: sticky; top: calc(var(--tb-h) + 18px); }
.side-nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 12px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; color: var(--text-2);
  transition: background .14s, color .14s;
}
.side-item:hover { background: #fff; color: var(--text); }
.side-item.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.si-icon { width: 20px; text-align: center; font-size: 15px; }
.new-post-btn { margin-top: 4px; height: 42px; }

#main { min-width: 0; }

#right-rail { position: sticky; top: calc(var(--tb-h) + 18px);
  display: flex; flex-direction: column; gap: 14px; }

/* ============================================================
 * 卡片 / 通用块
 * ============================================================ */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 14px;
}
.post { padding: 18px 20px 14px; position: relative; transition: border-color .15s; }
.post:hover { border-color: #d8dde8; }

.page-head {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px;
}
.page-head h2 { font-size: 19px; margin-bottom: 4px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }

.tabs {
  display: flex; gap: 4px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 5px; margin-bottom: 14px; overflow-x: auto;
}
.tab {
  padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--text-2); border: 0; background: transparent; cursor: pointer;
  white-space: nowrap;
}
.tab:hover { background: var(--line-2); }
.tab.active { background: var(--brand); color: #fff; }

/* ============================================================
 * 帖子卡
 * ============================================================ */

.p-head { display: flex; gap: 12px; align-items: flex-start; }
.av { border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: grid;
  place-items: center; color: #fff; font-weight: 700; }
.av-gen { user-select: none; }

.p-who { flex: 1 1 auto; min-width: 0; }
.p-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.p-meta { color: var(--muted-2); font-size: 12.5px; margin-top: 1px; }
.p-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.v-badge {
  font-style: normal; width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-grid; place-items: center; flex: 0 0 auto;
}
.v-badge.ent { background: var(--accent); }
.role-tag {
  font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 1px 6px; border-radius: 5px;
}
.kp {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; flex: 0 0 auto;
}
.kp-video { background: #eaf0ff; color: var(--brand); }
.kp-pain { background: var(--accent-soft); color: var(--accent); }
.kp-article { background: #f3eeff; color: var(--violet); }
.kp-repost { background: #e8f7f0; color: var(--ok); }

.pin-flag, .feat-flag {
  position: absolute; top: -1px; font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 0 0 8px 8px;
}
.pin-flag { left: 20px; background: var(--brand); color: #fff; }
.feat-flag { right: 20px; background: #fff4e5; color: var(--warn); border: 1px solid #ffe0b8; }

.p-title { font-size: 17px; margin: 12px 0 6px; }
.p-title a:hover { color: var(--brand); }
.p-body { color: var(--text-2); font-size: 15px; line-height: 1.75; word-break: break-word; }
.p-body br + br { display: block; content: ""; margin-top: 4px; }
.more-link { color: var(--brand); font-weight: 600; }
.inline-topic { color: var(--brand); font-weight: 600; }
.inline-user { color: var(--brand); }

.p-topics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.topic-tag {
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 3px 10px; border-radius: 999px;
}
.topic-tag:hover { background: var(--brand); color: #fff; }

/* 媒体 */

.img-grid { display: grid; gap: 6px; margin-top: 12px; border-radius: var(--r-sm);
  overflow: hidden; }
.img-grid.n1 { grid-template-columns: 1fr; max-width: 460px; }
.img-grid.n2 { grid-template-columns: 1fr 1fr; max-width: 460px; }
.img-grid.n3 { grid-template-columns: repeat(3, 1fr); max-width: 520px; }
.img-grid.n4 { grid-template-columns: 1fr 1fr; max-width: 460px; }
.img-cell { display: block; aspect-ratio: 1; overflow: hidden; background: var(--line-2); }
.img-grid.n1 .img-cell { aspect-ratio: 16/10; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.img-cell:hover img { transform: scale(1.04); }

.video-box {
  position: relative; margin-top: 12px; border-radius: var(--r-sm);
  overflow: hidden; background: #0d1117; max-width: 560px;
}
.video-box video { width: 100%; height: 100%; max-height: 620px;
  object-fit: contain; background: #000; display: block; }
.v-dur {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0, 0, 0, .68); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.demo-video {
  aspect-ratio: 16/9; background-size: cover; background-position: center;
  display: grid; place-items: center; cursor: pointer;
}
.demo-video .v-play {
  width: 60px; height: 60px; border-radius: 50%; background: rgba(0, 0, 0, .5);
  color: #fff; display: grid; place-items: center; font-size: 22px;
  padding-left: 4px; backdrop-filter: blur(3px);
}
.demo-video .v-note {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px;
  color: #fff; font-size: 12px; background: rgba(0, 0, 0, .5);
  padding: 3px 10px; border-radius: 6px; white-space: nowrap;
}

/* 痛点进度 */
.pain-bar {
  margin-top: 13px; padding: 12px 14px;
  background: linear-gradient(180deg, #fffaf6, #fff); border: 1px solid #ffe4d3;
  border-radius: var(--r-sm);
}
.pb-top { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; margin-bottom: 7px; }
.pb-label { font-weight: 700; color: var(--accent); }
.pb-num { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-track { height: 7px; border-radius: 999px; background: #ffe8dc; overflow: hidden; }
.pb-track > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ff9a5c, var(--accent));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.pb-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }

/* 转发内嵌 */
.repost-box {
  display: block; margin-top: 11px; padding: 12px 14px;
  background: var(--line-2); border-radius: var(--r-sm); border: 1px solid var(--line);
}
.repost-box:hover { background: #f7f9fc; }
.rb-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.rb-name { font-weight: 700; font-size: 13.5px; }
.rb-time { color: var(--muted-2); font-size: 12px; }
.rb-body { font-size: 14px; color: var(--text-2); }
.rb-img { margin-top: 8px; border-radius: 8px; max-height: 180px; object-fit: cover; }

/* 互动条 */
.p-acts {
  display: flex; align-items: center; gap: 6px; margin-top: 13px;
  padding-top: 11px; border-top: 1px solid var(--line-2);
}
.act {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px; border: 0; background: transparent;
  border-radius: 999px; color: var(--muted); font-size: 13px;
  cursor: pointer; transition: background .14s, color .14s;
}
.act:hover { background: var(--line-2); color: var(--text-2); }
.act-i { font-size: 14px; line-height: 1; }
.act-n { font-variant-numeric: tabular-nums; font-weight: 600; }
.act.on { color: var(--accent); font-weight: 700; }
.act.on .act-i { color: var(--accent); }
.act[data-act="bookmark"] { margin-left: auto; }
.act[data-act="bookmark"].on { color: var(--brand); }
.act.on[data-act="like"] .act-i { animation: heart .4s; }
@keyframes heart {
  0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); }
}
.act-i.pop { animation: heart .45s; }

.p-extra { margin-top: 12px; }
.quick-box { background: var(--line-2); border-radius: var(--r-sm); padding: 11px; }
.quick-input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font: inherit; font-size: 14px; resize: vertical;
  outline: none; background: #fff;
}
.quick-input:focus { border-color: var(--brand); }
.quick-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }

/* 评论 */
.cmt-wrap { border-top: 1px solid var(--line-2); padding-top: 12px; }
.cmt { display: flex; gap: 9px; padding: 9px 0; }
.cmt.sub { padding-left: 34px; padding-top: 6px; }
.cmt-main { flex: 1 1 auto; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.cmt-name { font-weight: 700; font-size: 13.5px; }
.cmt-time { color: var(--muted-2); font-size: 11.5px; }
.cmt-body { font-size: 14px; color: var(--text-2); word-break: break-word; }
.cmt-acts { display: flex; gap: 4px; margin-top: 4px; }
.cmt-acts button {
  border: 0; background: transparent; color: var(--muted-2);
  font-size: 12px; cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.cmt-acts button:hover { background: var(--line-2); color: var(--brand); }
.cmt-replies { margin-top: 4px; border-left: 2px solid var(--line-2); padding-left: 10px; }
.cmt-empty, .cmt-loading {
  color: var(--muted-2); font-size: 13px; padding: 14px 0; text-align: center;
}
.cmt-form { margin-top: 12px; display: flex; gap: 10px; align-items: flex-end; }
.cmt-input {
  flex: 1 1 auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font: inherit; font-size: 14px; resize: vertical; outline: none;
}
.cmt-input:focus { border-color: var(--brand); }
.cmt-form-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cmt-reply-hint { font-size: 11.5px; color: var(--brand); }

.mini-menu {
  position: absolute; right: 16px; top: 46px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 5px; min-width: 130px;
}
.mini-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 11px; border-radius: 8px; font-size: 13.5px; cursor: pointer;
  color: var(--text-2);
}
.mini-menu button:hover { background: var(--line-2); color: var(--text); }

/* ============================================================
 * 发帖框 / 表单
 * ============================================================ */

.composer { padding: 16px 20px; }
.composer-top { display: flex; gap: 12px; }
.composer textarea {
  flex: 1 1 auto; border: 0; outline: none; resize: none;
  font: inherit; font-size: 15.5px; line-height: 1.7; min-height: 54px;
  background: transparent;
}
.composer textarea::placeholder { color: var(--muted-2); }
.composer-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding-top: 11px; border-top: 1px solid var(--line-2);
}
.kind-pick { display: flex; gap: 4px; }
.kind-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 13px; font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer;
}
.kind-btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.composer-bar .spacer { flex: 1 1 auto; }
.counter { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 700; }

.field { margin-bottom: 13px; }
.field > label {
  display: block; font-size: 13px; font-weight: 700;
  margin-bottom: 6px; color: var(--text-2);
}
.field input[type=text], .field input[type=password], .field input[type=search],
.field input:not([type]), .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14.5px; outline: none;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.f-hint { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 5px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1 1 0; min-width: 0; }

/* ============================================================
 * 弹窗
 * ============================================================ */

.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .42);
  backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 20px;
  animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: var(--r-lg); padding: 26px 26px 22px;
  width: 100%; max-width: 420px; position: relative;
  box-shadow: var(--shadow-lg); animation: rise .2s;
  max-height: 90vh; overflow: auto;
}
.modal.small { max-width: 360px; }
.modal.wide { max-width: 620px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal h3 { font-size: 19px; margin-bottom: 6px; }
.modal > p.muted { margin-bottom: 16px; font-size: 13.5px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border: 0; background: var(--line-2); border-radius: 50%;
  font-size: 17px; color: var(--muted); cursor: pointer; line-height: 1;
}
.modal-x:hover { background: var(--line); color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

.seg {
  display: flex; gap: 4px; background: var(--line-2);
  padding: 4px; border-radius: 11px; margin-bottom: 15px;
}
.seg-item {
  flex: 1 1 0; border: 0; background: transparent; padding: 8px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
}
.seg-item.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

.auth-err {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid #fecaca; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 12px;
}
.auth-switch { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth-switch button {
  border: 0; background: transparent; color: var(--brand);
  font-weight: 700; cursor: pointer; font-size: 13.5px; padding: 0 3px;
}
.radio-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.radio {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font-size: 13px; user-select: none;
}
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.radio input { accent-color: var(--brand); }

/* ============================================================
 * 右栏卡片
 * ============================================================ */

.rail-card { padding: 15px 17px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rail-head h4 { font-size: 14.5px; }

.hot-list { list-style: none; margin: 0; padding: 0; }
.hot-list li { margin-bottom: 1px; }
.hot-list a {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: 9px; font-size: 14px; transition: background .14s;
}
.hot-list a:hover { background: var(--line-2); }
.hot-rank {
  font-style: normal; font-weight: 800; font-size: 12px; color: var(--muted-2);
  width: 17px; text-align: center; font-variant-numeric: tabular-nums;
}
.hot-rank.top { color: var(--accent); }
.hot-kw { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-heat { font-style: normal; font-size: 11.5px; color: var(--muted-2);
  font-variant-numeric: tabular-nums; }

.sug-list { display: flex; flex-direction: column; gap: 10px; }
.sug-item { display: flex; align-items: center; gap: 10px; }
.sug-info { flex: 1 1 auto; min-width: 0; }
.sug-name { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; }
.sug-info small { color: var(--muted-2); font-size: 11.5px; }

.about-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px; }

/* ============================================================
 * 演示横幅 / toast / 骨架
 * ============================================================ */

.demo-bar {
  position: fixed; top: var(--tb-h); left: 0; right: 0; z-index: 55;
  background: linear-gradient(90deg, #fff4e5, #fff9f0);
  border-bottom: 1px solid #ffe0b8; color: #92400e;
  padding: 8px 20px; font-size: 13px; display: flex; gap: 10px;
  align-items: center; justify-content: center; flex-wrap: wrap;
  text-align: center;
}
.demo-bar strong {
  background: var(--warn); color: #fff; padding: 1px 9px;
  border-radius: 999px; font-size: 11.5px; flex: 0 0 auto;
}
body:has(.demo-bar) { padding-top: calc(var(--tb-h) + 38px); }

#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: #1f2430; color: #fff; padding: 11px 20px; border-radius: 11px;
  font-size: 14px; z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.warn { background: #b45309; }
#toast.error { background: var(--danger); }

.skel { padding: 18px 20px; }
.skel-row { display: flex; gap: 12px; }
.skel-av { width: 44px; height: 44px; border-radius: 50%; background: var(--line-2); }
.skel-lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: 9px; }
.skel-line { height: 12px; border-radius: 6px; background: var(--line-2); }
.w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }
.skel-av, .skel-line { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.skel.rail { padding: 16px; }

.empty {
  text-align: center; padding: 54px 20px; color: var(--muted);
}
.empty .e-icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-2); }
.empty p { font-size: 13.5px; margin-bottom: 16px; }

/* ============================================================
 * 个人主页
 * ============================================================ */

.profile-cover {
  height: 150px; border-radius: var(--r) var(--r) 0 0;
  background: linear-gradient(120deg, #1e63ff, #6b4dff 55%, #ff6b35);
}
.profile-body { padding: 0 20px 18px; margin-top: -38px; }
.profile-top { display: flex; align-items: flex-end; gap: 14px; }
.profile-av { border: 4px solid #fff; border-radius: 50%; overflow: hidden; }
.profile-name { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; }
.profile-handle { color: var(--muted-2); font-size: 13.5px; }
.profile-bio { margin-top: 12px; font-size: 14.5px; color: var(--text-2); max-width: 620px; }
.profile-stats { display: flex; gap: 22px; margin-top: 15px; flex-wrap: wrap; }
.stat-b { display: flex; flex-direction: column; }
.stat-b b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-b span { font-size: 12px; color: var(--muted-2); }
.profile-acts { display: flex; gap: 9px; margin-top: 15px; flex-wrap: wrap; }

.level-band {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding: 12px 15px; background: var(--line-2); border-radius: var(--r-sm);
  max-width: 520px;
}
.lv-num {
  font-weight: 800; font-size: 15px; color: var(--brand);
  background: #fff; padding: 5px 12px; border-radius: 999px;
  box-shadow: var(--shadow); flex: 0 0 auto;
}
.lv-bar { flex: 1 1 auto; }
.lv-track { height: 6px; background: #dfe4ee; border-radius: 999px; overflow: hidden; margin-top: 5px; }
.lv-track > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.lv-hint { font-size: 11.5px; color: var(--muted); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px; }
.badge {
  text-align: center; padding: 13px 8px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: #fff;
}
.badge.locked { opacity: .42; filter: grayscale(1); }
.badge-icon { font-size: 23px; margin-bottom: 5px; }
.badge-name { font-size: 12.5px; font-weight: 700; }
.badge-desc { font-size: 11px; color: var(--muted-2); line-height: 1.45; }

/* ============================================================
 * 通知
 * ============================================================ */

.notif { display: flex; gap: 12px; padding: 15px 20px;
  border-bottom: 1px solid var(--line-2); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #f7faff; }
.notif-body { flex: 1 1 auto; min-width: 0; }
.notif-title { font-size: 14.5px; }
.notif-title b { font-weight: 700; }
.notif-text { color: var(--muted); font-size: 13.5px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--muted-2); font-size: 12px; margin-top: 5px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  flex: 0 0 auto; margin-top: 8px; }

/* ============================================================
 * 上传
 * ============================================================ */

.drop-zone {
  border: 2px dashed var(--line); border-radius: var(--r);
  padding: 32px 20px; text-align: center; background: #fff;
  transition: border-color .15s, background .15s; cursor: pointer;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone .dz-icon { font-size: 30px; margin-bottom: 8px; opacity: .6; }
.drop-zone h4 { font-size: 15px; margin-bottom: 5px; }
.drop-zone p { font-size: 12.5px; color: var(--muted); }

.upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.up-item {
  display: flex; gap: 12px; align-items: center; padding: 11px 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
}
.up-thumb {
  width: 62px; height: 62px; border-radius: 9px; object-fit: cover;
  background: var(--line-2); flex: 0 0 auto; display: grid; place-items: center;
  font-size: 22px; color: var(--muted-2); overflow: hidden;
}
.up-meta { flex: 1 1 auto; min-width: 0; }
.up-name { font-size: 13.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.up-info { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.up-track { height: 5px; background: var(--line-2); border-radius: 999px;
  margin-top: 7px; overflow: hidden; }
.up-track > i { display: block; height: 100%; width: 0; background: var(--brand);
  border-radius: 999px; transition: width .2s; }
.up-item.done .up-track > i { background: var(--ok); }
.up-item.fail { border-color: #fecaca; background: var(--danger-soft); }
.up-remove { border: 0; background: transparent; color: var(--muted-2);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.up-remove:hover { background: var(--line-2); color: var(--danger); }

.video-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============================================================
 * 后台
 * ============================================================ */

.admin-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 17px; }
.stat-card em { font-style: normal; font-size: 12.5px; color: var(--muted); display: block; }
.stat-card b { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums;
  display: block; margin-top: 4px; letter-spacing: -.5px; }
.stat-card small { font-size: 11.5px; color: var(--muted-2); }
.stat-card.alert b { color: var(--danger); }
.stat-card.good b { color: var(--ok); }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin-top: 10px; }
.spark i { flex: 1 1 0; background: var(--brand); border-radius: 3px 3px 0 0;
  min-height: 2px; opacity: .75; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fbfcfe;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfe; }
.td-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.td-actions button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-2);
  white-space: nowrap;
}
.td-actions button:hover { border-color: var(--brand); color: var(--brand); }
.td-actions button.danger:hover { border-color: var(--danger); color: var(--danger); }
.td-actions button.ok:hover { border-color: var(--ok); color: var(--ok); }

.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  white-space: nowrap; }
.tag.open { background: #fff4e5; color: var(--warn); }
.tag.done { background: #e8f7f0; color: var(--ok); }
.tag.hidden { background: var(--line); color: var(--muted); }
.tag.deleted { background: var(--danger-soft); color: var(--danger); }
.tag.visible { background: #e8f7f0; color: var(--ok); }
.tag.frozen { background: var(--danger-soft); color: var(--danger); }
.tag.active { background: #e8f7f0; color: var(--ok); }

.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: block; }

.drift-ok { color: var(--ok); font-weight: 700; }
.drift-bad { color: var(--danger); font-weight: 700; }

/* ============================================================
 * 发现页
 * ============================================================ */

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; }
.topic-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 17px; transition: border-color .15s, transform .15s; }
.topic-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.topic-card h4 { font-size: 16px; margin-bottom: 5px; }
.topic-card .tc-intro { font-size: 13px; color: var(--muted); min-height: 38px;
  margin-bottom: 10px; }
.topic-card .tc-foot { display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted-2); }

/* ============================================================
 * 响应式
 * ============================================================ */

@media (max-width: 1080px) {
  #layout { grid-template-columns: 190px minmax(0, 1fr); }
  #right-rail { display: none; }
}

@media (max-width: 820px) {
  .tb-nav { display: none; }
  .tb-burger { display: grid; place-items: center; }
  .nav-item.nav-post { display: flex; }
  .brand-text small { display: none; }
  .tb-search { max-width: none; }

  #layout { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
  #left-nav {
    position: fixed; top: var(--tb-h); left: 0; bottom: 0; width: 232px;
    background: #fff; z-index: 58; padding: 14px;
    transform: translateX(-100%); transition: transform .22s;
    box-shadow: var(--shadow-lg); overflow: auto;
  }
  body.nav-open #left-nav { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: var(--tb-h) 0 0; background: rgba(16,24,40,.34); z-index: 57;
  }
  .post { padding: 15px 14px 12px; }
  .p-title { font-size: 16px; }
  .p-body { font-size: 14.5px; }
  .video-box { max-width: 100%; }
  .img-grid.n1, .img-grid.n2, .img-grid.n3, .img-grid.n4 { max-width: 100%; }
  .modal { padding: 22px 18px 18px; }
  .profile-name { font-size: 18px; }
  .profile-cover { height: 110px; }
  .hot-heat { display: none; }
}

@media print {
  #topbar, #left-nav, #right-rail, .demo-bar { display: none; }
}
