/* =====================================================================
   星野 · 暗黑星空个人博客
   1. 变量与基础      2. 星空背景      3. 导航      4. 首屏
   5. 区块与按钮      6. 文章卡片      7. 关于      8. 联系   9. 页脚
   10. 编辑模式       11. 动效          12. 响应式    13. 无障碍
   ===================================================================== */

/* ----------------------------- 1. 基础 ----------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #04050c;
  --ink: #eeecf7;
  --ink-2: rgba(238, 236, 247, 0.72);
  --ink-3: rgba(238, 236, 247, 0.46);
  --line: rgba(168, 180, 255, 0.14);
  --line-strong: rgba(168, 180, 255, 0.32);
  --accent: #aebcff;
  --gold: #f2d9a6;
  --nav-h: 68px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --serif: "SimSun", "宋体", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Songti TC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(174, 188, 255, 0.28); color: #fff; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -180%);
  z-index: 99;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #070a16;
  font-size: 0.8rem;
  text-decoration: none;
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: translate(-50%, 0); }

/* --------------------------- 2. 星空背景 --------------------------- */
/* 星云：几团极低透明度的径向渐变，营造深空与银河 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(58% 46% at 22% 6%, rgba(96, 78, 196, 0.30), transparent 62%),
    radial-gradient(48% 40% at 84% 20%, rgba(36, 96, 178, 0.26), transparent 64%),
    radial-gradient(70% 58% at 46% 108%, rgba(126, 58, 148, 0.20), transparent 68%),
    radial-gradient(120% 80% at 50% -10%, rgba(40, 54, 120, 0.28), transparent 60%),
    linear-gradient(180deg, #04050c 0%, #070a17 44%, #04050c 100%);
}

/* 暗角：让四周沉下去，中间的字更亮 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 42%, rgba(2, 3, 8, 0.72) 100%);
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  pointer-events: none;
}

/* 极淡的颗粒，避免大面积渐变出现色带 */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ----------------------------- 3. 导航 ----------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--nav-h);
  padding: 0 clamp(1.1rem, 4vw, 3.2rem);
  border-bottom: 1px solid transparent;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease), backdrop-filter 0.45s var(--ease);
}

.nav.is-scrolled {
  background: rgba(4, 5, 12, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line);
}

.nav.is-open {
  background: rgba(5, 6, 14, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.07em;
  text-indent: 0.07em;
  white-space: nowrap;
}

.brand-mark {
  color: var(--gold);
  font-size: 0.78rem;
  text-indent: 0;
  letter-spacing: 0;
  animation: twinkle 5.5s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.3rem);
  margin-left: auto;
}

.nav-links a {
  position: relative;
  padding: 0.4rem 0;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  transition: color 0.3s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active { color: #fff; }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: clamp(0.8rem, 2vw, 1.6rem);
}

.lang {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-btn {
  border: 0;
  background: none;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.lang-btn:hover { color: var(--ink); }

.lang-btn.is-on {
  color: #080b16;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(174, 188, 255, 0.45);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}

.icon-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(174, 188, 255, 0.10);
  transform: translateY(-1px);
}

.icon-btn[aria-pressed="true"] {
  color: #080b16;
  background: var(--accent);
  border-color: var(--accent);
}

.menu-btn { display: none; }

.burger {
  display: block;
  width: 14px;
  height: 10px;
  position: relative;
}
.burger i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger i:first-child { top: 1px; }
.burger i:last-child { bottom: 1px; }
.nav.is-open .burger i:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .burger i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ------------------------- 4. 翻页与首屏 ------------------------- */
/* 翻页完全由 app.js 控制（缓动滚动 + 滚轮/键盘接管）：
   CSS 的 scroll-snap 会影响 window.scrollTo，所以这里不用它。 */

.slide {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 1.6rem) clamp(1.1rem, 4vw, 3rem) clamp(1.6rem, 3vw, 2.6rem);
}

.slide > .wrap { width: 100%; }

.slide--hero { text-align: center; }

.slide--last {
  display: grid;
  grid-template-rows: 1fr auto;
  justify-content: normal;
  justify-items: stretch;
  padding-bottom: 0;
}
.slide--last .wrap { align-self: center; }

.hero-inner {
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
  animation: rise 1.5s var(--ease) both;
}

.eyebrow {
  margin: 0 0 2.1rem;
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
}

.hero-title {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.35rem);
  line-height: 1.45;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  white-space: pre-line;
  color: #f6f4ff;
  text-shadow:
    0 0 18px rgba(168, 184, 255, 0.22),
    0 0 60px rgba(150, 168, 255, 0.30),
    0 0 120px rgba(120, 110, 220, 0.22);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  max-width: 300px;
  margin: 2.5rem auto 2.1rem;
  color: var(--gold);
}
.rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 217, 166, 0.55), transparent);
}
.rule b { font-size: 0.62rem; font-weight: 400; opacity: 0.9; }

.hero-sub {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 2.3rem;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: clamp(0.92rem, 1.6vw, 1.1rem);
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  white-space: pre-line;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.contact {
  position: relative;
  display: block;
  --c: 174, 188, 255;
}

.contact-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(var(--c), 0.3);
  border-radius: 50%;
  background: rgba(var(--c), 0.05);
  color: rgb(var(--c));
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.4s var(--ease);
}

.contact-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
}

.contact-btn:hover,
.contact-btn:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(var(--c), 0.85);
  background: rgba(var(--c), 0.14);
  box-shadow: 0 0 26px -6px rgba(var(--c), 0.85), inset 0 0 18px -10px rgba(var(--c), 0.9);
  color: rgb(var(--c));
}

/* 悬停 / 聚焦时显示平台名与账号 */
.contact-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translate(-50%, 5px);
  padding: 0.32rem 0.65rem;
  border: 1px solid rgba(var(--c), 0.28);
  border-radius: 8px;
  background: rgba(6, 8, 18, 0.94);
  color: var(--ink-2);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.contact:hover .contact-tip,
.contact-btn:focus-visible + .contact-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 复制成功的提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 80;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.94);
  color: var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 130%);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.9rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-3);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-decoration: none;
  transition: color 0.3s;
}
.scroll-hint:hover { color: var(--ink-2); }

.scroll-hint .line {
  position: relative;
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(174, 188, 255, 0.35), transparent);
}
.scroll-hint .line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -46px;
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, transparent, #fff);
  animation: trail 2.8s var(--ease) infinite;
}

/* --------------------------- 5. 区块与按钮 --------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-head { margin-bottom: clamp(1.5rem, 2.6vw, 2.2rem); }

.section-head .num {
  margin: 0 0 0.9rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  opacity: 0.7;
}

.section-head h2 {
  margin: 0;
  color: #f3f1fb;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 3.2vw, 2.4rem);
  letter-spacing: 0.18em;
  padding-left: 0.18em;
}

.section-head .sub {
  margin: 0.85rem 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.section-head::after {
  content: "";
  display: block;
  width: 46px;
  height: 1px;
  margin-top: 1.5rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* --------------------------- 6. 文章卡片 --------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.1rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.6rem 1.5rem 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  color: inherit;
  text-decoration: none;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease), background 0.45s var(--ease);
}

.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(65% 60% at 15% 0%, rgba(174, 188, 255, 0.16), transparent 70%);
  transition: opacity 0.45s var(--ease);
}

a.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -34px rgba(140, 160, 255, 0.95);
}

a.post-card:hover::after { opacity: 1; }

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-3);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.post-tag {
  padding: 0.14rem 0.6rem;
  border: 1px solid rgba(242, 217, 166, 0.28);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}

.post-title {
  margin: 0;
  color: #f2f0fa;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.65;
  letter-spacing: 0.09em;
}

.post-exc {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.86rem;
  line-height: 1.95;
}

.post-more {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  opacity: 0.8;
  transition: opacity 0.3s, gap 0.3s var(--ease);
}
a.post-card:hover .post-more { opacity: 1; gap: 0.7rem; }

/* 未接文章页时，占位卡片不做成可点击的样子 */
article.post-card .post-more { color: var(--ink-3); opacity: 0.75; letter-spacing: 0.1em; }

/* ----------------------------- 7. 关于 ----------------------------- */
/* 左边标题、右边一张「留言卡」：内容再短也不会显得空 */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 620px);
  gap: clamp(2rem, 6vw, 4.6rem);
  justify-content: center;
  align-items: center;
}

.about-intro .num {
  margin: 0 0 1.1rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  opacity: 0.75;
}

.about-intro h2 {
  margin: 0;
  color: #f5f3ff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  text-shadow: 0 0 46px rgba(150, 168, 255, 0.28);
}

.about-intro .sub {
  margin: 1.1rem 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.about-rule {
  display: block;
  width: 58px;
  height: 1px;
  margin-top: 1.9rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.about-card {
  position: relative;
  padding: clamp(1.7rem, 3vw, 2.6rem) clamp(1.6rem, 3vw, 2.6rem) clamp(1.5rem, 2.6vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.about-mark {
  position: absolute;
  top: 0.15rem;
  left: clamp(1.1rem, 2.4vw, 2rem);
  color: rgba(242, 217, 166, 0.16);
  font-family: var(--serif);
  font-size: 4.4rem;
  line-height: 1;
  pointer-events: none;
}

.about-body { position: relative; }

.about-body p {
  margin: 0 0 0.9rem;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.95;
  letter-spacing: 0.015em;
}

/* 第一段当作「正文主体」：宋体大字，撑住整张卡 */
.about-body p:first-child {
  margin-bottom: 0;
  color: #f6f4ff;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-autospace: normal;
  text-shadow: 0 0 40px rgba(150, 168, 255, 0.22);
}

.about-body p:last-child { margin-bottom: 0; }

.about-card .chips {
  margin-top: clamp(1.3rem, 2.4vw, 1.8rem);
  padding-top: clamp(1.1rem, 2vw, 1.5rem);
  border-top: 1px solid rgba(168, 180, 255, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.chips li:hover {
  border-color: var(--line-strong);
  color: #fff;
  background: rgba(174, 188, 255, 0.08);
}

/* --------------------------- 8. 更多文章入口 --------------------------- */
.more-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-2);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-decoration: none;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.more-link:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(174, 188, 255, 0.1);
  box-shadow: 0 0 30px -12px rgba(174, 188, 255, 0.9);
}
.more-link i {
  font-style: normal;
  transition: transform 0.35s var(--ease);
}
.more-link:hover i { transform: translateX(4px); }

/* ----------------------------- 9. 页脚 ----------------------------- */
.slide-foot {
  padding: 1.3rem 0 1.2rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-note {
  margin: 0 0 0.4rem;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 0.92rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.footer-meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

/* ------------------------ 9.5 翻页圆点 / 页码 ------------------------ */
.dots {
  position: fixed;
  right: clamp(0.9rem, 2.2vw, 1.8rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
}

.dot {
  position: relative;
  width: 18px;
  height: 2px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(238, 236, 247, 0.22);
  cursor: pointer;
  transition: width 0.4s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.dot::before {
  content: "";
  position: absolute;
  inset: -9px -8px;
  border-radius: 4px;
}

.dot:hover { background: rgba(238, 236, 247, 0.55); }

.dot.is-on {
  width: 32px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(242, 217, 166, 0.65);
}

.slide-count {
  position: fixed;
  left: clamp(1.1rem, 4vw, 3.2rem);
  bottom: 1.5rem;
  z-index: 45;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}
.slide-count b { color: var(--ink-2); font-weight: 400; }

/* （编辑模式已移除） */

/* ----------------------------- 11. 动效 ----------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.92) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.12) rotate(18deg); }
}

@keyframes trail {
  0%   { top: -46px; opacity: 0; }
  25%  { opacity: 1; }
  70%  { top: 46px; opacity: 0; }
  100% { top: 46px; opacity: 0; }
}

/* --------------------------- 12. 响应式 --------------------------- */
@media (max-width: 860px) {
  :root { --nav-h: 60px; }

  .menu-btn { display: inline-grid; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.4rem clamp(1.1rem, 4vw, 3.2rem) 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 6, 14, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }

  .nav.is-open .nav-links { opacity: 1; pointer-events: auto; transform: none; }

  .nav-links a {
    padding: 0.95rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }

  .about-layout { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .about-intro h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .about-rule { margin-top: 1.2rem; }
  .scroll-hint { display: none; }
  .contacts--lg { justify-content: center; }
  .section-head .sub { font-size: 0.85rem; }

  /* 窄屏：压缩版面，保证一页装得下 */
  .section-head { margin-bottom: 1.1rem; }
  .section-head h2 { font-size: clamp(1.5rem, 5.5vw, 1.9rem); }
  .section-head::after { margin-top: 1rem; }
  .post-grid { gap: 0.8rem; }
  .post-card { gap: 0.55rem; padding: 1.1rem 1.15rem 1rem; }
  .about-body p { margin-bottom: 0.85rem; line-height: 1.9; font-size: 0.9rem; }
  .about-body p:first-child { font-size: 1.12rem; line-height: 1.7; }
  .about-card { padding: 1.35rem 1.25rem 1.2rem; border-radius: 16px; }
  .about-mark { font-size: 3.2rem; }
  .dots, .slide-count { display: none; }
}

@media (max-width: 520px) {
  .brand { font-size: 0.9rem; letter-spacing: 0.04em; text-indent: 0.04em; }
  .lang-btn { padding: 0.3rem 0.5rem; font-size: 0.68rem; }
  .icon-btn { width: 30px; height: 30px; }
  .contact-btn { width: 46px; height: 46px; }
  .contact-btn svg { width: 20px; height: 20px; }
  .contact-tip { display: none; }
  .contacts { gap: 0.75rem; }
  .post-card { padding: 0.95rem 1.05rem 0.9rem; }
  .post-exc { display: none; }
  .post-title { font-size: 1.08rem; }
}

/* 矮屏（1280×720 这类）：压缩关于页，保证仍然一屏装下 */
@media (max-height: 700px) and (min-width: 861px) {
  .slide { padding-top: calc(var(--nav-h) + 1rem); padding-bottom: 1.4rem; }
  .section-head { margin-bottom: 1.2rem; }
  .post-card { gap: 0.55rem; padding: 1.15rem 1.2rem 1rem; }
  .post-title { font-size: 1.08rem; }
  .more-row { margin-top: 0.7rem; }

  .about-intro .num { margin-bottom: 0.55rem; }
  .about-intro h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
  .about-intro .sub { margin-top: 0.8rem; }
  .about-rule { margin-top: 1rem; }
  .about-card { padding: 1.25rem 1.55rem 1rem; border-radius: 16px; }
  .about-body p:first-child { font-size: 1.3rem; line-height: 1.6; }
  .about-card .chips { margin-top: 1rem; padding-top: 0.85rem; }
  .slide--last .slide-foot { padding: 0.9rem 0 0.8rem; }
}

/* --------------------------- 13. 无障碍 --------------------------- */
@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; }
}

/* 英文排版：中文的 0.16em 字距用在西文上会散架，单独收紧 */
html[data-lang="en"] .hero-title {
  font-family: Georgia, "Times New Roman", var(--serif);
  letter-spacing: 0.01em;
  padding-left: 0;
  line-height: 1.28;
}
html[data-lang="en"] .hero-sub,
html[data-lang="en"] .eyebrow,
html[data-lang="en"] .section-head h2,
html[data-lang="en"] .post-title,
html[data-lang="en"] .footer-note,
html[data-lang="en"] .brand { letter-spacing: 0.04em; text-indent: 0; }
html[data-lang="en"] .hero-sub { padding-left: 0; }

html[data-lang="en"] .page-head h1,
html[data-lang="en"] .article-title,
html[data-lang="en"] .arc-title,
html[data-lang="en"] .sib-title,
html[data-lang="en"] .prose h2,
html[data-lang="en"] .prose h3 {
  letter-spacing: 0.01em;
  padding-left: 0;
}
html[data-lang="en"] .page-head h1,
html[data-lang="en"] .article-title { font-family: Georgia, "Times New Roman", var(--serif); }
html[data-lang="en"] .section-head h2 { padding-left: 0; }

/* 滚动条 */
@supports (scrollbar-color: auto) {
  html { scrollbar-color: rgba(168, 180, 255, 0.28) transparent; scrollbar-width: thin; }
}
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: #04050c; }
::-webkit-scrollbar-thumb {
  border: 2px solid #04050c;
  border-radius: 99px;
  background: rgba(168, 180, 255, 0.22);
}
::-webkit-scrollbar-thumb:hover { background: rgba(168, 180, 255, 0.4); }

/* ===================== 14. 子页面：文章总目 / 正文 ===================== */
.nav.is-solid {
  background: rgba(4, 5, 12, 0.74);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line);
}

.page-main {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3.4rem) clamp(1.1rem, 4vw, 3rem) 3rem;
}

.page-head { max-width: 760px; }

.page-head .kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  opacity: 0.82;
}

.page-head h1 {
  margin: 0;
  color: #f5f3ff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  line-height: 1.35;
}

.page-head .sub {
  margin: 1rem 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.page-head::after {
  content: "";
  display: block;
  width: 46px;
  height: 1px;
  margin-top: 1.5rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ---------- 文章总目：最多两列，纵向无限，卡片等高 ---------- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.arc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  height: 280px;
  padding: 1.5rem 1.6rem 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  color: inherit;
  text-decoration: none;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.arc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(65% 55% at 15% 0%, rgba(174, 188, 255, 0.16), transparent 70%);
  transition: opacity 0.45s var(--ease);
}

.arc-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -34px rgba(140, 160, 255, 0.95);
}
.arc-card:hover::after { opacity: 1; }

.arc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.arc-no {
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0.7;
}

.arc-title {
  margin: 0.1rem 0 0;
  color: #f2f0fa;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.62;
  letter-spacing: 0.06em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.arc-exc {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.84rem;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.arc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(168, 180, 255, 0.12);
  color: var(--ink-3);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.arc-arrow { color: var(--accent); transition: transform 0.35s var(--ease); }
.arc-card:hover .arc-arrow { transform: translateX(3px); }

.page-actions { margin-top: 2.2rem; }

.page-foot {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ---------- 正文 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  box-shadow: 0 0 12px rgba(174, 188, 255, 0.6);
  transition: width 0.12s linear;
}

.article {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3.6rem) clamp(1.15rem, 4vw, 2rem) 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2.3rem;
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  transition: color 0.3s;
}
.back-link:hover { color: var(--ink); }

.article-head {
  margin-bottom: 2.4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.article-kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.article-title {
  margin: 0;
  color: #f6f4ff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.6vw, 2.55rem);
  line-height: 1.5;
  letter-spacing: 0.06em;
  padding-left: 0.06em;
  text-shadow: 0 0 50px rgba(150, 168, 255, 0.25);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.3rem 0 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}
.dot-sep { opacity: 0.5; }

.prose {
  color: rgba(238, 236, 247, 0.86);
  font-size: 1.02rem;
  line-height: 2.05;
  letter-spacing: 0.01em;
}

.prose p { margin: 0 0 1.45rem; }

.prose h2 {
  margin: 2.6rem 0 1rem;
  color: #f3f1fb;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.55;
  letter-spacing: 0.08em;
}

.prose h3 {
  margin: 2.1rem 0 0.8rem;
  color: #f3f1fb;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
}

.prose h4 {
  margin: 1.8rem 0 0.6rem;
  color: #f3f1fb;
  font-size: 1.02rem;
}

.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child { margin-top: 0; }

.prose strong { color: #fff; font-weight: 600; }
.prose em { color: var(--ink); }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(174, 188, 255, 0.4);
  transition: color 0.3s, border-color 0.3s;
}
.prose a:hover { color: #fff; border-bottom-color: var(--accent); }

.prose code {
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: rgba(174, 188, 255, 0.12);
  color: #dfe4ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 0.88em;
}

.prose pre {
  margin: 1.8rem 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 9, 19, 0.9);
  font-size: 0.85rem;
  line-height: 1.8;
}

.prose pre code {
  padding: 0;
  background: none;
  color: #cfd6ff;
  font-size: 1em;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 0.3rem 0 0.3rem 1.3rem;
  border-left: 2px solid rgba(242, 217, 166, 0.55);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1.05rem;
}
.prose blockquote p { margin: 0; }

.prose ul,
.prose ol { margin: 0 0 1.45rem; padding-left: 1.6rem; }
.prose li { margin: 0.45rem 0; padding-left: 0.25rem; }
.prose li::marker { color: rgba(242, 217, 166, 0.7); }

.prose hr { margin: 2.8rem 0; border: 0; border-top: 1px solid var(--line); }

.prose img { max-width: 100%; margin: 1.6rem 0; border-radius: 12px; }

/* ---------- 载入失败 / 找不到 ---------- */
.article-status {
  margin: 2rem 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.article-status.is-error {
  padding: 1.5rem 1.4rem;
  border: 1px dashed rgba(242, 217, 166, 0.45);
  border-radius: 16px;
  background: rgba(242, 217, 166, 0.04);
  color: var(--ink-2);
  letter-spacing: 0;
}

.article-status.is-error h2 {
  margin: 0 0 0.8rem;
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
}

.article-status.is-error p {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  line-height: 1.9;
}

.status-cmd {
  margin: 0;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #cfd6ff;
  font-size: 0.82rem;
}

/* ---------- 上下篇 ---------- */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.sibling {
  flex: 0 1 46%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}
.sibling:hover {
  border-color: var(--line-strong);
  background: rgba(174, 188, 255, 0.06);
  transform: translateY(-2px);
}
.sibling--next { align-items: flex-end; margin-left: auto; text-align: right; }
.sibling[hidden] { display: none; }

.article-nav[hidden] { display: none; }

.sib-label { color: var(--ink-3); font-size: 0.68rem; letter-spacing: 0.18em; }
.sib-title { color: #f0eefa; font-family: var(--serif); font-size: 0.98rem; line-height: 1.55; letter-spacing: 0.04em; }

/* ---------- 子页面响应式 ---------- */
@media (max-width: 760px) {
  .archive-grid { grid-template-columns: minmax(0, 1fr); }
  .arc-card { height: 250px; padding: 1.25rem 1.2rem 1.1rem; }
  .more-row { justify-content: center; }
  .article-nav { flex-direction: column; }
  .sibling--next { align-items: flex-start; text-align: left; }
  .page-head h1 { letter-spacing: 0.1em; padding-left: 0.1em; }
}
