/* =========================================================
   分享社区 · 基础样式（便当格 Bento）
   其余 7 套风格在 themes.css 里通过覆盖下面这些变量实现
   ========================================================= */
:root {
  --bg: #f2f1ec;
  --bg-img: none;
  --surface: #ffffff;
  --surface-2: #f2f1ec;
  --ink: #121212;
  --muted: #55534c;
  --line: #e6e4dc;
  --hero: #121212;
  --hero-ink: #ffffff;
  --hero-muted: #c9c7bf;
  --hero-chip: #2a2a2a;
  --hl: #e4f78b;
  --hl-ink: #121212;
  --dark: #121212;
  --dark-ink: #ffffff;
  --dark-2: #232323;
  --accent: #6b4ef0;
  --accent-ink: #ffffff;
  --like: #ff5a5f;
  --like-ink: #ffffff;
  --danger: #b3261e;
  --t-lilac: #dcd6ff; --t-lime: #e4f78b; --t-peach: #ffd9c2; --t-sky: #c9ecff; --t-sun: #ffe58f;
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px; --r-pill: 999px;
  --bd: 0 solid transparent;
  --shadow: none;
  --shadow-pop: 0 18px 40px rgba(0, 0, 0, .16);
  --press: scale(.96);
  --lift: translateY(-2px);
  --font: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: var(--font);
  --font-editorial: "Bricolage Grotesque", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --title-weight: 800;
  --title-track: -0.02em;
  --gap: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-img);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--title-track); line-height: 1.25; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 17px; margin: 0 0 10px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--dark); color: var(--dark-ink); }
.skip:focus { top: 12px; }
.hp { position: absolute; left: -9999px; }
.muted { color: var(--muted); }
.muted-dark { color: color-mix(in srgb, var(--ink) 78%, transparent); }
.muted-light { color: var(--hero-muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ul { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.push { margin-left: auto; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.main { padding-top: 6px; padding-bottom: 56px; display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-start; }
.col-main { flex: 2 1 560px; min-width: 0; }
.col-side { flex: 1 1 300px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 860px; width: 100%; }
.narrow-form { max-width: 560px; }

/* ---------- 方块 ---------- */
.tile {
  background: var(--tint, var(--surface));
  border: var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.tile-dark { --tint: var(--dark); color: var(--dark-ink); }
.tile-lilac { --tint: var(--t-lilac); }
.tile-lime { --tint: var(--t-lime); }
.tile-peach { --tint: var(--t-peach); }
.tile-sky { --tint: var(--t-sky); }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tile-head h2, .tile-head h3 { margin: 0; }
.tile-head.bare { margin: 6px 6px 0; }
.hl-link { color: var(--hl); font-size: 13px; font-weight: 600; }
.tint { background: var(--tint); }

/* ---------- 顶栏 ---------- */
.topbar { position: relative; z-index: 30; }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 22px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--dark); color: var(--hl); display: grid; place-items: center; font-weight: 800; font-size: 19px; border: var(--bd); flex: none; }
.brand-logo { width: 42px; height: 42px; display: block; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; }
.mainnav { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: var(--bd); box-shadow: var(--shadow); }
.mainnav-a { padding: 7px 16px; border-radius: var(--r-pill); font-weight: 500; transition: background .2s; }
.mainnav-a:hover { background: var(--surface-2); }
.mainnav-a.is-active { background: var(--dark); color: var(--dark-ink); font-weight: 600; }
.search { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface); border: var(--bd); box-shadow: var(--shadow); color: var(--muted); min-width: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pill-btn { height: 46px; padding: 0 18px; border-radius: var(--r-pill); border: var(--bd); background: var(--surface); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.pill-btn.primary { background: var(--accent); color: var(--accent-ink); }
.theme-btn { padding-left: 8px; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: var(--bd); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.sound-btn[aria-pressed="true"] { background: var(--hl); color: var(--hl-ink); }
.sound-btn .mute { display: none; }
.sound-btn[aria-pressed="false"] .wave { display: none; }
.sound-btn[aria-pressed="false"] .mute { display: inline; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; }
.avatar-btn .avatar { width: 46px; height: 46px; font-size: 18px; }

.swatch { width: 30px; height: 30px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--c1) 50%, var(--c2) 50%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.swatch.big { width: 44px; height: 44px; }

.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-width: calc(100vw - 24px); padding: 14px; border-radius: 22px; background: var(--surface); color: var(--ink); border: var(--bd); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 10px; z-index: 50; animation: popIn .18s ease both; }
.me-pop { width: 230px; gap: 2px; }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px 6px; }
.pop-head span { font-size: 12.5px; color: var(--muted); }
.pop-note { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.theme-opt { display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; text-align: left; transition: transform .15s; }
.theme-opt .swatch { width: 26px; height: 26px; }
.theme-opt small { margin-left: auto; font-size: 11px; font-weight: 600; opacity: .7; }
.theme-opt.is-on { background: var(--hl); color: var(--hl-ink); }
.theme-opt:hover { transform: var(--lift); }
.menu-a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; font-weight: 500; }
.menu-a:hover { background: var(--surface-2); }
.pop form { margin: 0; }

/* ---------- 头像 / 小件 ---------- */
.avatar { --size: 40px; width: var(--size); height: var(--size); border-radius: calc(var(--size) * .3); background: var(--tint, #dcd6ff); color: #121212; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--size) * .42); flex: none; line-height: 1; }
.avatar.sm { --size: 30px; }
.avatar.lg { --size: 56px; }
.avatar.xl { --size: 108px; border-radius: 32px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.chip.tint, .chip-white { color: #121212; }
.chip.tint { background: var(--tint); }
.chip-dark { background: var(--dark); color: var(--dark-ink); }
.chip-hl { background: var(--hl); color: var(--hl-ink); }
.chip-white { background: rgba(255, 255, 255, .8); color: #121212; }
.chip-warn { background: #ffe1d6; color: #8a2a0b; }
.chip-hero { background: var(--hero-chip); color: var(--hero-muted); }
.chip.xs { padding: 0 8px; font-size: 11.5px; }
.tag { display: inline-flex; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; border: 0; color: var(--ink); }
.tag:hover { background: var(--hl); color: var(--hl-ink); }
.tag-white { background: rgba(255, 255, 255, .78); color: #121212; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hl); display: inline-block; flex: none; }

/* ---------- 按钮 ---------- */
.btn { min-height: 44px; padding: 0 18px; border: var(--bd); border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; white-space: nowrap; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background .2s, color .2s; }
.btn.big { min-height: 48px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn-dark { background: var(--dark); color: var(--dark-ink); }
.btn-white { background: var(--surface); color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-hl { background: var(--hl); color: var(--hl-ink); }
.btn-ghost { background: transparent; }
.btn.danger, .btn-ghost.danger { color: var(--danger); }
.btn:hover, .pill-btn:hover, .icon-btn:hover, .act:hover, .ctile:hover { transform: var(--lift); }
.btn:active, .pill-btn:active, .icon-btn:active, .act:active, .ctile:active, .theme-opt:active, .cp:active, .tag:active { transform: var(--press); }

.act { height: 38px; padding: 0 14px; border: var(--bd); border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background .2s; }
.act.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.act-round { width: 40px; padding: 0; justify-content: center; }
.like-btn.is-on { background: var(--like); color: var(--like-ink); }
.like-btn.is-on svg, .save-btn.is-on svg { fill: currentColor; }
.save-btn.is-on { background: var(--accent); color: var(--accent-ink); }
.follow-btn { background: var(--dark); color: var(--dark-ink); }
.follow-btn.is-on { background: var(--surface); color: var(--ink); }
.pop-anim svg { animation: boing .45s ease; }

/* ---------- Hero ---------- */
.hero { background: var(--hero); color: var(--hero-ink); padding: 34px 36px; display: flex; flex-direction: column; gap: 16px; min-height: 240px; justify-content: space-between; }
.hero .chip { align-self: flex-start; }
.hero .chip-hl { background: var(--hero-chip); color: var(--hl); }
.hero-title { margin: 0; font-size: clamp(32px, 5vw, 56px); line-height: 1.06; font-weight: var(--title-weight); letter-spacing: -.03em; }
.hero-title.sm { font-size: clamp(28px, 4vw, 40px); }
.hero-title .hl, .hl { color: var(--hl); }
.hero-sub { color: var(--hero-muted); max-width: 560px; }
.hero-notice { display: flex; align-items: center; gap: 10px; color: var(--hero-muted); font-size: 14px; }
.hero-slim { min-height: 0; }
.hero-search { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 8px 0 18px; border-radius: var(--r-md); background: var(--surface); color: var(--muted); border: var(--bd); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.hero-search .btn { min-height: 42px; }

.compose-quick { display: flex; flex-direction: column; }
.quick-input { display: block; padding: 16px; border-radius: var(--r-md); background: var(--surface); color: var(--muted); min-height: 86px; }
.quick-input:hover { color: var(--ink); }

/* ---------- 圈子方块 ---------- */
.ctiles { display: flex; flex-wrap: wrap; gap: var(--gap); }
.ctile { flex: 1 1 170px; min-width: 0; min-height: 124px; padding: 18px 20px; border: var(--bd); border-radius: 24px; background: var(--tint); color: #121212; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; text-align: left; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s; }
.ctile-top, .ctile-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.ctile-bot { align-items: flex-end; }
.ctile-name { font-size: 17px; font-weight: 800; }
.ctile-mark { width: 26px; height: 26px; border-radius: 50%; background: rgba(18, 18, 18, .08); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ctile-desc { font-size: 13px; opacity: .85; }
.ctile-n { font-family: var(--font-display); font-size: 38px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.ctile.is-on { background: var(--dark); color: var(--dark-ink); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.ctile.is-on .ctile-mark { background: var(--hl); color: var(--hl-ink); }

/* ---------- 分段 ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: var(--bd); box-shadow: var(--shadow); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.seg-a { height: 38px; padding: 0 18px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font-weight: 600; white-space: nowrap; }
.seg-a.is-on { background: var(--dark); color: var(--dark-ink); }
.seg-sm .seg-a { height: 34px; padding: 0 14px; }

/* ---------- 帖子卡片 ---------- */
.post-card { display: flex; flex-direction: column; gap: 12px; animation: tileIn .3s ease both; }
.post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.meta-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.post-main { display: flex; gap: 18px; align-items: flex-start; }
.post-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-title { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }
.post-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.post-excerpt { color: color-mix(in srgb, var(--ink) 80%, var(--surface)); }
.post-cover { flex: none; width: 168px; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-card .post-meta .chip.tint { color: #121212; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 40px 24px; color: var(--muted); }
.empty-line { padding: 12px 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 0; }

/* ---------- 侧栏 ---------- */
.mini-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-link { aspect-ratio: 1; border-radius: var(--r-md); background: var(--dark-2); color: var(--dark-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; font-weight: 600; transition: transform .2s; padding: 4px; text-align: center; }
.mini-link:hover { transform: var(--lift); }
.mini-ini { font-size: 22px; font-weight: 800; color: var(--hl); }
.mini-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 正文 ---------- */
.crumbs { display: flex; gap: 8px; padding: 0 6px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.article { padding: 34px 40px; display: flex; flex-direction: column; gap: 18px; background: var(--surface); }
.article-top { display: flex; gap: 8px; flex-wrap: wrap; }
.article-title { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.article-meta .push { display: inline-flex; align-items: center; gap: 4px; }
.article-meta b { color: var(--ink); }
.article-cover { margin: 0; border-radius: var(--r-md); overflow: hidden; }
.article-cover img { width: 100%; max-height: 520px; object-fit: cover; }
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); align-items: center; }
.owner-tools { display: flex; gap: 6px; }
.owner-tools form { margin: 0; }
.mod-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; color: var(--muted); margin: 0; }
.mod-bar .btn { min-height: 34px; }

.md { font-size: 16.5px; line-height: 1.85; display: flex; flex-direction: column; gap: 14px; }
.md-sm { font-size: 15px; line-height: 1.7; gap: 8px; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md h3, .md h4, .md h5 { margin: 0; }
.md ul, .md ol { padding-left: 1.4em; }
.md blockquote { padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: color-mix(in srgb, var(--ink) 80%, transparent); }
.md code { font-family: var(--font-mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.md pre { padding: 14px 16px; border-radius: var(--r-md); background: var(--dark); color: var(--dark-ink); overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; }
.md a { text-decoration: underline; text-underline-offset: 3px; color: var(--accent); }
.md h3 { font-size: 22px; } .md h4 { font-size: 19px; } .md h5 { font-size: 17px; }

.author-card { display: flex; flex-direction: column; gap: 14px; }
.author-top { display: flex; align-items: center; gap: 12px; }
.author-name { font-weight: 800; font-size: 18px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-stats div { padding: 10px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; color: var(--ink); }
.mini-stats b { font-size: 22px; font-weight: 800; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.related { display: block; padding: 12px 14px; border-radius: 16px; background: var(--surface); font-weight: 600; color: #121212; }
.related.tint { background: color-mix(in srgb, var(--tint) 55%, var(--surface)); }
.related:hover { text-decoration: underline; }

.comments { display: flex; flex-direction: column; gap: 16px; padding: 30px 36px; }
.reply-form { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.reply-box { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 20px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; border: var(--bd); }
.reply-box textarea { width: 100%; border: 0; outline: 0; resize: vertical; background: transparent; min-height: 52px; }
.reply-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.reply-to { align-self: flex-start; display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 12px; border-radius: var(--r-pill); background: var(--hl); color: var(--hl-ink); font-size: 13px; font-weight: 600; }
.reply-to[hidden] { display: none; }
.x { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--dark); color: var(--dark-ink); font-size: 12px; line-height: 1; }
.comment { display: flex; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.comment-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comment-head .muted { font-size: 12.5px; }
.comment-acts { display: flex; gap: 6px; align-items: center; }
.comment-acts form { margin: 0; }
.reply { display: flex; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); margin-top: 4px; }
.comment:target, .reply:target { animation: flashBg 1.6s ease; }

/* ---------- 表单 ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 0 6px; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 800; }
.page-head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert { padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: var(--bd); }
.alert-err { background: #ffe1d6; color: #8a2a0b; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .compose textarea, .settings textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: var(--bd); border-radius: 14px; background: var(--surface-2); outline: 0; color: var(--ink); }
.input:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
.title-input { border: 0; outline: 0; background: transparent; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); padding: 4px 0; width: 100%; }
.title-input:focus { outline: 0; }
.col-main:focus-within:has(.title-input) { outline: 3px solid var(--accent); outline-offset: 2px; }
.hint-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.cp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp { position: relative; min-height: 56px; padding: 10px 12px; border: 3px solid transparent; border-radius: var(--r-md); background: var(--tint); color: #121212; font-weight: 700; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.cp input { position: absolute; opacity: 0; pointer-events: none; }
.cp i { font-style: normal; opacity: 0; }
.cp:has(input:checked) { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.cp:has(input:checked) i { opacity: 1; }
.cp:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.toolbar button { min-width: 44px; height: 38px; padding: 0 12px; border: var(--bd); border-radius: var(--r-sm); background: var(--surface-2); font-weight: 700; transition: transform .2s; }
.toolbar button:active { transform: var(--press); }
.toolbar .muted { font-size: 12.5px; }
.editor textarea { min-height: 300px; resize: vertical; font-size: 16px; line-height: 1.8; background: transparent; border: 0; padding: 4px 0; }
.editor textarea:focus { outline: 0; }
.drop { position: relative; min-height: 130px; border: 2px dashed rgba(18, 18, 18, .35); border-radius: 20px; background: rgba(255, 255, 255, .45); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 12px; cursor: pointer; color: #121212; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.cover-thumb { border-radius: var(--r-md); max-height: 160px; object-fit: cover; width: 100%; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: var(--r-pill); background: var(--hl); color: var(--hl-ink); font-size: 13px; font-weight: 600; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { font-size: 12.5px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 52px; height: 30px; border-radius: var(--r-pill); background: #d6d4cc; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: left .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 25px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.preview { display: flex; flex-direction: column; gap: 10px; color: #121212; }
.pv-title { margin: 0; font-size: 26px; font-weight: 800; }
.color-pick, .theme-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.cpick, .tpick { position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cpick input, .tpick input { position: absolute; opacity: 0; }
.cpick .avatar { --size: 44px; transition: transform .2s; }
.cpick:has(input:checked) .avatar, .tpick:has(input:checked) .swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.cpick:has(input:focus-visible), .tpick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.tpick small { font-size: 11.5px; color: var(--muted); }
.theme-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 个人主页 ---------- */
.profile-hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; min-height: 0; }
.profile-hero .avatar.xl { color: #121212; }
.profile-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-self: stretch; }
.stat { display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; padding: 18px 20px; color: #121212; }
.stat span { font-size: 13px; font-weight: 600; }
.stat b { font-family: var(--font-display); font-size: 38px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.bento-grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.bento-post { flex: 1 1 260px; min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; color: #121212; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.bento-post.wide { flex: 2 1 420px; }
.bento-post:hover { transform: var(--lift); }
.bp-title { font-family: var(--font-display); font-size: 20px; line-height: 1.35; font-weight: 800; }
.bp-meta { font-size: 13px; color: #3d3b35; }
.bento-post .chip { align-self: flex-start; }
.reply-item { display: flex; flex-direction: column; gap: 6px; }
.reply-quote { font-size: 16px; }

/* ---------- 资源导航 ---------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.link-tile { min-height: 190px; display: flex; flex-direction: column; gap: 8px; color: #121212; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); animation: tileIn .3s ease both; }
.link-tile:hover { transform: var(--lift); }
.link-tile[hidden] { display: none; }
.lt-top { display: flex; justify-content: space-between; align-items: flex-start; }
.lt-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--dark); color: var(--tint); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.lt-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.lt-desc { color: #3d3b35; }
.lt-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lt-host { font-size: 12.5px; color: #3d3b35; }

/* ---------- 登录 ---------- */
.auth { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: stretch; }
.auth-hero { flex: 1 1 380px; min-height: 380px; }
.auth-form { flex: 1 1 360px; max-width: 520px; justify-content: center; padding: 32px; }
.auth-form h2 { font-size: 26px; margin-bottom: 4px; }

.not-found { align-items: flex-start; min-height: 420px; justify-content: center; }
.nf-num { font-family: var(--font-display); font-size: 120px; line-height: 1; font-weight: 800; color: var(--hl); letter-spacing: -.05em; }

/* ---------- 页脚 / Toast / 手机底栏 ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 18px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 90; transform: translate(-50%, 20px); padding: 12px 22px; border-radius: var(--r-pill); background: var(--dark); color: var(--dark-ink); border: var(--bd); font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.3, 1.4, .5, 1); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8a2a0b; color: #fff; }
.mtab { display: none; }

/* ---------- 通知 ---------- */
.bell-btn { position: relative; }
.bell-btn.ring svg { animation: ring .9s ease; transform-origin: 50% 10%; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--like); color: var(--like-ink); border: 2px solid var(--bg); font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; }
.notif-pop { width: 380px; gap: 6px; }
.link-btn { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.link-btn:hover { text-decoration: underline; }
.notif-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.notif-empty { padding: 18px 8px; text-align: center; }
.notif-all { justify-content: center; font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; }
.notif-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; color: var(--ink); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-unread { background: color-mix(in srgb, var(--hl) 35%, var(--surface)); }
.notif-item.is-unread:hover { background: color-mix(in srgb, var(--hl) 55%, var(--surface)); }
.ava-stack { display: flex; flex: none; padding-top: 2px; }
.ava-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.ava-stack .avatar + .avatar { margin-left: -10px; }
.avatar.sys { background: var(--dark); color: var(--hl); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-text { font-weight: 600; line-height: 1.45; }
.notif-quote { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--muted); font-size: 12.5px; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--like); flex: none; margin-top: 8px; }
.notif-page { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.notif-page .notif-item { padding: 14px 16px; }
.plain-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.mtab-a { position: relative; }
.mtab-dot { position: absolute; top: 6px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--like); box-shadow: 0 0 0 2px var(--dark); }
@keyframes ring { 0% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0); } }

/* ---------- @提及 ---------- */
.md a.mention, a.mention { color: var(--accent); font-weight: 700; text-decoration: none; background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 0 4px; border-radius: 6px; }
.md a.mention:hover { text-decoration: underline; }
.mention-pop { position: absolute; z-index: 60; min-width: 220px; max-width: 300px; padding: 6px; border-radius: 16px; background: var(--surface); color: var(--ink); border: var(--bd); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 2px; animation: popIn .15s ease both; }
.mention-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; font: inherit; }
.mention-opt.is-on, .mention-opt:hover { background: var(--hl); color: var(--hl-ink); }
.mo-name { font-weight: 700; }
.mo-user { margin-left: auto; font-size: 12.5px; opacity: .7; }
.notif-prefs { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }

/* ---------- 私信 ---------- */
.dm-btn { position: relative; }
.dm-btn.is-active { background: var(--hl); color: var(--hl-ink); }
.badge.static { position: static; border: 0; flex: none; }
.dm { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: var(--gap); height: calc(100dvh - 150px); min-height: 520px; }
.dm-list { padding: 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.dm-list-head { padding: 6px 10px 10px; }
.dm-list-head h1 { margin: 0; font-size: 26px; font-family: var(--font-display); letter-spacing: var(--title-track); }
.dm-conv { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; color: var(--ink); }
.dm-conv:hover { background: var(--surface-2); }
.dm-conv.is-on { background: var(--hl); color: var(--hl-ink); }
.dm-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-conv-top { display: flex; align-items: baseline; gap: 8px; }
.dm-conv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-conv-top time { margin-left: auto; font-size: 12px; opacity: .65; flex: none; }
.dm-conv-prev { font-size: 13.5px; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-conv.is-unread .dm-conv-prev { opacity: 1; font-weight: 600; }
.dm-thread { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.dm-placeholder { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px; }
.dm-placeholder h2 { margin: 0; }
.dm-ph-icon { width: 76px; height: 76px; border-radius: 26px; background: var(--hl); color: var(--hl-ink); display: grid; place-items: center; }
.dm-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dm-head .icon-btn { width: 40px; height: 40px; font-size: 20px; font-weight: 800; }
.dm-back { display: none !important; }
.dm-who { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.dm-who span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dm-who small { color: var(--muted); font-size: 12.5px; }
.dm-menu { right: 0; left: auto; width: 200px; }
.menu-a.danger { color: var(--danger); }
.dm-scroll { flex: 1; overflow-y: auto; padding: 18px 18px 8px; overscroll-behavior: contain; }
.dm-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dm-hello { text-align: center; padding: 30px 0; }
.dm-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: min(78%, 560px); }
.dm-msg.mine { align-self: flex-end; align-items: flex-end; }
.dm-bubble { padding: 10px 14px; border-radius: 6px 20px 20px 20px; background: var(--surface-2); color: var(--ink); font-size: 15px; line-height: 1.6; gap: 8px; overflow-wrap: anywhere; }
.dm-msg.mine .dm-bubble { border-radius: 20px 6px 20px 20px; background: var(--dark); color: var(--dark-ink); }
.dm-msg.mine .dm-bubble a { color: inherit; text-decoration: underline; }
.dm-msg.is-new { animation: popIn .2s ease both; }
.dm-msg.is-sending { opacity: .55; }
.dm-bubble .md-img { max-height: 260px; }
.dm-meta { font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.dm-read[data-read="1"] { color: var(--accent); font-weight: 600; }
.dm-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.dm-compose .icon-btn { width: 44px; height: 44px; }
.dm-input { flex: 1; resize: none; min-height: 44px; max-height: 160px; padding-top: 10px; padding-bottom: 10px; line-height: 1.5; }
.dm-send { height: 44px; gap: 6px; }
.dm-typing { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dm-typing .dots { display: inline-flex; gap: 3px; padding: 8px 10px; border-radius: 6px 14px 14px 14px; background: var(--surface-2); }
.dm-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dmDot 1.2s infinite ease-in-out; }
.dm-typing .dots i:nth-child(2) { animation-delay: .15s; }
.dm-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dmDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }
.dm-locked { padding: 16px 18px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

/* ---------- 正文图片 / 上传 / 灯箱 ---------- */
.md-img { display: block; max-width: 100%; max-height: 560px; height: auto; border-radius: var(--r-md); cursor: zoom-in; background: var(--surface-2); }
.md p > .md-img + .md-img { margin-top: 8px; }
[data-upload].is-drop { outline: 3px dashed var(--accent); outline-offset: 2px; }
.upload-hint { font-size: 12.5px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 10, .86); cursor: zoom-out; animation: popIn .15s ease both; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox-x { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; }

/* ---------- 设置：邮箱 / 私信 ---------- */
.alert-ok { background: color-mix(in srgb, var(--hl) 55%, var(--surface)); color: var(--hl-ink); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.radio-row:has(input:checked) { background: var(--hl); color: var(--hl-ink); }
.radio-row input { accent-color: var(--dark); width: 18px; height: 18px; margin: 0; }
.forgot-link { align-self: flex-end; margin-top: -4px; }

/* ---------- 动画 ---------- */
@keyframes tileIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes boing { 0% { transform: scale(1); } 30% { transform: scale(1.4) rotate(-10deg); } 60% { transform: scale(.9) rotate(6deg); } 100% { transform: scale(1); } }
@keyframes flashBg { 0%, 40% { box-shadow: 0 0 0 4px var(--hl); } 100% { box-shadow: 0 0 0 0 transparent; } }

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

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .mainnav { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topbar-in { padding-top: 14px; gap: 8px; }
  .search { order: 5; flex-basis: 100%; height: 44px; }
  .hide-sm { display: none !important; }
  .brand-name { font-size: 20px; }
  .tile { padding: 18px; border-radius: calc(var(--r-lg) * .85); }
  .hero, .article, .comments { padding: 22px 20px; }
  .hero { min-height: 0; }
  .ctiles { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; }
  .ctiles::-webkit-scrollbar { display: none; }
  .ctile { flex: 0 0 148px; min-height: 104px; padding: 14px; scroll-snap-align: start; }
  .ctile-n { font-size: 30px; }
  .ctile-desc { display: none; }
  .post-main { flex-direction: column-reverse; }
  .post-cover { width: 100%; aspect-ratio: 16 / 9; }
  .post-title { font-size: 19px; }
  .main { padding-bottom: 110px; }
  .footer { padding-bottom: 110px; }
  .mtab { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; height: 66px; padding: 0 6px; border-radius: 24px; background: var(--dark); color: var(--dark-ink); border: var(--bd); align-items: center; justify-content: space-around; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
  .mtab-a { min-width: 56px; height: 52px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--dark-ink) 70%, transparent); }
  .mtab-a.is-active { background: var(--hl); color: var(--hl-ink); }
  .mtab-new { width: 52px; height: 52px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
  .toast { bottom: 96px; }
  .theme-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .comments .reply-form > .avatar { display: none; }
  .comment .avatar { --size: 32px; }
  .reply { padding: 10px; }
  .page-head h1 { font-size: 28px; }
  .stat b { font-size: 30px; }
  .auth-hero { min-height: 0; }
  .pop { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
  .dm { display: block; height: calc(100dvh - 200px); min-height: 420px; }
  .dm-list, .dm-thread { height: 100%; }
  .dm.has-thread .dm-list, .dm:not(.has-thread) .dm-thread { display: none; }
  .dm-back { display: grid !important; }
  .dm-msg { max-width: 86%; }
  .dm-scroll { padding: 14px 12px 8px; }
  .dm-compose { padding: 10px; }
}
.icon-btn.sm { width: 38px; height: 38px; }
.reply-foot .icon-btn.sm + .btn { margin-left: 0; }
.toolbar button { display: inline-flex; align-items: center; gap: 4px; }
