/* ============================================================
   星动猫猫 · 主题样式
   配色变量集中在 :root / [data-theme="dark"]，主题切换只换变量
   ============================================================ */
:root {
  --bg: #faf9ff;
  --bg-soft: #f2f0fb;
  --surface: #ffffff;
  --surface-2: #f7f6fc;
  --ink: #1e2030;
  --ink-soft: #5b5f75;
  --ink-faint: #9296ab;
  --line: #e9e7f3;
  --accent: #5b5bd6;
  --accent-2: #8b5cf6;
  --accent-soft: #eeecff;
  --warm: #e78b4f;
  --warm-soft: #fff2e7;
  --danger: #d1544e;
  --danger-soft: #fdecea;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(40, 38, 80, .04), 0 12px 32px rgba(40, 38, 80, .055);
  --shadow-lg: 0 10px 24px rgba(40, 38, 80, .09), 0 28px 64px rgba(40, 38, 80, .10);
  --grad: linear-gradient(135deg, #5b5bd6 0%, #8b5cf6 52%, #e879a6 100%);
  --grad-warm: linear-gradient(135deg, #ffb27a, #f2789f);
  --header-bg: rgba(250, 249, 255, .88);
  --accent-line: #d8d3f7;
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[data-theme="dark"] {
  --bg: #12141c;
  --bg-soft: #171a25;
  --surface: #1b1e2b;
  --surface-2: #222634;
  --ink: #eceef7;
  --ink-soft: #a8adc2;
  --ink-faint: #757c95;
  --line: #2c3042;
  --accent: #9a9aff;
  --accent-2: #bd93ff;
  --accent-soft: #28264a;
  --warm: #ffb27a;
  --warm-soft: #3a2c26;
  --danger: #ff8a84;
  --danger-soft: #3c2626;
  --shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 12px 32px rgba(0, 0, 0, .22);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, .3), 0 28px 64px rgba(0, 0, 0, .3);
  --header-bg: rgba(18, 20, 28, .88);
  --accent-line: #3b3766;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(91, 91, 214, .3);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-dot { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; font-size: 14px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); padding: 6px 12px; border-radius: 8px; transition: all .16s; white-space: nowrap; }
.nav a:hover { color: var(--accent); background: var(--accent-soft); }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav .nav-user { color: var(--ink-faint); font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; }
.nav .link-btn { background: none; border: 0; padding: 6px 10px; cursor: pointer; color: var(--ink-soft); font-size: 13px; }
.nav .link-btn:hover { color: var(--accent); }
.header-tools { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--ink-soft); transition: all .16s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
.reading-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.reading-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .08s linear; }

/* ---------------- generic ---------------- */
main { min-height: calc(100vh - 320px); padding-top: 34px; padding-bottom: 76px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-faint); padding: 80px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.fade-in { animation: fadeUp .34s ease both; }
.muted { color: var(--ink-faint); }
.empty { padding: 52px 24px; text-align: center; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.section-title { font-family: var(--serif); font-size: 25px; margin: 0 0 20px; letter-spacing: -.01em; }
.section-title .accent-bar { display: inline-block; width: 4px; height: 20px; border-radius: 3px; background: var(--grad); margin-right: 10px; vertical-align: -3px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); margin: 0 0 8px; }
.page-head p { color: var(--ink-soft); margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: transform .16s, box-shadow .16s, opacity .16s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(91, 91, 214, .24); }
.btn:active { transform: translateY(0); }
.btn.gradient { background: var(--grad); border-color: transparent; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); box-shadow: none; }
.btn.plain { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn.plain:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.field { display: block; margin-bottom: 17px; }
.field > span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; font-weight: 500; }
.input, .textarea, select.input {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.checkbox-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.notice { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 20px; }

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 50px 46px 0;
  background: linear-gradient(120deg, #f0edff 0%, #f7f2ff 42%, #fff0ea 100%);
  border: 1px solid var(--line); margin-bottom: 30px;
}
[data-theme="dark"] .hero { background: linear-gradient(120deg, #231f3d 0%, #241f36 45%, #33262c 100%); }
.hero::before {
  content: ''; position: absolute; width: 420px; height: 420px; right: -90px; top: -190px;
  background: radial-gradient(circle, rgba(139, 92, 246, .28), transparent 66%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: radial-gradient(var(--accent) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
}
.hero-inner { position: relative; z-index: 2; display: flex; gap: 30px; align-items: center; justify-content: space-between; }
.hero-text { max-width: 620px; padding-bottom: 42px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.hero-eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--grad); border-radius: 2px; }
.hero h1 { font-family: var(--serif); font-size: clamp(32px, 5.4vw, 50px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-soft); margin: 0 0 24px; font-size: 16px; max-width: 500px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { position: relative; width: 220px; height: 220px; flex-shrink: 0; margin-bottom: 34px; }
.orbit { position: absolute; inset: 0; border: 1px dashed var(--accent-line); border-radius: 50%; animation: spin 28s linear infinite; }
.orbit.inner { inset: 34px; border-style: solid; opacity: .55; animation-direction: reverse; animation-duration: 20s; }
.orbit-core { position: absolute; inset: 72px; border-radius: 50%; background: var(--grad); box-shadow: 0 14px 40px rgba(91, 91, 214, .38); display: grid; place-items: center; color: #fff; }
.orbit-core svg { width: 34px; height: 34px; }
.spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 5px rgba(231, 139, 79, .16); }
.spark.s1 { top: 8px; left: 46%; } .spark.s2 { bottom: 26px; right: 12px; background: var(--accent-2); box-shadow: 0 0 0 5px rgba(139, 92, 246, .16); }
.hero-stats { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--accent-line); }
.hero-stat { flex: 1 1 110px; padding: 16px 8px 18px; }
.hero-stat b { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.hero-stat span { font-size: 12px; color: var(--ink-faint); }

/* ---------------- layout / toolbar ---------------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 28px; align-items: start; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button, .seg a { border: 0; background: none; color: var(--ink-faint); padding: 5px 13px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.seg button.active, .seg a.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.search-box { display: flex; gap: 8px; flex: 1; min-width: 180px; }
.search-box .input { flex: 1; }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip { font-size: 12px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.filter-chip:hover, .filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------------- post cards ---------------- */
.post-list { display: grid; gap: 16px; }
.post-item {
  position: relative; display: block; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.post-item:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-lg); }
.post-cover { position: relative; height: 148px; overflow: hidden; background: var(--accent-soft); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-size: 40px; opacity: .9; }
.post-cover .cover-fallback::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.12), transparent); }
.post-body { padding: 20px 24px 22px; }
.post-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); }
.chip.warm { background: var(--warm-soft); color: var(--warm); }
.chip.plain { background: var(--surface-2); color: var(--ink-faint); border: 1px solid var(--line); }
.post-item h2 { font-family: var(--serif); font-size: 21px; line-height: 1.4; margin: 0 0 8px; }
.post-item:hover h2 { color: var(--accent); }
.post-item p { color: var(--ink-soft); margin: 0 0 14px; font-size: 14px; line-height: 1.7; }
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-faint); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.tag.plain { background: var(--surface-2); color: var(--ink-faint); }
.badge-draft { color: var(--warm); background: var(--warm-soft); padding: 2px 9px; border-radius: 99px; font-size: 12px; }
mark { background: #ffe9a8; color: #6b4b00; border-radius: 3px; padding: 0 2px; }
[data-theme="dark"] mark { background: #6b5a1f; color: #ffe9a8; }

/* ---------------- sidebar widgets ---------------- */
.side { display: grid; gap: 16px; position: sticky; top: 88px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow); }
.widget h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; font-weight: 700; }
.widget h3::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--grad); }
.profile-top { height: 62px; margin: -19px -19px 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--grad); position: relative; overflow: hidden; }
.profile-top::after { content: ''; position: absolute; width: 120px; height: 120px; right: -30px; top: -70px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.avatar { width: 54px; height: 54px; border-radius: 50%; margin: -27px 0 8px; border: 3px solid var(--surface); background: var(--grad-warm); display: grid; place-items: center; color: #fff; font-family: var(--serif); font-size: 22px; position: relative; }
.profile-name { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.profile-bio { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 12px; line-height: 1.65; }
.profile-links { display: flex; gap: 7px; flex-wrap: wrap; }
.profile-links a { font-size: 11.5px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-soft); }
.profile-links a:hover { border-color: var(--accent); color: var(--accent); }
.rank-list { display: grid; gap: 11px; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.rank-num { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-faint); }
.rank-item:nth-child(-n+3) .rank-num { background: var(--grad); color: #fff; }
.rank-item a { color: var(--ink-soft); }
.rank-item a:hover { color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { background: var(--surface-2); border: 1px solid var(--line); padding: 4px 11px; border-radius: 99px; font-size: 12px; color: var(--ink-soft); }
.tag-cloud a:hover, .tag-cloud a.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.month-list { display: grid; gap: 2px; }
.month-list a { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); padding: 5px 8px; border-radius: 7px; }
.month-list a:hover { background: var(--accent-soft); color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-grid div { background: var(--surface-2); border-radius: 9px; padding: 9px 11px; }
.stat-grid b { display: block; font-family: var(--serif); font-size: 19px; }
.stat-grid span { font-size: 11px; color: var(--ink-faint); }

/* ---------------- article ---------------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 38px; align-items: start; }
.article-main { min-width: 0; max-width: 780px; }
.article-head { margin-bottom: 26px; }
.back-link { font-size: 13px; color: var(--ink-faint); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 18px; }
.back-link:hover { color: var(--accent); }
.article-head h1 { font-family: var(--serif); font-size: clamp(28px, 4.4vw, 40px); line-height: 1.3; margin: 0 0 14px; letter-spacing: -.015em; }
.article-cover { width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius); margin: 0 0 30px; background: var(--accent-soft); box-shadow: var(--shadow); }
.article-body { font-size: 16px; line-height: 1.95; color: var(--ink); }
.article-body h1, .article-body h2, .article-body h3 { font-family: var(--serif); line-height: 1.4; margin: 1.9em 0 .7em; scroll-margin-top: 92px; }
.article-body h2 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-body h3 { font-size: 19px; }
.article-body p { margin: 0 0 1.1em; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.article-body blockquote {
  margin: 1.5em 0; padding: 12px 20px; border-left: 3px solid var(--accent);
  color: var(--ink-soft); background: var(--accent-soft); border-radius: 0 10px 10px 0;
}
.article-body pre { background: var(--surface-2); border: 1px solid var(--line); padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.65; }
.article-body code { background: var(--surface-2); padding: 2px 5px; border-radius: 4px; font-size: .9em; }
.article-body pre code { background: none; padding: 0; }
.article-body img { max-width: 100%; border-radius: var(--radius-sm); }
.article-body table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--surface-2); }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.toc { position: sticky; top: 92px; font-size: 12.5px; }
.toc h4 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.toc a { display: block; color: var(--ink-faint); padding: 4px 0 4px 11px; border-left: 2px solid var(--line); line-height: 1.5; }
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc a.lv3 { padding-left: 22px; font-size: 12px; }

.article-footer { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.like-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface);
  color: var(--ink-soft); font-size: 14px; transition: all .18s;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.like-btn.liked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.like-btn svg { width: 17px; height: 17px; }
.like-btn.liked svg { fill: currentColor; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; font-size: 13px; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: 99px; cursor: pointer; background: none; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.nav-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.nav-card:hover { border-color: var(--accent); }
.nav-card span { font-size: 11px; color: var(--ink-faint); letter-spacing: .06em; }
.nav-card b { display: block; font-family: var(--serif); font-size: 15px; margin-top: 5px; line-height: 1.5; }
.nav-card.empty-card { opacity: .45; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.related-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card b { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.5; margin-bottom: 8px; }
.related-card span { font-size: 11px; color: var(--ink-faint); }
.subsection-title { font-family: var(--serif); font-size: 20px; margin: 34px 0 12px; }

/* 站点为纯展示站，不提供评论区（相关样式已移除）。 */

/* ---------------- archive / works / about ---------------- */
.year-block { margin-bottom: 34px; }
.year-title { font-family: var(--serif); font-size: 30px; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; }
.year-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.month-group { margin-bottom: 20px; padding-left: 18px; border-left: 2px solid var(--line); }
.month-head { font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.archive-item { display: flex; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.archive-item:last-child { border-bottom: 0; }
.archive-item time { font-size: 12px; color: var(--ink-faint); flex-shrink: 0; width: 44px; }
.archive-item a { font-size: 15px; }
.archive-item a:hover { color: var(--accent); }
.archive-item .chip { margin-left: auto; }
.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.work-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.work-thumb { height: 132px; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-size: 34px; position: relative; }
.work-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.14), transparent); }
.work-body { padding: 18px 20px 20px; }
.work-body h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 8px; }
.work-body p { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.7; }
.work-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.about-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); margin-bottom: 20px; }
.about-hero h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 12px; }
.about-hero p { color: var(--ink-soft); margin: 0 0 12px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tech-list { display: grid; gap: 10px; }
.tech-item { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; }
.tech-bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-top: 8px; flex-shrink: 0; }
.tech-item b { display: block; }
.tech-item span { color: var(--ink-faint); font-size: 12px; }
.timeline { display: grid; gap: 0; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.tl-dot { width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); flex-shrink: 0; margin-top: 5px; z-index: 1; }
.tl-item b { display: block; font-size: 13.5px; }
.tl-item span { font-size: 12px; color: var(--ink-faint); }

/* ---------------- auth / admin ---------------- */
.auth-card { max-width: 430px; margin: 24px auto; padding: 32px; }
.auth-card h1 { font-family: var(--serif); font-size: 27px; margin: 0 0 6px; }
/* 登录页只保留登录一种模式，不再有注册切换标签。 */
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.admin-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px; min-width: 96px; }
.admin-stat b { display: block; font-family: var(--serif); font-size: 21px; }
.admin-stat span { font-size: 11px; color: var(--ink-faint); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row .title { font-weight: 600; }
.admin-row .actions { display: flex; gap: 7px; flex-shrink: 0; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-grid .full { grid-column: 1 / -1; }
.editor-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.md-toolbar button { border: 1px solid transparent; background: none; border-radius: 6px; padding: 3px 9px; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.md-toolbar button:hover { background: var(--surface); border-color: var(--line); color: var(--accent); }
.md-toolbar .count { margin-left: auto; font-size: 11px; color: var(--ink-faint); padding: 4px 6px; }
#contentInput { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.preview-pane { min-height: 320px; max-height: 640px; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cover-preview { margin-top: 8px; height: 90px; border-radius: 8px; background: var(--surface-2); object-fit: cover; width: 100%; display: none; }

/* ---------------- footer / toast ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 44px 0 32px; }
.footer-brand { font-family: var(--serif); font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.footer-desc { color: var(--ink-faint); font-size: 13px; margin: 0 0 16px; max-width: 320px; line-height: 1.7; }
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social a { font-size: 12px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-soft); }
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.footer-col h4 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--ink-soft); padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; padding: 18px 0 26px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 12px; flex-wrap: wrap; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 11px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 60;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .cols { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .wrap { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 60px; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { height: 0; }
  .header-tools { margin-left: auto; }
  main { padding-top: 22px; }
  .hero { padding: 34px 24px 0; }
  .hero-art { display: none; }
  .hero-text { padding-bottom: 30px; }
  .hero-stat { flex-basis: 25%; }
  .cols { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; }
  .works-grid, .about-grid, .related-grid, .nav-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-col:first-child { grid-column: 1 / -1; }
  .editor-grid { grid-template-columns: 1fr; }
  .article-cover { height: 200px; }
}
@media (max-width: 520px) {
  .side { grid-template-columns: 1fr; }
  .post-cover { height: 120px; }
  .post-body { padding: 17px 18px 19px; }
  .hero h1 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col:first-child { grid-column: auto; }
}

/* ============================================================
   功能加厚：首页动态 / 图表 / 作品预览 / 阅读增强 / 后台工具
   ============================================================ */

/* ---------------- 首页站点动态条 ---------------- */
.pulse-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 26px; }
.pulse-item {
  min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px; box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s;
}
.pulse-item:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.pulse-label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.pulse-item b { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-item a:hover b { color: var(--accent); }
.pulse-item small { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 首页下方三块入口 ---------------- */
.home-extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.extra-card { padding: 20px; display: flex; flex-direction: column; }
.extra-title { font-family: var(--serif); font-size: 17px; margin: 0 0 14px; }
.extra-title .accent-bar { display: inline-block; width: 3px; height: 15px; border-radius: 3px; background: var(--grad); margin-right: 9px; vertical-align: -2px; }
.extra-more { display: inline-block; margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--accent); }
.extra-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag-cloud.big a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 12px; }
.tag-cloud.big em { font-style: normal; font-size: 10px; color: var(--ink-faint); }
.tag-cloud.big a:hover em { color: var(--accent); }
.mini-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.mc-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mc-col i { width: 68%; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--grad); transition: height .45s ease; }
.mc-col i.zero { background: var(--line); }
.mc-col span { font-size: 9px; color: var(--ink-faint); line-height: 1; }
.mini-works { display: grid; gap: 11px; }
.mini-works a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-works i { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-style: normal; font-size: 16px; }
.mini-works span { min-width: 0; display: block; }
.mini-works b { display: block; font-size: 13px; line-height: 1.4; }
.mini-works small { display: block; font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-works a:hover b { color: var(--accent); }

/* ---------------- 精选大卡 / 网格视图 ---------------- */
.post-item.featured { display: grid; grid-template-columns: 38% 1fr; min-height: 232px; }
.post-item.featured .post-cover { height: 100%; }
.post-item.featured .post-cover .cover-fallback { font-size: 56px; }
.post-item.featured .post-body { padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.post-item.featured h2 { font-size: 25px; }
.featured-hint { margin-top: 14px; font-size: 12px; color: var(--accent); font-weight: 600; }
.post-list.grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.post-list.grid-view .post-item.featured { display: block; min-height: 0; }
.post-list.grid-view .post-item.featured .post-cover { height: 120px; }
.post-list.grid-view .post-item.featured .post-body { padding: 17px 18px 19px; display: block; }
.post-list.grid-view .post-item.featured h2 { font-size: 18px; }
.post-list.grid-view .post-cover { height: 120px; }
.post-list.grid-view .post-item h2 { font-size: 18px; }
.post-list.grid-view .post-item p { font-size: 13px; }
.post-list.grid-view .featured-hint { display: none; }
.view-seg { flex-shrink: 0; }

/* ---------------- 文章阅读增强 ---------------- */
.article-tools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 0 22px; padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 99px;
}
.article-tools .tools-label { font-size: 11px; color: var(--ink-faint); margin-right: 2px; }
.article-tools button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 3px 11px; font-size: 12px; color: var(--ink-soft); cursor: pointer; transition: all .16s;
}
.article-tools button:hover, .article-tools button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tools-sep { width: 1px; height: 15px; background: var(--line); margin: 0 3px; }
.article-end { text-align: center; color: var(--ink-faint); font-size: 12px; letter-spacing: .12em; margin: 0 0 20px; }
.article-body pre.code-block { position: relative; padding: 0; overflow: hidden; background: var(--surface-2); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink-faint); }
.code-bar button { border: 0; background: none; color: var(--ink-faint); cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: 5px; }
.code-bar button:hover { color: var(--accent); background: var(--accent-soft); }
.article-body pre.code-block code { display: block; padding: 14px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; background: none; }
.code-block .c-com { color: #8b93a8; font-style: italic; }
.code-block .c-str { color: #2f9276; }
.code-block .c-kw { color: #8257d6; font-weight: 600; }
.code-block .c-num { color: #c9703a; }
[data-theme="dark"] .code-block .c-com { color: #737d95; }
[data-theme="dark"] .code-block .c-str { color: #6fd0a8; }
[data-theme="dark"] .code-block .c-kw { color: #b79aff; }
[data-theme="dark"] .code-block .c-num { color: #ffb27a; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
.table-wrap table { margin: 0; min-width: 420px; }
.article-body img.zoomable { cursor: zoom-in; transition: transform .2s, box-shadow .2s; }
.article-body img.zoomable:hover { box-shadow: var(--shadow-lg); }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 46px; background: rgba(10, 10, 18, .9); backdrop-filter: blur(5px); animation: fadeUp .2s ease both; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.lightbox-close { position: absolute; top: 16px; right: 24px; background: none; border: 0; color: #fff; font-size: 36px; line-height: 1; cursor: pointer; opacity: .8; }
.lightbox-close:hover { opacity: 1; }

/* ---------------- 标签 / 分类总览 / 404 ---------------- */
.browse-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.browse-cloud a { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; transition: all .18s; }
.browse-cloud a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.browse-cloud em { font-style: normal; font-size: 11px; color: #fff; background: var(--grad); border-radius: 99px; padding: 1px 8px; }
.browse-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.browse-group .section-title { font-size: 19px; margin-bottom: 12px; }
.browse-group .section-title small { font-family: var(--sans); font-size: 11px; color: var(--ink-faint); font-weight: 400; }
.browse-link { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.browse-link:last-child { border-bottom: 0; }
.browse-link time { font-size: 11px; color: var(--ink-faint); flex-shrink: 0; }
.browse-link b { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-link span { font-size: 11px; color: var(--ink-faint); flex-shrink: 0; }
.browse-link:hover b { color: var(--accent); }
.browse-switch { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.notfound { text-align: center; padding: 70px 20px 90px; }
.nf-num { font-family: var(--serif); font-size: clamp(76px, 15vw, 140px); line-height: 1; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85; }
.notfound h1 { font-family: var(--serif); font-size: 26px; margin: 6px 0 12px; }
.notfound p { color: var(--ink-soft); line-height: 1.9; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------------- 后台：标签页 / 批量 / 站点设置 / 工具 ---------------- */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.admin-tabs a { padding: 9px 16px; font-size: 13px; color: var(--ink-faint); border-bottom: 2px solid transparent; }
.admin-tabs a:hover { color: var(--accent); }
.admin-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.admin-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.admin-toolbar #adminSearch { flex: 1; min-width: 180px; }
.admin-toolbar .checkbox-field { flex-shrink: 0; }
.batch-controls { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.batch-controls .input { width: auto; padding: 7px 10px; font-size: 12px; }
.batch-controls #batchAction { max-width: 124px; }
.batch-controls #batchValue { max-width: 178px; }
.row-check-wrap { display: flex; align-items: center; padding-right: 4px; }
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.site-card { margin-bottom: 18px; }
.site-card .section-title { font-size: 19px; margin-bottom: 18px; }
.repeat-row { display: grid; grid-template-columns: 1fr 1.6fr 1fr 1.5fr auto; gap: 8px; align-items: center; margin-bottom: 9px; }
.repeat-row .input { padding: 8px 10px; font-size: 12px; }
.site-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 30px; }
.site-actions .form-error { margin: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; }
.tool-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; margin-bottom: 12px; }
.tool-card h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 8px; }
.tool-card p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.75; margin: 0 0 16px; flex: 1; }
.tool-card .btn { align-self: flex-start; }
#footerLinks a { display: block; font-size: 13px; color: var(--ink-soft); padding: 4px 0; }
#footerLinks a:hover { color: var(--accent); }

/* ---------------- 移动端底部导航 ---------------- */
.mobile-nav { display: none; }
@media (max-width: 820px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 4px 8px; border-radius: 9px; font-size: 10px; color: var(--ink-faint); }
  .mobile-nav a span { font-size: 17px; line-height: 1.1; }
  .mobile-nav a.active { color: var(--accent); background: var(--accent-soft); }
  body { padding-bottom: 60px; }
  main { padding-bottom: 34px; }
  .pulse-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-extras, .tool-grid { grid-template-columns: 1fr; }
  .browse-groups { grid-template-columns: 1fr; }
  .repeat-row { grid-template-columns: 1fr 1fr; }
  .repeat-row .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 520px) {
  .pulse-strip { grid-template-columns: 1fr; }
  .post-list.grid-view { grid-template-columns: 1fr; }
  .post-item.featured { display: block; min-height: 0; }
  .post-item.featured .post-cover { height: 148px; }
  .post-item.featured .post-body { padding: 20px 22px; display: block; }
  .post-item.featured h2 { font-size: 21px; }
  .article-tools { border-radius: var(--radius-sm); }
  .repeat-row { grid-template-columns: 1fr; }
  .lightbox { padding: 20px; }
}

/* ---------------- 编辑器增强：上传 / 工具栏 / 保存状态 / 沉浸写作 ---------------- */
.admin-head-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; line-height: 1.6; }
.field-hint code, .notice code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.cover-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cover-row .input { flex: 1 1 220px; min-width: 170px; }
.cover-row .btn { flex-shrink: 0; }

.md-toolbar { align-items: center; }
.md-toolbar .md-sep { width: 1px; height: 17px; background: var(--line); margin: 0 3px; }
.md-toolbar button.md-accent { color: var(--accent); font-weight: 500; }
.md-toolbar button.md-accent:hover { background: var(--accent-soft); }
.md-lang {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 6px; padding: 3px 6px; font-size: 12px; max-width: 108px; cursor: pointer;
}
.md-lang:focus { outline: none; border-color: var(--accent); }
.md-toolbar .count { white-space: nowrap; }

.editor-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 2px 4px; font-size: 12px; }
.save-state { color: var(--ink-faint); font-weight: 500; white-space: nowrap; }
.save-state.pending { color: var(--warm); }
.save-state.saving { color: var(--accent); }
.save-state.saved { color: var(--ink-soft); }
.save-state.saved::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.save-state.error { color: var(--danger); }
.upload-state { color: var(--ink-faint); white-space: nowrap; }
.upload-state.busy { color: var(--accent); }
.editor-hint { margin-left: auto; color: var(--ink-faint); font-size: 11px; }

.editor-advanced { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0 16px; margin: 14px 0 4px; }
.editor-advanced summary { cursor: pointer; padding: 11px 0; font-size: 13px; color: var(--ink-soft); font-weight: 500; list-style: none; }
.editor-advanced summary::-webkit-details-marker { display: none; }
.editor-advanced summary::before { content: '＋'; color: var(--accent); margin-right: 8px; }
.editor-advanced[open] summary::before { content: '－'; }
.advanced-body { border-top: 1px solid var(--line); padding-top: 16px; }
.advanced-body .field:last-child { margin-bottom: 2px; }

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.preview-head h3 { margin: 0; font-size: 13px; letter-spacing: .08em; color: var(--ink-faint); font-weight: 500; }
.preview-seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.preview-seg button { border: 0; background: transparent; color: var(--ink-faint); font-size: 12px; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.preview-seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.preview-pane.mobile-width { max-width: 375px; margin: 0 auto; border-left-width: 6px; border-right-width: 6px; }
.editor-grid.dragging { outline: 2px dashed var(--accent); outline-offset: 8px; border-radius: var(--radius-sm); }

body.editor-focus .site-header,
body.editor-focus .site-footer,
body.editor-focus .mobile-nav,
body.editor-focus .editor-preview { display: none !important; }
body.editor-focus .admin-head { position: sticky; top: 0; z-index: 20; padding: 10px 0; background: var(--bg); }
body.editor-focus .editor-grid { grid-template-columns: 1fr; }
body.editor-focus #contentInput { min-height: calc(100vh - 380px) !important; }

/* ---------------- 资源库：上传区 / 卡片 / 弹层 ---------------- */
.admin-tabs { overflow-x: auto; white-space: nowrap; }
.asset-drop {
  display: flex; align-items: center; gap: 16px; padding: 22px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.asset-drop:hover, .asset-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.asset-drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.asset-drop b { font-size: 14px; font-weight: 500; }
.asset-drop p { margin: 4px 0 0; font-size: 12px; color: var(--ink-faint); }
.asset-drop-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 24px; }
.asset-drop.compact { padding: 12px 16px; font-size: 13px; color: var(--ink-soft); gap: 10px; }
.asset-progress { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-faint); }
.asset-progress[hidden] { display: none; }
.asset-progress i { flex: 0 0 140px; height: 5px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.asset-progress i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: 99px; background: var(--grad); transition: width .2s; }
.asset-progress span { flex: 1; }

.asset-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 14px; }
.asset-toolbar .input { width: auto; }
.asset-toolbar #assetSearch, .asset-toolbar [data-lib="search"] { flex: 1; min-width: 170px; }
.asset-toolbar select.input { max-width: 150px; }
.asset-summary { margin-left: auto; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.asset-grid.compact { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; }
.asset-card { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.asset-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-file { font-size: 12px; letter-spacing: .1em; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 7px 12px; border-radius: 8px; }
.asset-info { padding: 9px 11px 6px; }
.asset-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-meta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.asset-ops { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 10px 11px; }
.asset-ops .btn { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

.asset-modal {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 24px; background: rgba(10, 10, 18, .55); backdrop-filter: blur(4px);
  animation: fadeUp .18s ease both;
}
.asset-modal-card {
  width: min(860px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px;
}
.asset-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.asset-modal-head h3 { margin: 0; font-family: var(--serif); font-size: 18px; }
.asset-modal-head .icon-btn { font-size: 24px; line-height: 1; }
.asset-modal-foot { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tool-footer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; font-size: 12px; color: var(--ink-faint); }

@media (max-width: 820px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-hint { display: none; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .asset-modal { padding: 12px; }
  .asset-modal-card { padding: 16px; }
  .asset-progress i { flex-basis: 90px; }
}
@media (max-width: 520px) {
  .cover-row .input { flex-basis: 100%; }
  .asset-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
