/* ============================================================
   星月问尘的小站 · 样式表
   配色方案：后台可切换（purple / celadon / ocean），
   每套都含白天（默认）与夜间（[data-theme="dark"]）两版。
   ============================================================ */

:root {
  --radius: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --mono: "SFMono-Regular", Consolas, "JetBrains Mono", Menlo, monospace;
}

/* ---------- 方案一：星夜紫 ---------- */
[data-palette="purple"] {
  --bg: #f6f6fa;
  --bg-soft: #fbfbfe;
  --elev: #ffffff;
  --text: #1b1c2a;
  --text-soft: #3c3e52;
  --muted: #71748a;
  --line: rgba(22, 24, 40, 0.09);
  --line-strong: rgba(22, 24, 40, 0.16);
  --brand: #5b5bd6;
  --brand-2: #8b5cf6;
  --brand-soft: rgba(91, 91, 214, 0.09);
  --gold: #d9a13b;
  --rose: #c2547a;
  --teal: #2f8f83;
  --shadow-sm: 0 1px 2px rgba(22, 24, 40, 0.04);
  --shadow: 0 1px 3px rgba(22, 24, 40, 0.05), 0 12px 28px -16px rgba(22, 24, 40, 0.18);
  --shadow-lg: 0 18px 48px -22px rgba(22, 24, 40, 0.3);
}
[data-palette="purple"][data-theme="dark"] {
  --bg: #0e1017;
  --bg-soft: #12141d;
  --elev: #171a25;
  --text: #e9eaf2;
  --text-soft: #cfd2e0;
  --muted: #9aa0b5;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --brand: #8f8ff5;
  --brand-2: #a78bfa;
  --brand-soft: rgba(143, 143, 245, 0.14);
  --gold: #e6bd63;
  --rose: #e08aa9;
  --teal: #63c2b4;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 16px 32px -20px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 52px -24px rgba(0, 0, 0, 0.8);
}

/* ---------- 方案二：月白青瓷 ---------- */
[data-palette="celadon"] {
  --bg: #f6f3ea;
  --bg-soft: #fbf8f0;
  --elev: #fffdf7;
  --text: #23211c;
  --text-soft: #403c33;
  --muted: #736c5d;
  --line: rgba(35, 33, 28, 0.1);
  --line-strong: rgba(35, 33, 28, 0.18);
  --brand: #2f7d6f;
  --brand-2: #4a9c8c;
  --brand-soft: rgba(47, 125, 111, 0.09);
  --gold: #b8860b;
  --rose: #b4553f;
  --teal: #2f7d6f;
  --shadow-sm: 0 1px 2px rgba(35, 33, 28, 0.04);
  --shadow: 0 1px 3px rgba(35, 33, 28, 0.05), 0 12px 28px -16px rgba(35, 33, 28, 0.16);
  --shadow-lg: 0 18px 48px -22px rgba(35, 33, 28, 0.26);
}
[data-palette="celadon"][data-theme="dark"] {
  --bg: #14161a;
  --bg-soft: #181b20;
  --elev: #1b1e23;
  --text: #ece7db;
  --text-soft: #cfc9bb;
  --muted: #a09a8c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --brand: #6fbfae;
  --brand-2: #8fd4c4;
  --brand-soft: rgba(111, 191, 174, 0.13);
  --gold: #d8b26a;
  --rose: #e08a72;
  --teal: #6fbfae;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.42), 0 16px 32px -20px rgba(0, 0, 0, 0.62);
  --shadow-lg: 0 20px 52px -24px rgba(0, 0, 0, 0.82);
}

/* ---------- 方案三：深蓝夜航 ---------- */
[data-palette="ocean"] {
  --bg: #f2f5fa;
  --bg-soft: #f8fafd;
  --elev: #ffffff;
  --text: #16202e;
  --text-soft: #33445c;
  --muted: #64748b;
  --line: rgba(20, 35, 60, 0.1);
  --line-strong: rgba(20, 35, 60, 0.18);
  --brand: #2b5fd9;
  --brand-2: #4f8ef7;
  --brand-soft: rgba(43, 95, 217, 0.09);
  --gold: #c08a2e;
  --rose: #c15a76;
  --teal: #2f8f83;
  --shadow-sm: 0 1px 2px rgba(20, 35, 60, 0.05);
  --shadow: 0 1px 3px rgba(20, 35, 60, 0.06), 0 12px 28px -16px rgba(20, 35, 60, 0.2);
  --shadow-lg: 0 18px 48px -22px rgba(20, 35, 60, 0.32);
}
[data-palette="ocean"][data-theme="dark"] {
  --bg: #0a0f1c;
  --bg-soft: #0e1524;
  --elev: #131c2e;
  --text: #e6edf9;
  --text-soft: #c3cfe3;
  --muted: #8b9ab2;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --brand: #6f9dff;
  --brand-2: #8fb8ff;
  --brand-soft: rgba(111, 157, 255, 0.14);
  --gold: #e2b567;
  --rose: #e589a2;
  --teal: #5fb8ab;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.34);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.44), 0 16px 32px -20px rgba(0, 0, 0, 0.64);
  --shadow-lg: 0 20px 52px -24px rgba(0, 0, 0, 0.84);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------- 顶栏 */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 20px; height: 70px; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px -8px var(--brand);
}
.brand-mark svg { width: 21px; height: 21px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; }
.brand-text small {
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14.5px; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--brand-soft); }
.nav-link.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--elev); color: var(--text-soft); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* ---------------------------------------------------------- 首屏 */

.hero {
  position: relative;
  width: min(1124px, calc(100% - 56px));
  margin: 34px auto 10px;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(1000px 320px at 12% -30%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 60%),
    radial-gradient(760px 300px at 88% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 62%),
    var(--elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 26%, color-mix(in srgb, var(--brand) 60%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 72% 22%, color-mix(in srgb, var(--gold) 78%, transparent), transparent 60%),
    radial-gradient(1.6px 1.6px at 52% 68%, color-mix(in srgb, var(--brand-2) 50%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 74%, color-mix(in srgb, var(--brand) 45%, transparent), transparent 60%),
    radial-gradient(1px 1px at 33% 82%, color-mix(in srgb, var(--gold) 55%, transparent), transparent 60%);
  pointer-events: none; opacity: 0.85;
}
.hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 30px;
  padding: 48px 46px;
}
.hero-avatar {
  width: 92px; height: 92px; flex: 0 0 92px;
  border-radius: 28px;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 40px; color: #fff;
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 65%, color-mix(in srgb, var(--brand-2) 70%, #fff) 100%);
  box-shadow: 0 18px 34px -18px color-mix(in srgb, var(--brand) 80%, transparent);
}
.hero-kicker {
  margin: 0 0 8px; font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--brand); font-weight: 600;
}
.hero-text h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.01em; line-height: 1.25;
}
.hero-desc { margin: 0 0 16px; color: var(--text-soft); font-size: 15.5px; max-width: 56ch; }
.hero-stats {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.hero-stats b { color: var(--text); font-weight: 600; }
.hero-stats .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

/* ---------------------------------------------------------- 筛选 */

.feed { padding: 26px 0 60px; }
.feed-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--elev);
  font-size: 13.5px; color: var(--muted);
  transition: all 0.2s;
}
.chip i { font-style: normal; font-size: 11.5px; opacity: 0.65; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px -10px var(--brand);
}
.chip.is-active i { opacity: 0.85; }
.feed-hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------- 瀑布流 */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.post-grid.masonry-ready { display: block; position: relative; }
.masonry-ready .card { position: absolute; top: 0; left: 0; width: 100%; }

.card {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.4s,
    box-shadow 0.25s, border-color 0.25s;
  will-change: transform;
}
.masonry-ready .card { opacity: 0; }
.masonry-ready.is-ready .card { opacity: 1; }
.card.is-in {
  animation: cardIn 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-fill-mode: both;
}
@keyframes cardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.card:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: var(--shadow-lg);
}
.card-link { display: block; padding: 20px 22px 18px; }

.card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-top time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.pill-dev { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.pill-life { color: var(--rose); background: color-mix(in srgb, var(--rose) 12%, transparent); border-color: color-mix(in srgb, var(--rose) 22%, transparent); }
.pill-note { color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); border-color: color-mix(in srgb, var(--teal) 22%, transparent); }
.pill.sm { font-size: 10.5px; padding: 2px 8px; }

.card-title {
  margin: 0 0 10px;
  text-wrap: balance;
  font-family: var(--serif);
  font-size: 19px; line-height: 1.45; letter-spacing: 0.01em;
  transition: color 0.2s;
}
.card:hover .card-title { color: var(--brand); }
.card-summary {
  margin: 0 0 16px;
  font-size: 14px; color: var(--muted); line-height: 1.72;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 13px; border-top: 1px dashed var(--line);
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; color: var(--muted);
  padding: 1px 0; transition: color 0.2s;
}
.card:hover .tag { color: var(--text-soft); }
.card-read { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------- 加载状态 */

.loader {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 34px 0 8px; color: var(--muted); font-size: 13px;
}
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }
.feed-end { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: 0.1em; padding: 30px 0 6px; margin: 0; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .chip { margin-top: 10px; }

/* ---------------------------------------------------------- 页脚 */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 26px; padding-bottom: 26px;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.footer-inner p { margin: 0; }
.footer-meta { font-size: 12px; opacity: 0.8; }
/* 版权 + 备案号放在右下角，两者同一行，窄屏自动换行 */
.footer-legals { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-icp { font-size: 12px; }
.footer-icp a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.footer-icp a:hover { color: var(--brand); border-bottom-color: currentColor; }

.to-top {
  position: fixed; right: 24px; bottom: 26px; z-index: 30;
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--elev); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: var(--text-soft);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-size: 17px;
}
.to-top.is-on { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------- 文章页 */

.article { max-width: 760px; padding-top: 40px; padding-bottom: 70px; }

.back { font-size: 13.5px; color: var(--muted); display: inline-block; }
.back:hover { color: var(--brand); }

.article-head { margin: 22px 0 34px; }
.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
}
.article-head h1 {
  margin: 0; font-family: var(--serif);
  text-wrap: balance;
  font-size: clamp(26px, 4.2vw, 38px); line-height: 1.35; letter-spacing: 0.01em;
}
.article-foot {
  margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

/* 正文排版 */
.prose { font-size: 16.5px; line-height: 1.92; color: var(--text-soft); }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); color: var(--text);
  line-height: 1.45; margin: 2em 0 0.7em; scroll-margin-top: 90px;
}
.prose h1 { font-size: 28px; }
.prose h2 {
  font-size: 23px; padding-left: 12px; border-left: 3px solid var(--brand);
}
.prose h3 { font-size: 19px; }
.prose h4 { font-size: 17px; color: var(--text-soft); }
.prose p { margin: 0 0 1.15em; }
.prose a { color: var(--brand); border-bottom: 1px solid currentColor; }
.prose a:hover { opacity: 0.8; }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--brand); }
.prose blockquote {
  margin: 1.5em 0; padding: 14px 20px;
  border-left: 3px solid var(--brand-2);
  background: var(--brand-soft);
  border-radius: 0 12px 12px 0;
  color: var(--text-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--brand-soft); color: var(--brand);
  padding: 2px 6px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.prose pre {
  margin: 1.4em 0; padding: 18px 20px;
  background: #1a1c28; color: #e6e8f2;
  border-radius: 14px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.75;
  box-shadow: var(--shadow-sm);
}
.prose pre code {
  background: none; border: none; padding: 0;
  color: inherit; font-size: inherit;
}
.prose hr { border: none; border-top: 1px dashed var(--line-strong); margin: 2.4em 0; }
.prose img { border-radius: 12px; margin: 1em 0; box-shadow: var(--shadow); }
.prose .table-wrap { overflow-x: auto; margin: 1.4em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------- 关于 */

.about {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 26px; padding-top: 40px; padding-bottom: 70px; align-items: start;
}
.about-card {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 36px; box-shadow: var(--shadow);
}
.about-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.about-head .hero-avatar { width: 68px; height: 68px; flex-basis: 68px; border-radius: 22px; font-size: 30px; }
.about-head h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; }
.about-head .muted { margin: 0; font-size: 13.5px; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.social {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; color: var(--text-soft);
  transition: all 0.2s;
}
.social:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.social svg { width: 13px; height: 13px; color: var(--gold); }

.about-side {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: 22px; padding: 28px 28px 30px;
}
.about-side h2 { margin: 0 0 12px; font-size: 16px; font-family: var(--serif); }
.about-side p { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.plain { margin: 0 0 16px; padding-left: 18px; font-size: 14px; color: var(--muted); }
.plain li { margin: 6px 0; }
.plain li::marker { color: var(--brand); }
/* 「关于这个小站」正文：后台可编辑的 Markdown，字号比正文小一号 */
.about-note { font-size: 14px; line-height: 1.85; color: var(--muted); }
.about-note > *:first-child { margin-top: 0; }
.about-note > *:last-child { margin-bottom: 0; }
.about-note p { margin: 0 0 12px; font-size: 14px; }
.about-note ul, .about-note ol { padding-left: 18px; margin: 0 0 12px; font-size: 14px; }
.about-note li { margin: 6px 0; }
.about-note li::marker { color: var(--brand); }
.about-note h3, .about-note h4 { font-size: 14.5px; margin: 14px 0 8px; }
.about-note a { color: var(--brand); border-bottom: 1px solid currentColor; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------------------------------------------------------- 归档 */

.archive { max-width: 820px; padding-top: 44px; padding-bottom: 70px; }
.page-title { font-family: var(--serif); font-size: 32px; margin: 0 0 6px; }
.arc-year { margin-top: 38px; }
.arc-year h2 {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--serif); font-size: 22px; margin: 0 0 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.arc-year h2 span { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 400; }
.arc-list { list-style: none; margin: 0; padding: 0; }
.arc-list li a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px; border-radius: 12px;
  transition: background 0.2s;
}
.arc-list li a:hover { background: var(--brand-soft); }
.arc-list time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 48px; }
.arc-title { flex: 1; font-size: 15px; }
.arc-list li a:hover .arc-title { color: var(--brand); }

/* ---------------------------------------------------------- 空页 */

.empty-page { text-align: center; padding: 90px 20px 110px; }
.empty-page .big {
  font-family: var(--serif); font-size: 76px; margin: 0;
  color: var(--brand); opacity: 0.35; line-height: 1;
}
.empty-page h1 { font-family: var(--serif); margin: 8px 0 6px; font-size: 26px; }
.empty-page .btn { margin-top: 18px; }

/* ---------------------------------------------------------- 按钮 / 表单 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--elev); color: var(--text);
  font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px -12px var(--brand);
}
.btn.primary:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 14px 26px -12px var(--brand); }
.btn.ghost { background: transparent; }
.btn.danger { color: #c0392b; border-color: rgba(192, 57, 43, 0.28); background: transparent; }
.btn.danger:hover { background: rgba(192, 57, 43, 0.08); color: #c0392b; border-color: rgba(192, 57, 43, 0.5); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--bg-soft); color: var(--text);
  font-family: inherit; font-size: 14.5px; line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; }
.field .mono { font-family: var(--mono); font-size: 13.5px; line-height: 1.8; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-soft); margin-bottom: 18px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }

/* ---------------------------------------------------------- 登录 */

.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(700px 400px at 20% 0%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 60%),
    radial-gradient(600px 380px at 85% 10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 392px;
  background: var(--elev); border: 1px solid var(--line);
  border-radius: 22px; padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-mark {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, var(--brand), var(--brand-2));
  margin-bottom: 18px;
}
.login-card h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.login-card > p { margin: 0 0 22px; font-size: 13.5px; }

/* 验证码一行：输入框 + 图片 + 换一张（要盖过 .field > span / .field input 的默认样式） */
.field > .captcha-row { display: flex; align-items: center; gap: 8px; }
.field > .captcha-row input {
  width: auto; flex: 1 1 auto; min-width: 0; letter-spacing: 2px;
}
.captcha-img {
  flex: 0 0 auto; width: 124px; height: 46px; display: block;
  border-radius: 9px; border: 1px solid var(--line);
  background: #eef0f7; cursor: pointer;
}
.captcha-refresh {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer;
  font-size: 12.5px; color: var(--muted); padding: 4px 2px; white-space: nowrap;
}
.captcha-refresh:hover { color: var(--brand); }

@media (max-width: 420px) {
  .captcha-img { width: 100px; height: 38px; }
  .captcha-refresh { font-size: 12px; }
}

.login-back { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.login-back:hover { color: var(--brand); }
.form-error {
  margin: 0 0 16px; padding: 10px 13px; border-radius: 10px;
  background: rgba(192, 57, 43, 0.08); color: #c0392b; font-size: 13px;
  border: 1px solid rgba(192, 57, 43, 0.18);
}
.flash {
  margin-bottom: 18px; padding: 11px 15px; border-radius: 11px;
  background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 24%, transparent); font-size: 13.5px;
}

/* ---------------------------------------------------------- 后台 */

.admin-body { background: var(--bg); }
.admin-header { border-bottom: 1px solid var(--line); background: var(--elev); position: sticky; top: 0; z-index: 20; }
.admin-header-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.admin-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.admin-nav-link { padding: 7px 13px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.admin-nav-link:hover { color: var(--text); background: var(--brand-soft); }
.admin-nav-link.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.admin-actions { display: flex; gap: 8px; }

.admin-main { padding-top: 34px; padding-bottom: 70px; max-width: 1000px; }
.admin-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 22px; flex-wrap: wrap;
}
.admin-page-head h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 25px; }
.admin-page-head p { margin: 0; font-size: 13px; max-width: 62ch; }

.table-card {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: center; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 13px 18px; background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.muted { color: var(--muted); text-align: center; padding: 40px 0; }
.admin-table .td-title { text-align: left; }
.td-title a { font-weight: 600; color: var(--text); }
.td-title a:hover { color: var(--brand); }
.td-title small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
/* 状态列：徽章居中 */
.td-status { text-align: center; }
/* 操作列：flex 必须放在单元格内部的 div 上。
   直接给 <td> 加 display:flex 会让它脱离表格单元格布局，底部分割线会比其他列高一截。 */
.td-ops { text-align: center; white-space: nowrap; }
.td-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
.inline { display: inline; margin: 0; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted); background: var(--bg-soft);
  border: 1px solid var(--line);
}
.badge.on { color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); border-color: color-mix(in srgb, var(--teal) 24%, transparent); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.editor-main, .editor-side {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm);
}
.editor-side { position: sticky; top: 90px; }
.editor-side .btn.block { margin-top: 4px; }
.editor-side .muted.small { margin: 12px 0 0; }
.editor.narrow { max-width: 460px; }
.editor.narrow { background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .header-inner { height: 62px; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 15px; }
  .nav { gap: 2px; }
  .nav-link { padding: 7px 10px; font-size: 13.5px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; }

  .hero { width: calc(100% - 36px); margin: 18px auto 6px; border-radius: 20px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 24px 30px; }
  .hero-avatar { width: 66px; height: 66px; flex-basis: 66px; border-radius: 20px; font-size: 28px; }
  .hero-desc { font-size: 14.5px; }
  .hero-stats { font-size: 12px; gap: 9px; }

  .feed { padding: 18px 0 44px; }
  .feed-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chips { gap: 6px; width: 100%; }
  .chip { padding: 6px 12px; font-size: 13px; }
  .feed-hint { display: none; }

  .post-grid { grid-template-columns: 1fr; }
  .card { border-radius: 16px; }
  .card-link { padding: 18px 18px 16px; }
  .card-title { font-size: 18px; }

  .article { padding-top: 24px; padding-bottom: 50px; }
  .article-head { margin: 18px 0 26px; }
  .prose { font-size: 16px; line-height: 1.88; }
  .prose h2 { font-size: 20px; }
  .prose pre { padding: 14px 15px; font-size: 12.5px; border-radius: 12px; }

  .about { padding-top: 24px; gap: 18px; }
  .about-card, .about-side { padding: 22px 20px; border-radius: 18px; }
  .about-head .hero-avatar { width: 56px; height: 56px; flex-basis: 56px; font-size: 24px; }

  .admin-main { padding-top: 22px; }
  .admin-header-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .admin-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .admin-actions { margin-left: auto; }
  .textarea, .editor-main, .editor-side { padding: 18px; }
  .admin-table th, .admin-table td { padding: 11px 12px; }
  .td-actions { flex-direction: column; gap: 6px; }

  .to-top { right: 14px; bottom: 16px; width: 38px; height: 38px; border-radius: 12px; }
  .footer-inner { padding-top: 20px; padding-bottom: 20px; }
}

@media (max-width: 380px) {
  .brand-text strong { font-size: 14px; }
  .nav-link { padding: 7px 8px; font-size: 13px; }
}

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

/* ---------------------------------------------------------- 后台：外观配色 */

.palette-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}
.palette-card {
  position: relative; display: block; cursor: pointer;
  background: var(--elev); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 12px; transition: all 0.2s;
}
.palette-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.palette-card.is-active,
.palette-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.palette-card:has(input:checked) .palette-text strong { color: var(--brand); }
.palette-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-soft); }
.palette-card input { position: absolute; opacity: 0; pointer-events: none; }
/* 选中标记 */
.palette-check {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
  opacity: 0; transform: scale(0.6); transition: all 0.18s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.palette-card.is-active .palette-check,
.palette-card:has(input:checked) .palette-check {
  opacity: 1; transform: scale(1);
}
.palette-preview {
  display: block; border-radius: 11px; overflow: hidden;
  background: var(--p-bg); border: 1px solid var(--line);
  padding: 8px 9px 10px; height: 118px;
}
.pp-bar { display: flex; gap: 3px; margin-bottom: 8px; }
.pp-bar i { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--p-a) 22%, transparent); }
.pp-hero {
  display: block; height: 30px; border-radius: 7px; margin-bottom: 8px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--p-a) 18%, transparent), color-mix(in srgb, var(--p-b) 12%, transparent));
}
.pp-cards { display: flex; gap: 5px; }
.pp-cards b {
  flex: 1; height: 34px; border-radius: 6px; background: #fff;
  border-top: 2px solid var(--p-a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.pp-cards b:nth-child(2) { height: 42px; border-top-color: var(--p-b); }
.palette-text { display: block; padding: 12px 4px 4px; }
.palette-text strong { display: block; font-size: 15px; margin-bottom: 4px; }
.palette-text small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.palette-text em {
  display: inline-block; margin-top: 8px; font-style: normal;
  font-family: var(--mono); font-size: 11px; color: var(--muted); opacity: 0.8;
}
.palette-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .palette-grid { grid-template-columns: 1fr; }
  .palette-preview { height: 96px; }
}
