/* ===== 话题 huati — 样式表（浅色主题） ===== */

:root {
  --bg: #f3f4f8;
  --bg-soft: #e9ebf2;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --text: #14161c;
  --text-2: #454b57;
  --muted: #7b8393;
  --border: #e5e7ef;
  --border-2: #eef0f6;
  --primary: #5b62f4;
  --primary-2: #8b5cf6;
  --primary-soft: #eef0ff;
  --accent: #ff6b3d;
  --hot: #ff4d4f;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(20, 22, 28, .05), 0 2px 8px rgba(20, 22, 28, .04);
  --shadow-2: 0 4px 16px rgba(20, 22, 28, .07), 0 12px 32px rgba(20, 22, 28, .06);
  --shadow-3: 0 16px 48px rgba(20, 22, 28, .16);
  --grad: linear-gradient(135deg, #5b62f4 0%, #8b5cf6 100%);
}

* { box-sizing: border-box; }

/*
 * 兜底：本文件里给 .modal 等元素写了 display，会盖掉浏览器默认的
 * [hidden] { display: none }，导致 hidden 属性失效（弹窗关不掉、遮罩挡住整页）。
 * 这一行保证「写了 hidden 就是真的看不见」。
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background: radial-gradient(900px 300px at 14% -60%, rgba(91, 98, 244, .16), transparent 62%),
              radial-gradient(700px 280px at 76% -70%, rgba(255, 107, 61, .13), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.ic {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad);
  color: #fff; font-weight: 700; font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(91, 98, 244, .32);
}
.logo-text { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.logo-text em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: .5px; }

.search {
  flex: 1; max-width: 520px; position: relative;
  display: flex; align-items: center;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  transition: .18s;
}
.search:focus-within { background: #fff; border-color: #c9cdfb; box-shadow: 0 0 0 4px rgba(91, 98, 244, .1); }
.search .ic { color: var(--muted); }
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 10px 10px; font-size: 14px; color: var(--text);
}
.search input::placeholder { color: #9aa1b1; }
.search-clear {
  border: 0; background: transparent; font-size: 18px; line-height: 1;
  color: var(--muted); padding: 2px 4px; border-radius: 6px;
}
.search-clear:hover { background: var(--border-2); color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 600;
  transition: .16s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 14px rgba(91, 98, 244, .3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(91, 98, 244, .42); filter: brightness(1.04); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #d5d8e4; color: var(--text); }
.btn-wide { width: 100%; justify-content: center; padding: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent;
  border-radius: 999px; padding: 4px 12px 4px 4px;
  transition: .16s;
}
.user-chip:hover { background: var(--bg-soft); }
.user-name { font-size: 14px; font-weight: 600; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
  background: var(--grad); flex: none;
  user-select: none;
}

/* ---------- 布局 ---------- */
.layout {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 22px auto 0;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 292px;
  gap: 20px;
  align-items: start;
}
.sidebar, .hot-panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 74px; }
.main { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px;
}
.card-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: .2px; margin-bottom: 10px;
}
.card-sub { font-size: 11px; font-weight: 500; color: var(--muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; transition: .14s;
}
.tag-chip:hover { border-color: #c9cdfb; color: var(--primary); background: var(--primary-soft); }
.tag-chip i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 4px; }

.stat-card { display: flex; flex-direction: column; gap: 8px; }
.stat-row { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.stat-row b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 列表区 ---------- */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-1); }
.tab {
  border: 0; background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: .16s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 98, 244, .3); }
.list-hint { font-size: 12.5px; color: var(--muted); }

.topic-list { display: flex; flex-direction: column; gap: 12px; }

.topic-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 16px 18px; transition: .18s; cursor: pointer;
  animation: rise .34s cubic-bezier(.22, .8, .3, 1) both;
}
.topic-card:hover { border-color: #d8dbf0; box-shadow: var(--shadow-2); transform: translateY(-2px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.tc-cat {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
}
.tc-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.tc-title {
  font-size: 17.5px; font-weight: 700; line-height: 1.45; letter-spacing: -.2px;
  margin: 0 0 7px; color: var(--text);
}
.topic-card:hover .tc-title { color: var(--primary); }
.tc-excerpt {
  font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0 0 11px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap;
}
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tc-tag { font-size: 12px; color: #6b6fd8; background: #f2f3ff; border-radius: 999px; padding: 2px 9px; }

.tc-foot { display: flex; align-items: center; gap: 8px; padding-top: 11px; border-top: 1px solid var(--border-2); }
.tc-author { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.tc-author .avatar { width: 24px; height: 24px; font-size: 11px; }
.tc-metrics { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.metric {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; background: transparent;
  border-radius: 999px; padding: 5px 10px;
  font-size: 13px; color: var(--muted); font-weight: 600;
  transition: .14s; font-variant-numeric: tabular-nums;
}
.metric:hover { background: var(--bg-soft); color: var(--text-2); }
.metric.is-liked { color: var(--hot); background: #fff1f1; }
.metric.is-liked .ic { fill: var(--hot); stroke: var(--hot); }
.metric.just-liked { animation: pop .42s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* ---------- 热榜 ---------- */
.hot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hot-item {
  display: flex; gap: 10px; padding: 9px 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: .14s; align-items: flex-start;
}
.hot-item:hover { background: var(--bg-soft); }
.hot-rank {
  width: 20px; flex: none; text-align: center;
  font-size: 13px; font-weight: 800; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.hot-item:nth-child(1) .hot-rank { color: #f5222d; }
.hot-item:nth-child(2) .hot-rank { color: #fa8c16; }
.hot-item:nth-child(3) .hot-rank { color: #faad14; }
.hot-title { font-size: 13.5px; line-height: 1.5; color: var(--text-2); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hot-item:hover .hot-title { color: var(--primary); }
.hot-heat { font-size: 11px; color: var(--muted); margin-top: 3px; }

.guide ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.guide li { margin-bottom: 4px; }
.guide li::marker { color: var(--primary); }

/* ---------- 空 / 骨架 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { width: 88px; height: 88px; margin-bottom: 14px; opacity: .85; }
.empty h4 { margin: 0 0 6px; font-size: 16px; color: var(--text); font-weight: 700; }
.empty p { margin: 0 0 16px; font-size: 13.5px; }

.sk { background: linear-gradient(90deg, #eef0f6 25%, #f7f8fc 37%, #eef0f6 63%); background-size: 400% 100%; animation: shim 1.3s ease infinite; border-radius: 8px; }
@keyframes shim { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-1); }
.sk-line { height: 14px; margin-bottom: 10px; }
.list-more { margin-top: 14px; }

/* ---------- 离线模式提示条 ---------- */
.offline-bar {
  position: relative; z-index: 59;
  background: linear-gradient(90deg, #fff8e6 0%, #fff4ef 100%);
  border-bottom: 1px solid #ffe2b8;
  color: #8a5300;
}
.offline-bar__inner {
  max-width: 1240px; margin: 0 auto;
  padding: 9px 20px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.6;
}
.offline-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #fa8c16; box-shadow: 0 0 0 4px rgba(250, 140, 22, .16);
  animation: beacon 1.9s ease-in-out infinite;
}
@keyframes beacon { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.offline-text { flex: 1; min-width: 240px; }
.offline-text b { color: #ad4e00; margin-right: 7px; }
.offline-actions { display: flex; gap: 8px; flex: none; }
.offline-actions .btn { padding: 5px 12px; font-size: 12.5px; }

/* ---------- 云端模式提示条 ---------- */
.cloud-bar {
  position: relative; z-index: 59;
  background: linear-gradient(90deg, #eefaf4 0%, #eef6fd 100%);
  border-bottom: 1px solid #c9ead9;
  color: #1d6b4a;
}
.cloud-bar__inner {
  max-width: 1240px; margin: 0 auto;
  padding: 9px 20px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.6;
}
.cloud-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #12b76a; box-shadow: 0 0 0 4px rgba(18, 183, 106, .16);
  animation: beacon 1.9s ease-in-out infinite;
}
.cloud-text { flex: 1; min-width: 240px; }
.cloud-text b { color: #0f7a4c; margin-right: 7px; }
.cloud-actions { display: flex; gap: 8px; flex: none; }
.cloud-actions .btn { padding: 5px 12px; font-size: 12.5px; }

/* ---------- 详情 ---------- */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 14px; transition: .14s;
}
.detail-back:hover { border-color: #d5d8e4; color: var(--text); background: var(--surface-2); }

.detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 24px 26px; animation: rise .3s both;
}
.detail-cat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-title { font-size: 25px; line-height: 1.38; font-weight: 800; letter-spacing: -.5px; margin: 0 0 14px; }
.detail-author { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border-2); margin-bottom: 18px; }
.detail-author .avatar { width: 38px; height: 38px; font-size: 15px; }
.detail-author-name { font-size: 14px; font-weight: 700; }
.detail-author-meta { font-size: 12px; color: var(--muted); }
.detail-body { font-size: 15.5px; line-height: 1.95; color: #24272e; white-space: pre-wrap; word-break: break-word; margin-bottom: 18px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.detail-foot { display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border-2); flex-wrap: wrap; }
.detail-foot .metric { border-color: var(--border); padding: 8px 16px; font-size: 14px; }
.detail-nav { margin-left: auto; display: flex; gap: 8px; }

/* ---------- 评论 ---------- */
.comment-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px; margin-top: 16px;
}
.comment-box h4 { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.comment-box h4 span { font-size: 12px; font-weight: 600; color: var(--muted); }

.cmt-editor { display: flex; gap: 10px; margin-bottom: 6px; }
.cmt-editor .avatar { width: 34px; height: 34px; font-size: 13px; margin-top: 2px; }
.cmt-editor-main { flex: 1; }
.cmt-editor textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14px; line-height: 1.7; resize: vertical;
  outline: 0; transition: .16s; background: var(--surface-2); min-height: 62px;
}
.cmt-editor textarea:focus { border-color: #c9cdfb; background: #fff; box-shadow: 0 0 0 4px rgba(91, 98, 244, .09); }
.cmt-editor-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cmt-editor-bar .counter { font-size: 12px; color: var(--muted); }

.cmt-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cmt-item { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--border-2); }
.cmt-item:first-child { border-top: 0; }
.cmt-item .avatar { width: 34px; height: 34px; font-size: 13px; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cmt-name { font-size: 13.5px; font-weight: 700; }
.cmt-badge { font-size: 10.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 1px 6px; }
.cmt-badge.op { color: #b45309; background: #fef3c7; }
.cmt-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.cmt-text { font-size: 14.5px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.cmt-actions { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.cmt-actions .metric { padding: 3px 9px; font-size: 12.5px; }
.cmt-replies { margin-top: 10px; padding: 4px 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border-2); }
.cmt-replies .cmt-item { padding: 10px 0; }
.cmt-reply-target { color: var(--primary); font-weight: 600; }
.cmt-reply-hint { font-size: 12px; color: var(--primary); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cmt-reply-hint button { border: 0; background: transparent; color: var(--muted); font-size: 12px; }

/* ---------- 我的 ---------- */
.mine-head { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.mine-head .avatar { width: 62px; height: 62px; font-size: 25px; }
.mine-name { font-size: 21px; font-weight: 800; margin: 0 0 3px; }
.mine-meta { font-size: 13px; color: var(--muted); }
.seg { display: flex; gap: 6px; margin-bottom: 14px; }
.seg button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 22, 28, .42); backdrop-filter: blur(3px); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-3);
  animation: zoom .24s cubic-bezier(.22, .9, .3, 1.1) both;
}
.modal-sm { max-width: 400px; }
@keyframes zoom { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); border-radius: 20px 20px 0 0; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 5px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.modal-body { padding: 18px 22px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border-2); position: sticky; bottom: 0; background: var(--surface); }

.field { display: block; position: relative; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.field input[type="text"], .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14.5px; outline: 0; background: var(--surface-2);
  transition: .16s; line-height: 1.7;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: #c9cdfb; background: #fff; box-shadow: 0 0 0 4px rgba(91, 98, 244, .09); }
.field .counter { position: absolute; right: 12px; bottom: 9px; font-size: 11.5px; color: var(--muted); }
.field .counter b { font-weight: 700; }
.tip { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.7; }
.form-error { margin: 0 0 14px; font-size: 13px; color: #d4380d; background: #fff2e8; border: 1px solid #ffd8bf; border-radius: var(--radius-sm); padding: 9px 12px; }

/* ---------- 分类（首页胶囊栏 / 发布弹窗共用同一套） ----------
   两个地方的分类按钮长得完全一样，因为它们本来就是同一个组件：
   .cat-bar 里是 .cat-pill，弹窗里是 .cat-pick，样式共享下面这段。 */
.cat-bar {
  display: flex; flex-wrap: wrap; gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.cat-picker { display: flex; flex-wrap: wrap; gap: 7px; }

.cat-pill, .cat-pick {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  transition: .14s; white-space: nowrap;
}
.cat-pill:hover, .cat-pick:hover {
  border-color: #c9cdfb; color: var(--primary); background: var(--primary-soft);
}
.cat-pill.is-active, .cat-pick.is-active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(91, 98, 244, .28);
}
.cat-pill.is-active:hover, .cat-pick.is-active:hover { color: #fff; background: var(--grad); }
.cat-pill i { font-style: normal; font-size: 11.5px; opacity: .72; font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast-box { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1e2128; color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
  animation: toastIn .26s cubic-bezier(.2, 1.2, .4, 1) both;
  display: flex; align-items: center; gap: 8px; max-width: 88vw;
}
.toast.out { animation: toastOut .24s ease both; }
.toast.err { background: #c62828; }
.toast.ok { background: #10795c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.footer { text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 20px 34px; position: relative; z-index: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .hot-panel { display: none; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .top-actions { gap: 6px; }
  .btn span, .user-name { display: none; }
  .btn { padding: 9px 12px; }
  .user-chip { padding: 4px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 14px 30px; margin-top: 16px; gap: 14px; }
  .sidebar { position: static; }
  .sidebar .stat-card { display: none; }
  /* 手机上分类栏变成横向滑动的单行，不再换行堆高 */
  .cat-bar {
    flex-wrap: nowrap; overflow-x: auto; gap: 6px;
    padding: 9px 10px; margin-bottom: 12px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .cat-bar::-webkit-scrollbar { display: none; }
  .cat-pill { flex: none; padding: 6px 12px; }
  .offline-bar__inner { padding: 9px 14px; }
  .offline-actions { width: 100%; }
  .detail-card { padding: 18px 16px; }
  .detail-title { font-size: 21px; }
  .comment-box { padding: 14px; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-panel { max-width: none; border-radius: 20px 20px 0 0; max-height: 94vh; }
  .modal-head { border-radius: 20px 20px 0 0; }
  .tabs .tab { padding: 7px 10px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== 通知中心 ===== */
.bell-wrap { position: relative; }
.btn-icon { padding: 9px; }
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--hot); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  border: 2px solid #fff; box-sizing: content-box;
}
.notify-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 344px; max-height: 68vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-3); z-index: 120;
  animation: zoom .18s cubic-bezier(.22, .9, .3, 1.05) both;
}
.notify-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border-2);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  font-size: 13px; font-weight: 700;
}
.link-btn {
  border: 0; background: transparent; color: var(--primary);
  font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 6px;
}
.link-btn:hover { background: var(--primary-soft); }
.notify-list { padding: 6px; }
.notify-item {
  display: flex; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 10px;
  border-radius: 10px; transition: .14s;
}
.notify-item:hover { background: var(--bg-soft); }
.notify-item.is-unread { background: #f4f5ff; }
.notify-item.is-unread .notify-line { font-weight: 600; }
.notify-icon { font-size: 16px; line-height: 1.45; flex: none; }
.notify-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notify-line { font-size: 13.5px; color: var(--text-2); }
.notify-line b { color: var(--text); }
.notify-excerpt {
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notify-time { font-size: 11.5px; color: #9aa1b1; }
.notify-loading { padding: 26px; text-align: center; font-size: 13px; color: var(--muted); }
.notify-empty {
  padding: 26px 18px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.notify-empty svg { width: 64px; height: 64px; margin-bottom: 2px; }
.notify-empty p { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.notify-empty span { font-size: 12.5px; line-height: 1.65; }
.notify-empty-tip {
  margin-top: 8px; padding: 7px 11px; background: var(--surface-2);
  border: 1px dashed var(--border); border-radius: 9px; text-align: left;
}

/* ===== @ 提及 ===== */
.mention {  color: var(--primary); font-weight: 600;
  background: var(--primary-soft); border-radius: 5px; padding: 0 3px;
}

/* ===== 图片 ===== */
.image-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb {
  position: relative; width: 80px; height: 80px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border); background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  border-radius: 50%; border: 0; background: rgba(20, 22, 28, .62);
  color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.thumb-del:hover { background: var(--hot); }
.thumb-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 80px; height: 80px; border: 1px dashed #c9cdfb; border-radius: 10px;
  background: var(--surface-2); color: var(--primary); font-size: 11.5px; font-weight: 600;
}
.thumb-add em { font-style: normal; color: var(--muted); font-size: 10px; }
.thumb-add .ic { width: 17px; height: 17px; }
.thumb-add:hover { background: var(--primary-soft); border-color: var(--primary); }

.img-grid { display: grid; gap: 6px; margin: 0 0 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.img-grid.one { grid-template-columns: minmax(0, 320px); }
.img-grid.two { grid-template-columns: repeat(2, minmax(0, 240px)); }
.img-cell {
  padding: 0; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; display: block;
}
.img-cell:hover { border-color: #c9cdfb; box-shadow: 0 4px 14px rgba(91, 98, 244, .14); }
.img-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.tc-thumbs { display: flex; gap: 6px; margin: 0 0 11px; }
.tc-thumb {
  width: 78px; height: 60px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border); display: block; flex: none;
}

.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(12, 14, 18, .88);
  display: grid; place-items: center; padding: 24px;
  cursor: zoom-out; animation: fade .18s both;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* ===== 作者操作 ===== */
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { background: var(--hot); color: #fff; box-shadow: 0 4px 14px rgba(255, 77, 79, .3); }
.btn-danger:hover { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(255, 77, 79, .4); }
.btn-ghost.danger { color: var(--hot); border-color: #ffd4d4; }
.btn-ghost.danger:hover { background: #fff1f1; border-color: #ffb3b3; }
.detail-owner-actions { margin-left: auto; display: flex; gap: 8px; }
.metric.danger:hover { color: var(--hot); background: #fff1f1; }
.tc-edited {
  font-size: 11px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}
.cmt-edit { margin: 7px 0 0; }
.cmt-edit textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; line-height: 1.7; resize: vertical;
  min-height: 66px; outline: 0; background: var(--surface-2); color: var(--text);
}
.cmt-edit textarea:focus { border-color: #c9cdfb; background: #fff; box-shadow: 0 0 0 4px rgba(91, 98, 244, .09); }
.cmt-editor-left { display: flex; align-items: center; gap: 10px; }
#cmtImageWrap { margin-top: 8px; }
#cmtImageWrap .thumb { width: 84px; height: 84px; }
.detail-author { flex-wrap: wrap; }

@media (max-width: 760px) {
  .notify-panel { position: fixed; top: 62px; left: 12px; right: 12px; width: auto; max-height: 72vh; }
  .img-grid.one { grid-template-columns: minmax(0, 1fr); }
  .detail-owner-actions { margin-left: 0; width: 100%; }
  .img-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ================================================================
   ===== 账号体系：登录入口 / 登录注册弹窗 / 账号设置 =====
   ================================================================ */

/* ---------- 顶栏：登录入口与账号菜单 ---------- */
.user-chip--guest {
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
}
.user-chip--guest:hover {
  border-style: solid;
  border-color: #c9cdfb;
  color: var(--primary);
  background: var(--primary-soft);
}
.avatar--ghost {
  background: var(--bg-soft) !important;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.avatar--ghost .ic { width: 15px; height: 15px; }
.avatar-lg { width: 42px !important; height: 42px !important; font-size: 17px !important; }

.ic-caret { width: 14px !important; height: 14px !important; color: var(--muted); }

.user-wrap { position: relative; }
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 232px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  padding: 6px;
  z-index: 150;
  animation: zoom .16s ease both;
}
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 6px;
}
.user-menu-id { display: flex; flex-direction: column; min-width: 0; }
.user-menu-id b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-id em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.user-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13.5px; color: var(--text-2); text-align: left;
  transition: .14s;
}
.user-menu-item .ic { width: 16px; height: 16px; color: var(--muted); }
.user-menu-item:hover { background: var(--bg-soft); color: var(--text); }
.user-menu-item:hover .ic { color: var(--text-2); }
.user-menu-item.danger { color: var(--hot); }
.user-menu-item.danger .ic { color: var(--hot); }
.user-menu-item.danger:hover { background: #fff1f1; }

/* ---------- 登录注册弹窗 ---------- */
.modal-auth { max-width: 428px; }
.modal-body--auth { padding: 4px 22px 6px; min-height: 262px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 22px 0;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 6px 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: .16s;
}
.auth-tab:hover { color: var(--text-2); }
.auth-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
/* 注销页签用同一个胶囊样式，只把强调色换成危险色。
   位置与外观跟其它页签一致，用户才好找 —— 应用市场也要求注销「容易发现」。 */
.auth-tab--danger.is-active { color: var(--hot); border-bottom-color: var(--hot); }

/* 注销说明块：把「会删掉什么」逐条摆出来，
   比笼统写一句「不可恢复，请谨慎操作」有用得多。 */
.danger-box {
  border: 1px solid #ffd4d4;
  background: #fff6f6;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.danger-box h5 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--hot); }
.danger-box p { margin: 0 0 8px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.danger-box ul { margin: 0 0 8px; padding-left: 18px; }
.danger-box li { font-size: 13px; line-height: 1.8; color: var(--text-2); }
.danger-box b { color: var(--hot); }
.danger-box .tip { margin: 0; }

.auth-pane { animation: fade .18s ease both; }

.auth-seg { margin-bottom: 16px; }
.seg--sm button { padding: 6px 14px; font-size: 12.5px; }
.auth-seg button { flex: 1; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; white-space: nowrap; padding: 0 14px; font-size: 13px; }
.code-row .btn[disabled] { opacity: .55; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: -4px;
}
.auth-links .link-btn { font-size: 12.5px; }

.auth-note {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.65;
  word-break: break-word;
}
.auth-note b { font-weight: 700; }
.auth-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #92400e;
  user-select: all;
}
.auth-note--info { background: var(--primary-soft); border-color: #dfe2ff; color: #3a3f9e; }
.auth-note--info code { border-color: #dfe2ff; color: #3a3f9e; }

.modal-foot--split {
  justify-content: space-between;
  align-items: center;
}
.foot-actions { display: flex; gap: 10px; }

/* ---------- 第三方登录 ---------- */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.provider-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: .15s;
}
.provider-btn:hover {
  border-color: #d5d8e4;
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.provider-btn .provider-ic {
  width: 22px; height: 22px;
  flex: none;
  display: grid; place-items: center;
}
.provider-btn .provider-ic svg { width: 22px; height: 22px; display: block; }
.provider-btn.is-disabled {
  opacity: .5;
  cursor: not-allowed;
  background: var(--surface-2);
}
.provider-btn.is-disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.provider-btn em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; }
.provider-btn--wide { grid-column: 1 / -1; }

/* ---------- 账号设置 ---------- */
.acct-list { display: flex; flex-direction: column; }
.acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13.5px;
}
.acct-row:last-child { border-bottom: 0; }
.acct-row .acct-k { color: var(--muted); flex: none; width: 76px; }
.acct-row .acct-v { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acct-row .acct-v.muted { color: var(--muted); font-weight: 500; }
.acct-row .acct-act { margin-left: auto; }

.acct-bind { margin-top: 12px; }
.acct-bind h5 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.acct-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  background: var(--surface-2);
}
.acct-chip .provider-ic { flex: none; display: grid; place-items: center; }
.acct-chip .provider-ic svg { width: 18px; height: 18px; display: block; }
.acct-chip .acct-chip-name { font-weight: 600; color: var(--text); }
.acct-chip .acct-chip-sub { font-size: 11.5px; color: var(--muted); }
.acct-chip .acct-act { margin-left: auto; }

.mine-guest {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #f5f6ff, #fdf6ff);
  border: 1px solid #e2e4ff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.mine-guest b { font-size: 14.5px; font-weight: 700; }
.mine-guest p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.mine-guest .btn { margin-left: auto; }
.mine-head-act { margin-left: auto; }

@media (max-width: 760px) {
  .user-chip--guest .user-name { display: inline; font-size: 12.5px; }
  .user-chip--guest { padding: 6px 10px; }
  .user-menu { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .provider-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-body--auth { min-height: 0; }
  .auth-links { flex-direction: column; gap: 6px; align-items: flex-start; }
}

