/*
 * Qiqi Blog 全站样式。所有页面共用这一份，页面模板只使用这里定义的类名和令牌。
 * 设计稿 docs/design/qiqi-blog-design.html 直接引用这份样式；新增页面或状态时在设计稿里补上对应的示例。
 *
 * 布局：PC 端左侧固定窄栏（站名 + 胶囊导航）+ 右侧内容栏，内容全部是胖圆角卡片；
 *       手机端窄栏收成顶部一行，瞬间发布入口变成右下角按钮 + 全屏编辑页。
 * 颜色：暖色糖果色。橙、黄、粉、蜜桃四种颜色在卡片之间轮换；
 *       文章正文是一张白色大纸，保持安静，只有标题区和链接带颜色。
 *       葡萄紫只表示“仅自己可见”，黄色提示条只表示“暂停写入”，红色只表示失败与删除。
 *       文字色（--ink-3、--accent-text 和各种提示色）在两套主题里它会出现的每种底色上对比度都不低于 4.5:1，调色时保持。
 * 字体：不加载网络字体，全部用系统字体；标题用最粗字重撑起分量。
 * 动效：卡片悬停上浮、按钮按下回弹、页面进入上滑，都在 0.35 秒以内。
 */
:root {
  --bg: #FFF7EE;
  --surface: #FFFFFF;
  --ink: #2B1B24;
  --ink-2: #5E4A52;
  --ink-3: #74626A;
  --line: #F1E2D6;
  --accent: #FF7A2F;
  --accent-deep: #D95A12;
  --accent-text: #B0400A;
  --accent-soft: #FFE8D4;
  --on-accent: #2B1B24;

  /* 糖果色：pop 是鲜艳本色（两套主题相同），tint 是卡片底色 */
  --pop-1: #FF8A3D; --pop-2: #FFCB3D; --pop-3: #FF7096; --pop-4: #FF9E80;
  --on-pop: #2B1B24;
  --tint-1: #FFE8D4; --tint-2: #FFF2C2; --tint-3: #FFDFE6; --tint-4: #FFE4DA;

  --private: #6B3FC9;
  --private-soft: #ECE3FF;
  --warn: #7A5200;
  --warn-soft: #FFEFB8;
  --danger: #C41E3A;
  --danger-soft: #FFE0E5;
  --ok: #157A52;
  --ok-soft: #D5F5E6;
  --code-bg: #FBEFE4;
  --shadow: 0 10px 28px rgb(140 70 20 / .12);

  --font-text: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, "Courier New", monospace;

  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --fs-2xl: 34px;

  --rail: 190px;
  --measure: 720px;
  --r-card: 26px;
  --r-ctl: 16px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1418; --surface: #2A1D22; --ink: #FFF1E6; --ink-2: #D6C2C4; --ink-3: #B3A0A4;
    --line: #3D2B31; --accent: #FF8A4C; --accent-deep: #C9561A; --accent-text: #FFA574; --accent-soft: #43281B; --on-accent: #24161C;
    --tint-1: #3F281B; --tint-2: #3D3415; --tint-3: #43222D; --tint-4: #40271F;
    --private: #C4A8FF; --private-soft: #33264F; --warn: #FFD666; --warn-soft: #3F3312;
    --danger: #FF8FA3; --danger-soft: #47202A; --ok: #6FDDAA; --ok-soft: #17382A;
    --code-bg: #35252A; --shadow: 0 10px 28px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1418; --surface: #2A1D22; --ink: #FFF1E6; --ink-2: #D6C2C4; --ink-3: #B3A0A4;
  --line: #3D2B31; --accent: #FF8A4C; --accent-deep: #C9561A; --accent-text: #FFA574; --accent-soft: #43281B; --on-accent: #24161C;
  --tint-1: #3F281B; --tint-2: #3D3415; --tint-3: #43222D; --tint-4: #40271F;
  --private: #C4A8FF; --private-soft: #33264F; --warn: #FFD666; --warn-soft: #3F3312;
  --danger: #FF8FA3; --danger-soft: #47202A; --ok: #6FDDAA; --ok-soft: #17382A;
  --code-bg: #35252A; --shadow: 0 10px 28px rgb(0 0 0 / .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-base)/1.7 var(--font-text);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 整体骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 56px;
  max-width: 1060px;
  margin: 0 auto;
  padding-inline: 32px;
  padding-block: 48px 96px;
}
.rail { position: sticky; top: 48px; align-self: start; display: flex; flex-direction: column; gap: 28px; }
.wordmark { display: inline-block; font: 900 34px/1.1 var(--font-display); letter-spacing: -0.02em; transition: transform .3s var(--spring); }
.wordmark:hover { transform: rotate(-4deg) scale(1.05); }
.wordmark i { display: inline-block; width: .34em; height: .34em; margin-left: .06em; border-radius: 50%; background: var(--pop-3); box-shadow: .22em -.5em 0 -.04em var(--pop-2); font-size: inherit; color: transparent; overflow: hidden; }
.tagline { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 99px;
  color: var(--ink-2); font-weight: 600;
  transition: background .2s, transform .25s var(--spring);
}
.nav a:hover { background: var(--tint-2); color: var(--ink); transform: translateX(3px); }
.nav a[aria-current="page"] { background: var(--pop-2); color: var(--on-pop); }
.nav .sep { align-self: stretch; height: 2px; border-radius: 2px; background: var(--line); margin: 8px 0; }
/* “更多”只在手机顶栏出现，样式见手机端一节 */
.nav-more { display: none; }
.rail-foot { font-size: var(--fs-xs); color: var(--ink-3); }
main { min-width: 0; max-width: var(--measure); }

main > section { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

body[data-role="guest"] .admin-only { display: none !important; }
body[data-role="admin"] .guest-only { display: none !important; }

/* ---------- 通用部件 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font: 900 var(--fs-2xl)/1.25 var(--font-display); letter-spacing: -0.01em; }
.page-head .count { padding: 4px 14px; border-radius: 99px; background: var(--tint-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 18px;
  border: 2px solid var(--line); border-radius: 99px;
  background: var(--surface); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--spring), border-color .2s, box-shadow .15s;
}
.btn:hover { border-color: var(--pop-1); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; box-shadow: 0 4px 0 var(--accent-deep); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-deep); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.link-btn:hover { color: var(--accent-text); }
.link-btn.danger:hover { color: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 99px;
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.7; white-space: nowrap;
  background: var(--code-bg); color: var(--ink-2);
}
.pill.private { background: var(--private-soft); color: var(--private); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
/* 项目状态：进行中绿、已完成主色橙、已停止灰。紫、黄、红另有含义，不挪用 */
.pill.status-active { background: var(--ok-soft); color: var(--ok); }
.pill.status-done { background: var(--accent-soft); color: var(--accent-text); }
.pill.status-stopped { background: var(--code-bg); color: var(--ink-3); }
/* 后台列表里的“上首页” */
.pill.featured { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 18px; border-radius: 20px;
  font-size: var(--fs-sm); line-height: 1.6;
  background: var(--code-bg); color: var(--ink-2);
}
.notice .icon { margin-top: 3px; font-size: 17px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice b { font-weight: 700; }
.pause-banner { display: none; margin-bottom: 16px; }
body[data-paused="true"] .pause-banner { display: flex; }

.more { display: flex; justify-content: center; margin-top: 28px; }

/* 只给读屏软件读的文字，例如首页推荐格缩略图上锁形图标的说明 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.empty { padding: 48px 24px; text-align: center; color: var(--ink-3); background: var(--tint-2); border-radius: var(--r-card); }
.empty h2 { margin: 0 0 6px; font: 800 var(--fs-lg) var(--font-display); color: var(--ink); }
.empty p { margin: 0 auto; max-width: 30em; font-size: var(--fs-sm); color: var(--ink-2); }
.empty .btn { margin-top: 18px; }
code, .cmd { font-family: var(--font-mono); font-size: .9em; background: var(--code-bg); padding: 2px 7px; border-radius: 8px; }
.empty code, .notice code { background: var(--surface); }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); translate: -50% 0;
  padding: 12px 22px; border-radius: 99px; z-index: 50;
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 700;
  animation: pop .35s var(--spring);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.9); } }

/* ---------- 首页招牌（自我介绍格）与 /posts 文章卡片 ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin-bottom: 32px; padding: 36px 36px 32px;
  border-radius: 36px; background: var(--pop-1); color: var(--on-pop);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.hero::before { width: 220px; height: 220px; right: -50px; top: -70px; background: var(--pop-2); }
.hero::after { width: 130px; height: 130px; right: 90px; bottom: -60px; background: var(--pop-3); }
.hero-kicker { display: inline-block; max-width: 100%; overflow-wrap: anywhere; margin: 0 0 14px; padding: 3px 14px; border-radius: 99px; background: var(--on-pop); color: var(--pop-2); font-size: var(--fs-sm); font-weight: 700; }
.hero h1 { margin: 0; font: 900 clamp(28px, 4.6vw, 44px)/1.3 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.hero-description { max-width: 42em; margin: 16px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hero-stats { margin: 18px 0 0; font-size: var(--fs-sm); font-weight: 600; }
/* 自我介绍的头像和小标语排成一行。没有头像时是站名首字的糖果色圆块 */
.hero-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero-id .hero-kicker { margin: 0; }
.hero-avatar {
  display: block; flex: none; width: 64px; height: 64px;
  border: 3px solid var(--on-pop); border-radius: 50%; object-fit: cover;
}
span.hero-avatar { display: grid; place-items: center; background: var(--pop-3); font: 900 28px/1 var(--font-display); }
/* 最后一行：社交链接和“关于我”，放不下时换行 */
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hero-links a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--on-pop); color: var(--pop-2); font-size: 20px;
  transition: transform .25s var(--spring);
}
.hero-links a:hover { transform: translateY(-3px) rotate(-6deg); }
/* 招牌是橙色底，默认的橙色焦点框看不见，换成深色 */
.hero-links a:focus-visible { outline-color: var(--on-pop); }
/* “关于我”：和小标语同一套深底胶囊，带箭头表示可以点进去 */
.hero-about {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 16px;
  border-radius: 99px; background: var(--on-pop); color: var(--pop-2);
  font-size: var(--fs-sm); font-weight: 700;
  transition: transform .25s var(--spring);
}
.hero-about:hover { transform: translateX(3px); }
@media (max-width: 860px) {
  .hero-id { margin-bottom: 14px; }
  .hero-avatar { width: 56px; height: 56px; }
  span.hero-avatar { font-size: 24px; }
  .hero-foot { margin-top: 14px; }
}

.year {
  display: inline-block; margin: 36px 0 14px; padding: 3px 16px;
  border-radius: 99px; background: var(--ink); color: var(--bg);
  font: 800 var(--fs-sm) var(--font-mono); letter-spacing: .06em; rotate: -2deg;
}
.year:first-of-type { margin-top: 0; }
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.post-row {
  position: relative; padding: 22px 26px 24px;
  border-radius: var(--r-card); background: var(--tint-1);
  transition: transform .3s var(--spring), box-shadow .3s;
}
.post-row:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow); }
.post-row a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-row time {
  display: inline-block; margin-bottom: 10px; padding: 2px 12px; border-radius: 99px;
  background: var(--pop-1); color: var(--on-pop);
  font: 700 var(--fs-xs)/1.8 var(--font-mono); font-variant-numeric: tabular-nums;
}
.post-row:nth-child(4n+2) { background: var(--tint-2); } .post-row:nth-child(4n+2) time { background: var(--pop-2); }
.post-row:nth-child(4n+3) { background: var(--tint-3); } .post-row:nth-child(4n+3) time { background: var(--pop-3); }
.post-row:nth-child(4n+4) { background: var(--tint-4); } .post-row:nth-child(4n+4) time { background: var(--pop-4); }
.post-row h2 { margin: 0; font: 800 var(--fs-lg)/1.4 var(--font-display); text-wrap: balance; }
.post-row p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.7; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.tags span { padding: 1px 10px; border-radius: 99px; background: var(--surface); }
.tags span::before { content: "#"; opacity: .5; }
.post-row .pill { margin-left: 8px; vertical-align: 3px; }

/* ---------- 首页：便当盒 ---------- */
/* 主栏是自我介绍和最近文章，右栏是一竖排窄格。没有内容的格子模板不输出：
   右栏缺格时剩下的格子往下拉长（flex: 1），右栏整栏缺席时只剩一列，主栏横向撑满。 */
main:has(> .bento) { max-width: none; }
.bento { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.bento:has(> .bento-side) { grid-template-columns: minmax(0, 1fr) 260px; }
.bento-main, .bento-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bento .hero { margin-bottom: 0; }
.bento .hero h1 { font-size: clamp(28px, 3.4vw, 38px); }
.tile { display: flex; flex-direction: column; padding: 24px 26px 26px; border-radius: var(--r-card); }
.tile-label { margin: 0 0 14px; font: 800 var(--fs-xs)/1.6 var(--font-text); letter-spacing: .12em; color: var(--ink-3); }
.tile-more {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  margin-top: auto; padding-top: 16px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text);
  transition: transform .25s var(--spring);
}
.tile-more:hover { transform: translateX(3px); }

/* 最近文章：和文章页一样是白纸，第一篇带摘要，其余每篇一行 */
.tile-posts { flex: 1; background: var(--surface); }
.tile-posts .lead { display: block; padding-bottom: 18px; }
.tile-posts .lead time {
  display: inline-block; padding: 2px 12px; border-radius: 99px;
  background: var(--pop-1); color: var(--on-pop);
  font: 700 var(--fs-xs)/1.8 var(--font-mono); font-variant-numeric: tabular-nums;
}
.tile-posts .lead h3 { margin: 10px 0 0; font: 800 var(--fs-xl)/1.35 var(--font-display); text-wrap: balance; overflow-wrap: anywhere; transition: color .2s; }
.tile-posts .lead:hover h3 { color: var(--accent-text); }
.tile-posts .lead p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }
.tile-posts .pill { margin-left: 8px; vertical-align: 3px; }
.recent { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.recent a { display: flex; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: 2px solid var(--line); }
.recent li:last-child a { border-bottom: 0; }
.recent time { flex: none; font: 600 var(--fs-xs)/1.8 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.recent span:not(.pill) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; transition: color .2s; }
.recent a:hover span:not(.pill) { color: var(--accent-text); }
.recent .pill { flex: none; margin-left: 0; vertical-align: 0; }
.tile-posts .empty { padding: 32px 16px; }

/* 最新瞬间：整格可点；有图时图片吃掉格子里多出来的高度 */
.tile-moment { flex: 1; gap: 12px; background: var(--tint-3); transition: transform .3s var(--spring), box-shadow .3s; }
.tile-moment:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-moment .tile-label { margin: 0; }
.tile-photo { position: relative; flex: 1 1 auto; min-height: 150px; border-radius: 18px; overflow: hidden; background: var(--surface); }
.tile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-moment p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tile-moment .tile-photo ~ p { -webkit-line-clamp: 3; }
/* 没有图时文字就是这一格的主角，放大成引语 */
.tile-moment .tile-label + p { -webkit-line-clamp: 9; font: 700 var(--fs-lg)/1.6 var(--font-display); }
.tile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: auto; font: 600 var(--fs-xs)/1.8 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* 我的项目：名称、状态、一句话介绍。右栏只剩这一格时它往下拉长，“全部项目”沉到底部 */
.bento-side > :only-child { flex: 1; }
.tile-project { gap: 8px; background: var(--tint-2); transition: transform .3s var(--spring), box-shadow .3s; }
.tile-project:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-project .tile-label { margin: 0 0 2px; }
.tile-project h3 { margin: 0; font: 800 var(--fs-lg)/1.35 var(--font-display); overflow-wrap: anywhere; }
.tile-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tile-project p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.tile-project .tile-more { padding-top: 8px; }
/* 我的推荐：一排 3 个方形缩略图，没有图时是名称首字的糖果色块；仅自己可见的右上角挂紫色小锁 */
.tile-picks { gap: 12px; background: var(--tint-1); transition: transform .3s var(--spring), box-shadow .3s; }
.tile-picks:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-picks .tile-label { margin: 0; }
.tile-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tile-thumbs li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  border-radius: 14px; background: var(--pop-1); color: var(--on-pop); font: 900 24px/1 var(--font-display);
}
.tile-thumbs li:nth-child(2) .thumb { background: var(--pop-2); }
.tile-thumbs li:nth-child(3) .thumb { background: var(--pop-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-private {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--private-soft); color: var(--private); font-size: 13px;
}
.thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.tile-picks .tile-more { padding-top: 4px; }
/* 站长才看得到的占位格：还没有内容时提示去后台添加 */
.tile-placeholder {
  align-items: center; justify-content: center; min-height: 120px;
  border: 2px dashed var(--line); background: transparent;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); text-align: center;
  transition: border-color .2s, color .2s;
}
.tile-placeholder:hover { border-color: var(--pop-1); color: var(--accent-text); }

/* ---------- 项目页 ---------- */
/* 两列卡片，封面比文字两边各宽出一点；没有封面时是名称首字的糖果色块，按卡片顺序轮换颜色 */
.page-lede { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 24px 24px; border-radius: var(--r-card); background: var(--surface); }
.project-cover {
  display: grid; place-items: center; aspect-ratio: 16 / 9; margin: 0 -10px 6px; overflow: hidden;
  border-radius: 18px; background: var(--pop-1); color: var(--on-pop); font: 900 56px/1 var(--font-display);
}
.project-card:nth-child(4n+2) .project-cover { background: var(--pop-2); }
.project-card:nth-child(4n+3) .project-cover { background: var(--pop-3); }
.project-card:nth-child(4n+4) .project-cover { background: var(--pop-4); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.project-title h2 { margin: 0; font: 800 var(--fs-lg)/1.35 var(--font-display); overflow-wrap: anywhere; }
.project-card > p { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.project-tech { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.project-tech li { padding: 1px 10px; border-radius: 99px; background: var(--code-bg); font: 600 var(--fs-xs)/1.8 var(--font-mono); color: var(--ink-2); }
/* 链接行沉到卡片底部，同一行两张卡片的链接对齐 */
.project-card > .project-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: auto; padding-top: 4px; }
.project-links a { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); transition: transform .25s var(--spring); }
.project-links a:hover { transform: translateY(-2px); }
.project-edit { position: absolute; top: 24px; right: 24px; min-height: 34px; padding: 0 14px; }
@media (max-width: 860px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card { padding: 12px 20px 22px; }
  .project-edit { top: 20px; right: 20px; }
  .tile-project:hover { transform: none; box-shadow: none; }
}

/* ---------- 推荐页 ---------- */
/* 顶部一排分类胶囊是页内锚点；每段的排法由分类样式决定：竖封面 2:3、方图 1:1，图标链接是左图右文的白卡片。
   没有图时是名称首字的糖果色块，按卡片顺序轮换颜色。推荐语不截断，一两句话要让人读完 */
.pick-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-nav a { padding: 6px 16px; border-radius: 99px; background: var(--surface); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); transition: transform .2s var(--spring), color .2s; }
.pick-nav a:hover { color: var(--accent-text); transform: translateY(-2px); }
.pick-section { margin-top: 32px; scroll-margin-top: 24px; }
.pick-section-title { margin: 0 0 14px; font: 800 var(--fs-lg) var(--font-display); }
.pick-grid { display: grid; align-items: start; gap: 22px 14px; }
.pick-grid.style-cover { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pick-grid.style-square { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pick-grid.style-icon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pick-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pick-cover {
  display: grid; place-items: center; overflow: hidden;
  border-radius: 16px; background: var(--pop-1); color: var(--on-pop); font: 900 40px/1 var(--font-display);
  transition: transform .3s var(--spring), box-shadow .3s;
}
.pick-card:nth-child(4n+2) .pick-cover { background: var(--pop-2); }
.pick-card:nth-child(4n+3) .pick-cover { background: var(--pop-3); }
.pick-card:nth-child(4n+4) .pick-cover { background: var(--pop-4); }
.pick-cover img { width: 100%; height: 100%; object-fit: cover; }
.style-cover .pick-cover { aspect-ratio: 2 / 3; }
.style-square .pick-cover { aspect-ratio: 1; }
a.pick-main:hover .pick-cover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-name { font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; transition: color .2s; }
a.pick-main:hover .pick-name { color: var(--accent-text); }
.pick-out { margin-left: 3px; font-size: .85em; color: var(--ink-3); }
.pick-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--fs-xs)/1.6 var(--font-mono); color: var(--ink-3); }
.pick-blurb { font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.pick-text .pill { align-self: flex-start; margin-top: 4px; }
.pick-review { align-self: flex-start; font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); transition: transform .25s var(--spring); }
.pick-review:hover { transform: translateX(3px); }
.pick-edit { position: absolute; top: 8px; right: 8px; min-height: 30px; padding: 0 12px; font-size: var(--fs-xs); }
/* 图标链接：小图标固定 48px，“读我的长评”和右侧文字对齐；站长看到的“编辑”占住右上角，文字给它让位 */
.style-icon .pick-card { padding: 16px 18px; border-radius: 22px; background: var(--surface); transition: transform .3s var(--spring), box-shadow .3s; }
.style-icon .pick-card:has(> a.pick-main):hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.style-icon .pick-card:has(> .pick-edit) { padding-right: 84px; }
.style-icon .pick-main { flex-direction: row; align-items: flex-start; gap: 14px; }
.style-icon .pick-cover { flex: none; width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
.style-icon a.pick-main:hover .pick-cover { transform: none; box-shadow: none; }
.style-icon .pick-review { margin-left: 62px; }
.style-icon .pick-edit { top: 14px; right: 14px; }
@media (max-width: 860px) {
  .pick-grid.style-cover { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pick-grid.style-square { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-grid.style-icon { grid-template-columns: minmax(0, 1fr); }
  .pick-cover { font-size: 32px; }
  /* 手机顶栏常驻（约 56px），跳到分段时标题要露在它下面 */
  .pick-section { scroll-margin-top: 76px; }
  a.pick-main:hover .pick-cover, .style-icon .pick-card:has(> a.pick-main):hover, .tile-picks:hover { transform: none; box-shadow: none; }
}

/* ---------- 文章详情：一张安静的白纸 ---------- */
.back {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; padding: 5px 14px 5px 8px;
  border-radius: 99px; background: var(--tint-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  transition: transform .25s var(--spring);
}
.back:hover { transform: translateX(-3px); color: var(--ink); }
.article-sheet { padding: 44px 44px 36px; border-radius: 36px; background: var(--surface); }
.article-head h1 { margin: 0; font: 900 var(--fs-2xl)/1.3 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
.article-head h1::before { content: ""; display: block; width: 56px; height: 10px; margin-bottom: 20px; border-radius: 99px; background: var(--pop-1); box-shadow: 66px 0 0 -1px var(--pop-2), 86px 0 0 -1px var(--pop-3); clip-path: inset(0 -100px 0 0 round 0); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 16px; font-size: var(--fs-sm); color: var(--ink-3); }
.article-meta .tags span { background: var(--code-bg); }
.owner-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 24px; padding: 10px 10px 10px 18px;
  border-radius: 20px; background: var(--tint-2);
  font-size: var(--fs-sm); color: var(--ink-2);
}
.owner-bar .actions { display: flex; gap: 8px; }
.prose { margin-top: 36px; font-size: 17px; line-height: 1.9; overflow-wrap: break-word; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2.2em; font: 800 var(--fs-xl)/1.4 var(--font-display); }
.prose h3 { margin-top: 1.8em; font: 800 var(--fs-lg)/1.5 var(--font-display); }
.prose a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--pop-2); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.prose a:hover { text-decoration-color: var(--pop-1); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .3em; }
.prose li::marker { color: var(--accent-text); font-weight: 700; }
.prose blockquote { padding: 14px 20px; border-radius: 20px; background: var(--tint-2); color: var(--ink-2); font-weight: 600; }
.prose .tasks { list-style: none; padding-left: 0; }
.prose .tasks li { display: flex; gap: 10px; align-items: baseline; }
.prose .tasks input { accent-color: var(--accent); width: 16px; height: 16px; translate: 0 3px; }
.prose pre {
  position: relative; overflow-x: auto;
  padding: 18px 20px; border-radius: 20px;
  background: var(--code-bg); font: 14px/1.7 var(--font-mono);
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose pre .lang { position: absolute; top: 10px; right: 14px; padding: 0 10px; border-radius: 99px; background: var(--surface); font-size: var(--fs-xs); color: var(--ink-3); }
.tok-k { color: var(--accent-text); font-weight: 600; } .tok-s { color: var(--ok); } .tok-c { color: var(--ink-3); font-style: italic; }
.table-wrap { overflow-x: auto; border-radius: 20px; border: 2px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 16px; border-bottom: 2px solid var(--line); text-align: left; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose th { font-size: var(--fs-sm); font-weight: 700; background: var(--code-bg); }
.prose td.num, .prose th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.prose figure img, .prose figure .ph { border-radius: 20px; }
.prose figcaption { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
.math-block { overflow-x: auto; padding: 8px 0; text-align: center; font: italic 19px/1.6 "Cambria Math", "STIX Two Math", Georgia, serif; }
.math-block sub { font-size: .7em; font-style: normal; }
.diagram { overflow-x: auto; padding: 18px; border: 2px solid var(--line); border-radius: 20px; }
.diagram svg { display: block; margin: 0 auto; min-width: 460px; max-width: 560px; }
.article-foot { margin-top: 48px; padding-top: 22px; border-top: 2px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.article-foot a:hover { color: var(--accent-text); }

/* 示例图片占位：正式实现中是真实图片 */
.ph { display: block; width: 100%; aspect-ratio: 1; background: var(--code-bg); }
.ph.a { background: linear-gradient(140deg, #FFD36E, #FF7A59 60%, #C93A6B); }
.ph.b { background: linear-gradient(200deg, #FFE29A, #FF8A3D 65%, #8C2F4B); }
.ph.c { background: linear-gradient(160deg, #C9F2C7, #43B08A 70%, #1F6B62); }
.ph.d { background: linear-gradient(20deg, #5B2A6E, #FF7096 70%, #FFC7A8); }
.ph.e { background: linear-gradient(120deg, #FFF0C9, #FFB199 60%, #E0668A); }
.ph.wide { aspect-ratio: 16 / 9; }

/* ---------- 瞬间时间线 ---------- */
#timeline { display: flex; flex-direction: column; gap: 14px; }
.moment {
  padding: 20px 24px 22px; border-radius: var(--r-card); background: var(--surface);
  transition: transform .3s var(--spring), box-shadow .3s;
}
.moment:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.moment-time {
  display: inline-flex; gap: 8px; margin-bottom: 10px; padding: 2px 12px; border-radius: 99px;
  background: var(--tint-1); color: var(--ink-2);
  font: 600 var(--fs-xs)/1.8 var(--font-mono); font-variant-numeric: tabular-nums;
}
.moment-time b { font-weight: 800; color: var(--ink); }
.moment:nth-child(4n+2) .moment-time { background: var(--tint-3); }
.moment:nth-child(4n+3) .moment-time { background: var(--tint-2); }
.moment:nth-child(4n+4) .moment-time { background: var(--tint-4); }
.moment-body p { margin: 0; font-size: 17px; white-space: pre-wrap; overflow-wrap: break-word; }
.moment-body p a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--pop-2); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.photos { display: grid; gap: 6px; margin-top: 14px; max-width: 440px; grid-template-columns: repeat(3, 1fr); }
.photos[data-n="1"] { grid-template-columns: 1fr; max-width: 340px; }
.photos[data-n="1"] .ph { aspect-ratio: 4 / 3; }
.photos[data-n="2"], .photos[data-n="4"] { grid-template-columns: repeat(2, 1fr); max-width: 320px; }
.photos .ph, .photos img { border-radius: 16px; object-fit: cover; aspect-ratio: 1; width: 100%; }
.moment-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; min-height: 24px; }

/* 瞬间编辑器：PC 内嵌在时间线顶部；手机为全屏页 */
.composer { margin-bottom: 20px; padding: 18px 20px; background: var(--surface); border: 3px solid var(--pop-2); border-radius: var(--r-card); transition: border-color .2s; }
.composer:focus-within { border-color: var(--pop-1); }
.composer-head { display: none; }
.composer textarea {
  display: block; width: 100%; min-height: 96px; resize: vertical;
  border: 0; background: transparent; outline: none;
  font-size: 17px; line-height: 1.7;
}
.composer textarea::placeholder { color: var(--ink-3); }
.picked { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.picked .thumb { position: relative; width: 76px; height: 76px; animation: pop .3s var(--spring); }
.picked img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.picked .thumb button {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1; cursor: pointer;
}
.composer-msg { margin-top: 10px; }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 2px solid var(--line); }
.composer-bar .spacer { flex: 1; }
.draft-state { font-size: var(--fs-xs); color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--code-bg); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 14px; border-radius: 99px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); transition: background .2s; }
.seg input:checked + span { background: var(--pop-2); color: var(--on-pop); }
.seg input[value="private"]:checked + span { background: var(--private); color: var(--private-soft); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }
.fab { display: none; }

/* ---------- 搜索 ---------- */
.search-box { display: flex; gap: 10px; }
.search-box input, .field input {
  min-height: 48px; padding: 0 18px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 99px;
  transition: border-color .2s;
}
.search-box input { flex: 1; min-width: 0; }
.search-box input:focus, .field input:focus { border-color: var(--pop-1); outline: none; }
.search-box .btn { min-height: 44px; }
.search-meta { margin: 22px 0 12px; font-size: var(--fs-sm); color: var(--ink-3); }
.result { margin-bottom: 12px; padding: 18px 24px 20px; border-radius: var(--r-card); background: var(--surface); }
.result .kind { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); display: flex; gap: 10px; align-items: center; }
.result .kind > span:first-child { padding: 1px 10px; border-radius: 99px; background: var(--tint-3); color: var(--ink-2); }
.result h2 { margin: 8px 0 0; font: 800 var(--fs-lg)/1.45 var(--font-display); }
.result a:hover h2 { color: var(--accent-text); }
.result p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
mark { background: var(--pop-2); color: var(--on-pop); padding: 0 4px; border-radius: 6px; font-weight: 700; }

/* ---------- 登录 ---------- */
.login { max-width: 400px; margin-top: 8px; padding: 36px; border-radius: 36px; background: var(--surface); }
.login h1 { margin: 0 0 4px; font: 900 var(--fs-2xl)/1.25 var(--font-display); }
.login > p { margin: 0 0 24px; font-size: var(--fs-sm); color: var(--ink-3); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { padding-left: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.field input { background: var(--bg); }
.login .notice { margin-bottom: 16px; }
.login .btn { width: 100%; min-height: 48px; margin-top: 8px; font-size: var(--fs-base); }

/* ---------- 管理 ---------- */
.tabs { display: inline-flex; gap: 4px; max-width: 100%; margin-bottom: 20px; padding: 4px; border-radius: 99px; background: var(--surface); overflow-x: auto; }
.tabs a { padding: 6px 18px; border-radius: 99px; font-weight: 600; color: var(--ink-3); white-space: nowrap; transition: background .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--pop-2); color: var(--on-pop); }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; padding: 16px 16px 16px 22px; border-radius: 22px; background: var(--surface); }
.admin-row .info { flex: 1 1 260px; min-width: 0; }
.admin-row .title { font-weight: 700; line-height: 1.5; }
.admin-row .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.admin-row .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-row .btn { min-height: 36px; padding: 0 14px; }
.admin-row.off { background: transparent; border: 2px dashed var(--line); }
.admin-row.off .title { color: var(--ink-3); }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }
.hint { margin: 0 0 18px; font-size: var(--fs-sm); color: var(--ink-3); }
.admin-intro { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.admin-intro .hint { flex: 1 1 320px; margin: 0; }
.admin-intro .hint a { color: var(--accent-text); font-weight: 600; }
/* 推荐分类：每行一张改名、选样式的小表单，后面是条数和上移、下移、删除；最后一行虚线框是新增分类 */
.category-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; flex: 1 1 360px; min-width: 0; }
.category-form input, .category-form select { min-height: 40px; padding: 0 16px; border: 2px solid var(--line); border-radius: 99px; background: var(--bg); }
.category-form input { flex: 1 1 160px; min-width: 0; }
.category-form select { flex: none; }
.category-form input:focus, .category-form select:focus { border-color: var(--pop-1); outline: none; }
.category-count { font-size: var(--fs-xs); color: var(--ink-3); }
.category-new { background: transparent; border: 2px dashed var(--line); }
/* 后台的白底表单（自我介绍、项目） */
.admin-form { margin-top: 20px; padding: 26px; border-radius: var(--r-card); background: var(--surface); }
.form-title { margin: 0 0 20px; font: 800 var(--fs-lg) var(--font-display); }
.admin-form .field input, .admin-form .field select { min-width: 0; width: 100%; }
.admin-form .field select { min-height: 48px; padding: 0 18px; border: 2px solid var(--line); border-radius: 99px; background: var(--bg); }
.admin-form .field select:focus { border-color: var(--pop-1); outline: none; }
.admin-form textarea { width: 100%; min-height: 140px; padding: 12px 18px; border: 2px solid var(--line); border-radius: 20px; background: var(--bg); resize: vertical; }
.admin-form textarea:focus { border-color: var(--pop-1); outline: none; }
/* 单选一组（项目状态），用 .seg 的胶囊样式 */
.choice-field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.choice-field legend { margin-bottom: 6px; padding-left: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-danger { margin-top: 16px; }
.check-field { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; cursor: pointer; }
.check-field input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
/* 后台表单的图片字段（partials.html 的 image-field）。不用 .field，那里的输入框样式是给文字框的 */
.image-field { margin-bottom: 20px; }
.image-field > label { display: block; margin-bottom: 6px; padding-left: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.image-field-body { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.image-field-controls { flex: 1 1 240px; min-width: 0; }
.image-field-controls input[type="file"] { max-width: 100%; font-size: var(--fs-sm); }
.image-field .check-field { margin: 10px 0 0; font-size: var(--fs-sm); }
.image-field .hint { margin: 8px 0 0; }
.image-preview {
  display: grid; place-items: center; flex: none; width: 88px; height: 88px; overflow: hidden;
  border: 2px dashed var(--line); border-radius: 20px; background: var(--bg);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.image-preview.round { border-radius: 50%; }
.image-preview.wide { width: 156px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
/* 社交链接的输入行：平台下拉框 + 地址 + 调整按钮（有脚本时才出现） */
.link-fields { margin: 4px 0 24px; padding: 0; border: 0; min-width: 0; }
.link-fields legend { margin-bottom: 8px; padding-left: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.link-row select, .link-row input {
  min-height: 44px; padding: 0 16px;
  border: 2px solid var(--line); border-radius: 99px; background: var(--bg);
}
.link-row select { flex: none; width: 8.5em; }
.link-row input { flex: 1 1 220px; min-width: 0; }
.link-row select:focus, .link-row input:focus { border-color: var(--pop-1); outline: none; }
.link-tools { display: inline-flex; gap: 12px; }
.link-tools .link-btn[disabled] { opacity: .35; cursor: default; }
.link-fields .hint { margin: 4px 0 0; }
@media (max-width: 860px) {
  /* 手机上地址框单独占一行，调整按钮挨着平台下拉框 */
  .link-tools { order: 1; }
  .link-row input { order: 2; flex-basis: 100%; }
}

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 0 0 16px; padding: 24px 26px; background: var(--tint-2); border-radius: var(--r-card); }
.kv dt { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.kv dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 800; }
.kv dd .pill { font-size: var(--fs-sm); }
.sect { margin: 32px 0 12px; font: 800 var(--fs-lg) var(--font-display); }
.token-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.token-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 10px 16px; border-radius: 99px; background: var(--surface); }

/* ---------- 状态图鉴 ---------- */
.state { margin-bottom: 32px; }
.state > h2 { margin: 0 0 2px; font: 800 var(--fs-lg) var(--font-display); }
.state > .where { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--ink-3); }
.frame { padding: 22px; background: var(--surface); border-radius: var(--r-card); }
.frame .empty { padding: 28px 20px; }
.skeleton i { display: block; height: 14px; margin-bottom: 12px; border-radius: 99px; background: var(--tint-1); animation: pulse 1.4s ease-in-out infinite; }
.skeleton i:nth-child(1) { width: 55%; height: 22px; background: var(--tint-3); } .skeleton i:nth-child(2) { width: 92%; } .skeleton i:nth-child(3) { width: 70%; margin-bottom: 0; background: var(--tint-2); }
@keyframes pulse { 50% { opacity: .45; } }
.progress { height: 8px; border-radius: 99px; background: var(--code-bg); overflow: hidden; margin-top: 12px; }
.progress i { display: block; width: 60%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pop-2), var(--pop-1), var(--pop-3)); }
.terminal { overflow-x: auto; margin: 0; padding: 18px 20px; border-radius: 20px; background: var(--surface); font: 13px/1.75 var(--font-mono); white-space: pre; }
.terminal .ok { color: var(--ok); font-weight: 700; } .terminal .err { color: var(--danger); font-weight: 700; } .terminal .dim { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 手机端 ---------- */
@media (max-width: 860px) {
  :root { --fs-2xl: 28px; --fs-xl: 23px; --fs-lg: 18px; --r-card: 22px; }
  .shell { display: block; padding-inline: 16px; padding-block: 0 96px; }
  .rail {
    top: env(safe-area-inset-top, 0px); z-index: 10;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    margin-inline: -16px; padding: 10px 16px;
    background: var(--bg);
  }
  /* 375px 宽的手机上，五个字的站名加四个导航项要排在一行，下面几处尺寸是按这个算的 */
  .wordmark { font-size: 24px; white-space: nowrap; }
  .tagline, .rail-foot, .nav .sep { display: none; }
  .nav { flex-direction: row; align-items: center; gap: 2px; }
  .nav a { padding: 5px 9px; font-size: 15px; white-space: nowrap; }
  .nav a:hover { transform: none; }
  .nav a .label-wide { display: none; }
  /* 顶栏只留文章、瞬间、搜索，其余收进“更多” */
  .nav .nav-wide { display: none; }
  .nav-more { display: block; position: relative; }
  .nav-more summary {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 9px; border-radius: 99px;
    color: var(--ink-2); font-size: 15px; font-weight: 600; white-space: nowrap;
    list-style: none; cursor: pointer; user-select: none;
  }
  .nav-more summary::-webkit-details-marker { display: none; }
  /* 小箭头：收起时朝下，展开时朝上 */
  .nav-more summary::after {
    content: ""; width: 6px; height: 6px;
    border: solid currentColor; border-width: 0 2px 2px 0;
    transform: translateY(-2px) rotate(45deg); transition: transform .2s;
  }
  .nav-more[open] summary::after { transform: translateY(1px) rotate(-135deg); }
  .nav-more[open] summary { background: var(--tint-2); color: var(--ink); }
  .nav-more summary.is-current { background: var(--pop-2); color: var(--on-pop); }
  .nav-more-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 128px; padding: 6px;
    background: var(--surface); border: 2px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .nav-more-menu a { padding: 8px 14px; }
  main { padding-top: 12px; max-width: none; }

  .hero { margin-bottom: 24px; padding: 26px 24px 24px; border-radius: 28px; }
  .hero::before { width: 150px; height: 150px; right: -50px; top: -50px; }
  .hero::after { width: 90px; height: 90px; right: 30px; bottom: -50px; }
  .post-row { padding: 18px 20px 20px; }
  .post-row:hover, .moment:hover, .tile-moment:hover { transform: none; box-shadow: none; }
  /* 便当盒排成单列，顺序就是模板里的顺序：自我介绍 → 文章 → 右栏各格 */
  .bento, .bento:has(> .bento-side) { grid-template-columns: minmax(0, 1fr); }
  .tile { padding: 20px 20px 22px; }
  .tile-photo { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
  .article-sheet { padding: 26px 20px 24px; border-radius: 28px; }
  .prose { font-size: 16px; }
  .moment { padding: 18px 20px 20px; }
  .moment-body p { font-size: 16px; }
  .photos { max-width: none; }
  .photos[data-n="1"] { max-width: 80%; }
  .photos[data-n="2"], .photos[data-n="4"] { max-width: 72%; }
  .login { padding: 28px 22px; border-radius: 28px; }

  .composer { display: none; }
  body.composing .composer {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 40; margin: 0; border: 0; border-radius: 0;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 20px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto; animation: rise .3s ease-out;
  }
  body.composing .composer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 800; }
  body.composing .composer textarea { flex: 1; min-height: 160px; resize: none; }
  body.composing { overflow: hidden; }
  .fab {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; right: 18px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 20;
    width: 62px; height: 62px; border-radius: 24px; border: 0;
    background: var(--accent); color: var(--on-accent); font-size: 26px; cursor: pointer;
    box-shadow: 0 5px 0 var(--accent-deep), 0 12px 24px rgb(140 70 20 / .3);
    transition: transform .2s var(--spring), box-shadow .15s;
  }
  .fab:active { transform: translateY(5px) rotate(-6deg); box-shadow: 0 0 0 var(--accent-deep); }
  .admin-row { padding: 16px 18px; }
  .admin-row .actions { width: 100%; }
  .article-foot { flex-direction: column; }
}

/* ---------- 实现阶段补充：真实内容需要的样式 ---------- */

/* 表单包住的按钮在布局里当作不存在这层表单 */
.actions form, .moment-foot form, .owner-bar form, .rail-foot form { display: contents; }
.owner-bar { margin-top: 16px; }
.article-head .pause-banner { margin: 20px 0 0; }

/* 瞬间里的真实图片 */
.photos a { display: block; border-radius: 16px; overflow: hidden; }
.photos[data-n="1"] img { aspect-ratio: auto; max-height: 420px; }
.moment > .moment-foot { margin-top: 12px; }
.composer .progress { margin-top: 10px; }
.composer .progress i { transition: width .2s; }

/* 代码高亮：服务端只输出 class，颜色跟随站点令牌，深浅主题自动适配 */
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: var(--accent-text); font-weight: 600; }
.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .s1, .chroma .s2, .chroma .se, .chroma .sh, .chroma .si, .chroma .sr, .chroma .ss, .chroma .dl { color: var(--ok); }
.chroma .c, .chroma .c1, .chroma .ch, .chroma .cm, .chroma .cs, .chroma .cp, .chroma .cpf { color: var(--ink-3); font-style: italic; }
.chroma .m, .chroma .mi, .chroma .mf, .chroma .mh, .chroma .mo, .chroma .mb, .chroma .il { color: var(--private); }
.chroma .nf, .chroma .nc, .chroma .nn { font-weight: 600; }
.chroma .gd { color: var(--danger); } .chroma .gi { color: var(--ok); }
.chroma .err { color: inherit; }

/* 文章里的原始 HTML 不执行，按文字显示 */
.prose pre.raw-html { border: 2px dashed var(--line); background: transparent; white-space: pre-wrap; }
.prose img { max-width: 100%; height: auto; border-radius: 20px; }
.prose .math.display { display: block; overflow-x: auto; padding: 8px 0; text-align: center; }
.prose .katex { font-size: 1.1em; }
.diagram svg { min-width: 0; max-width: 100%; height: auto; }
.prose hr { border: 0; height: 2px; background: var(--line); margin-block: 2em; }
.prose del { color: var(--ink-3); }
.prose :not(pre) > code { overflow-wrap: anywhere; }
.prose li > input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin-right: 8px; translate: 0 2px; }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
/* 位置是瞬间的次要信息；私密细节只在站长展开后展示。 */
.moment-location { font-size: .875rem; color: var(--muted, #737373); margin-top: .75rem; }
.moment-location summary { cursor: pointer; }
.location-editor { border-top: 1px solid var(--line, #ddd); padding-block: 1rem; }
.location-editor label { display: block; margin-block: .75rem; font-size: .875rem; }
.location-editor input { display: block; width: 100%; margin-top: .35rem; }
.location-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.location-result { display: block; text-align: left; width: 100%; padding: .75rem; border: 0; background: transparent; cursor: pointer; }
.location-result:hover { background: var(--surface, #f4f4f4); }

/* ---------- 关于页 ---------- */
/* 关于页本身沿用文章页的白纸（.article-sheet），首页的“关于我”入口在自我介绍格那一节。 */
/* 后台文章列表里的“关于页”标签 */
.pill.about { background: var(--accent-soft); color: var(--accent-text); }
