/* ============================================================
   星屑日记 ✧ Hoshikuzu Diary
   二次元插画背景 + 毛玻璃卡片 · 纯白/纯黑双主题
   ============================================================ */

/* ---------- 1. 主题变量 ---------- */
:root {
  /* 白昼：纸白 + 墨黑 + 樱粉 */
  --bg: #ffffff;
  --bg-soft: #f7f6f4;
  --card: #ffffff;
  --card-2: #faf7f8;
  --panel: #ffffff;

  --ink: #141414;
  --ink-2: #454448;
  --ink-3: #7d7c82;
  --ink-strong: #141414;

  --line: #e7e5e2;
  --line-strong: #141414;
  --frame: #141414;
  --code-bg: #f5f3f6;
  --code-ink: #2b2a33;

  --accent: #ff4f7e;
  --accent-soft: #ffe3ec;
  --accent-deep: #e63668;
  --accent-ink: #d6336c;

  --nav-bg: rgba(255, 255, 255, .88);
  --glass: rgba(255, 255, 255, .78);
  --glass-strong: rgba(255, 255, 255, .92);
  --veil: rgba(250, 250, 252, .87);      /* 内容区背景纱 */
  --shadow-hard: 4px 4px 0 rgba(20, 20, 20, .9);
  --shadow-hard-sm: 3px 3px 0 rgba(20, 20, 20, .9);
  --shadow-pop: 7px 7px 0 rgba(20, 20, 20, .9);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(.2, .9, .3, 1.2);

  --sakura-color: rgba(255, 92, 138, .9);
}

html[data-theme="dark"] {
  /* 黑夜：纯黑 + 白 + 樱粉 */
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --card: #0d0d0d;
  --card-2: #141414;
  --panel: #000000;

  --ink: #f5f4f6;
  --ink-2: #c9c8cd;
  --ink-3: #949399;
  --ink-strong: #f5f4f6;

  --line: #2b2b2b;
  --line-strong: #7a7a85;
  --frame: #7a7a85;
  --code-bg: #101014;
  --code-ink: #f2f0f5;

  --accent: #ff5c8a;
  --accent-soft: #2b0f18;
  --accent-deep: #ff7ba1;
  --accent-ink: #ff7ba1;

  --nav-bg: rgba(0, 0, 0, .88);
  --glass: rgba(12, 12, 14, .62);
  --glass-strong: rgba(10, 10, 12, .85);
  --veil: rgba(0, 0, 0, .9);
  --shadow-hard: 4px 4px 0 rgba(122, 122, 133, .65);
  --shadow-hard-sm: 3px 3px 0 rgba(122, 122, 133, .65);
  --shadow-pop: 7px 7px 0 rgba(122, 122, 133, .55);

  --sakura-color: rgba(255, 92, 138, .5);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

/* 固定氛围层：模糊立绘 + 主题纱（内容区隐约透出插画） */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background: url("../img/hero-blur.jpg?v=2") center / cover no-repeat;
  filter: blur(34px) saturate(1.15);
  transform: scale(1.18);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background: var(--veil);
  transition: background .3s;
}

::selection { background: var(--accent); color: #fff; }

img, svg { max-width: 100%; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-deep); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; border: 2px solid var(--bg); }

.container { width: min(1180px, 92%); margin-inline: auto; }

.grad-text {
  background: linear-gradient(100deg, var(--accent) 20%, var(--ink) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.sticker {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .04em .22em;
  border-radius: .18em;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .85);
  transform: rotate(-1.6deg);
}

/* ---------- 3. 页面加载动画（少女祈祷中…） ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  background: var(--bg);
  transition: opacity .55s ease, visibility .55s;
}
#preloader.done { opacity: 0; visibility: hidden; }

.pre-sakura { width: 76px; height: 76px; animation: pre-spin 2.4s linear infinite; }
@keyframes pre-spin { to { transform: rotate(360deg); } }

.pre-dots { display: flex; gap: 12px; }
.pre-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2.5px solid var(--frame);
  background: var(--accent);
  animation: pre-bounce 1s var(--ease) infinite;
}
.pre-dots span:nth-child(2) { background: var(--card); animation-delay: .15s; }
.pre-dots span:nth-child(3) { background: var(--ink-strong); animation-delay: .3s; }
@keyframes pre-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-13px); }
}

.pre-text {
  font-size: 15px; letter-spacing: .4em; text-indent: .4em;
  color: var(--ink-2); user-select: none; font-weight: 600;
}
.pre-text b { color: var(--accent-ink); }

.pre-bar { width: 210px; height: 14px; border: 2.5px solid var(--frame); border-radius: 99px; overflow: hidden; background: var(--card); }
.pre-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, var(--accent-soft) 8px 16px);
  transition: width .3s;
}

/* ---------- 4. 樱花飘落画布 ---------- */
#sakura-canvas {
  position: fixed; inset: 0; z-index: 9990;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ---------- 5. 导航栏（滚动自动变样式） ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  background: transparent;
  border-bottom: 2.5px solid transparent;
  transition: background .35s ease, border-color .35s ease;
}
.navbar.scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line-strong);
  box-shadow: 0 5px 24px rgba(0, 0, 0, .14);
}
html[data-theme="dark"] .navbar.scrolled { box-shadow: 0 5px 24px rgba(0, 0, 0, .5); }

.nav-inner {
  width: min(1280px, 94%); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 86px;
  transition: height .3s ease;
}
.navbar.scrolled .nav-inner { height: 64px; }

/* 首页：透明导航浮在插画上时用白字 */
body.has-hero .navbar:not(.scrolled) .brand-name,
body.has-hero .navbar:not(.scrolled) .nav-links a {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .55);
}
body.has-hero .navbar:not(.scrolled) .brand-sub { color: rgba(255, 255, 255, .82); }
body.has-hero .navbar:not(.scrolled) .nav-links a.active { color: #fff; }
body.has-hero .navbar:not(.scrolled) .brand-logo { filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)) drop-shadow(2.5px 2.5px 0 rgba(20,20,20,.85)); }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-logo {
  width: 46px; height: 46px; flex: none;
  filter: drop-shadow(2.5px 2.5px 0 rgba(20, 20, 20, .85));
  animation: logo-float 3.6s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-4px) rotate(4deg); }
}
.brand-name { font-size: 21px; letter-spacing: .04em; white-space: nowrap; }
.brand-sub {
  font-size: 10px; letter-spacing: .3em;
  display: block; margin-top: -5px; white-space: nowrap; font-weight: 600;
  color: var(--ink-3);
}

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative; display: block;
  padding: 8px 17px; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .05em;
  border: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s, transform .2s var(--ease);
}
.nav-links a:hover {
  color: var(--accent-ink);
  border-color: var(--frame);
  background: var(--glass-strong);
  transform: translateY(-2px);
}
.nav-links a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--frame);
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .85);
  transform: rotate(-1.2deg);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

/* 黑白主题切换按钮 */
.theme-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid var(--frame);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  cursor: pointer; position: relative; overflow: hidden;
  color: var(--ink);
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .8);
  transition: transform .25s var(--ease);
}
html[data-theme="dark"] .theme-btn { box-shadow: 2.5px 2.5px 0 rgba(122, 122, 133, .7); }
.theme-btn:hover { transform: rotate(18deg) scale(1.06); }
.theme-btn .ico-sun, .theme-btn .ico-moon {
  position: absolute; transition: transform .5s var(--ease), opacity .35s;
}
html[data-theme="light"] .ico-moon { transform: translateY(150%) rotate(90deg); opacity: 0; }
html[data-theme="dark"] .ico-sun { transform: translateY(-150%) rotate(-90deg); opacity: 0; }

/* 汉堡按钮（移动端） */
.burger {
  display: none;
  width: 44px; height: 44px; border-radius: 12px;
  border: 2.5px solid var(--frame);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer; position: relative;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .8);
}
html[data-theme="dark"] .burger { box-shadow: 2.5px 2.5px 0 rgba(122, 122, 133, .7); }
.burger span {
  position: absolute; left: 11px; right: 11px; height: 2.6px;
  border-radius: 2px; background: var(--ink-strong);
  transition: transform .3s var(--ease), opacity .2s, top .3s var(--ease);
}
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 26px; }
.burger.open span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* 移动端抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 8990;
  width: min(320px, 84vw);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border-left: 2.5px solid var(--line-strong);
  box-shadow: -14px 0 44px rgba(0, 0, 0, .3);
  transform: translateX(105%);
  transition: transform .4s var(--ease);
  display: flex; flex-direction: column;
  padding: 100px 24px 30px;
}
.drawer.open { transform: translateX(0); }
.drawer a {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; margin-bottom: 10px;
  border-radius: 14px; font-size: 17px; font-weight: 700;
  color: var(--ink);
  border: 2px solid var(--line-strong);
  background: var(--glass);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .8);
  transition: transform .2s var(--ease), background .2s, color .2s;
}
html[data-theme="dark"] .drawer a { box-shadow: 3px 3px 0 rgba(122, 122, 133, .6); }
.drawer a:hover, .drawer a.active {
  background: var(--accent); color: #fff;
  transform: translateX(6px) rotate(-.6deg);
}
.drawer-mask {
  position: fixed; inset: 0; z-index: 8980;
  background: rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden;
  transition: opacity .35s, visibility .35s;
}
.drawer-mask.show { opacity: 1; visibility: visible; }

/* ---------- 6. Hero：全屏立绘背景（人物居左，文字居右） ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
  background: url("../img/hero-wide.jpg?v=2") 26% center / cover no-repeat #101018;
}
/* 可读性渐变：暗在右（文字区），人物在左保持通透 + 底部融入页面 */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(270deg, rgba(10, 10, 16, .62) 0%, rgba(10, 10, 16, .34) 38%, rgba(10, 10, 16, .03) 70%),
    linear-gradient(180deg, rgba(10, 10, 16, .42) 0%, transparent 24%, transparent 58%, var(--bg) 97%);
  pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 5;
  width: min(1180px, 92%);
  margin-inline: auto 0;          /* 左auto右0 → 文字块推到右侧 */
  padding: clamp(96px, 12vh, 130px) 0 clamp(80px, 10vh, 110px);
  max-width: 560px;
}

/* 手机：竖版立绘，人物居中偏上，文字沉底 */
@media (max-width: 760px) {
  .hero {
    background-image: url("../img/hero-tall.jpg?v=2");
    background-position: 62% 18%;
    align-items: flex-end;
  }
  .hero::before {
    background:
      linear-gradient(0deg, rgba(10, 10, 16, .82) 0%, rgba(10, 10, 16, .48) 30%, rgba(10, 10, 16, .08) 58%, rgba(10, 10, 16, .32) 100%),
      linear-gradient(180deg, rgba(10, 10, 16, .32) 0%, transparent 20%, transparent 74%, var(--bg) 99%);
  }
  .hero-inner { margin-inline: auto; padding: 130px 0 84px; max-width: 560px; }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 18px; margin-bottom: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 2px solid var(--frame);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .85);
  font-size: 13px; color: #141414;
  font-weight: 700; letter-spacing: .1em;
  transform: rotate(-1.4deg);
}
.hero-badge .pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--frame);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.45); }
}

.hero-title {
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.26; font-weight: 900;
  letter-spacing: .015em; margin: 0 0 16px;
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .5), 0 0 2px rgba(0, 0, 0, .35);
}
.hero-title .tilde { color: #ff9db9; }

.hero-desc {
  font-size: clamp(15px, 1.5vw, 16.5px);
  color: rgba(255, 255, 255, .95);
  max-width: 26em; margin: 0 0 26px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .3);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 27px; border-radius: 999px;
  font-size: 15.5px; font-weight: 800; letter-spacing: .04em;
  border: 2.5px solid var(--frame);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .88);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(20, 20, 20, .88); color: #fff; }
.btn-ghost {
  background: rgba(255, 255, 255, .92);
  color: #141414;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .7);
}
.btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(20, 20, 20, .7); }

/* 一言（深色毛玻璃气泡） */
.hero-quote {
  margin-top: 26px; max-width: 30em;
  padding: 13px 20px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 6px 22px 22px 22px;
  background: rgba(14, 14, 20, .5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px; color: rgba(255, 255, 255, .94);
  position: relative;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.hero-quote::before {
  content: "NOTE";
  position: absolute; top: -13px; left: 18px;
  font-size: 10px; font-weight: 900; letter-spacing: .22em;
  background: #fff; color: #141414;
  padding: 2px 10px; border-radius: 99px;
}
.hero-quote b { color: #ff9db9; font-weight: 700; }
.hero-quote .q-refresh {
  float: right; cursor: pointer; opacity: .7; font-size: 15px;
  transition: opacity .2s, transform .4s var(--ease);
}
.hero-quote .q-refresh:hover { opacity: 1; transform: rotate(180deg); color: #ff9db9; }

/* 滚动提示 */
.scroll-hint {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(255, 255, 255, .85); font-size: 11px; letter-spacing: .34em; text-indent: .34em;
  font-weight: 700; user-select: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.scroll-hint .mouse {
  width: 24px; height: 38px; border: 2.5px solid rgba(255, 255, 255, .9); border-radius: 14px;
  position: relative;
}
.scroll-hint .mouse::after {
  content: ""; position: absolute; left: 50%; top: 7px;
  width: 4px; height: 9px; border-radius: 3px;
  background: var(--accent); transform: translateX(-50%);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0% { opacity: 1; transform: translate(-50%, 0); }
  70% { opacity: 0; transform: translate(-50%, 12px); }
  100% { opacity: 0; }
}

/* 动画工具类 */
.float-y { animation: float-y 4s ease-in-out infinite; }
.float-y2 { animation: float-y 5.2s ease-in-out infinite reverse; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.mascot-eye { animation: blink 4.6s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.08); }
}

/* ---------- 7. 通用区块 ---------- */
.section { padding: 88px 0 44px; position: relative; }
.section-head { text-align: center; margin-bottom: 46px; }
.section-kicker {
  display: inline-block; font-size: 12px; letter-spacing: .42em; text-indent: .42em;
  color: var(--bg); margin-bottom: 14px; font-weight: 900;
  background: var(--ink-strong);
  padding: 4px 14px; border-radius: 99px;
  transform: rotate(-1deg);
}
.section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; margin: 0; letter-spacing: .03em; }
.section-desc { color: var(--ink-3); margin: 12px 0 0; font-size: 15px; }

/* 卡片网格 */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* 文章卡片：毛玻璃 + 描边 */
.post-card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-hard);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.post-card:hover {
  transform: translate(-3px, -5px) rotate(-.5deg);
  box-shadow: var(--shadow-pop);
}

.post-cover {
  position: relative; height: 168px;
  display: grid; place-items: center;
  background: var(--cv1, var(--accent));
  border-bottom: 2.5px solid var(--frame);
  overflow: hidden;
}
.post-cover::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(rgba(255, 255, 255, .5) 1.4px, transparent 1.5px) 0 0 / 18px 18px,
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .14) 0 12px, transparent 12px 26px);
  opacity: .8;
}
.post-cover .cover-emoji {
  font-size: 60px; position: relative;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .28));
  transition: transform .3s var(--ease);
}
.post-card:hover .cover-emoji { transform: scale(1.16) rotate(6deg); }
.post-cover .cover-mood {
  position: absolute; top: 12px; right: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px;
  background: var(--glass-strong);
  border: 2.5px solid var(--frame);
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .8);
}

.post-body { padding: 22px 24px 20px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; font-weight: 600;
}
.post-meta .dot { opacity: .6; }
.post-title {
  font-size: 18.5px; font-weight: 800; line-height: 1.45; margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card:hover .post-title { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.post-excerpt {
  color: var(--ink-3); font-size: 14px; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tag {
  font-size: 12px; padding: 3px 12px; border-radius: 999px; font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1.5px solid currentColor;
}
.tag::before { content: "# "; }

.more-wrap { text-align: center; margin-top: 48px; }

/* ---------- 8. 首页：关于速览 & 数据 ---------- */
.about-strip { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: stretch; }
.about-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg); padding: 30px 32px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-hard);
}
.about-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.about-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.about-card strong { color: var(--accent-ink); }

.stat-card {
  background: var(--accent);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg); color: #fff;
  padding: 30px 32px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: center; text-align: center; gap: 8px;
  box-shadow: var(--shadow-hard);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(rgba(255, 255, 255, .4) 1.4px, transparent 1.5px) 0 0 / 20px 20px;
  opacity: .5;
}
.stat-num { font-size: 36px; font-weight: 900; text-shadow: 2.5px 2.5px 0 rgba(0, 0, 0, .25); position: relative; }
.stat-label { font-size: 12px; opacity: .95; letter-spacing: .2em; text-indent: .2em; font-weight: 700; position: relative; }

/* ---------- 9. 归档 / 博客列表页 ---------- */
.page-hero {
  position: relative;
  padding: 152px 0 52px;
  text-align: center;
  background: url("../img/hero-wide.jpg?v=2") center 62% / cover no-repeat #101018;
  border-bottom: 3px solid var(--frame);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 16, .5) 0%, rgba(10, 10, 16, .36) 46%, var(--veil) 100%);
  pointer-events: none;
}
.page-hero > * { position: relative; }
.page-hero h1 {
  font-size: clamp(28px, 4vw, 42px); margin: 0 0 10px; font-weight: 900; letter-spacing: .04em;
  color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, .5);
}
.page-hero p { color: rgba(255, 255, 255, .92); margin: 0; font-size: 15px; font-weight: 600; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.page-hero .section-kicker { background: #fff; color: #141414; }

/* 搜索 + 筛选 */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin: 34px 0 12px; position: relative; z-index: 20;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .9);
  border: 2.5px solid var(--frame);
  border-radius: 999px; padding: 10px 20px;
  width: min(380px, 100%);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .8);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.search-box:focus-within { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(20, 20, 20, .8); }
.search-box input {
  border: none; outline: none; background: transparent; flex: 1;
  font: inherit; font-size: 14.5px; font-weight: 600; color: #141414;
}
.search-box input::placeholder { color: #7d7c82; }
.search-box svg { flex: none; color: #454448; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 40px; position: relative; }
.chip {
  padding: 7px 19px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--frame);
  background: rgba(255, 255, 255, .9); color: #141414;
  font-size: 13.5px; font-weight: 700; letter-spacing: .04em;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .75);
  transition: all .2s var(--ease);
  user-select: none;
}
.chip:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 rgba(20, 20, 20, .75); color: var(--accent-deep); }
.chip.on {
  background: var(--accent); color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .8);
}

/* 时间线归档 */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: "";
  position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: repeating-linear-gradient(180deg, var(--frame) 0 10px, transparent 10px 18px);
  opacity: .4;
}
.tl-item { position: relative; padding: 0 0 32px 20px; }
.tl-item::before {
  content: "❀"; position: absolute; left: -37px; top: 0;
  width: 27px; height: 27px; display: grid; place-items: center;
  color: #fff; font-size: 12px;
  background: var(--accent);
  border: 2.5px solid var(--frame);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(20, 20, 20, .75);
}
.tl-date { font-size: 12.5px; color: var(--ink-3); letter-spacing: .08em; margin-bottom: 5px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.tl-title { font-size: 17.5px; font-weight: 800; transition: color .2s; }
.tl-title:hover { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.tl-tags { margin-top: 7px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 空状态 */
.empty { text-align: center; padding: 70px 20px; color: var(--ink-3); font-weight: 600; }
.empty .big { font-size: 56px; margin-bottom: 14px; display: block; animation: float-y 3.6s ease-in-out infinite; }

/* ---------- 10. 文章页 ---------- */
.post-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  gap: 44px; align-items: start;
  padding-top: 130px;
}
.post-paper {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 52px);
  box-shadow: 6px 6px 0 rgba(20, 20, 20, .8);
}
html[data-theme="dark"] .post-paper { box-shadow: 6px 6px 0 rgba(122, 122, 133, .7); }
.post-paper h1 {
  font-size: clamp(24px, 3.2vw, 34px); line-height: 1.4;
  margin: 14px 0 18px; font-weight: 900; letter-spacing: .015em;
}
.post-paper .post-meta { font-size: 13.5px; margin-bottom: 8px; }
.post-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--accent); margin: 22px 0 34px; font-size: 12px; letter-spacing: .5em; font-weight: 900;
}
.post-divider::before, .post-divider::after {
  content: ""; flex: 1; height: 3px;
  background: repeating-linear-gradient(90deg, var(--frame) 0 10px, transparent 10px 18px);
  opacity: .35;
}

/* 正文排版 */
.prose { font-size: 16px; color: var(--ink); }
.prose p { margin: 0 0 1.15em; color: var(--ink-2); }
.prose strong { color: var(--accent-ink); }
.prose h2 {
  font-size: 22px; margin: 2em 0 .9em; font-weight: 900;
  padding-left: 16px; position: relative; letter-spacing: .02em;
}
.prose h2::before {
  content: ""; position: absolute; left: 0; top: .16em; bottom: .16em;
  width: 6px; border-radius: 3px;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--frame);
}
.prose h3 { font-size: 18px; margin: 1.7em 0 .7em; font-weight: 800; color: var(--ink); }
.prose h3::before { content: "✦ "; color: var(--accent); font-size: 14px; }
.prose blockquote {
  margin: 1.4em 0; padding: 15px 22px;
  border: 2.5px solid var(--frame);
  border-left: 9px solid var(--accent);
  border-radius: 8px 16px 16px 16px;
  background: var(--glass);
  color: var(--ink-2); font-size: 15px;
  position: relative;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .7);
}
html[data-theme="dark"] .prose blockquote { box-shadow: 3px 3px 0 rgba(122, 122, 133, .55); }
.prose ul, .prose ol { padding-left: 1.5em; color: var(--ink-2); }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--accent); font-weight: 900; }
.prose code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: .88em;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 2px 8px; border-radius: 7px;
  border: 1px solid currentColor;
}
.prose pre {
  background: var(--code-bg); color: var(--code-ink);
  border: 2.5px solid var(--frame);
  border-radius: 14px; padding: 20px 22px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.7;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .7);
  position: relative;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; border: none; }
.prose pre::before {
  content: "⌘ CODE"; position: absolute; top: 10px; right: 14px;
  font-size: 10px; letter-spacing: .2em; font-weight: 900;
  color: var(--code-ink); opacity: .45;
}
.prose hr { border: none; height: 3px; margin: 2.4em 0; background: repeating-linear-gradient(90deg, var(--frame) 0 10px, transparent 10px 18px); opacity: .3; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 14.5px; }
.prose th, .prose td { border: 2px solid var(--frame); padding: 9px 14px; }
.prose th { background: var(--accent); color: #fff; font-weight: 800; }
.prose td { color: var(--ink-2); background: var(--glass); }
.prose a.inline-link { color: var(--accent-ink); font-weight: 700; border-bottom: 2.5px dashed var(--accent); }
.prose a.inline-link:hover { border-bottom-style: solid; }

/* 侧栏 TOC */
.toc {
  position: sticky; top: 106px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-md); padding: 20px 22px;
  max-height: calc(100vh - 150px); overflow-y: auto;
  box-shadow: var(--shadow-hard-sm);
}
.toc-title { font-size: 12.5px; letter-spacing: .3em; text-indent: .3em; color: var(--bg); background: var(--ink-strong); display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 900; margin-bottom: 12px; }
.toc a {
  display: block; padding: 6px 0 6px 14px;
  font-size: 13.5px; color: var(--ink-3); font-weight: 600;
  border-left: 3px solid transparent;
  transition: color .2s, border-color .2s, padding-left .25s var(--ease);
}
.toc a:hover { color: var(--accent-ink); }
.toc a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 800; padding-left: 20px; }

/* 阅读进度条 */
#read-progress {
  position: fixed; top: 0; left: 0; height: 5px; width: 0%;
  z-index: 9500;
  background: var(--accent);
  transition: width .12s linear;
}

/* 上一篇 / 下一篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.post-nav a {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-md); padding: 16px 20px;
  box-shadow: var(--shadow-hard-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.post-nav a:hover { transform: translate(-2px, -3px); box-shadow: 5px 5px 0 rgba(20, 20, 20, .8); }
.post-nav .nav-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .15em; display: block; margin-bottom: 5px; font-weight: 900; }
.post-nav .nav-title { font-size: 14.5px; font-weight: 700; }
.post-nav .next { text-align: right; }

/* ---------- 11. 关于页 ---------- */
.profile-grid { display: grid; grid-template-columns: 330px 1fr; gap: 36px; align-items: start; }
.profile-card {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg); padding: 34px 28px;
  text-align: center; box-shadow: 6px 6px 0 rgba(20, 20, 20, .8);
  position: sticky; top: 106px;
}
html[data-theme="dark"] .profile-card { box-shadow: 6px 6px 0 rgba(122, 122, 133, .7); }
.avatar-ring {
  width: 152px; height: 152px; margin: 0 auto 20px;
  border-radius: 50%; padding: 6px;
  background: conic-gradient(var(--accent) 0 25%, #141414 25% 50%, var(--accent) 50% 75%, #141414 75%);
  animation: ring-spin 8s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.avatar-ring svg { width: 100%; height: 100%; border-radius: 50%; background: var(--card-2); display: block; border: 3px solid var(--frame); }
.profile-card h2 { margin: 0 0 4px; font-size: 23px; font-weight: 900; }
.profile-card .bio { color: var(--ink-3); font-size: 13.5px; margin: 0 0 18px; font-weight: 600; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 2.5px dashed var(--line-strong);
  padding-top: 18px; margin-top: 6px;
}
.profile-stats b { display: block; font-size: 20px; color: var(--accent-ink); }
.profile-stats span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .1em; font-weight: 700; }

.social-row { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.social-btn {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--glass);
  border: 2.5px solid var(--frame);
  color: var(--ink);
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .8);
  font-size: 17px;
  transition: all .2s var(--ease);
}
.social-btn:hover { transform: translate(-2px, -2px) rotate(-5deg); box-shadow: 5px 5px 0 rgba(20, 20, 20, .8); background: var(--accent); color: #fff; }

/* 技能条 */
.skill { margin-bottom: 22px; }
.skill-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: var(--ink-2); font-weight: 600; }
.skill-head b { color: var(--ink); font-weight: 800; }
.skill-bar { height: 14px; border-radius: 99px; background: var(--glass); border: 2px solid var(--frame); overflow: hidden; }
.skill-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 9px, var(--accent-deep) 9px 18px);
  transition: width 1.1s var(--ease);
}

/* ---------- 12. 友链页 ---------- */
.friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.friend-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-md); padding: 20px 22px;
  box-shadow: var(--shadow-hard-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.friend-card:hover { transform: translate(-2px, -4px) rotate(-.5deg); box-shadow: 6px 6px 0 rgba(20, 20, 20, .8); }
.friend-avatar {
  width: 56px; height: 56px; flex: none; border-radius: 16px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--fa1, var(--accent));
  border: 2.5px solid var(--frame);
  box-shadow: 2px 2px 0 rgba(20, 20, 20, .8);
}
.friend-card h3 { margin: 0 0 3px; font-size: 16px; font-weight: 800; }
.friend-card p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ---------- 13. 404 ---------- */
.err-wrap {
  min-height: 88vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 20px 60px;
}
.err-code {
  font-size: clamp(90px, 16vw, 150px); font-weight: 900; line-height: 1;
  letter-spacing: .06em;
  color: var(--bg);
  -webkit-text-stroke: 3.5px var(--accent);
  text-shadow: 6px 6px 0 rgba(20, 20, 20, .8);
}
.err-wrap .mascot-big { width: 190px; margin: 18px 0 6px; animation: float-y 4s ease-in-out infinite; }
.err-wrap p { color: var(--ink-2); margin: 8px 0 30px; font-weight: 600; }

/* ---------- 14. 页脚 ---------- */
footer {
  margin-top: 92px;
  border-top: 3px solid var(--frame);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  position: relative;
}
.footer-inner {
  position: relative;
  width: min(1180px, 92%); margin-inline: auto;
  padding: 44px 0 30px;
  display: flex; flex-wrap: wrap; gap: 26px;
  align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.footer-brand svg { width: 38px; height: 38px; }
.footer-links { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-meta { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; font-weight: 600; }
.footer-meta .beat { color: var(--accent); display: inline-block; animation: heart-beat 1.2s ease-in-out infinite; }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.35); } }

/* ---------- 15. 回到顶部 ---------- */
#back-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 8500;
  width: 52px; height: 52px; border-radius: 50%;
  border: 2.5px solid var(--frame);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: all .35s var(--ease);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .85);
}
#back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-top:hover { transform: translate(-2px, -3px); box-shadow: 5px 6px 0 rgba(20, 20, 20, .85); }
#back-top .rocket { transition: transform .25s var(--ease); }
#back-top:hover .rocket { transform: translateY(-3px); }

/* ---------- 16. 入场动画 ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }

/* ---------- 17. 光标樱花拖尾（桌面） ---------- */
.cursor-petal {
  position: fixed; z-index: 9800; pointer-events: none;
  font-size: 13px; will-change: transform, opacity;
  animation: petal-fade .9s ease-out forwards;
}
@keyframes petal-fade {
  0% { opacity: .95; transform: translate(0, 0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translate(-14px, 26px) rotate(220deg) scale(.4); }
}

/* ---------- 18. 响应式 ---------- */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .friend-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 30px; }
}

/* 平板 */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .hero-inner { padding: 126px 0 130px; }
  .about-strip { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .post-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* 手机 */
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .friend-grid { grid-template-columns: 1fr; }
  .nav-inner { height: 70px; }
  .navbar.scrolled .nav-inner { height: 58px; }
  .brand-name { font-size: 17px; }
  .brand-sub { display: none; }
  .section { padding: 62px 0 28px; }
  .post-cover { height: 146px; }
  .post-cover .cover-emoji { font-size: 48px; }
  .post-paper { padding: 24px 20px; }
  .post-card, .post-paper { box-shadow: var(--shadow-hard-sm); }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .scroll-hint { display: none; }
  #back-top { right: 16px; bottom: 18px; width: 47px; height: 47px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ---------- 19. 无障碍 & 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- 20. 小工具页 ---------- */
.tool-card {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 6px 6px 0 rgba(20, 20, 20, .8);
  margin-bottom: 34px;
}
html[data-theme="dark"] .tool-card { box-shadow: 6px 6px 0 rgba(122, 122, 133, .7); }

.tool-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.tool-no {
  flex: none;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900;
  background: var(--accent); color: #fff;
  border: 2.5px solid var(--frame);
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .8);
  transform: rotate(-3deg);
  font-family: Georgia, serif;
}
.tool-head > div { flex: 1; min-width: 200px; }
.tool-head h2 { margin: 0 0 2px; font-size: 21px; font-weight: 900; }
.tool-head p { margin: 0; font-size: 13px; color: var(--ink-3); font-weight: 600; }

.tool-select {
  font: inherit; font-weight: 700; font-size: 14px;
  color: var(--ink);
  background: var(--glass);
  border: 2px solid var(--frame);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .7);
}
html[data-theme="dark"] .tool-select { box-shadow: 2.5px 2.5px 0 rgba(122, 122, 133, .55); }
.tool-select:focus { outline: 2.5px solid var(--accent); }

.tool-io-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.io-label {
  display: inline-block;
  font-size: 10.5px; font-weight: 900; letter-spacing: .24em;
  color: var(--bg); background: var(--ink-strong);
  padding: 2.5px 12px; border-radius: 99px;
  margin-bottom: 9px;
  user-select: none;
}
.tool-io {
  width: 100%; resize: vertical;
  font: inherit; font-size: 13.5px; line-height: 1.65;
  color: var(--ink);
  background: var(--glass);
  border: 2px solid var(--frame);
  border-radius: var(--r-md);
  padding: 13px 16px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tool-io.mono, .code-out { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; }
.tool-io:focus {
  outline: none;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .7);
}
html[data-theme="dark"] .tool-io:focus { box-shadow: 4px 4px 0 rgba(122, 122, 133, .5); }
.tool-io[readonly] { opacity: .92; }

.tool-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 16px;
}
.btn-sm { padding: 8px 19px; font-size: 13.5px; }
.tool-hint { font-size: 13px; font-weight: 700; color: var(--accent-ink); min-width: 60px; }

.tool-opts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.opt-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border: 2px solid var(--frame);
  border-radius: 999px;
  background: var(--glass);
  font-size: 13px; font-weight: 700;
  cursor: pointer; user-select: none;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .65);
  transition: transform .2s var(--ease);
}
html[data-theme="dark"] .opt-chip { box-shadow: 2.5px 2.5px 0 rgba(122, 122, 133, .5); }
.opt-chip:has(input:checked) {
  background: var(--accent); color: #fff;
  transform: rotate(-1deg);
}
.opt-chip input { width: 15px; height: 15px; accent-color: #fff; cursor: pointer; }

.code-out {
  background: var(--code-bg); color: var(--code-ink);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-md);
  padding: 20px 22px;
  font-size: 13px; line-height: 1.7;
  overflow-x: auto;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .7);
  position: relative;
  white-space: pre;
}
.code-out::before {
  content: "PYTHON · HTTPX";
  position: absolute; top: 9px; right: 13px;
  font-size: 9.5px; font-weight: 900; letter-spacing: .18em;
  color: var(--code-ink); opacity: .45;
  font-family: system-ui, sans-serif;
}

.tool-note {
  margin: 18px 0 0;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.8;
  border-top: 2px dashed var(--line);
  padding-top: 14px;
}

@media (max-width: 760px) {
  .tool-io-grid { grid-template-columns: 1fr; }
  .tool-head { gap: 12px; }
  .tool-select { width: 100%; }
}

/* ---------- 21. 账号系统 & 写记事 ---------- */
/* 导航用户区 */
.user-chip {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  border: 2px solid var(--frame);
  border-radius: 999px;
  background: var(--glass-strong);
  cursor: pointer; user-select: none;
  box-shadow: 2.5px 2.5px 0 rgba(20, 20, 20, .55);
  font-weight: 700; font-size: 14px;
}
html[data-theme="dark"] .user-chip { box-shadow: 2.5px 2.5px 0 rgba(122, 122, 133, .5); }
.user-ava {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 2px solid var(--frame);
  background: var(--accent);
}
.user-ava.letter, .mini-ava.letter {
  display: inline-grid; place-items: center;
  color: #fff; background: var(--accent);
  font-weight: 900;
}
.user-ava.letter { width: 30px; height: 30px; border-radius: 50%; font-size: 14px; }
.user-caret { font-size: 11px; color: var(--ink-3); transition: transform .25s; }
.user-chip.open .user-caret { transform: rotate(180deg); }
.user-menu {
  position: absolute; top: calc(100% + 12px); right: 0;
  min-width: 168px; z-index: 9100;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 2px solid var(--frame);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .55);
  padding: 7px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all .25s var(--ease);
}
html[data-theme="dark"] .user-menu { box-shadow: 4px 4px 0 rgba(122, 122, 133, .45); }
.user-chip.open .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu a {
  display: block; padding: 9px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.user-menu a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.user-menu a.danger:hover { background: rgba(255, 79, 126, .14); color: var(--accent-ink); }
@media (max-width: 640px) {
  .user-chip .user-name { display: none; }
}

/* 迷你头像（meta 行内） */
.mini-ava {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; vertical-align: -5px; margin-right: 5px;
  border: 1.5px solid var(--frame);
}
.mini-ava.letter { width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 11px; vertical-align: -5px; margin-right: 5px; border-radius: 50%; color: #fff; background: var(--accent); }

/* 弹窗 */
#hoshi-overlay {
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(8, 8, 14, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .25s;
  padding: 20px;
}
#hoshi-overlay.show { opacity: 1; }
.modal-card {
  width: min(430px, 94vw);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg);
  box-shadow: 7px 7px 0 rgba(20, 20, 20, .6);
  padding: 30px 30px 26px;
  transform: translateY(14px) scale(.97);
  transition: transform .3s var(--ease);
}
html[data-theme="dark"] .modal-card { box-shadow: 7px 7px 0 rgba(122, 122, 133, .45); }
#hoshi-overlay.show .modal-card { transform: translateY(0) scale(1); }
.modal-title { margin: 0 0 20px; font-size: 20px; font-weight: 900; }

.auth-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.auth-note {
  margin: 0 0 16px; padding: 10px 14px;
  font-size: 13px; color: var(--accent-ink); font-weight: 600;
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
}
.fld { display: block; margin-bottom: 14px; }
.fld span {
  display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .14em;
  color: var(--ink-3); margin-bottom: 6px;
}
.fld input {
  width: 100%;
  font: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  border: 2px solid var(--frame);
  border-radius: 12px;
  padding: 11px 14px;
}
.fld input:focus { outline: 2.5px solid var(--accent); }
.form-err {
  margin: 4px 0 12px; font-size: 13px; font-weight: 700;
  color: var(--accent-ink);
  background: rgba(255, 79, 126, .1);
  border-radius: 8px; padding: 8px 12px;
}
.auth-submit { width: 100%; justify-content: center; }

/* 资料编辑 */
.profile-edit { display: flex; gap: 22px; align-items: flex-start; }
.profile-ava {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--frame);
  background: var(--accent);
}
.profile-ava.letter { display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 900; }
.profile-ava-wrap { text-align: center; flex: none; }
.ava-btn { margin-top: 12px; cursor: pointer; }
.profile-fields { flex: 1; min-width: 0; }
.profile-actions { display: flex; gap: 10px; margin-top: 6px; }
@media (max-width: 560px) {
  .profile-edit { flex-direction: column; align-items: center; }
  .profile-fields { width: 100%; }
}

/* 写记事页 */
.write-wrap {
  width: min(880px, 92%); margin-inline: auto;
  padding: 132px 0 60px;
}
.write-card {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3.4vw, 40px);
  box-shadow: 6px 6px 0 rgba(20, 20, 20, .7);
}
html[data-theme="dark"] .write-card { box-shadow: 6px 6px 0 rgba(122, 122, 133, .5); }
.write-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
}
.write-head h1 { margin: 0; font-size: 24px; font-weight: 900; }
.write-title {
  width: 100%;
  font: inherit; font-size: 21px; font-weight: 800;
  color: var(--ink);
  background: var(--glass);
  border: 2px solid var(--frame);
  border-radius: var(--r-md);
  padding: 13px 18px;
  margin-bottom: 18px;
}
.write-title:focus { outline: 2.5px solid var(--accent); }
.write-meta-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px;
  align-items: start; margin-bottom: 18px;
}
.meta-block { min-width: 0; }
.mood-row { display: flex; flex-wrap: wrap; gap: 7px; }
.mood {
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 19px; cursor: pointer;
  background: var(--glass);
  border: 2px solid var(--frame);
  transition: transform .2s var(--ease), background .2s;
}
.mood:hover { transform: translateY(-2px) rotate(-4deg); }
.mood.on { background: var(--accent); border-color: var(--frame); box-shadow: 2px 2px 0 rgba(20, 20, 20, .6); }
.write-input {
  width: 100%;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  border: 2px solid var(--frame);
  border-radius: 12px;
  padding: 10px 14px;
}
.write-input:focus { outline: 2.5px solid var(--accent); }
.cover-row { display: flex; gap: 8px; }
.csw {
  width: 34px; height: 34px; border-radius: 11px; cursor: pointer;
  border: 2px solid var(--frame);
  box-shadow: 2px 2px 0 rgba(20, 20, 20, .5);
  transition: transform .2s var(--ease);
}
.csw:hover { transform: translateY(-2px); }
.csw.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.editor-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.md-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.write-editor-grid { position: relative; }
.write-editor-grid .tool-io { width: 100%; min-height: 320px; }
.write-preview {
  border: 2px dashed var(--frame);
  border-radius: var(--r-md);
  padding: 16px 20px;
  min-height: 320px;
  background: var(--glass);
}
.write-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 18px;
}
.write-foot-right { display: flex; align-items: center; gap: 14px; }
.write-locked { text-align: center; padding: 70px 30px; }
.del-btn {
  border: 1.5px solid var(--frame);
  background: var(--glass);
  color: var(--accent-ink);
  border-radius: 8px; padding: 1px 9px;
  font-size: 12px; cursor: pointer;
}
.del-btn:hover { background: var(--accent); color: #fff; }

/* 轻提示 */
#hoshi-toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 9700;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-strong); color: var(--bg);
  font-size: 14px; font-weight: 700;
  padding: 11px 24px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  opacity: 0; visibility: hidden;
  transition: all .3s var(--ease);
  pointer-events: none;
}
#hoshi-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .write-meta-row { grid-template-columns: 1fr; }
  .editor-bar { flex-direction: column; align-items: flex-start; }
}
