/* ==========================================================================
   星屑日和 · 二次元个人博客
   Author: 樱夜 / Design tokens first, mobile-friendly, no dependencies
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #fdf7f8;
  --bg-deep: #f7edf1;
  --ink: #2d2433;
  --ink-2: #6f6178;
  --ink-3: #9b8ea3;

  /* 主配色：由 html[data-palette] 切换（规则在文件末尾） */
  --a1: #ff7aa2;
  --a2: #9b7ede;
  --a3: #62c3e7;

  --sakura: var(--a1);
  --violet: var(--a2);
  --sky: var(--a3);
  --sakura-soft: color-mix(in srgb, var(--a1) 24%, #fff);
  --violet-soft: color-mix(in srgb, var(--a2) 20%, #fff);

  --glow-1: color-mix(in srgb, var(--a1) 46%, transparent);
  --glow-2: color-mix(in srgb, var(--a2) 40%, transparent);
  --glow-3: color-mix(in srgb, var(--a3) 40%, transparent);
  --acc-glow: color-mix(in srgb, var(--a1) 55%, transparent);
  --acc-line: color-mix(in srgb, var(--a1) 35%, transparent);
  --acc-soft: color-mix(in srgb, var(--a1) 12%, transparent);

  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #fffafc;
  --line: rgba(45, 36, 51, 0.1);
  --header-bg: rgba(253, 247, 248, 0.86);

  --shadow-sm: 0 2px 8px rgba(190, 120, 150, 0.08);
  --shadow-md: 0 14px 40px -18px rgba(190, 120, 150, 0.34);
  --shadow-lg: 0 30px 70px -30px rgba(120, 80, 140, 0.42);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;

  --wrap: 1120px;
  --header-h: 68px;
  --nav-h: 58px;   /* 悬浮胶囊导航的实际高度：首屏要从它底下穿过去 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #120f1a;
  --bg-deep: #191425;
  --ink: #f3edf9;
  --ink-2: #b9aec8;
  --ink-3: #8c81a0;

  --sakura: var(--a1);
  --violet: var(--a2);
  --sky: var(--a3);
  --sakura-soft: color-mix(in srgb, var(--a1) 26%, #120f1a);
  --violet-soft: color-mix(in srgb, var(--a2) 24%, #120f1a);

  --glow-1: color-mix(in srgb, var(--a1) 20%, transparent);
  --glow-2: color-mix(in srgb, var(--a2) 22%, transparent);
  --glow-3: color-mix(in srgb, var(--a3) 14%, transparent);
  --acc-glow: color-mix(in srgb, var(--a1) 45%, transparent);
  --acc-line: color-mix(in srgb, var(--a1) 32%, transparent);
  --acc-soft: color-mix(in srgb, var(--a1) 16%, transparent);

  --card: rgba(32, 26, 46, 0.68);
  --card-solid: #1c1629;
  --line: rgba(255, 255, 255, 0.09);
  --header-bg: rgba(18, 15, 26, 0.86);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.75);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 760px at 88% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 720px at -8% 12%, var(--glow-2), transparent 58%),
    radial-gradient(1000px 800px at 50% 112%, var(--glow-3), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  transition: opacity 0.4s ease;
}

[hidden] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--sakura-soft); color: var(--ink); }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 1000;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  transition: top 0.25s var(--ease);
}
.skip-link:focus-visible { top: 14px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

#petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main,
.site-footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -22px rgba(90, 50, 90, 0.6);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  flex-shrink: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-family: var(--font-serif);
  font-size: 19px;
  color: #fff;
  background: linear-gradient(140deg, var(--sakura), var(--violet));
  box-shadow: 0 6px 18px -8px var(--acc-glow);
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
}
.brand-text em {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sakura), var(--violet));
  transform: translateX(-50%);
  transition: width 0.28s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link.is-active::after { width: 18px; }
.nav-link.is-active { color: var(--ink); font-weight: 600; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--sakura);
  box-shadow: 0 8px 20px -12px var(--acc-glow);
}
.icon-btn:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.to-top:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.menu-btn .bar {
  display: block;
  width: 16px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
body.nav-open .menu-btn .bar:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
body.nav-open .menu-btn .bar:nth-child(2) { opacity: 0; }
body.nav-open .menu-btn .bar:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-top: clamp(48px, 8vw, 92px);
  padding-bottom: clamp(40px, 6vw, 72px);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px 16px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sakura);
  box-shadow: 0 0 0 4px var(--acc-soft);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 6.4vw, 4.15rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

.grad {
  background: linear-gradient(115deg, var(--a1) 5%, var(--a2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.grad-2 {
  background: linear-gradient(115deg, var(--violet), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  margin-top: 20px;
  min-height: 1.8em;
  font-size: clamp(15px, 1.9vw, 17px);
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--sakura);
  font-weight: 300;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  margin-top: 10px;
  max-width: 46ch;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s ease, border-color 0.28s ease;
}
.btn span { transition: transform 0.28s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--a1), var(--a2));
  box-shadow: 0 14px 30px -14px var(--acc-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -16px var(--acc-glow);
}
.btn-ghost {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--sakura);
  box-shadow: var(--shadow-md);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.hero-tags li {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
}

/* hero card */
.hero-card {
  position: relative;
  padding: 34px 28px 26px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  overflow: hidden;
  animation: floatIn 0.9s var(--ease) both;
  animation-delay: 0.15s;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.card-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--acc-glow), transparent 68%);
  transform: translateX(-50%);
  filter: blur(10px);
  pointer-events: none;
}
.avatar-ring {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(from 0deg, var(--sakura), var(--violet), var(--sky), var(--sakura));
  animation: spin 14s linear infinite;
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed var(--acc-line);
  animation: spin 22s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  width: calc(100% - 7px);
  height: calc(100% - 7px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 38px;
  color: #fff;
  background: linear-gradient(140deg, var(--a1), var(--a2) 60%, var(--a3));
  text-shadow: 0 2px 10px rgba(120, 40, 90, 0.35);
  animation: spin 14s linear infinite reverse;
}

/* ---------- 头像：支持自定义图片 ---------- */
.avatar,
.author-avatar { position: relative; overflow: hidden; }
.avatar[data-avatar-edit] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.avatar:focus-visible { outline: 2px solid var(--a1); outline-offset: 4px; }
.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
}
.avatar.has-img { background: var(--card); }

.avatar-hint,
.avatar-reset {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  line-height: 1;
  color: #fff;
  background: rgba(22, 14, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.avatar-hint { font-size: 12px; right: 8px; bottom: 22px; opacity: 0; }
.avatar-reset { font-size: 16px; left: 8px; top: 22px; opacity: 0; cursor: pointer; }
.avatar:hover .avatar-hint,
.avatar:hover .avatar-reset,
.avatar:focus-visible .avatar-hint,
.avatar:focus-visible .avatar-reset { opacity: 1; }
.avatar:active .avatar-hint { transform: scale(0.9); }
@media (hover: none) {
  .avatar[data-avatar-edit] .avatar-hint { opacity: 0.9; }
  .avatar.has-img .avatar-reset { opacity: 0.9; }
}

/* 换头像后的小提示条 */
.avatar-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 999;
  max-width: min(90vw, 380px);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #fff;
  background: rgba(26, 18, 28, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.avatar-toast.show { opacity: 1; transform: translate(-50%, 0); }

.card-name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.04em;
}
.card-name span {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 4px;
}
.card-role {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.card-meta {
  margin: 20px 0 18px;
  display: grid;
  gap: 9px;
  text-align: left;
}
.card-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.32);
  font-size: 12.8px;
  color: var(--ink-2);
}
[data-theme="dark"] .card-meta li { background: rgba(255, 255, 255, 0.04); }
.card-meta .ico { font-size: 13px; }

.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.card-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-stats div + div { border-left: 1px solid var(--line); }
.card-stats b {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--sakura);
}
.card-stats span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
}
.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08); } }

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(40px, 6vw, 72px);
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.section + .section { border-top: 1px dashed var(--line); }

.section-head {
  max-width: 640px;
  margin-bottom: 34px;
}
.section-jp {
  font-size: 11.5px;
  letter-spacing: 0.24em;
  color: var(--sakura);
  text-transform: uppercase;
  font-weight: 600;
}
.section-head h2 {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  letter-spacing: 0.02em;
}
.section-desc {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ---------- Filter ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.chip:hover { border-color: var(--sakura); color: var(--ink); }
.chip.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--sakura), var(--violet));
  box-shadow: 0 8px 20px -12px var(--acc-glow);
}

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.post-card {
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.3s ease;
}
.post-card.is-hidden { display: none; }
.post-card:hover { transform: translateY(-6px); }

.post-link {
  display: block;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), border-color 0.3s ease;
}
.post-link:hover {
  border-color: var(--acc-line);
  box-shadow: var(--shadow-md);
}
.post-link:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.cover {
  position: relative;
  height: 148px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.4) 0 1.5px, transparent 1.5px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px);
  background-size: 90px 90px, 70px 70px, 50px 50px;
  opacity: 0.7;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(255, 255, 255, 0.16));
}
.cover-emoji {
  position: relative;
  z-index: 1;
  font-size: 44px;
  filter: drop-shadow(0 8px 16px rgba(120, 60, 100, 0.25));
  transition: transform 0.5s var(--ease);
}
.post-link:hover .cover-emoji { transform: scale(1.12) rotate(-6deg); }

.cover-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  letter-spacing: 0.06em;
}

.cover-1 { background: linear-gradient(140deg, #ffd9e3, #ffb0c8 45%, #e0a7f0); }
.cover-2 { background: linear-gradient(140deg, #cfd8ff, #a9b7f7 45%, #b49bea); }
.cover-3 { background: linear-gradient(140deg, #cdeee0, #a9dcc7 45%, #a8d8ea); }
.cover-4 { background: linear-gradient(140deg, #ffe4bd, #ffc48c 45%, #ff9fb0); }
.cover-5 { background: linear-gradient(140deg, #efe0ff, #d3bdf5 45%, #b8a3e8); }
.cover-6 { background: linear-gradient(140deg, #c6e9ff, #9bd2f2 45%, #b9a0ff); }

.post-body { padding: 18px 20px 20px; }
.post-body h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}
.post-link:hover .post-body h3 { color: var(--sakura); }
.post-body p {
  margin-top: 8px;
  font-size: 13.2px;
  color: var(--ink-2);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.empty-note {
  margin-top: 26px;
  padding: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(26px, 5vw, 56px);
  align-items: start;
}

.about-text p { margin-top: 14px; font-size: 14.8px; color: var(--ink-2); line-height: 1.95; }
.about-lead {
  margin-top: 0 !important;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.35rem) !important;
  color: var(--ink) !important;
  line-height: 1.6 !important;
}
.about-note {
  padding: 12px 16px;
  border-left: 3px solid var(--sakura);
  border-radius: 0 12px 12px 0;
  background: var(--acc-soft);
  font-size: 13.5px !important;
}
.about-note .ico { color: var(--sakura); }

.timeline {
  margin-top: 26px;
  display: grid;
  gap: 0;
  border-left: 1px dashed var(--line);
  padding-left: 20px;
}
.timeline li {
  position: relative;
  padding: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-2);
  display: grid;
  gap: 2px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--sakura);
}
.timeline b {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.about-skills {
  padding: 28px 26px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.skills-title {
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 20px;
}
.skills-title span {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 6px;
}

.skill + .skill { margin-top: 16px; }
.skill-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--ink-2);
}
.skill-top b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}
.skill-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(155, 142, 163, 0.16);
  overflow: hidden;
}
.skill-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sakura), var(--violet));
  transition: width 1.1s var(--ease);
}
.about-skills.in .skill-fill { width: var(--lv); }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.skill-tags span {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--a2) 12%, transparent);
}

/* ---------- Friends ---------- */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (min-width: 820px) {
  .friend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.friend-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), border-color 0.3s ease, box-shadow 0.35s ease;
}
.friend-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--a2) 40%, transparent);
  box-shadow: var(--shadow-md);
}
.friend-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 17px;
  color: #59405f;
  background: linear-gradient(140deg, var(--c1, #ffd3e0), var(--c2, #ffb7c5));
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.friend-card b { display: block; font-size: 14px; font-weight: 600; }
.friend-card small { display: block; font-size: 11.5px; color: var(--ink-3); }
.friend-arrow {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 14px;
  transition: transform 0.3s var(--ease), color 0.3s ease;
}
.friend-card:hover .friend-arrow { transform: translate(2px, -2px); color: var(--sakura); }

/* ---------- CTA ---------- */
.cta-section { padding-bottom: clamp(48px, 7vw, 84px); }
.cta {
  position: relative;
  padding: clamp(34px, 5vw, 54px) clamp(26px, 4vw, 48px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(255, 255, 255, 0.28), transparent 60%),
    linear-gradient(120deg, var(--a1), var(--a2));
  box-shadow: 0 30px 60px -30px var(--acc-glow);
}
.cta-inner { position: relative; z-index: 1; max-width: 560px; margin-inline: auto; }
.cta-jp {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.85;
}
.cta h2 {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.4vw, 2rem);
}
.cta p {
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.85;
}
.cta .btn-primary {
  margin-top: 24px;
  color: #7a3a55;
  background: #fff;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.5);
}
.cta .btn-primary:hover { box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6); }

.cta-deco span {
  position: absolute;
  font-size: 26px;
  opacity: 0.4;
  animation: drift 9s ease-in-out infinite;
}
.cta-deco span:nth-child(1) { top: 18%; left: 8%; }
.cta-deco span:nth-child(2) { bottom: 16%; left: 22%; font-size: 16px; animation-delay: 1.6s; }
.cta-deco span:nth-child(3) { top: 26%; right: 12%; font-size: 20px; animation-delay: 3.2s; }
@keyframes drift {
  50% { transform: translateY(-14px) rotate(12deg); }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
  background: rgba(255, 255, 255, 0.22);
}
[data-theme="dark"] .site-footer { background: rgba(255, 255, 255, 0.02); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}
.footer-brand span {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  margin-left: 6px;
}
.footer-meta { font-size: 11.5px; color: var(--ink-3); }
.footer-links { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.footer-links a { transition: color 0.25s ease; }
.footer-links a:hover { color: var(--sakura); }

/* ---------- To top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: all 0.35s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--sakura); color: var(--sakura); transform: translateY(-3px); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 40px;
  }
  .hero-card { max-width: 420px; margin-inline: auto; width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .about-skills { max-width: 520px; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .wrap { padding-inline: 18px; }

  .menu-btn { display: flex; }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 18px 18px;
    background: var(--card-solid);
    border-radius: 0 0 20px 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 50px -34px rgba(0, 0, 0, 0.55);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, transform 0.28s var(--ease), visibility 0.28s;
  }
  body.nav-open .nav { opacity: 1; transform: none; visibility: visible; }
  .nav-link { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
  .nav-link.is-active { background: var(--acc-soft); }
  .nav-link::after { display: none; }

  .hero-title { font-size: clamp(2rem, 8.6vw, 2.9rem); }
  .section-head { margin-bottom: 26px; }
  /* 手机上两列小卡片，别再一张占满一行 */
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .cover { height: 104px; }
  .cover-emoji { font-size: 30px; }
  .cover-badge { top: 8px; left: 8px; padding: 2px 8px; font-size: 10px; }
  .post-body { padding: 12px 13px 14px; }
  .post-body h3 {
    font-size: 13.6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .post-body p {
    margin-top: 5px;
    font-size: 11.8px;
    line-height: 1.6;
    -webkit-line-clamp: 1;
  }
  .post-meta { margin-top: 8px; font-size: 10px; gap: 4px; }
  .post-meta .meta-dot-views,
  .post-meta .meta-views { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-actions .btn { flex: 1 1 auto; padding-inline: 18px; }
  .card-stats b { font-size: 18px; }
  .about-skills { padding: 22px 20px; }
}

/* 小屏手机：两列卡片再收一点 */
@media (max-width: 380px) {
  .post-grid { gap: 10px; }
  .cover { height: 92px; }
  .post-body { padding: 10px 11px 12px; }
  .post-body h3 { font-size: 12.8px; }
  .post-meta { font-size: 9.5px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  #petals { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, #petals, .to-top, .cta-deco, .hero-card { display: none !important; }
  body::before { display: none; }
}

/* ==========================================================================
   文章详情页
   ========================================================================== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.read-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--sakura), var(--violet), var(--sky));
  box-shadow: 0 0 12px var(--acc-glow);
  transition: width 0.1s linear;
}

.article-hero {
  padding-top: clamp(28px, 5vw, 52px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.breadcrumb a { transition: color 0.25s ease; }
.breadcrumb a:hover { color: var(--sakura); }
.breadcrumb span[aria-current] { color: var(--ink-2); }

.article-title {
  margin-top: 18px;
  max-width: 20ch;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.article-banner {
  position: relative;
  margin-top: 28px;
  height: clamp(180px, 26vw, 260px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(500px 240px at 25% 20%, rgba(255, 255, 255, 0.55), transparent 65%),
    linear-gradient(130deg, color-mix(in srgb, var(--a1) 30%, #fff), color-mix(in srgb, var(--a1) 60%, #fff) 42%, color-mix(in srgb, var(--a2) 55%, #fff) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.article-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.6) 0 2.5px, transparent 2.5px),
    radial-gradient(circle at 76% 65%, rgba(255, 255, 255, 0.45) 0 2px, transparent 2px),
    radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.35) 0 1.5px, transparent 1.5px);
  background-size: 110px 110px, 80px 80px, 60px 60px;
}
.banner-emoji {
  font-size: clamp(60px, 12vw, 104px);
  filter: drop-shadow(0 16px 30px rgba(140, 60, 100, 0.3));
  transform: rotate(-8deg);
}
.banner-word {
  position: absolute;
  bottom: 16px;
  left: 22px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}
.banner-jp {
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.85);
  writing-mode: vertical-rl;
}

/* layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  padding-top: clamp(30px, 4vw, 48px);
}

/* prose */
.prose {
  min-width: 0;
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink-2);
}
.prose > * + * { margin-top: 18px; }
.prose p { text-wrap: pretty; }
.prose .lead {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.9;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose b { color: var(--ink); font-weight: 600; }

.prose h2 {
  position: relative;
  margin-top: 44px;
  padding-left: 22px;
  font-family: var(--font-serif);
  font-size: clamp(1.28rem, 3vw, 1.55rem);
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h2::before {
  content: "❀";
  position: absolute;
  left: 0;
  top: 0.1em;
  font-size: 0.8em;
  color: var(--sakura);
}
.prose h3 {
  margin-top: 30px;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h3::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 9px;
  vertical-align: 5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sakura), var(--violet));
}

.prose ul {
  display: grid;
  gap: 8px;
  padding-left: 4px;
}
.prose ul li {
  position: relative;
  padding-left: 20px;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-soft);
  border: 1.5px solid var(--violet);
}

.prose code {
  padding: 2px 7px;
  border-radius: 6px;
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 0.86em;
  color: color-mix(in srgb, var(--a1) 78%, #4a1a2a);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
}
[data-theme="dark"] .prose code { color: color-mix(in srgb, var(--a1) 52%, #fff); }

.prose pre {
  position: relative;
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  background: #241d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  color: #e7dff5;
  font-size: 12.8px;
  line-height: 1.72;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #e7dff5;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}
.prose pre:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }

.prose blockquote {
  position: relative;
  margin: 26px 0;
  padding: 18px 22px 18px 26px;
  border-left: 3px solid var(--sakura);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, var(--acc-soft), color-mix(in srgb, var(--a2) 6%, transparent));
  font-family: var(--font-serif);
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.8;
}
.prose blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
}

.tip {
  margin: 26px 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--a3) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--a3) 50%, transparent);
  font-size: 14.2px;
}
.tip p { margin: 0; }
.tip-title { font-weight: 700; color: #2b8fb5; margin-bottom: 4px !important; }
[data-theme="dark"] .tip-title { color: #7dd3f0; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.post-tags .tag-label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.14em; }
.post-tags a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}
.post-tags a:hover { border-color: var(--sakura); color: var(--sakura); }

/* author */
.author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.author-avatar {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 21px;
  color: #fff;
  background: linear-gradient(140deg, #ffa8c2, #b79bef);
}
.author-card b { display: block; font-size: 14.5px; color: var(--ink); }
.author-card p { margin-top: 4px; font-size: 12.8px; line-height: 1.7; }
.author-btn { margin-left: auto; padding: 9px 18px; font-size: 12.5px; flex-shrink: 0; }

/* prev / next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.post-nav-item {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}
.post-nav-item:hover { transform: translateY(-3px); border-color: var(--acc-line); }
.post-nav-item small { font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }
.post-nav-item b { font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.post-nav-item.next { text-align: right; }

/* toc */
.toc-side { position: sticky; top: calc(var(--header-h) + 24px); }
.toc-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toc-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}
.toc-title span {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.toc-card ol {
  margin-top: 12px;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}
.toc-card li { counter-increment: toc; }
.toc-card a {
  position: relative;
  display: block;
  padding: 6px 10px 6px 26px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: background 0.25s ease, color 0.25s ease;
}
.toc-card a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 8px;
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.toc-card a:hover { background: var(--acc-soft); color: var(--ink); }
.toc-card a.is-active {
  color: var(--sakura);
  font-weight: 600;
  background: var(--acc-soft);
}
.toc-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toc-foot a { color: var(--sakura); }

/* comments */
.comments {
  padding-top: clamp(44px, 6vw, 70px);
  padding-bottom: clamp(50px, 7vw, 80px);
  border-top: 1px dashed var(--line);
  margin-top: clamp(40px, 6vw, 70px);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.comment-form {
  padding: clamp(22px, 3.5vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--ink-3); letter-spacing: 0.08em; }
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea { background: rgba(255, 255, 255, 0.04); }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); opacity: 0.8; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sakura);
  background: var(--card-solid);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.form-hint { font-size: 11.5px; color: var(--ink-3); }
.form-note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--a3) 14%, transparent);
  border: 1px dashed color-mix(in srgb, var(--a3) 50%, transparent);
}

.comment-list { margin-top: 26px; display: grid; gap: 14px; }
.comment {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.comment-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 15px;
  color: #59405f;
  background: linear-gradient(140deg, var(--c1, #ffd3e0), var(--c2, #ffb7c5));
}
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}
.comment-head b { color: var(--ink); }
.comment-head time { font-size: 11px; color: var(--ink-3); }
.comment-body > p:last-child { margin-top: 6px; font-size: 13.5px; line-height: 1.8; }
.comment-demo {
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}

@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-side { display: none; }
}

@media (max-width: 620px) {
  .prose { font-size: 15.5px; }
  .prose h2 { margin-top: 36px; }
  .field-row { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.next { text-align: left; }
  .author-card { flex-wrap: wrap; }
  .author-btn { margin-left: 0; }
  .form-foot .btn { width: 100%; }
  .comment-demo { text-align: left; }
}

@media print {
  .read-progress, .toc-side, .comment-form, .comment-list, .post-nav, .author-btn { display: none !important; }
  .prose { color: #222; }
}


/* ==========================================================================
   配色方案：html[data-palette] 一键换色（main.js 切换并记忆）
   ========================================================================== */
html[data-palette="sakura"] { --a1: #ff7aa2; --a2: #9b7ede; --a3: #62c3e7; }

.palette-wrap { position: relative; display: flex; }

.palette-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 136px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s var(--ease), visibility 0.22s;
}
.palette-wrap.is-open .palette-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.swatch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.swatch:hover { background: var(--acc-soft); color: var(--ink); }
.swatch.is-active { background: var(--acc-soft); color: var(--ink); font-weight: 600; }
.swatch i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   账号 · 登录 / 注册 / 用户后台
   ========================================================================== */
.auth-main {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  align-items: center;
  padding-block: clamp(32px, 6vw, 72px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-badge {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.auth-title {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
}
.auth-title span { color: var(--sakura); }

.auth-sub {
  margin-top: 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin: 22px 0 20px;
  border-radius: 999px;
  background: rgba(155, 142, 163, 0.14);
}
.auth-tab {
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.auth-tab.is-active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(120deg, var(--a1), var(--a2));
  box-shadow: 0 8px 18px -10px var(--acc-glow);
}

.auth-form .field:last-of-type { margin-bottom: 4px; }
.auth-submit { width: 100%; margin-top: 8px; }

.auth-msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.8px;
  line-height: 1.7;
  border: 1px dashed var(--line);
  color: var(--ink-2);
  background: var(--card);
}
.auth-msg.is-error {
  color: #c23b3b;
  background: rgba(255, 95, 95, 0.08);
  border-color: rgba(255, 95, 95, 0.45);
}
.auth-msg.is-ok {
  color: var(--ink);
  background: var(--acc-soft);
  border-color: var(--acc-line);
}
.auth-msg.is-info {
  color: var(--ink-2);
  background: color-mix(in srgb, var(--a3) 12%, transparent);
  border-color: color-mix(in srgb, var(--a3) 45%, transparent);
}
[data-theme="dark"] .auth-msg.is-error { color: #ff9c9c; }

.auth-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.auth-foot a { color: var(--sakura); }

.auth-user { text-align: center; padding-top: 6px; }
.auth-avatar {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 24px;
  color: #fff;
  background: linear-gradient(140deg, var(--a1), var(--a2) 60%, var(--a3));
  box-shadow: 0 10px 24px -12px var(--acc-glow);
}
.auth-user b { display: block; font-size: 16px; }
.auth-mail { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); word-break: break-all; }
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.auth-actions .btn { padding: 10px 20px; font-size: 13px; }

/* ---------- 管理后台 ---------- */
.admin-main { padding-block: clamp(32px, 6vw, 64px); min-height: calc(100vh - var(--header-h) - 130px); }

.admin-head { margin-bottom: 22px; }
.admin-head h1 {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}
.admin-toolbar input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}
.admin-toolbar input:focus {
  outline: none;
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.admin-count { font-size: 12px; color: var(--ink-3); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}
.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
  background: rgba(155, 142, 163, 0.08);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--acc-soft); }
.admin-table .cell-email { color: var(--ink); }
.admin-table .cell-dim { color: var(--ink-3); }
.admin-table .mono { font-variant-numeric: tabular-nums; }

.admin-table.is-wide { min-width: 1060px; }

.admin-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(155, 142, 163, 0.16);
  color: var(--ink-2);
}
.admin-badge.is-admin {
  background: linear-gradient(120deg, var(--a1), var(--a2));
  color: #fff;
}

.admin-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 34px 0 14px;
}
.admin-subtitle {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.admin-subhead .btn { padding: 7px 12px; font-size: 12px; }
.btn-ghost.is-armed {
  color: #e0556f;
  border-color: rgba(224, 85, 111, 0.5);
}
@media (max-width: 640px) {
  .admin-subhead { gap: 8px; }
  .admin-subhead .btn { padding: 6px 10px; }
}

.admin-place,
.content-place { width: 250px; }
.content-place { color: var(--ink); }
.coord-link {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--sakura);
  text-decoration: none;
  white-space: nowrap;
}
.coord-link:hover { text-decoration: underline; }
.admin-place-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
}
.admin-place-empty { color: var(--ink-3); }

.content-place span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.admin-place span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .admin-place { width: 180px; }
}

/* ---------- 手机上：后台表格改成一块一块，不再横向挤 ---------- */
@media (max-width: 640px) {
  .admin-table,
  .admin-table.is-wide {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-table thead { display: none; }
  .admin-table tbody { display: block; }
  .admin-table tbody tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .admin-table tbody tr:last-child { border-bottom: 0; }
  .admin-table td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  /* 用户表 */
  .admin-table .col-no { display: none; }
  .admin-table .col-user { display: flex; align-items: center; gap: 9px; }
  .admin-table .col-user .admin-name { font-size: 14px; font-weight: 600; }
  .admin-table .col-mail { font-size: 11.5px; color: var(--ink-3); margin: 3px 0 6px; }
  .admin-table .col-geo,
  .admin-table .col-login { width: auto; font-size: 12px; margin-top: 3px; }
  .admin-table .col-geo::before,
  .admin-table .col-login::before {
    content: attr(data-label);
    display: inline;
    color: var(--ink-3);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    margin-right: 6px;
  }
  .admin-table .admin-place span { display: inline; line-height: 1.6; }
  .admin-table .admin-place span + span::before { content: ' · '; color: var(--ink-3); }
  .admin-table .admin-place .admin-place-sub {
    font-size: 10.5px;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .admin-table .col-anon,
  .admin-table .col-role,
  .admin-table .col-time { display: inline-block; margin: 8px 10px 0 0; font-size: 11px; }

  /* 访客表：时间 + 来源一行，地点一行，IP 一行 */
  .admin-table .col-vtime { display: inline; font-size: 11px; }
  .admin-table .col-source { display: inline; font-size: 11px; color: var(--ink-3); }
  .admin-table .col-source::before { content: ' · '; }
  .admin-table .col-place { width: auto; margin: 3px 0; font-size: 13px; }
  .admin-table .content-place span { display: inline; line-height: 1.6; }
  .admin-table .col-ip { display: inline; font-size: 11px; color: var(--ink-3); }
  .admin-table .col-isp { display: none; }
  .admin-subhead { margin-top: 26px; }
}

.admin-tip { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); line-height: 1.8; }
.admin-empty { padding: 30px; text-align: center; font-size: 13px; color: var(--ink-3); }

.admin-code {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #241d31;
  color: #e7dff5;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- 留言：绑定账号 ---------- */
.comment-as {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.comment-as b { display: block; font-size: 13.5px; }
.comment-as small { display: block; font-size: 11.5px; color: var(--ink-3); word-break: break-all; }
.comment-as .btn { margin-left: auto; padding: 8px 16px; font-size: 12px; }

.comment-gate {
  padding: 30px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.comment-gate p { font-size: 13.5px; color: var(--ink-2); }
.comment-gate .btn { margin-top: 16px; }

.comment-empty {
  padding: 26px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.comment-time { font-size: 11px; color: var(--ink-3); margin-left: auto; }
.comment-head { display: flex; align-items: baseline; gap: 10px; }
.comment-mine {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--sakura);
  background: var(--acc-soft);
}
.comment-del {
  margin-left: 8px;
  border: 0;
  background: none;
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
}
.comment-del:hover { color: var(--sakura); }

/* ---------- 邮箱验证码 ---------- */
.otp-send {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}
.otp-send .field { flex: 1; margin-bottom: 0; }
.otp-send .btn {
  padding: 11px 14px;
  font-size: 12.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.otp-send .btn:disabled { opacity: 0.6; cursor: default; }
.otp-tip {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.75;
}
.otp-code input {
  letter-spacing: 0.4em;
  font-size: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--sakura);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
 * 文章系统（数据库文章）+ 写文章页
 * ========================================================================== */

/* 导航里的「写文章」 */
.nav-link.nav-write { color: var(--sakura); }
.nav-link.nav-write[hidden] { display: none !important; }

/* 目录层级 */
.toc-card .toc-lv2 { padding-left: 14px; }
.toc-card .toc-lv2 a { font-size: 12px; opacity: 0.85; }

/* 上下篇占位 */
.post-nav-item.is-empty {
  display: block;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  color: var(--ink-3);
  cursor: default;
}
.post-nav-item.is-empty b { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.post-nav-item.next.is-empty { text-align: right; }

/* 正文里的图片：平板上别一张图占满整屏，收窄居中；
   特别长的竖图也不霸占好几屏 */
.prose img {
  display: block;
  max-width: min(100%, 620px);
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  margin: 22px auto;
}
/* 连着插的几张图：自动并排，两列对齐 */
.prose .img-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 22px auto;
}
.prose .img-row img {
  width: 100%;
  max-width: none;
  aspect-ratio: 4 / 3;
  max-height: none;
  object-fit: contain;
  background: var(--acc-soft);
  border-radius: 12px;
  margin: 0;
}
.prose .img-row img:only-child {
  grid-column: 1 / -1;
  max-height: 78vh;
  object-fit: contain;
}
/* 张数是奇数时，最后一张占满一整行，不留空洞 */
.prose .img-row img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}
/* ---------- 正文链接：自动标蓝，不用记格式 ---------- */
.prose p a,
.prose li a,
.prose blockquote a,
.prose figcaption a,
.prose td a {
  color: #2f6fe4;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, #2f6fe4 35%, transparent);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.prose p a:hover,
.prose li a:hover,
.prose blockquote a:hover,
.prose figcaption a:hover { border-bottom-color: currentColor; }
[data-theme="dark"] .prose p a,
[data-theme="dark"] .prose li a,
[data-theme="dark"] .prose blockquote a,
[data-theme="dark"] .prose figcaption a {
  color: #7aa9ff;
  border-bottom-color: rgba(122, 169, 255, 0.38);
}

/* ---------- 单张图片：可以选位置和大小 ---------- */
.prose::after { content: ""; display: block; clear: both; }
.prose .img-block {
  margin: 24px auto;
  max-width: 620px;
}
.prose .img-block img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 14px;
}
.prose .img-block figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}
.prose .img-block.align-left {
  float: left;
  margin: 6px 18px 16px 0;
}
.prose .img-block.align-right {
  float: right;
  margin: 6px 0 16px 18px;
}
.prose .img-block.size-full { max-width: 100%; }
.prose .img-block.size-half { max-width: 50%; }
.prose .img-block.size-sm { max-width: 32%; }
/* 并排的图可以整排拉满 */
.prose .img-row.is-full { max-width: 100%; }

/* 正文行宽也收一点，平板上读起来更舒服 */
.prose { max-width: 720px; }
/* 文章顶部那张封面也一样宽度，别在平板上拉成一整条 */
.article-banner { max-width: 720px; }
@media (max-width: 640px) {
  .prose { max-width: none; }
  .prose img { max-width: 100%; margin: 18px 0; max-height: 70vh; }
  .prose .img-row { grid-template-columns: 1fr; gap: 12px; margin: 18px 0; max-width: none; }
  .prose .img-row img { margin: 0; aspect-ratio: auto; max-height: 60vh; }
  .prose .img-block.align-left,
  .prose .img-block.align-right { float: none; margin: 18px auto; }
  .prose .img-block.size-half { max-width: 74%; }
  .prose .img-block.size-sm { max-width: 46%; }
  .article-banner { max-width: none; }
}

/* ---------- 写文章 ---------- */
.write-page { padding-block: clamp(28px, 5vw, 56px) clamp(48px, 8vw, 90px); }
.write-page > section { max-width: 880px; margin-inline: auto; }

.write-gate {
  text-align: center;
  padding: clamp(34px, 6vw, 60px) 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.write-gate h1 { font-family: var(--font-serif); font-size: clamp(20px, 4vw, 26px); }
.write-gate p { margin-top: 10px; color: var(--ink-2); font-size: 13.5px; line-height: 1.8; }
.write-gate-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

.write-form {
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.write-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
}
.field-emoji input { text-align: center; font-size: 18px; }
.write-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.85;
  min-height: 330px;
  resize: vertical;
}
.write-sub {
  margin: 32px 0 12px;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.write-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.write-item-main { flex: 1; min-width: 0; }
.write-item-main b { display: block; font-size: 14px; line-height: 1.5; }
.write-item-main small { color: var(--ink-3); font-size: 11.5px; }
.write-item-emoji { font-size: 18px; }
.write-btn { padding: 6px 13px; font-size: 12px; flex-shrink: 0; }
.write-btn.is-danger { color: #e0556f; }

@media (max-width: 640px) {
  .write-row { grid-template-columns: 76px 1fr; }
  .write-item { flex-wrap: wrap; }
  .write-item-main { flex-basis: 100%; }
}

/* 账号页 · 我的资料 */
.auth-settings {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.auth-settings-title {
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  color: var(--ink);
}
.auth-settings-tip {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-3);
  margin-top: 6px;
}
.auth-settings .form-foot { flex-wrap: wrap; }

/* 头像选图：页面里的原生文件框，label 直接触发（iOS 上比 JS click 稳） */
.avatar-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  pointer-events: none;
}
.avatar[for] { cursor: pointer; }
.avatar.is-locked { cursor: default; }
.avatar.is-locked .avatar-hint,
.avatar.is-locked .avatar-reset { display: none; }
label.btn { cursor: pointer; }

/* ==========================================================================
 * 文章封面图 / 封面选择器 / 独立留言板 / 两步删除
 * ========================================================================== */

/* 列表卡片封面图 */
.cover-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-link:hover .cover-img img { transform: scale(1.05); }
.cover-img::before,
.cover-img::after { display: none; }

/* 文章页大图 */
.article-banner.has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.article-banner.has-cover::after { display: none; }
.article-banner.has-cover .banner-emoji,
.article-banner.has-cover .banner-word,
.article-banner.has-cover .banner-jp { display: none; }

/* 写文章：封面选择 */
.write-cover { margin: 2px 0 16px; }
.write-cover-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.write-cover-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.write-cover-box {
  position: relative;
  width: 232px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  overflow: hidden;
}
[data-theme="dark"] .write-cover-box { background: rgba(255, 255, 255, 0.04); }
.write-cover-box img { width: 100%; height: 100%; object-fit: cover; }
.write-cover-empty { font-size: 12px; color: var(--ink-3); }
.write-cover-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.write-cover-tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* 独立留言板 */
.guestbook-hero { padding-block: clamp(30px, 5vw, 58px) 4px; }
.guestbook-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 5vw, 40px);
  letter-spacing: 0.03em;
  margin-top: 6px;
}

/* 两步删除：第一下变「再点一次」 */
[data-del][data-armed="1"],
.comment-del[data-armed="1"] {
  color: #e0556f;
  font-weight: 600;
}

/* 文章页：只有管理员能看到的「改 / 删」 */
.post-admin {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.post-admin[hidden] { display: none !important; }
.post-admin .btn { padding: 8px 18px; font-size: 12.5px; }
.post-admin-del[data-armed="1"] { color: #e0556f; font-weight: 600; }

/* 联系卡片：用应用图标 */
.friend-avatar.has-img {
  background: none;
  border-color: transparent;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(120, 80, 110, 0.14);
}
.friend-avatar.has-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* ==========================================================================
 * 联系卡片 + 二维码弹层
 * ========================================================================== */
.friend-grid {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.friend-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 18px;
  gap: 12px;
}
.friend-text { min-width: 0; flex: 1; }
.friend-text b {
  display: block;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink);
}
.friend-text small {
  display: block;
  margin-top: 2px;
  font-size: 11.8px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  letter-spacing: 0;
  color: var(--ink-3);
  background: var(--acc-soft);
  transition: background 0.25s ease, color 0.25s ease;
}
.friend-card.has-qr:hover .friend-arrow { color: #fff; background: var(--a1); }

/* 弹层 */
body.qr-open { overflow: hidden; }
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 20px;
}
.qr-modal.show { display: grid; }
.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 16, 28, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.qr-card {
  position: relative;
  width: min(340px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: var(--card-solid, #fff);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  transform-origin: center center;
  will-change: transform, opacity;
}
.qr-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.qr-head {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding-right: 30px;
  margin-bottom: 14px;
}
.qr-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(120, 80, 110, 0.16);
}
.qr-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-head b { display: block; font-size: 15.5px; color: var(--ink); }
.qr-head small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.qr-shot {
  border-radius: 18px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
.qr-shot img { width: 100%; display: block; border-radius: 12px; }
.qr-shot img.is-round { border-radius: 50%; }
.qr-tip {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}
.qr-btns { display: flex; gap: 10px; margin-top: 14px; }
.qr-btn {
  flex: 1;
  justify-content: center;
  padding: 11px 12px;
  font-size: 13px;
}

/* ==========================================================================
 * 丝滑过渡
 * ========================================================================== */

/* 页面之间：支持的浏览器用原生 View Transition，不支持的走淡入 */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut 0.22s ease both; }
::view-transition-new(root) { animation: vtIn 0.3s ease both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px) scale(0.996); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px) scale(0.996); } }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
/* 注意：动画只放在 main 上，别放在 body —— body 带 transform 会让 position:fixed 的弹层错位 */
main { animation: pageFadeIn 0.42s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both; }

/* 换配色 / 切深色时颜色平滑过渡（只过渡颜色，不碰渐变） */
body,
.site-header,
.site-footer,
.post-card,
.friend-card,
.toc-card,
.comments,
.article-hero,
.section-head,
.prose {
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

/* 点按与悬停都顺一点 */
.btn,
.chip,
.nav-link,
.friend-card,
.post-card,
.friend-arrow,
.qr-btn {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 弹层淡出 */
.qr-modal { transition: opacity 0.2s ease; }

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
 * 品牌：头像图标 + 新副标题
 * ========================================================================== */
.brand-mark {
  overflow: hidden;
  background: #fff;
  padding: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.brand-text em {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: none;
}

/* ==========================================================================
 * 关于我 · 新版
 * ========================================================================== */
.about-hello {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.4;
  margin-bottom: 14px;
  color: var(--ink);
}
.about-text p { margin-bottom: 12px; line-height: 1.9; }

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.about-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease, ease), border-color 0.3s ease, box-shadow 0.3s ease;
}
.about-facts li:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--a2) 40%, transparent);
  box-shadow: var(--shadow-sm);
}
.fact-ico { font-size: 17px; line-height: 1.4; }
.about-facts b { display: block; font-size: 13.5px; color: var(--ink); }
.about-facts small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }

@media (max-width: 640px) {
  .about-facts { grid-template-columns: 1fr; }
}

/* ==========================================================================
 * 悬浮胶囊导航 + 全屏首屏（参考那种干净的个人站排版）
 * ========================================================================== */
.site-header {
  top: 10px;
  padding: 0 12px;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.site-header.is-scrolled {
  border-bottom-color: transparent;
  box-shadow: none;
}
.site-header .header-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 34px -18px rgba(120, 80, 110, 0.6);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
[data-theme="dark"] .site-header .header-inner {
  background: rgba(26, 19, 32, 0.66);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ---------- 首屏 ---------- */
.hero-stage {
  position: relative;
  min-height: calc(100vh - 90px);
  display: grid;
  place-items: center;
  text-align: center;
  /* 往上顶一截，让柔光从悬浮导航下面穿过去，顶部就不会出现一条硬切的分界线 */
  margin-top: calc(-1 * var(--nav-h));
  padding: calc(48px + var(--nav-h)) 20px 96px;
  overflow: hidden;
  isolation: isolate;
}
.stage-bg {
  position: absolute;
  inset: -12% -2% 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* 背景在首屏底部逐渐化开，不要在容器边缘被硬切一刀 */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.6) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.6) 82%, transparent 100%);
}
/* 首屏那张插画：比容器高出一点，留给视差用 */
.stage-photo {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 124%;
  object-fit: cover;
  object-position: center 32%;
  will-change: transform;
  transition: filter 0.4s ease;
}
/* 压一层和页面同色的柔光，字才看得清 */
.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% 42%, color-mix(in srgb, var(--bg) 72%, transparent) 0%, transparent 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 55%, transparent) 0%,
      color-mix(in srgb, var(--bg) 30%, transparent) 38%,
      color-mix(in srgb, var(--bg) 62%, transparent) 78%,
      color-mix(in srgb, var(--bg) 92%, transparent) 100%);
  pointer-events: none;
}
/* 有插画时，原来的柔光团就不用了 */
.stage-bg.has-photo span { display: none; }
[data-theme="dark"] .stage-photo { filter: brightness(0.42) saturate(0.9); }
[data-theme="dark"] .stage-bg::after {
  background:
    radial-gradient(70% 55% at 50% 42%, color-mix(in srgb, var(--bg) 62%, transparent) 0%, transparent 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 55%, transparent) 0%,
      color-mix(in srgb, var(--bg) 28%, transparent) 40%,
      color-mix(in srgb, var(--bg) 70%, transparent) 80%,
      color-mix(in srgb, var(--bg) 95%, transparent) 100%);
}
.stage-bg span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.34;
}
.stage-bg span:nth-child(1) {
  width: min(46vw, 460px); height: min(46vw, 460px);
  left: -6%; top: 4%;
  background: var(--a1);
}
.stage-bg span:nth-child(2) {
  width: min(42vw, 420px); height: min(42vw, 420px);
  right: -4%; top: 12%;
  background: var(--a2);
}
.stage-bg span:nth-child(3) {
  width: min(50vw, 520px); height: min(50vw, 520px);
  left: 18%; bottom: -18%;
  background: var(--a3);
  opacity: 0.35;
}
.stage-bg span:nth-child(4) {
  width: min(28vw, 260px); height: min(28vw, 260px);
  right: 16%; bottom: 6%;
  background: var(--a1);
  opacity: 0.28;
}

.stage-inner {
  width: 100%;
  max-width: 660px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.stage-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 36px;
  color: #fff;
  background: linear-gradient(140deg, var(--a1), var(--a2) 60%, var(--a3));
  box-shadow: 0 18px 44px -20px var(--acc-glow), 0 0 0 6px rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
  cursor: default;
  animation: none;
}
.stage-avatar[for] { cursor: pointer; }
.stage-avatar .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.stage-avatar { position: relative; }

.stage-name {
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stage-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 8vw, 68px);
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.stage-desc {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 30em;
}
.stage-social {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.stage-social a,
.stage-social button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.stage-social a:hover,
.stage-social button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: color-mix(in srgb, var(--a2) 45%, transparent);
}
.stage-social img { width: 100%; height: 100%; object-fit: cover; display: block; }

.stage-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-stage .hero-tags { margin-top: 6px; justify-content: center; }

.stage-scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 18px;
  color: var(--ink-3);
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (max-width: 640px) {
  :root { --nav-h: 54px; }
  .site-header .header-inner { height: var(--nav-h); padding: 0 10px; gap: 12px; }
  .hero-stage { min-height: calc(100vh - 80px); padding-top: calc(30px + var(--nav-h)); }
  .stage-avatar { width: 84px; height: 84px; font-size: 30px; }
}

/* 留言折叠：加载更多 */
.comment-more-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px auto 4px;
}

.comment-more {
  display: block;
  margin: 0;
  padding: 10px 24px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.comment-collapse {
  opacity: 0.72;
}

.comment-collapse:hover {
  opacity: 1;
}

/* ---------- 手机端：汉堡图标居中，下拉菜单从胶囊下方展开 ---------- */
.menu-btn {
  justify-content: center;
  align-items: center;
}
@media (max-width: 760px) {
  .nav {
    top: 74px;
    left: 12px;
    right: 12px;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 26px 50px -26px rgba(60, 30, 60, 0.45);
  }
}

/* ==========================================================================
 * 文章分类 + 正文编辑器（工具栏 / 预览 / 插图）
 * ========================================================================== */

/* 分类输入 + 已有分类 */
.field-label {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.field-tip {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
  margin-top: 2px;
}

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.cat-chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.cat-chip:hover,
.cat-chip:active {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--a2) 55%, transparent);
  transform: translateY(-1px);
}

/* 正文编辑器外壳 */
.editor {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
[data-theme="dark"] .editor { background: rgba(255, 255, 255, 0.04); }
.editor:focus-within {
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

/* 工具栏：一行放不下就左右滑 */
.editor-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.editor-bar::-webkit-scrollbar { display: none; }

.ed-btn {
  flex: 0 0 auto;
  min-width: 33px;
  height: 30px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.ed-btn:hover,
.ed-btn:active {
  color: var(--ink);
  border-color: var(--line);
}
.ed-btn.is-b { font-weight: 700; }
.ed-btn.is-i { font-style: italic; }
.ed-img { font-size: 15px; }
.ed-preview {
  margin-left: auto;
  padding: 0 12px;
  font-size: 12px;
  color: var(--ink-2);
  border-color: var(--line);
  background: var(--card);
}
.ed-preview[aria-pressed="true"] {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--a2) 45%, transparent);
}

/* 文本框：去掉自带的边框，跟工具栏拼成一块 */
.editor .write-body {
  min-height: 300px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.editor .write-body:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* 预览 */
.write-preview {
  padding: 16px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
}
.write-preview img { border-radius: 12px; }

/* 文章页 / 列表里的分类小标签 */
.post-cat {
  display: inline-flex;
  align-items: center;
  padding: 2px 11px;
  border-radius: 999px;
  border: 1px solid var(--acc-line);
  background: var(--acc-soft);
  color: var(--ink-2);
  font-size: 12px;
}
.post-cat::before {
  content: "分类 · ";
  opacity: 0.6;
}
.write-item-cat { color: color-mix(in srgb, var(--a2) 62%, var(--ink-2)); }

/* ==========================================================================
 * 留言回复
 * ========================================================================== */
.comment-body { flex: 1; min-width: 0; }
.comment-text {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.comment-at { color: var(--ink-3); }

.comment-reply-btn {
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
}
.comment-reply-btn:hover { color: var(--a2); }

/* 一条主留言下面的回复 */
.comment-replies {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 10px;
}
.comment-reply {
  padding: 11px 13px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-solid) 52%, transparent);
}
.comment-reply .comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 12px;
}
.comment-reply .comment-head { font-size: 12.5px; }
.comment-reply .comment-text { font-size: 13px; }

/* 回复输入框（只有一个，跟着被点的那条走） */
.comment-reply-form { margin-top: 12px; }
.comment-reply-form textarea {
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
[data-theme="dark"] .comment-reply-form textarea { background: rgba(255, 255, 255, 0.04); }
.comment-reply-form textarea:focus {
  outline: none;
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.comment-reply-form textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
.comment-reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.comment-reply-actions .btn { padding: 8px 18px; font-size: 12.5px; }

/* ==========================================================================
 * 后台：用户头像 + 「匿名」开关
 * ========================================================================== */
.admin-user-cell { white-space: nowrap; }
.admin-avatar {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 30px;
  height: 30px;
  margin-right: 9px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--acc-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-name { vertical-align: middle; font-size: 13px; }

.admin-anon {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.admin-anon:hover { border-color: var(--sakura); color: var(--ink); }
.admin-anon.is-anon {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--a3) 50%, transparent);
  background: color-mix(in srgb, var(--a3) 14%, transparent);
}

/* ==========================================================================
 * 底部通栏播放器
 * ========================================================================== */
:root { --bgm-h: 54px; --bgm-line: 3px; }

.bgm-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  box-shadow: 0 -12px 34px -26px rgba(80, 50, 80, 0.6);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: bgmIn 0.5s var(--ease) both;
}
@keyframes bgmIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* 顶部那条进度线：本身就是可点的 */
.bgm-prog {
  position: relative;
  height: 3px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  cursor: pointer;
  touch-action: none;
}
.bgm-prog::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  bottom: -9px;
}
.bgm-prog-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  transition: width 0.15s linear;
}
.bgm-prog:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }

.bgm-main {
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--bgm-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bgm-play {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}
.bgm-play:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--a2) 50%, transparent);
}
.bgm-play:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* 播放中：三根小跳条 */
.bgm-bars { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.bgm-bars i {
  width: 2.5px;
  height: 5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--a1), var(--a2));
  animation: bgmBar 1.15s ease-in-out infinite;
}
.bgm-bars i:nth-child(2) { animation-delay: 0.18s; }
.bgm-bars i:nth-child(3) { animation-delay: 0.36s; }
@keyframes bgmBar {
  0%, 100% { height: 5px; opacity: 0.75; }
  50% { height: 13px; opacity: 1; }
}

/* 暂停时：小三角 */
.bgm-tri {
  display: none;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-left: 9px solid var(--ink-2);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.bgm-play.is-paused .bgm-bars { display: none; }
.bgm-play.is-paused .bgm-tri { display: block; }

.bgm-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.bgm-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.bgm-time {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.bgm-next {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.bgm-next:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}
.bgm-next:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.bgm-next-ico { display: flex; align-items: center; }
.bgm-next-ico i {
  width: 0;
  height: 0;
  border-left: 7px solid var(--ink-2);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.bgm-next-ico i + i { margin-left: -2px; }

/* 给播放器让出位置，别让页脚被压住 */
body.has-bgm { padding-bottom: calc(var(--bgm-h) + var(--bgm-line) + env(safe-area-inset-bottom, 0px)); }
body.has-bgm .to-top { bottom: calc(var(--bgm-h) + var(--bgm-line) + env(safe-area-inset-bottom, 0px) + 16px); }

@media (max-width: 640px) {
  :root { --bgm-h: 50px; }
  .bgm-main { padding: 0 12px; gap: 10px; }
  .bgm-title { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bgm-bar { animation: none; }
  .bgm-bars i { animation: none; height: 9px; }
}

/* ==========================================================================
 * 站内跳转用 iframe（音乐不中断）
 * ========================================================================== */
.bgm-shell-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 94;
  background: var(--bg);
  color-scheme: light dark;
}
html.is-shell,
html.is-shell body {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}
body.is-shell .to-top,
body.is-shell .site-header { display: none; }
/* 里层页面：底部给播放器让位 */
html.in-shell .to-top { display: none; }

/* ==========================================================================
 * 文章加载骨架（等数据库回来之前先占位，别一片空白）
 * ========================================================================== */
.article-title.is-skeleton { display: flex; align-items: center; min-height: 1.3em; }
.sk-line {
  display: block;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--ink) 7%, transparent) 25%,
    color-mix(in srgb, var(--ink) 15%, transparent) 37%,
    color-mix(in srgb, var(--ink) 7%, transparent) 63%);
  background-size: 400% 100%;
  animation: skShimmer 1.3s ease infinite;
}
.article-title.is-skeleton .sk-line {
  height: clamp(26px, 5vw, 40px);
  width: min(58%, 420px);
  border-radius: 10px;
}
.sk-body { display: grid; gap: 14px; }
.sk-body .sk-line.is-short { width: 62%; }
@keyframes skShimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-line { animation: none; }
}

/* ==========================================================================
 * 编辑器：图片位置条 / 封面裁剪 / 点图放大
 * ========================================================================== */
.img-layout-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--acc-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.img-layout-bar[hidden] { display: none; }
.img-layout-bar > span { margin-right: 2px; opacity: 0.85; }
.img-layout-bar button {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.img-layout-bar button:hover { border-color: var(--sakura); color: var(--ink); }
.img-layout-bar button.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--sakura), var(--violet));
}

/* 封面裁剪 */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  background: rgba(10, 8, 14, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.crop-modal[hidden] { display: none; }
.crop-frame {
  position: relative;
  width: min(88vw, 560px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  touch-action: none;
  cursor: grab;
}
.crop-frame.is-dragging { cursor: grabbing; }
.crop-frame img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.crop-panel {
  width: min(88vw, 560px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #fff;
  font-size: 12.5px;
}
.crop-panel input[type="range"] { width: 100%; accent-color: #ff8fb1; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; }
.crop-tip { opacity: 0.7; }

/* 点正文里的图放大看 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
  animation: lbIn 0.18s ease both;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
}
body.lb-open { overflow: hidden; }
.prose img,
.write-preview img { cursor: zoom-in; }

/* 裁剪里的比例按钮 */
.crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crop-ratios[hidden] { display: none; }
.crop-ratios button {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
}
.crop-ratios button.is-active {
  background: linear-gradient(120deg, #ff8fb1, #b48bff);
  border-color: transparent;
}
