/* ==========================================================================
   LANGYU · 知乎式信息流 UI
   布局：顶栏 + 左侧竖向导航 + 中间信息流 + 右侧热榜
   配色：白底 / 灰分割线 / 克莱因蓝强调（品牌色集中在 :root 的 --brand 三兄弟）
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--brand); color: #fff; }

/* ---------- Tokens ---------- */
:root {
  --white:   #ffffff;
  --grey-50: #fafafa;
  --grey-100:#f6f6f6;
  --grey-200:#f0f0f0;
  --grey-300:#ebebeb;
  --grey-400:#d3d3d3;
  --grey-500:#bfbfbf;
  --grey-600:#6e7683;   /* 次要文字：白底对比度 4.6:1，满足 WCAG AA */
  --grey-700:#5f6976;   /* 辅助文字：白底对比度 5.6:1 */
  --grey-800:#444;
  --grey-900:#121212;
  --ink:     #121212;

  /* 品牌色：界面蓝。与 Logo 同族（明度对齐 41%~42%），饱和度略降，大面积铺设不刺眼。
     换色只需改这三行 */
  --brand:      #0b45c4;
  --brand-dark: #0938a6;
  --brand-soft: #e9effc;
  /* 签名暖色：占画面 ≤3%，只做「状态标记」，永不承载可点击语义 */
  --accent:      #e08a00;
  --accent-dark: #b46a00;
  --accent-soft: #fdf3e3;
  /* 语义色：成功 / 通过，固定用绿色，不随品牌色变化 */
  --ok:         #07c160;
  --ok-dark:    #06a852;
  --ok-soft:    #e9f9f0;
  --link:       #0938a6;
  --blue:       #056de8;

  --fg:        var(--grey-900);
  --fg-2:      var(--grey-800);
  --fg-muted:  var(--grey-700);
  --fg-subtle: var(--grey-600);
  --bg:        #f6f7f9;
  --card:      #ffffff;
  --line:      #ebebeb;
  --line-soft: #f2f2f2;

  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
          "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 4px; --r: 8px; --r-lg: 12px; --r-pill: 999px;
  --field-h: 44px;   /* 单行输入框 / 大按钮 的统一高度，保证并排时齐平 */

  --header-h: 52px;
  --side-w: 190px;
  --aside-w: 296px;
  --main-w: 694px;
  --page-w: 1170px;

  --shadow-card: 0 1px 3px rgba(18,18,18,.04);
  --ease: cubic-bezier(.32,.72,0,1);
  --t: .2s var(--ease);
}

[data-theme="dark"] {
  --fg:        #eaeaea;
  --fg-2:      #d0d0d0;
  --fg-muted:  #9aa1ac;
  --fg-subtle: #868d98;
  --bg:        #191a1c;
  --card:      #232427;
  --line:      #333438;
  --line-soft: #2b2c30;
  --grey-100:#2b2c30;
  --grey-200:#333438;
  /* 暗色下品牌蓝需提亮，否则在深底上几乎看不见 */
  --brand:     #4c82f0;
  --brand-dark:#3e6edb;
  --brand-soft:#16203a;
  --accent:      #f0a93c;
  --accent-dark: #ffc06a;
  --accent-soft: #2b2113;
  --ok-soft:   #0d2a1c;
  --link:      #7eb3f5;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.67;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.no-scroll { overflow: hidden; }

a { transition: color var(--t); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--brand); color: #fff; padding: 8px 16px; }
.skip-link:focus { left: 0; }

/* 通用工具 */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0 }
.flex{display:flex}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}
.items-center{align-items:center}.items-baseline{align-items:baseline}
.justify-between{justify-content:space-between}.justify-center{justify-content:center}
.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}
.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mt-6{margin-top:24px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.mb-6{margin-bottom:24px}
.text-center{text-align:center}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(18,18,18,.03);
}
.topbar__inner {
  height: 100%; max-width: var(--page-w);
  margin-inline: auto; padding-inline: 16px;
  display: flex; align-items: center; gap: 12px;
}
@media (min-width: 1200px) { .topbar__inner { padding-inline: 0; } }

.topbar__logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
@media (max-width: 700px) { .logo-text { display: none; } }

.topbar__nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.topnav-link {
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 15px; color: var(--fg-2);
  transition: background var(--t), color var(--t);
}
.topnav-link:hover { background: var(--grey-100); color: var(--fg); }
.topnav-link.is-active { color: var(--brand); font-weight: 600; }

.topbar__search {
  flex: 1; max-width: 340px; margin-inline: auto;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding-inline: 12px;
  background: var(--grey-100); border-radius: var(--r-pill);
  transition: background var(--t), box-shadow var(--t);
}
.topbar__search:focus-within { background: var(--card); box-shadow: 0 0 0 2px var(--brand-soft); }
.topbar__search svg { width: 15px; height: 15px; stroke: var(--fg-subtle); fill: none; stroke-width: 2; flex-shrink: 0; }
.topbar__search input {
  flex: 1; min-width: 0; border: 0; background: none; font-size: 14px;
}
.topbar__search input::placeholder { color: var(--fg-subtle); }
.topbar__search input:focus { outline: none; }
@media (max-width: 860px) { .topbar__search { display: none; } }

.topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--fg-muted);
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--grey-100); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding-inline: 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { border: 1px solid var(--brand); color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--plain { background: var(--grey-100); color: var(--fg-2); }
.btn--plain:hover { background: var(--grey-200); }
.btn--white { background: var(--card); border: 1px solid var(--line); color: var(--fg-2); }
.btn--white:hover { border-color: var(--grey-500); }
.btn--lg { height: var(--field-h); padding-inline: 22px; font-size: 15px; }
.btn--sm { height: 28px; padding-inline: 12px; font-size: 13px; }
.btn--block { width: 100%; }

.btn--icon { width: 34px; padding: 0; }

/* 写文章按钮放在顶栏 */
@media (max-width: 560px) { .topbar__write { display: none; } }

/* ---------- 页面两栏骨架（正文 + 右栏） ---------- */
div.page {
  max-width: var(--page-w);
  margin-inline: auto;
  padding-inline: 16px;
  display: grid;
  grid-template-columns: minmax(0, var(--main-w)) var(--aside-w);
  gap: 10px;
  align-items: start;
  justify-content: center;
  padding-top: 10px;
  padding-bottom: 60px;
}
@media (min-width: 1200px) { div.page { padding-inline: 0; } }

/* 移动端 */
.sidebar-mobile-tabs { display: none; }

/* 手机：单列 */
@media (max-width: 900px) {
  div.page { grid-template-columns: minmax(0, 1fr); }
}

/* 无右栏页面（私信等）：正文单列居中，宽度略放宽 */
div.page--solo { grid-template-columns: minmax(0, 880px); }
@media (max-width: 900px) {
  div.page--solo { grid-template-columns: minmax(0, 1fr); }
}

/* 卡片式链接组（个人中心 / 私信 / 资料编辑右栏仍在用） */
.side__card {
  background: var(--card); border-radius: var(--r);
  padding: 4px 0; box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}
.side__link {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding-inline: 16px;
  font-size: 15px; color: var(--fg-2);
  transition: background var(--t), color var(--t);
}
.side__link:hover { background: var(--grey-100); }
.side__link.is-active { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.side__link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side__link .badge { margin-left: auto; font-size: 12px; color: var(--fg-subtle); background: var(--grey-100); border-radius: var(--r-pill); padding: 1px 7px; }

/* 中间主区 */
.main { min-width: 0; }

/* 右栏 */
.aside { position: sticky; top: calc(var(--header-h) + 10px); }
@media (max-width: 1240px) { .aside { display: none; } }

/* ---------- 卡片容器 ---------- */
.card {
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow-card); margin-bottom: 10px;
  overflow: hidden;
}
.card__head {
  padding: 14px 20px 0; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--fg-muted);
}
.card__head h2 { font-size: 15px; font-weight: 600; color: var(--fg); }

/* 顶部 Tab 栏（关注/推荐/热榜） */
.feed-tabs {
  display: flex; align-items: center; gap: 2px;
  padding-inline: 16px; background: var(--card);
  border-radius: var(--r); box-shadow: var(--shadow-card);
  margin-bottom: 10px; overflow-x: auto; scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab {
  position: relative; height: 48px; padding-inline: 16px;
  font-size: 15px; color: var(--fg-muted); white-space: nowrap;
  transition: color var(--t);
}
.feed-tab:hover { color: var(--fg); }
.feed-tab.is-active { color: var(--fg); font-weight: 600; }
.feed-tab.is-active::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0;
  height: 3px; background: var(--brand); border-radius: 3px 3px 0 0;
}

/* Tab 面板：默认隐藏，激活显示 */
[data-panel] { display: none; }
[data-panel].is-active { display: block; }

/* ---------- 信息流条目（知乎式列表） ---------- */
/* 整块列表容器：白底一整张，条目之间只用分隔线，不再一条一卡 */
.feed-list .feed-item:last-of-type { border-bottom: 0; }
.feed-list .load-more {
  height: 46px; border-radius: 0; box-shadow: none;
  background: transparent; border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.feed-list .load-more.is-done { border-top: 0; }

.feed-item {
  padding: 18px 20px 10px; border-bottom: 1px solid var(--line-soft);
  transition: background var(--t);
}
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--grey-50); }
[data-theme="dark"] .feed-item:hover { background: rgba(255,255,255,.02); }

/* 标题 */
.feed-item__title {
  margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.5;
  letter-spacing: -.008em;
}
.feed-item__title a { color: var(--fg); }
.feed-item__title a:hover { color: var(--brand); }

/* 图左文右：摘要垂直居中，短摘要不会在图片旁吊出大片空白 */
.feed-item__body { display: flex; gap: 14px; align-items: center; }
.feed-item__thumb {
  flex: 0 0 180px; width: 180px; aspect-ratio: 16 / 9;
  border-radius: var(--r-sm); overflow: hidden; background: var(--grey-100);
}
.feed-item__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.feed-item:hover .feed-item__thumb img { transform: scale(1.04); }
@media (max-width: 640px) {
  .feed-item__body { gap: 10px; }
  .feed-item__thumb { flex-basis: 110px; width: 110px; }
}

/* 摘要 + 阅读全文：最多 3 行，超出截断（与 PHP 端 96 字截断双保险） */
.feed-item__excerpt {
  margin: 0; font-size: 15px; line-height: 1.7; color: var(--fg-2);
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.feed-item__more {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 6px;
  color: var(--fg-muted); white-space: nowrap;
}
.feed-item__more:hover { color: var(--brand); }
.feed-item__more svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 操作条：赞同/反对胶囊 + 评论/收藏/喜欢/分享 */
.feed-item__foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding-inline: 10px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--fg-muted); white-space: nowrap;
  background: transparent; border: 0; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.act:hover { background: var(--grey-100); color: var(--fg-2); }
.act svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.act--up { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.act--up:hover { background: var(--brand); color: #fff; }
.act.is-on { color: var(--brand); font-weight: 600; }
.act--more { margin-left: auto; }
.vote-group {
  display: inline-flex; align-items: stretch;
  background: var(--grey-100); border-radius: var(--r-pill);
  margin-right: 6px; overflow: hidden;
}
.vote-group .act { border-radius: 0; background: transparent; }
.vote-group .act:hover { background: transparent; color: var(--brand); }
.vote-group .act--up { padding-right: 8px; font-weight: 600; color: var(--fg-2); }
.vote-group .act--down { padding-inline: 8px; border-left: 1px solid var(--line); color: var(--fg-muted); }
.vote-group .act--up.is-on { background: var(--brand); color: #fff; }
.vote-group .act--up.is-on:hover { background: var(--brand); color: #fff; }
.act--up svg, .act--down svg { fill: currentColor; stroke: none; }
.act--down.is-on { color: var(--fg-2); font-weight: 600; }
[data-theme="dark"] .vote-group { background: rgba(255,255,255,.06); }
[data-theme="dark"] .vote-group .act--down { border-left-color: rgba(255,255,255,.08); }

/* 话题标签 */
.topic-link { color: var(--brand-dark); font-weight: 500; }
.topic-link:hover { color: var(--brand); }

/* ---------- 右栏组件 ---------- */
.widget {
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow-card); margin-bottom: 10px; overflow: hidden;
}
.widget__head {
  padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between;
}
.widget__head h3 { font-size: 15px; font-weight: 600; }
.widget__head a { font-size: 13px; color: var(--fg-muted); }
.widget__head a:hover { color: var(--brand); }

/* 热榜 */
.hot-list { padding: 0 16px 8px; }
.hot-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding-block: 9px; font-size: 14px; line-height: 1.5;
}
.hot-item__rank {
  flex-shrink: 0; width: 18px; text-align: center;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--fg-subtle); padding-top: 1px;
}
/* 热榜序号：同一支暖色的明度阶梯，替代原来的红→橙→黄三色跳色 */
.hot-item:nth-child(1) .hot-item__rank { color: var(--accent); }
.hot-item:nth-child(2) .hot-item__rank { color: var(--accent); opacity: .74; }
.hot-item:nth-child(3) .hot-item__rank { color: var(--accent); opacity: .5; }
.hot-item__title { color: var(--fg-2); transition: color var(--t); }
.hot-item:hover .hot-item__title { color: var(--brand); }
.hot-item__meta { font-size: 12px; color: var(--fg-subtle); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
/* 语义分工：「热」用暖色，「新」用品牌蓝 */
.hot-tag { font-size: 11px; padding: 1px 5px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-dark); }
.hot-tag--new { background: var(--brand-soft); color: var(--brand-dark); }

/* 用户卡 */
.profile-mini { padding: 16px; }
.profile-mini__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-mini__name { font-size: 15px; font-weight: 600; }
.profile-mini__bio { font-size: 12px; color: var(--fg-subtle); margin-top: 2px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.profile-stat { text-align: center; }
.profile-stat__num { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-stat__label { font-size: 12px; color: var(--fg-subtle); }

/* 推荐关注 */
.follow-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.follow-item__info { flex: 1; min-width: 0; }
.follow-item__name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-item__desc { font-size: 12px; color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 页脚 */
.site-footer {
  max-width: var(--page-w); margin-inline: auto; padding: 0 16px 40px;
  font-size: 13px; color: var(--fg-subtle);
}
@media (min-width: 1200px) { .site-footer { padding-inline: 0; } }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.site-footer__links a:hover { color: var(--brand); }

/* ---------- 分页 / 加载更多 ---------- */
.load-more {
  display: flex; align-items: center; justify-content: center;
  height: 48px; background: var(--card); border-radius: var(--r);
  font-size: 15px; color: var(--fg-muted); box-shadow: var(--shadow-card);
  transition: color var(--t);
}
.load-more:hover { color: var(--brand); }
.load-more.is-loading { color: var(--fg-subtle); cursor: progress; }
.load-more.is-loading::after {
  content: ""; width: 12px; height: 12px; margin-left: 8px; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: langyu-spin .7s linear infinite;
}
.load-more.is-done { color: var(--fg-subtle); cursor: default; box-shadow: none; background: transparent; }
.load-more.is-done:hover { color: var(--fg-subtle); }
.load-more.is-error { color: #e5484d; }
@keyframes langyu-spin { to { transform: rotate(360deg); } }

/* 追加更早年份时的分隔标签 */
.archive-year-label {
  padding: 18px 20px 4px; font-size: 12px; letter-spacing: .04em;
  color: var(--fg-subtle); border-top: 1px solid var(--line-soft); margin-top: 12px;
}

/* ---------- 内页通用 ---------- */
.narrow-page {
  max-width: var(--page-w); margin-inline: auto; padding: 10px 16px 60px;
  display: grid; grid-template-columns: minmax(0,var(--main-w)) var(--aside-w); gap: 10px; align-items: start;
  justify-content: center;
}
@media (min-width: 1200px) { .narrow-page { padding-inline: 0; } }
@media (max-width: 1240px) { .narrow-page { grid-template-columns: minmax(0,var(--main-w)); } }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-subtle); padding: 4px 0 10px; }
.breadcrumb a:hover { color: var(--brand); }

/* 内页头部 */
.page-head { padding: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-block: 8px 8px; }
.page-head p { font-size: 14px; color: var(--fg-muted); }
.page-head__stats { display: flex; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.stat__num { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--fg-subtle); }

/* ---------- 文章详情页 ---------- */
.article-title { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: -.022em; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--fg-subtle); margin-bottom: 16px; }
.article-actions { display: flex; align-items: center; gap: 8px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line-soft); }

.prose { font-size: 16px; line-height: 1.8; color: var(--fg-2); }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-size: 20px; font-weight: 700; color: var(--fg); margin-top: 1.9em; letter-spacing: -.015em; }
.prose h3 { font-size: 17px; font-weight: 600; color: var(--fg); margin-top: 1.6em; }
.prose a { color: var(--link); }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 600; color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--fg-subtle); }
.prose blockquote {
  border-left: 3px solid var(--brand); background: var(--grey-50);
  padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; color: var(--fg-2);
}
[data-theme="dark"] .prose blockquote { background: var(--grey-100); }
.prose figure img { border-radius: var(--r); }
.prose figcaption { font-size: 13px; color: var(--fg-subtle); margin-top: 8px; text-align: center; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--grey-100); padding: 2px 5px; border-radius: 3px; }
.prose pre { background: #1e1e22; color: #e6e6e6; border-radius: var(--r); padding: 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { font-size: 14px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.prose th { text-align: left; padding: 10px 14px; background: var(--grey-50); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
[data-theme="dark"] .prose th { background: var(--grey-100); }
.prose td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }

/* ---------- 评论 ---------- */
/* 用 grid 而非 flex：WP 的 div 风格不输出 .children 包裹层，
   嵌套回复只能靠 grid-column 1/-1 独占一行，否则会被挤到父评论右侧。 */
.comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.comment > .comment { grid-column: 1 / -1; margin-top: 10px; }
.comment:last-child { border-bottom: 0; }
.comment__body { min-width: 0; grid-column: 2; }
.comment__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment__name { font-size: 14px; font-weight: 600; }
.comment__time { font-size: 12px; color: var(--fg-subtle); }
.comment__text { font-size: 15px; line-height: 1.7; color: var(--fg-2); }
.comment__foot { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
/* 嵌套回复：WP 的 div 样式不输出 children 包裹层，缩进由主题按深度控制 */
.comment--reply { border-bottom: 0; border-left: 2px solid var(--line); padding-left: 16px; }
.comment--reply:hover { border-left-color: var(--brand-soft); }
.comment-list .comment--depth-2 { margin-left: 44px; }
.comment-list .comment--depth-3 { margin-left: 88px; }
.comment-list .comment--depth-4 { margin-left: 132px; }
.comment-list .comment--depth-5 { margin-left: 176px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.input, .textarea, .select {
  width: 100%; padding: 9px 12px; font-size: 15px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
/* 单行输入框固定高度：不写字号与行高决定高度，才能与按钮严格齐平 */
.input, .select { height: var(--field-h); padding-block: 0; }
.input[type="file"] { height: auto; padding-block: 7px; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--fg-muted); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.form-msg { display: none; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; }

/* ---------- 归档 ---------- */
.archive-group { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.archive-group:last-child { border-bottom: 0; }
.archive-group__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.archive-group__head h3 { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.archive-group__head span { font-size: 12px; color: var(--fg-subtle); }
.archive-list a { display: flex; gap: 12px; align-items: baseline; padding-block: 8px; font-size: 14px; color: var(--fg-2); transition: color var(--t); }
.archive-list a:hover { color: var(--brand); }
.archive-list time { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); flex-shrink: 0; }

/* ---------- 搜索页 ---------- */
.search-result { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.search-result:last-child { border-bottom: 0; }
.search-result__url { font-size: 12px; color: var(--fg-subtle); margin-bottom: 4px; }
.search-result h2 { font-size: 17px; font-weight: 600; line-height: 1.5; margin-bottom: 5px; }
.search-result h2 a:hover { color: var(--brand); }
.search-result p { font-size: 14px; color: var(--fg-muted); line-height: 1.65; }
mark { background: var(--brand-soft); color: var(--brand-dark); padding: 1px 3px; border-radius: 2px; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 40px 16px; background: var(--bg); }
.auth-card { width: min(400px,100%); background: var(--card); border-radius: var(--r-lg); box-shadow: 0 4px 24px rgba(18,18,18,.08); padding: 32px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; }
.auth-card h1 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-card > p { font-size: 14px; color: var(--fg-muted); text-align: center; margin-bottom: 22px; }
/* 登录墙按钮（需要登录的页面） */
.auth-wall { margin: 4px 0 0; }
.auth-card > .auth-wall { margin-bottom: 0; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { flex: 1; height: 40px; font-size: 15px; color: var(--fg-muted); position: relative; }
.tabs button.is-active { color: var(--brand); font-weight: 600; }
.tabs button.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.pane { display: none; }
.pane.is-active { display: flex; flex-direction: column; gap: 14px; }
.divider-text { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--fg-subtle); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 入场动画 */
[data-reveal] { opacity: 0; transform: translateY(6px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity .4s var(--ease), transform .4s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* 返回顶部 */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); color: var(--fg-2);
  border: 1px solid var(--line); box-shadow: 0 2px 12px rgba(18,18,18,.1);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .24s var(--ease);
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }
.to-top svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 进度条 */
.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 100; background: var(--brand); }

/* 移动端底部 Tab 栏 */
.mobile-tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-tabbar__inner { display: grid; grid-template-columns: repeat(4,1fr); height: 50px; }
.mobile-tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; color: var(--fg-subtle);
}
.mobile-tabbar a.is-active { color: var(--brand); }
.mobile-tabbar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  .mobile-tabbar { display: block; }
  .topbar__nav { display: none; }
  .page, .narrow-page { padding-bottom: 76px; }
  .site-footer { padding-bottom: 76px; }
}

/* ---------- 内页补充组件 ---------- */
/* 筛选行（分类/归档页） */
.filters {
  position: sticky; top: var(--header-h); z-index: 40;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--card);
  border-radius: var(--r); box-shadow: var(--shadow-card); margin-bottom: 10px;
}
.chip {
  height: 30px; padding-inline: 13px; display: inline-flex; align-items: center;
  font-size: 13px; color: var(--fg-2); background: var(--grey-100);
  border-radius: var(--r-pill); white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.chip:hover { background: var(--grey-200); }
.chip.is-active { background: var(--brand); color: #fff; font-weight: 500; }
.filters__spacer { flex: 1; }
.filters__count { font-size: 13px; color: var(--fg-subtle); }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 16px; }
.tag {
  font-size: 13px; padding: 4px 10px; border-radius: var(--r-sm);
  background: var(--grey-100); color: var(--fg-2);
  transition: background var(--t), color var(--t);
}
.tag:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* 文章目录 */
.toc { padding: 4px 0 8px; }
.toc a {
  position: relative; display: block; padding: 7px 16px 7px 18px;
  font-size: 14px; color: var(--fg-muted); border-left: 2px solid transparent;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.toc a:hover { color: var(--fg); }
.toc a.is-active {
  color: var(--brand-dark); font-weight: 500;
  border-left-color: var(--brand); background: var(--brand-soft);
}

/* 作者卡（文章页） */
.author-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.author-card__info { flex: 1; min-width: 0; }
.author-card__name { font-size: 15px; font-weight: 600; }
.author-card__name:hover { color: var(--brand); }
.author-card__bio { font-size: 13px; color: var(--fg-muted); margin-top: 3px; }
.author-card__stats { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--fg-subtle); }
.author-card__stats strong { color: var(--fg-2); font-weight: 600; }

/* 相关阅读 */
.related-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.related-item:last-child { border-bottom: 0; }
.related-item__text { flex: 1; min-width: 0; }
.related-item__text h4 { font-size: 14px; font-weight: 500; line-height: 1.5; }
.related-item__text h4 a:hover { color: var(--brand); }
.related-item__text span { font-size: 12px; color: var(--fg-subtle); }
.related-item img { width: 84px; height: 56px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }

/* 上下篇 */
.pn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pn-nav a {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-card);
  padding: 13px 16px; transition: box-shadow var(--t);
}
.pn-nav a:hover { box-shadow: 0 3px 12px rgba(18,18,18,.08); }
.pn-nav a:last-child { text-align: right; }
.pn-nav .pn-label { display: block; font-size: 12px; color: var(--fg-subtle); margin-bottom: 4px; }
.pn-nav .pn-title { font-size: 14px; font-weight: 500; color: var(--fg-2); }
.pn-nav a:hover .pn-title { color: var(--brand); }
@media (max-width: 640px) { .pn-nav { grid-template-columns: 1fr; } .pn-nav a:last-child { text-align: left; } }

/* FAQ（details/summary） */
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 14px 20px; font-size: 15px; font-weight: 500; cursor: pointer;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 18px; color: var(--fg-subtle); flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { color: var(--brand-dark); }
.faq details > div { padding: 0 20px 16px; font-size: 14px; color: var(--fg-muted); line-height: 1.75; }

/* 团队卡片 */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 20px 20px; }
@media (max-width: 640px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.team-card { text-align: center; padding: 18px 10px; border: 1px solid var(--line-soft); border-radius: var(--r); }
.team-card .avatar--xl { margin: 0 auto 10px; }
.team-card h4 { font-size: 15px; font-weight: 600; }
.team-card p { font-size: 12px; color: var(--fg-muted); margin-top: 3px; }

/* 理念（about） */
.principle { display: flex; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.principle:last-child { border-bottom: 0; }
.principle__num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.principle h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.principle p { font-size: 14px; color: var(--fg-muted); }

/* 时间线（about） */
.timeline { padding: 6px 20px 20px; }
.timeline-item { position: relative; padding: 0 0 20px 24px; border-left: 2px solid var(--line); }
.timeline-item:last-child { padding-bottom: 4px; border-left-color: transparent; }
.timeline-item::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--brand);
}
.timeline-item time { font-size: 12px; font-weight: 600; color: var(--brand-dark); }
.timeline-item h4 { font-size: 15px; font-weight: 600; margin-top: 2px; }
.timeline-item p { font-size: 13px; color: var(--fg-muted); margin-top: 3px; }

/* 联系方式卡 */
.contact-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.contact-item:last-child { border-bottom: 0; }
.contact-item__icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: var(--r);
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center;
}
.contact-item__icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-item h4 { font-size: 14px; font-weight: 600; }
.contact-item p { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
.contact-item a:hover { color: var(--brand); }

/* 年份筛选（归档页） */
.year-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }

/* 搜索 facet */
.facet a { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; font-size: 14px; color: var(--fg-2); }
.facet a:hover { background: var(--grey-50); }
.facet a.is-active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 500; }
.facet-count { font-size: 12px; color: var(--fg-subtle); }

/* 数据指标卡（about） */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 20px; }
.metric { text-align: center; padding: 12px 6px; background: var(--grey-50); border-radius: var(--r); }
[data-theme="dark"] .metric { background: var(--grey-100); }
.metric b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric span { font-size: 12px; color: var(--fg-subtle); }

/* 轻提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 80px; z-index: 120;
  transform: translate(-50%, 12px);
  background: rgba(18,18,18,.88); color: #fff;
  font-size: 14px; padding: 9px 18px; border-radius: var(--r-pill);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: all .24s var(--ease);
  max-width: 80vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .toast { background: rgba(255,255,255,.92); color: #121212; }
.toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* 评论表单 */
.comment-form {
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 10px;
  background: var(--grey-50);
}
[data-theme="dark"] .comment-form { background: var(--grey-100); }

/* ==========================================================================
   WordPress 适配层（主题特有元素）
   ========================================================================== */

/* 评论表单（WP comment_form 输出的结构） */
.comment-form { padding: 16px 20px; }
.comment-form p { margin: 0 0 12px; }
.comment-form label { font-size: 13px; color: var(--fg-muted); display: block; margin-bottom: 4px; }
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url { padding-inline: 20px; }
.comment-form .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; padding-inline: 20px; }
.comment-form .comment-form-cookies-consent label { margin: 0; }
.comment-form .submit { margin-left: auto; }
.comment-form .form-submit { display: flex; align-items: center; gap: 12px; padding: 0 20px 16px; }
.comment-form .input, .comment-form .textarea { width: 100%; }
/* 嵌套缩进见 .comment--depth-* */

/* 登录表单（wp_login_form 输出的结构） */
#langyu-login p { margin-bottom: 12px; }
#langyu-login label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
#langyu-login input[type="text"],
#langyu-login input[type="password"] {
  width: 100%; height: 40px; padding: 0 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--fg);
}
#langyu-login input[type="text"]:focus,
#langyu-login input[type="password"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
#langyu-login .login-remember { display: flex; align-items: center; gap: 8px; }
#langyu-login .login-remember label { margin: 0; font-weight: 400; color: var(--fg-muted); }
#langyu-login .button,
#langyu-login input[type="submit"] {
  width: 100%; height: 40px; border: 0; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background var(--t);
}
#langyu-login .button:hover, #langyu-login input[type="submit"]:hover { background: var(--brand-dark); }

/* 分页（paginate_links 输出） */
.pagination, .page-numbers { display: inline-flex; gap: 6px; align-items: center; }
.page-numbers.current { color: var(--brand); font-weight: 700; }
.page-numbers { padding: 4px 8px; border-radius: var(--r-sm); }
.page-numbers:not(.current):not(.dots):hover { background: var(--grey-100); color: var(--brand); }

/* 搜索表单兜底 */
.search-form { display: flex; gap: 8px; padding: 16px 20px; }
.search-form .search-field { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.search-form .search-submit { height: 40px; padding-inline: 18px; border: 0; border-radius: var(--r-sm); background: var(--brand); color: #fff; cursor: pointer; }

/* 对齐 / 图片（WP 编辑器输出） */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, .wp-element-caption { font-size: 13px; color: var(--fg-subtle); text-align: center; margin-top: 8px; }
.sticky { border-left: 3px solid var(--brand); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* 后台编辑栏避让 */
body.admin-bar .topbar { top: 32px; }
body.admin-bar .side, body.admin-bar .aside { top: calc(var(--header-h) + 42px); }
@media screen and (max-width: 782px) { body.admin-bar .topbar { top: 46px; } }

/* 侧栏挂件默认排版 */
.widget > h3 { padding: 14px 16px 6px; font-size: 15px; font-weight: 600; }
.widget ul { padding: 0 16px 12px; }
.widget li { padding-block: 6px; font-size: 14px; color: var(--fg-2); }
.widget li a:hover { color: var(--brand); }

/* ---------- 归档页增强 ---------- */
.chip__count {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 11px; line-height: 16px; border-radius: var(--r-pill);
  background: var(--grey-200); color: var(--fg-subtle);
}
.chip.is-active .chip__count { background: rgba(255,255,255,.28); color: #fff; }

.archive-list a { justify-content: flex-start; }
.archive-list__title { flex: 1; min-width: 0; }
.archive-list__cat {
  flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--grey-100); color: var(--fg-subtle);
}

/* 分类分布条 */
.stat-bars { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.stat-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.stat-bar__label { width: 56px; flex-shrink: 0; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar__track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--grey-100); overflow: hidden; }
.stat-bar__track i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); transition: width .5s var(--ease); }
.stat-bar__num { width: 22px; flex-shrink: 0; text-align: right; color: var(--fg-subtle); font-variant-numeric: tabular-nums; }

/* 归档页右栏在窄屏下与两栏布局同步隐藏 */
@media (max-width: 1240px) {
  .narrow-page .aside { display: none; }
}

@media print {
  .topbar, .site-footer, .to-top, .progress-bar, .aside, .side, .mobile-tabbar { display: none; }
}

/* ---------- 作者归档页：作者信息卡 ---------- */
.author-hero__row { display: flex; align-items: flex-start; gap: 16px; padding: 20px; }
.author-hero__avatar { flex-shrink: 0; }
.author-hero__avatar img { width: 72px; height: 72px; border-radius: var(--r-full, 50%); object-fit: cover; border: 3px solid var(--brand-soft); }
.author-hero__meta { flex: 1; min-width: 0; }
.author-hero__name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.author-hero__bio { font-size: 14px; color: var(--fg-muted); line-height: 1.7; margin-bottom: 10px; }
.author-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 转载来源声明 ---------- */
.source-note {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brand);
  border-radius: var(--r);
  background: var(--grey-50);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--fg-muted);
}
.source-note p { margin: 0; }
.source-note p + p { margin-top: 6px; }
.source-note strong { color: var(--fg-2); }
.source-note a { color: var(--link); word-break: break-all; }
.source-note__link { font-size: 12.5px; }
.post-figure { margin: 1.4em 0; text-align: center; }
.post-figure img { max-width: 100%; height: auto; border-radius: var(--r); }

/* ---------- 登录 / 注册：Tab 与表单 ---------- */
/* 标签数量随短信开关变化（2 个 / 3 个），用 flex 等分，不能写死列数 */
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--grey-100); border-radius: var(--r-pill); margin-bottom: 18px; }
.auth-tabs[hidden] { display: none; }
.auth-tab { flex: 1 1 0; min-width: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--fg-muted); padding: 9px 6px; border-radius: var(--r-pill); white-space: nowrap; transition: background .16s, color .16s; }
.auth-tab:hover { color: var(--fg); }
.auth-tab[hidden] { display: none; }
.auth-tab.is-active { background: var(--card, #fff); color: var(--brand); box-shadow: 0 1px 4px rgba(18,18,18,.08); }
@media (max-width: 380px) { .auth-tab { font-size: 13px; padding: 9px 4px; } }
/* 忘记密码 / 返回登录：文字链接样式的按钮 */
.auth-link { display: block; margin: 12px auto 0; border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 13px; color: var(--link); cursor: pointer; text-align: center; }
.auth-link:hover { text-decoration: underline; }
.auth-link--inline { display: inline; margin: 0; padding: 0; font-size: inherit; }
.auth-back { margin-bottom: 12px; }
.auth-back .auth-link { margin: 0; text-align: left; font-size: 13px; }
.auth-title-sm { margin: 0 0 4px; font-size: 17px; font-weight: 600; text-align: center; }
.auth-sub-sm { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--fg-muted); text-align: center; }
/* 主视图底部的次要入口：注册 / 忘记密码 */
.auth-alt { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft, #f0f0f3); font-size: 13px; color: var(--fg-muted); }
.auth-alt[hidden] { display: none; }
.auth-alt__sep { color: var(--grey-500, #c2c8d0); }
.auth-alert { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r); background: #fff1f0; border: 1px solid #ffccc7; color: #cf1322; font-size: 13px; }
[data-theme="dark"] .auth-alert { background: rgba(207,19,34,.14); border-color: rgba(255,120,117,.35); color: #ff9c9c; }
.auth-hint { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--fg-muted); }
.auth-hint a { color: var(--link); }
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field .input { padding-right: 58px; }
.pw-toggle { position: absolute; right: 10px; border: 0; background: none; cursor: pointer; font-size: 12.5px; color: var(--fg-muted); padding: 4px; }
.pw-toggle:hover { color: var(--brand); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg-muted); cursor: pointer; }
.auth-card .pane.is-active { display: flex; }
.auth-card .divider-text { margin: 18px 0 0; }

/* ---------- 登录 / 注册弹窗 ---------- */
.auth-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-modal__backdrop { position: absolute; inset: 0; background: rgba(12,14,16,.5); opacity: 0; transition: opacity .2s ease; }
.auth-modal.is-open .auth-modal__backdrop { opacity: 1; }
.auth-modal__dialog {
  position: relative; width: min(400px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--card, #fff); border-radius: var(--r-lg); padding: 26px 24px 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  transform: translateY(14px) scale(.98); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
.auth-modal.is-open .auth-modal__dialog { transform: none; opacity: 1; }
.auth-modal__close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--grey-100); color: var(--fg-muted); cursor: pointer; display: grid; place-items: center; }
.auth-modal__close:hover { background: var(--grey-200, #ececec); color: var(--fg); }
.auth-modal__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.auth-modal__head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; }
.auth-modal__head h2 { font-size: 17px; font-weight: 700; }
body.has-auth-modal { overflow: hidden; }

/* ==========================================================================
   用户中心 / 资料编辑（前台实现，不依赖 wp-admin 的 profile.php）
   ========================================================================== */

/* ---------- 作者信息卡的补充信息行 ---------- */
.author-hero__sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--fg-subtle); margin-bottom: 8px; line-height: 1.6;
}
.author-hero__sub .sep { color: var(--grey-500); }
.author-hero__handle { color: var(--fg-muted); }

/* ---------- 个人中心：统计条 ---------- */
.user-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 20px 20px; }
.user-stat { text-align: center; padding: 12px 6px; background: var(--grey-50); border-radius: var(--r); }
[data-theme="dark"] .user-stat { background: var(--grey-100); }
.user-stat b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.user-stat span { font-size: 12px; color: var(--fg-subtle); }

/* ---------- 个人中心：Tab ---------- */
.user-tabs {
  display: flex; gap: 2px; padding: 12px 16px 0;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.user-tabs::-webkit-scrollbar { display: none; }
.user-tab {
  position: relative; padding: 9px 14px; font-size: 14px; color: var(--fg-muted);
  white-space: nowrap; border-radius: var(--r) var(--r) 0 0; transition: color var(--t), background var(--t);
}
.user-tab:hover { color: var(--fg); background: var(--grey-100); }
.user-tab.is-active { color: var(--brand); font-weight: 600; }
.user-tab.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--brand); border-radius: 2px;
}
.user-panel { display: none; }
.user-panel.is-active { display: block; }
.panel-note { font-size: 12.5px; color: var(--fg-subtle); line-height: 1.75; padding: 14px 20px 4px; }
.empty-state { padding: 40px 20px; text-align: center; font-size: 14px; color: var(--fg-subtle); }

/* 个人中心的扁平文章列表 */
.archive-list--flat { padding: 6px 20px 18px; }
.archive-list--flat a { padding-block: 11px; border-bottom: 1px solid var(--line-soft); }
.archive-list--flat a:last-child { border-bottom: 0; }
.archive-list__meta { flex-shrink: 0; font-size: 12px; color: var(--fg-subtle); }

/* 个人中心：我的评论 */
.comment-list--mine { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; }
.comment-item { padding: 14px 16px; background: var(--grey-50); border-radius: var(--r); }
[data-theme="dark"] .comment-item { background: var(--grey-100); }
.comment-item__text { font-size: 14px; line-height: 1.8; color: var(--fg-2); }
.comment-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--fg-subtle); }
.comment-item__meta a { color: var(--fg-muted); transition: color var(--t); }
.comment-item__meta a:hover { color: var(--brand); }
.comment-item__meta .sep { color: var(--grey-500); }

/* ---------- 账号信息（只读键值对） ---------- */
.user-facts { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 16px; }
.user-facts--wide { padding: 0; }
.user-fact { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13px; }
.user-fact span { color: var(--fg-subtle); flex-shrink: 0; }
.user-fact b { font-weight: 600; min-width: 0; word-break: break-all; text-align: right; }

/* ---------- 资料表单 ---------- */
.form-section {
  font-size: 15px; font-weight: 600; padding: 20px 20px 2px;
  border-top: 1px solid var(--line-soft); margin-top: 4px;
}
.profile-form > .form-section:first-of-type { border-top: 0; margin-top: 0; }
.form-row { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; padding: 12px 20px; }
.form-label { font-size: 14px; color: var(--fg-2); padding-top: 9px; }
.form-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-row .input, .form-row .textarea { width: 100%; }
.field-hint { font-size: 12px; color: var(--fg-subtle); line-height: 1.7; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px 24px; }

/* ---------- 头像上传 ---------- */
.avatar-tools { display: flex; align-items: flex-start; gap: 16px; }
.avatar-preview { display: block; flex-shrink: 0; }
.avatar-preview img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-soft); background: var(--grey-100); }
.avatar-tools__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.file-input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 提示条：成功态 ---------- */
.auth-alert--ok { background: var(--ok-soft); border-color: #b7ebd1; color: var(--ok-dark); }
[data-theme="dark"] .auth-alert--ok { background: rgba(7,193,96,.14); border-color: rgba(7,193,96,.34); color: #7ee2a8; }

/* ---------- 右栏内的裸列表 ---------- */
.side__card--plain { background: transparent; box-shadow: none; margin-bottom: 0; padding: 0; border-radius: 0; }
.side__card--plain .side__link { padding-inline: 20px; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 720px) {
  .user-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .form-label { padding-top: 0; }
  .avatar-tools { flex-direction: column; }
  .author-hero__row { flex-direction: column; }
  .author-hero__actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   社交：右栏版权 / 关注 / 私信
   ========================================================================== */

/* ---------- 右栏底部的版权信息 ---------- */
.side__copy {
  padding: 4px 20px 0; font-size: 12px; line-height: 1.7; color: var(--fg-subtle);
}
.side__copy p { margin: 0; }
.side__copy-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.side__copy-links a { color: var(--fg-subtle); }
.side__copy-links a:hover { color: var(--brand); }
[data-theme="dark"] .side__copy { color: var(--fg-muted); }
[data-theme="dark"] .side__copy-links a { color: var(--fg-muted); }

/* ---------- 页脚备案号 ---------- */
.filings { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0 0; font-size: 12px; color: var(--fg-subtle); }
.filings__sep { opacity: .45; }
.filing-link { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-subtle); }
.filing-link:hover { color: var(--brand); }
.filing-link__ico { width: 13px; height: 13px; flex: none; }
.side__copy .filings { margin-top: 6px; }
.site-footer .filings { margin: 8px 0 10px; font-size: 13px; }
[data-theme="dark"] .filings, [data-theme="dark"] .filing-link { color: var(--fg-muted); }

/* ---------- 用户卡：个人中心 / 私信 两个按钮并排 ---------- */
.profile-mini__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- 未读角标 ---------- */
.btn__count, .side__count, .icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px;
  font-size: 11px; font-weight: 600; line-height: 1; color: #fff;
  background: #e5484d; border-radius: var(--r-pill);
}
.btn__count { margin-left: 6px; }
.side__count { margin-left: auto; }
.icon-badge { position: absolute; top: -5px; right: -5px; }
.topbar__msg { position: relative; }

/* ---------- 关注按钮 ---------- */
.follow-btn { white-space: nowrap; }
.follow-btn.is-following { color: var(--fg-muted); }
.follow-btn__hover { display: none; }
.follow-btn.is-following:hover { color: #e5484d; border-color: currentColor; }
.follow-btn.is-following:hover .follow-btn__text { display: none; }
.follow-btn.is-following:hover .follow-btn__hover { display: inline; }

/* ---------- 用户条目（关注 / 粉丝 / 推荐作者） ---------- */
.follow-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.follow-item + .follow-item { border-top: 1px solid var(--line-soft); }
.follow-item__avatar { flex-shrink: 0; }
.follow-item__avatar .avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--grey-100); }
.follow-item__info { flex: 1; min-width: 0; }
.follow-item__name { display: block; font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.follow-item__name:hover { color: var(--brand); }
.follow-item__desc { font-size: 12px; color: var(--fg-subtle); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.follow-item .btn { flex-shrink: 0; }

/* ---------- 个人中心：6 格统计 ---------- */
.user-stats--six { grid-template-columns: repeat(3, 1fr); }
a.user-stat { transition: background var(--t); }
a.user-stat:hover { background: var(--grey-200); }

/* ---------- 私信页 ---------- */
.msg-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-side { overflow: hidden; }
.msg-side .page-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.msg-side .page-head h1 { font-size: 17px; margin-block: 2px 4px; }
.msg-side .page-head p { font-size: 12.5px; }
.msg-conv-list { display: flex; flex-direction: column; }
.msg-conv { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); transition: background var(--t); }
.msg-conv:last-child { border-bottom: 0; }
.msg-conv:hover { background: var(--grey-100); }
.msg-conv.is-active { background: var(--brand-soft); }
[data-theme="dark"] .msg-conv.is-active { background: var(--brand-soft); }
.msg-conv__avatar .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-conv__body { flex: 1; min-width: 0; }
.msg-conv__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.msg-conv__top b { font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-conv__top time { flex-shrink: 0; font-size: 11px; color: var(--fg-subtle); }
.msg-conv__last { display: block; font-size: 12.5px; color: var(--fg-subtle); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 600;
  line-height: 1; color: #fff; background: #e5484d; border-radius: var(--r-pill);
}

.msg-peer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.msg-peer__avatar .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.msg-peer__info { flex: 1; min-width: 0; }
.msg-peer__name { display: block; font-size: 15px; font-weight: 500; }
.msg-peer__name:hover { color: var(--brand); }
.msg-peer__sub { font-size: 12px; color: var(--fg-subtle); }

.msg-thread { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; max-height: 52vh; overflow-y: auto; }
.msg-bubble { display: flex; gap: 10px; align-items: flex-start; }
.msg-bubble__avatar .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-bubble__main { max-width: 76%; min-width: 0; }
.msg-bubble__text {
  padding: 9px 13px; font-size: 14px; line-height: 1.75; word-break: break-word;
  background: var(--grey-100); border-radius: 2px var(--r-lg) var(--r-lg) var(--r-lg);
}
[data-theme="dark"] .msg-bubble__text { background: var(--grey-200); }
.msg-bubble__time { display: block; margin-top: 4px; font-size: 11px; color: var(--fg-subtle); }
.msg-bubble.is-mine { flex-direction: row-reverse; }
.msg-bubble.is-mine .msg-bubble__main { display: flex; flex-direction: column; align-items: flex-end; }
.msg-bubble.is-mine .msg-bubble__text { background: var(--brand); color: #fff; border-radius: var(--r-lg) 2px var(--r-lg) var(--r-lg); }
[data-theme="dark"] .msg-bubble.is-mine .msg-bubble__text { background: var(--brand-dark); }

.msg-form { padding: 0 20px 20px; }
.msg-form .textarea { min-height: 84px; font-size: 14px; }
.msg-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- 私信：窄屏 ---------- */
@media (max-width: 900px) {
  .msg-layout { grid-template-columns: 1fr; }
  .msg-thread { max-height: none; }
}

@media (max-width: 720px) {
  .user-stats--six { grid-template-columns: repeat(2, 1fr); }
  .profile-mini__actions { grid-template-columns: 1fr; }
  .msg-bubble__main { max-width: 84%; }
}

/* 角标用 hidden 隐藏时，需覆盖上面的 display，否则属性失效 */
.btn__count[hidden], .side__count[hidden], .icon-badge[hidden], .msg-badge[hidden] { display: none; }

/* ==========================================================================
   评论区优化（中文表单 / 空态 / 栅格字段 / 身份行）
   ========================================================================== */
.comments-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.comments-head h2 { font-size: 15px; font-weight: 600; color: var(--fg); }

/* 0 条评论的空态 */
.comments-empty { padding: 36px 20px 32px; text-align: center; color: var(--fg-subtle); font-size: 14px; }
.comments-empty svg {
  width: 40px; height: 40px; margin: 0 auto 10px;
  stroke: var(--grey-400); fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 表单标题与「取消回复」 */
.comment-form__title { padding: 16px 20px 0; font-size: 16px; font-weight: 600; }
.comment-form__title small { display: block; font-size: 12px; font-weight: 400; margin-top: 6px; }
.comment-form__title small a { color: var(--fg-muted); text-decoration: underline; }

/* 已登录身份行 */
.comment-as-user { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; font-size: 13px; color: var(--fg-muted); }
.comment-as-user .avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.comment-as-user__text b { font-weight: 600; color: var(--fg-2); }
.comment-as-user a { color: var(--brand); }
.comment-as-user a:hover { text-decoration: underline; }
.comment-as-user .sep { color: var(--grey-400); }
.must-log-in { padding: 16px 20px 0; font-size: 13px; color: var(--fg-muted); }
.must-log-in a { color: var(--brand); font-weight: 500; }

/* 游客字段栅格：昵称 / 邮箱 / 网站一行 */
.comment-form-fields { display: grid; grid-template-columns: 1fr; gap: 0 12px; padding: 0 20px; }
@media (min-width: 640px) { .comment-form-fields { grid-template-columns: 1fr 1fr 1fr; } }
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url { padding-inline: 0; margin: 14px 0 0; }
.comment-form .comment-form-cookies-consent { grid-column: 1 / -1; padding-inline: 0; margin-top: 12px; }
.comment-form label { font-size: 13px; color: var(--fg-muted); }
.comment-form .req { color: #e5484d; }

/* 正文输入框与提交行 */
.comment-form .comment-form-comment { padding: 14px 20px 0; margin: 0; }
.comment-form .form-submit { display: flex; align-items: center; gap: 12px; padding: 12px 20px 18px; }
.comment-form__hint { margin-right: auto; font-size: 12px; color: var(--fg-subtle); }
.comment-form .submit { margin-left: 0; }

/* 评论正文排版 */
.comment__text p { margin: 0 0 6px; }
.comment__text p:last-child { margin-bottom: 0; }
.comment__text a { color: var(--link); word-break: break-all; }

/* 窄屏：嵌套回复缩进收窄 */
@media (max-width: 720px) {
  .comment-list .comment--depth-2 { margin-left: 28px; }
  .comment-list .comment--depth-3 { margin-left: 56px; }
  .comment-list .comment--depth-4 { margin-left: 84px; }
  .comment-list .comment--depth-5 { margin-left: 112px; }
  .comment-form-fields { grid-template-columns: 1fr; }
}

/* 待审核提示（跟随评论出现，游客首评可见） */
.comment-await {
  display: inline-block; margin: 2px 0 8px; padding: 5px 10px;
  font-size: 12px; color: #8a6d1a; background: #fdf6dd; border-radius: var(--r-sm);
}
[data-theme="dark"] .comment-await { color: #e6c65c; background: rgba(230,198,92,.12); }

/* ============================================================
 *  验证码登录 / 会员中心 / 支付弹窗
 * ============================================================ */

/* 验证码输入行：码 + 发送按钮 */
.code-field { display: flex; gap: 8px; align-items: stretch; }
.code-field .input { flex: 1; min-width: 0; }
.code-field .code-send { white-space: nowrap; flex-shrink: 0; height: var(--field-h); }

/* 会员状态卡 */
.member-status { padding: 22px 20px; }
.member-status__sub { margin: 0; color: var(--fg-muted, #8590a6); }
.member-badge {
  display: inline-block; margin-right: 6px; padding: 2px 10px;
  font-size: 12px; font-weight: 600; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 999px;
}

/* 会员方案 */
.pay-plans {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; padding: 4px 20px 20px;
}
.plan-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 16px; text-align: center;
  border: 1px solid var(--line, #e8e8ec); border-radius: var(--r-lg, 12px);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.plan-card:hover { border-color: var(--link, #4f6ef7); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.plan-card__name { margin: 0; font-size: 15px; font-weight: 600; }
.plan-card__price { color: var(--link, #4f6ef7); }
.plan-card__price strong { font-size: 30px; font-weight: 700; line-height: 1; margin: 0 2px; }
.plan-card__price span { font-size: 12px; color: var(--fg-muted, #8590a6); }
.plan-card__desc { margin: 0; font-size: 12px; color: var(--fg-muted, #8590a6); min-height: 18px; }
.plan-card__actions { margin-top: auto; display: grid; gap: 6px; }

/* 支付方式选择（易支付可同时开微信 / 支付宝，会员页与附件页共用） */
.pay-choice { display: grid; gap: 6px; }
.pay-choice__label { margin: 0; font-size: 12px; color: var(--fg-muted); }
.pay-choice__btn { color: #fff; font-weight: 500; border: 0; }
.pay-choice__btn--wechat { background: #07c160; }
.pay-choice__btn--wechat:hover { background: #06ad56; color: #fff; }
.pay-choice__btn--alipay { background: #1677ff; }
.pay-choice__btn--alipay:hover { background: #0e63d9; color: #fff; }
.pay-choice__btn:disabled { opacity: .6; }
.dl-actions .pay-choice { display: flex; gap: 10px; flex-wrap: wrap; }

/* 支付二维码弹窗（复用 auth-modal 结构） */
.pay-modal { position: fixed; inset: 0; z-index: 1000; }
.pay-modal .auth-modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,28,.5); opacity: 0; transition: opacity .18s; }
.pay-modal.is-open .auth-modal__backdrop { opacity: 1; }
.pay-modal .auth-modal__dialog {
  position: relative; margin: 12vh auto 0; width: min(340px, calc(100vw - 32px));
  background: var(--card, #fff); border-radius: var(--r-lg, 12px);
  padding: 22px 20px; opacity: 0; transform: translateY(10px); transition: opacity .18s, transform .18s;
}
.pay-modal.is-open .auth-modal__dialog { opacity: 1; transform: none; }
.pay-qr { text-align: center; }
.pay-qr__box { display: inline-block; padding: 10px; border: 1px solid var(--line, #e8e8ec); border-radius: var(--r, 8px); min-height: 220px; min-width: 220px; }
.pay-qr__box img, .pay-qr__box canvas { display: block; }
.pay-qr__amount { margin: 10px 0 2px; font-size: 12px; color: var(--fg-muted, #8590a6); }
.pay-qr__hint { margin: 0 0 12px; font-size: 13px; }

/* ============================================================
 *  顶栏：消息面板 / 头像菜单 + 附件卡片 + 下载页
 * ============================================================ */

/* 顶栏动作区 */
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.topbar__actions .icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: var(--r, 8px);
  background: transparent; color: inherit; cursor: pointer; transition: background .15s;
}
.topbar__actions .icon-btn:hover { background: rgba(127,127,140,.12); }

/* 用户头像按钮 */
.user-menu { position: relative; }
.user-menu__btn {
  display: inline-flex; align-items: center; padding: 2px; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; line-height: 0; transition: box-shadow .15s;
}
.user-menu__btn:hover { box-shadow: 0 0 0 2px var(--link, #4f6ef7); }
.user-menu__btn .avatar { width: 30px; height: 30px; border-radius: 50%; }

.user-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 200;
  width: 200px; padding: 8px; border-radius: var(--r-lg, 12px);
  background: var(--card, #fff); border: 1px solid var(--line, #e8e8ec);
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
}
.user-menu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line, #e8e8ec); margin-bottom: 6px; }
.user-menu__head b { display: block; font-size: 14px; }
.user-menu__role { font-size: 12px; color: var(--fg-muted, #8590a6); }
.user-menu__panel > a {
  display: block; padding: 8px 10px; border-radius: var(--r, 8px);
  font-size: 14px; color: var(--fg, #121212); text-decoration: none; transition: background .12s;
}
.user-menu__panel > a:hover { background: rgba(127,127,140,.1); }
.user-menu__logout { color: #d33 !important; border-top: 1px solid var(--line, #e8e8ec); margin-top: 4px; border-radius: 0 0 var(--r-sm,8px) var(--r-sm,8px) !important; }

/* 消息（通知）面板 */
.ntf-wrap { position: relative; }
.ntf-panel {
  position: absolute; right: -40px; top: calc(100% + 8px); z-index: 200;
  width: 320px; border-radius: var(--r-lg, 12px); overflow: hidden;
  background: var(--card, #fff); border: 1px solid var(--line, #e8e8ec);
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
}
.ntf-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line, #e8e8ec); font-size: 14px;
}
.ntf-panel__readall { border: 0; background: none; color: var(--link, #4f6ef7); font-size: 12px; cursor: pointer; }
.ntf-panel__readall:hover { text-decoration: underline; }
.ntf-panel__list { max-height: 360px; overflow-y: auto; }
.ntf-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--fg-muted, #8590a6); margin: 0; }
.ntf-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px;
  text-decoration: none; color: var(--fg, #121212); border-bottom: 1px solid var(--line, #e8e8ec);
  transition: background .12s;
}
.ntf-item:last-child { border-bottom: 0; }
.ntf-item:hover { background: rgba(127,127,140,.07); }
.ntf-item.is-unread { background: rgba(79,110,247,.06); }
.ntf-item__emoji { font-size: 16px; line-height: 1.4; }
.ntf-item__body { flex: 1; min-width: 0; }
.ntf-item__text { display: block; font-size: 13px; line-height: 1.5; }
.ntf-item__meta { display: block; margin-top: 2px; font-size: 12px; color: var(--fg-muted, #8590a6); }

/* 移动端：面板收回屏幕内 */
@media (max-width: 640px) {
  .ntf-panel { position: fixed; right: 8px; left: 8px; top: 60px; width: auto; }
  .user-menu__panel { position: fixed; right: 8px; top: 60px; }
}

/* 文章附件卡片 */
.att-box .att-list { padding: 4px 20px 20px; display: grid; gap: 10px; }
.att-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line, #e8e8ec); border-radius: var(--r, 8px);
  transition: border-color .15s;
}
.att-item:hover { border-color: var(--link, #4f6ef7); }
.att-item__icon { flex-shrink: 0; display: inline-flex; }
.att-item__icon--file {
  width: 34px; height: 34px; border-radius: var(--r, 8px); display: grid; place-items: center;
  background: rgba(127,127,140,.12); color: var(--fg-muted, #8590a6);
}
.att-item__icon--file svg { width: 19px; height: 19px; }
.att-item__info { flex: 1; min-width: 0; }
.att-item__name { font-size: 14px; display: block; }
.att-item__meta { display: block; margin-top: 3px; font-size: 12px; color: var(--fg-muted, #8590a6); }
.att-item__code { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--fg-muted, #8590a6); }
.att-item__code b { color: var(--fg, #121212); letter-spacing: .04em; }
.att-item__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.att-item__price { font-weight: 700; color: var(--link, #4f6ef7); }

/* 网盘图标（彩色底 + 白色图形） */
.pan-ico {
  display: inline-grid; place-items: center; flex-shrink: 0;
  border-radius: 8px; vertical-align: middle; overflow: hidden;
}
.pan-ico svg { width: 68%; height: 68%; display: block; }

/* 下载页：网盘标识 */
.dl-pan-badge {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  font-size: 13px; font-weight: 600; color: var(--fg, #121212);
}
.dl-code {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted, #8590a6);
}
.dl-code b { color: var(--fg, #121212); letter-spacing: .05em; }
.dl-pan-tip {
  display: flex; align-items: center; gap: 6px; margin: 0 20px 18px;
  padding: 10px 12px; font-size: 12.5px; color: var(--fg-muted, #8590a6);
  background: rgba(127,127,140,.08); border-radius: var(--r, 8px); flex-wrap: wrap;
}

/* 编辑器：网盘标签与新增区 */
.langyu-pan-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.langyu-att-add { margin: 14px 0; padding-top: 12px; border-top: 1px solid #f0f0f1; }
.langyu-pan-add__row { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.langyu-pan-add__hint { margin: 0 0 8px; font-size: 12px; color: #646970; }

/* 下载页 */
.dl-head { display: flex; align-items: center; gap: 16px; padding: 22px 20px 16px; }
.dl-head__icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 64px; height: 64px; border-radius: var(--r-lg, 12px); color: #fff;
  background: linear-gradient(135deg, var(--link, #4f6ef7), #7b5bf7);
}
.dl-head__info { flex: 1; min-width: 0; }
.dl-head__meta { margin: 0; font-size: 13px; color: var(--fg-muted, #8590a6); }
.dl-head__price { text-align: right; flex-shrink: 0; }
.dl-head__price strong { font-size: 26px; color: var(--link, #4f6ef7); }
.dl-head__free { color: #2e9e5b !important; }
.dl-head__state { display: block; font-size: 12px; color: var(--fg-muted, #8590a6); }
.dl-actions { display: flex; gap: 10px; padding: 4px 20px 22px; flex-wrap: wrap; }
.pay-qr__title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

/* 编辑器附件 meta box 行距 */
#langyu-atts-table code { font-size: 12px; }

/* ============================================================
 *  站点 Logo + 分享弹窗
 * ============================================================ */

/* 顶栏图片 logo（后台「站点信息」配置） */
.logo-img { display: block; height: 34px; width: auto; max-width: 180px; object-fit: contain; }

/* ---------- 分享弹窗 ---------- */
.share-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.share-modal[hidden] { display: none; }
.share-modal__backdrop { position: absolute; inset: 0; background: rgba(16,18,22,.5); opacity: 0; transition: opacity .18s; }
.share-modal.is-open .share-modal__backdrop { opacity: 1; }
.share-modal__dialog {
  position: relative; width: min(430px, 100%); max-height: 90vh; overflow: auto;
  background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .18s, transform .18s;
}
.share-modal.is-open .share-modal__dialog { opacity: 1; transform: none; }
.share-modal__close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--grey-100, #f4f5f7); color: var(--fg-muted); cursor: pointer; display: grid; place-items: center;
}
.share-modal__close:hover { color: var(--fg); background: var(--grey-200, #ececec); }
.share-modal__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.share-modal__title { margin: 0 0 16px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.share-modal__body { display: flex; gap: 16px; align-items: flex-start; }

.share-qr { flex: 0 0 172px; text-align: center; }
.share-qr__box {
  width: 172px; height: 172px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; padding: 5px; margin-inline: auto;
}
.share-qr__box img, .share-qr__box canvas { display: block; }
.share-qr__fb { font-size: 12px; color: var(--fg-muted); }
.share-qr__hint { margin: 8px 0 0; font-size: 12px; color: var(--fg-muted); }
.share-qr.is-pulse { animation: sharePulse .6s var(--ease, ease); }
@keyframes sharePulse { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

.share-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 6px; }
.share-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 2px; border: 0; border-radius: var(--r); background: transparent;
  cursor: pointer; transition: background .12s;
}
.share-item:hover { background: rgba(127,127,140,.12); }
.share-item__icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 700; line-height: 1; background: var(--fg-muted);
}
.share-item__icon svg { width: 21px; height: 21px; fill: #fff; stroke: none; }
.share-item__label { font-size: 12px; color: var(--fg-muted); }
.share-item--weibo .share-item__icon { background: #e6162d; }
.share-item--qq .share-item__icon { background: #12b7f5; }
.share-item--qzone .share-item__icon { background: #ffb400; }
.share-item--twitter .share-item__icon { background: #111; }
.share-item--xiaohongshu .share-item__icon { background: #ff2442; }
.share-item--copy .share-item__icon { background: var(--fg-subtle); }

.share-link { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.share-link__input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--fg);
}
.share-modal__tip { margin: 8px 0 0; font-size: 12px; color: var(--fg-subtle); }

@media (max-width: 560px) {
  .share-modal__body { flex-direction: column; align-items: stretch; }
  .share-qr { flex: none; }
  .share-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .share-modal__dialog { padding: 18px 16px; }
}

/* ---------- 404 页面 ---------- */
.notfound { padding: 42px 24px 38px; text-align: center; }
.notfound__code {
  font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -.05em;
  color: var(--brand); opacity: .16;
}
.notfound__title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 8px; }
.notfound__desc { font-size: 14px; color: var(--fg-muted); max-width: 430px; margin: 0 auto 22px; line-height: 1.7; }
.notfound__search { display: flex; gap: 8px; max-width: 430px; margin: 0 auto 18px; }
.notfound__search .input { flex: 1; }
.notfound__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.notfound__list { list-style: none; margin: 0; padding: 4px 20px 14px; }
.notfound__list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14.5px;
}
.notfound__list li:last-child { border-bottom: 0; }
.notfound__list a { color: var(--fg); }
.notfound__list a:hover { color: var(--brand); }
.notfound__list span { font-size: 12.5px; color: var(--fg-subtle); white-space: nowrap; }

@media (max-width: 560px) {
  .notfound { padding: 32px 16px 30px; }
  .notfound__code { font-size: 54px; }
  .notfound__search { flex-direction: column; }
}

/* ---------- 搜索表单（searchform.php） ---------- */
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form__input { flex: 1; min-width: 0; }
.search-form__submit { flex: none; }
@media (max-width: 560px) {
  .search-form { flex-direction: column; align-items: stretch; }
}
