/* ==========================================================================
   Design System — 浅色编辑感个人站
   基于参考视频逐帧取色的设计 token（见 materials/palette/design-tokens.json）
   字体：Fraunces (Display) / Inter (Body) / Space Grotesk (Label)
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-Variable-Italic.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk-Variable.ttf") format("truetype-variations");
  font-weight: 300 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg: #f4f1ec;
  --bg-deep: #ebe6de;
  --surface: #ffffff;
  --surface-warm: #fbf9f6;
  --ink: #12121a;
  --ink-2: #4e4e58;
  --muted: #8b8b95;
  --line: rgba(18, 18, 26, 0.10);
  --line-strong: rgba(18, 18, 26, 0.20);

  /* accent — 取自 Velorah 夜空站，为浅底加深保证对比度 */
  --accent: #1c6b76;
  --accent-mid: #308898;
  --accent-soft: #7fb3bd;
  --accent-wash: rgba(48, 136, 152, 0.08);

  /* 辅助强调（暖调，用于少量点睛） */
  --warm: #b4653f;
  --warm-wash: rgba(180, 101, 63, 0.08);

  /* type
     拉丁字体在前、中文在后：中英文各自用同族字体，且三处（标题/正文/标签）
     共用同一套中文回退，避免标题走宋体、正文走雅黑的两张脸问题 */
  --font-display: "Fraunces", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
  --font-label: "Space Grotesk", "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", system-ui, sans-serif;

  /* metrics */
  --maxw: 1180px;
  --gutter: 32px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* glass */
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(18, 18, 26, 0.08);
  --glass-shadow: 0 8px 32px rgba(18, 18, 26, 0.07);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 锚点跳转时避开固定导航 */
  scroll-padding-top: 96px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-optical-sizing: auto;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

/* ---------- Paper grain + ambient light ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(48, 136, 152, 0.13), transparent 62%),
    radial-gradient(900px 540px at 8% 12%, rgba(180, 101, 63, 0.07), transparent 60%),
    radial-gradient(760px 520px at 52% 108%, rgba(48, 136, 152, 0.09), transparent 62%);
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-narrow {
  max-width: 820px;
}

section {
  position: relative;
  padding: 118px 0;
}

.sec-line {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.16;
  font-variation-settings: "SOFT" 30, "WONK" 1;
}

.h-display {
  font-size: clamp(40px, 8vw, 108px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.h-section {
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 300;
  font-variation-settings: "SOFT" 35, "WONK" 1, "opsz" 100;
  letter-spacing: -0.016em;
  line-height: 1.08;
}

.h-card {
  font-size: 24px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 48;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

em.accent-i {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  color: var(--accent);
}

.lede {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 60ch;
}

.label {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.label-accent {
  color: var(--accent);
}

/* ---------- 中文排版 ---------- */
/* 中文由思源宋体 / 思源黑体提供（见 cjk-fonts.css），与 Fraunces / Inter 一一对应。
   中文字体没有真正的斜体，浏览器合成的假斜体（如标题里的「光」）会让笔画走形，
   这里统一关掉合成，强调色仍然生效，字形保持端正。 */
body,
h1,
h2,
h3,
h4,
.h-display,
.h-section,
.h-card,
em.accent-i,
.label,
.btn,
.btn-text {
  font-synthesis: none;
}

/* 思源宋体带比例宽度字形，标题里的中文标点（，。、）会收得更紧 */
h1,
h2,
h3,
h4,
.h-display,
.h-section,
.h-card {
  font-feature-settings: "palt" 1;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease), background 0.5s var(--ease);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 14px 34px rgba(18, 18, 26, 0.12);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbfaf8;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(28, 107, 118, 0.28);
}

.btn-arrow {
  transition: transform 0.5s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(28, 107, 118, 0.3);
  transition: border-color 0.4s var(--ease), gap 0.4s var(--ease);
}

.btn-text:hover {
  border-color: var(--accent);
  gap: 13px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  transition: top 0.55s var(--ease);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--maxw);
  padding: 9px 10px 9px 22px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  transition: padding 0.55s var(--ease), box-shadow 0.55s var(--ease),
    background 0.55s var(--ease);
}

.nav.scrolled .nav-inner {
  padding: 6px 8px 6px 18px;
  box-shadow: 0 10px 40px rgba(18, 18, 26, 0.11);
  background: rgba(255, 255, 255, 0.78);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 40;
  letter-spacing: -0.02em;
  margin-right: auto;
  white-space: nowrap;
}

.nav-brand .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.35s var(--ease), background 0.35s var(--ease);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(18, 18, 26, 0.05);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-wash);
}

.nav-cta {
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fbfaf8;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}

.nav-cta:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.nav-burger {
  position: relative;
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex-shrink: 0;
}

.nav-burger span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform 0.42s var(--ease);
}

.nav-burger span:first-child {
  transform: translate(-50%, calc(-50% - 3.5px));
}

.nav-burger span:last-child {
  transform: translate(-50%, calc(-50% + 3.5px));
}

.nav.open .nav-burger span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav.open .nav-burger span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 已登录：导航栏右上角头像（点击弹出账号菜单） */
.nav-user {
  position: relative;
  display: flex;
  flex-shrink: 0;
}

.nav-avatar {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  background: var(--accent-wash);
  border: 1.5px solid var(--glass-border);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(18, 18, 26, 0.08);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(18, 18, 26, 0.14);
}
.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 账号下拉菜单 */
.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  min-width: 178px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 16px;
  background: #fdfcfa;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 54px rgba(18, 18, 26, 0.18);
  animation: navMenuIn 0.22s var(--ease);
}
.nav-menu[hidden] {
  display: none;
}
.nav-menu a,
.nav-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.nav-menu a:hover,
.nav-menu button:hover {
  background: rgba(18, 18, 26, 0.05);
  color: var(--ink);
}
.nav-menu .is-danger {
  color: #b43c32;
}
.nav-menu .is-danger:hover {
  background: rgba(180, 60, 50, 0.08);
  color: #b43c32;
}
.nav-menu-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--line);
}
@keyframes navMenuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 0 90px;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  top: 50%;
  right: -6%;
  width: min(760px, 62vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 34% 32%, rgba(127, 179, 189, 0.55), transparent 52%),
    radial-gradient(circle at 68% 62%, rgba(48, 136, 152, 0.42), transparent 55%),
    radial-gradient(circle at 46% 78%, rgba(180, 101, 63, 0.20), transparent 52%),
    radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.85), transparent 60%);
  filter: blur(52px);
  animation: orbDrift 22s var(--ease-soft) infinite alternate;
  /* 独立于 transform 的视差位移，避免和 animation 打架 */
  translate: 0 var(--py, 0px);
  transition: translate 0.1s linear;
}

.hero-orb::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1px solid rgba(28, 107, 118, 0.14);
  animation: orbSpin 44s linear infinite;
}

@keyframes orbDrift {
  0% {
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(-53%) scale(1.07) rotate(8deg);
  }
  100% {
    transform: translateY(-47%) scale(0.96) rotate(-6deg);
  }
}

@keyframes orbSpin {
  to {
    transform: rotate(360deg);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  margin-bottom: 30px;
}

.hero-eyebrow .pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-eyebrow .pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.5;
  animation: pulseRing 2.4s var(--ease-soft) infinite;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  70% {
    transform: scale(1.7);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.hero-eyebrow span {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.hero h1 {
  max-width: 15ch;
  margin-bottom: 30px;
}

.hero-lede {
  max-width: 46ch;
  font-size: clamp(15.5px, 1.25vw, 18px);
  line-height: 1.72;
  color: var(--ink-2);
  margin-bottom: 42px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 76px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  max-width: 640px;
}

.hero-meta-item .label {
  display: block;
  margin-bottom: 7px;
}

.hero-meta-item strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "opsz" 40;
  letter-spacing: -0.01em;
}

.scroll-hint {
  position: absolute;
  left: var(--gutter);
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 11px;
  z-index: 3;
}

.scroll-hint .label {
  font-size: 10.5px;
  letter-spacing: 0.2em;
}

.scroll-hint .track {
  position: relative;
  width: 46px;
  height: 1px;
  background: var(--line-strong);
  overflow: hidden;
}

.scroll-hint .track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scrollTrack 2.6s var(--ease-soft) infinite;
}

@keyframes scrollTrack {
  0% {
    transform: translateX(-100%);
  }
  55%,
  100% {
    transform: translateX(100%);
  }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface-warm);
}

.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marqueeScroll 46s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 26px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.marquee-item::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
  flex-shrink: 0;
}

@keyframes marqueeScroll {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Section header ---------- */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 58px;
}

.sec-head-left {
  max-width: 620px;
}

.sec-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.sec-kicker .num {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--accent-wash);
  border: 1px solid rgba(48, 136, 152, 0.18);
}

.sec-head .lede {
  margin-top: 20px;
}

/* ---------- Work cards ---------- */
.work-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(2, 1fr);
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease),
    border-color 0.6s var(--ease);
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 60px rgba(18, 18, 26, 0.11);
}

.work-card.featured {
  grid-column: span 2;
}

.work-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-deep);
}

.work-card.featured .work-media {
  aspect-ratio: 21 / 9;
}

.work-media img,
.work-media .cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease);
}

.work-card:hover .work-media img,
.work-card:hover .work-media .cover {
  transform: scale(1.045);
}

.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 18, 26, 0.14), transparent 46%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.work-card:hover .work-media::after {
  opacity: 1;
}

.work-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 26px 28px 28px;
  flex: 1;
}

.work-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.work-year {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex-shrink: 0;
}

.work-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.work-arrow {
  position: absolute;
  right: 24px;
  bottom: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translate(6px, 6px) scale(0.85);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.work-card:hover .work-arrow {
  opacity: 1;
  transform: none;
}

/* ---------- About split ---------- */
.about-split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 70px;
  align-items: center;
}

.portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-deep);
  border: 1px solid var(--line);
}

.portrait .cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-note {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  text-align: center;
}

.about-text h2 {
  margin-bottom: 24px;
}

.about-text p {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--ink-2);
  margin-bottom: 18px;
}

.about-text p strong {
  color: var(--ink);
  font-weight: 500;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 72;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 7px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat-num .suffix {
  font-size: 0.55em;
  color: var(--accent);
}

.stat-label {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  gap: 0;
}

.tl-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 38px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.5s var(--ease);
}

.tl-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s var(--ease);
}

.tl-row:hover::before {
  transform: scaleY(1);
}

.tl-row:hover {
  padding-left: 18px;
}

.tl-time {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 4px;
}

.tl-body h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 44;
  letter-spacing: -0.012em;
  margin-bottom: 6px;
}

.tl-body .tl-role {
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 9px;
}

.tl-body p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------- Skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  padding: 28px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(18, 18, 26, 0.08);
}

.skill-card .label {
  margin-bottom: 16px;
  display: block;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.skill-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Contact ---------- */
.contact {
  padding: 130px 0 110px;
  border-top: 1px solid var(--line);
}

.contact-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact h2 {
  margin-bottom: 22px;
  max-width: 18ch;
}

.contact .lede {
  margin: 0 auto 44px;
  text-align: center;
}

.email-link {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
  letter-spacing: -0.03em;
  padding-bottom: 6px;
  transition: color 0.5s var(--ease);
}

.email-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 0.6s var(--ease), background 0.5s var(--ease);
}

.email-link:hover {
  color: var(--accent);
}

.email-link:hover::after {
  transform: scaleX(0);
  background: var(--accent);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 46px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease),
    color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.social-pill:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 12px 30px rgba(28, 107, 118, 0.13);
}

.social-pill svg {
  width: 15px;
  height: 15px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 40px 0 46px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-note {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Page header (inner pages) ---------- */
.page-head {
  padding: 172px 0 76px;
  position: relative;
}

.page-head .label {
  display: block;
  margin-bottom: 22px;
}

.page-head h1 {
  font-size: clamp(42px, 6.6vw, 88px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  letter-spacing: -0.034em;
  line-height: 0.98;
  max-width: 20ch;
  margin-bottom: 28px;
}

.page-head .lede {
  max-width: 54ch;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 44px;
}

.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  transition: all 0.4s var(--ease);
}

.filter-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbfaf8;
}

/* ---------- Reveal animation ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  will-change: opacity, transform;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal-scale {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.js .reveal-scale.in {
  opacity: 1;
  transform: none;
}

/* line-by-line mask reveal for headings */
.line-mask {
  display: block;
  overflow: hidden;
}

.js .line-mask > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1.05s var(--ease);
  will-change: transform;
}

.js .line-mask.in > span {
  transform: none;
}

/* ---------- Cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--ink);
  margin: -3px 0 0 -3px;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(18, 18, 26, 0.28);
  margin: -17px 0 0 -17px;
  transition: opacity 0.3s ease, width 0.35s var(--ease),
    height 0.35s var(--ease), margin 0.35s var(--ease),
    background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.cursor-ring.grow {
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  background: rgba(48, 136, 152, 0.1);
  border-color: rgba(28, 107, 118, 0.4);
}

@media (hover: none) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 1001;
  width: 0;
  transition: width 0.1s linear;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  :root {
    --gutter: 24px;
  }

  section {
    padding: 88px 0;
  }

  .about-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .portrait {
    max-width: 380px;
    aspect-ratio: 4 / 5;
  }

  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-card.featured .work-media {
    aspect-ratio: 16 / 10;
  }

  .hero-orb {
    width: 88vw;
    right: -28%;
    opacity: 0.72;
  }
}

@media (max-width: 760px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-burger {
    display: block;
  }

  .nav.open .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: 22px;
    /* 移动端菜单优先保证可读性：近乎不透明，避免页面文字透出 */
    background: #fdfcfa;
    border: 1px solid var(--glass-border);
    box-shadow: 0 18px 50px rgba(18, 18, 26, 0.16);
  }

  .nav.open .nav-links a {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 14px;
  }

  .hero {
    padding: 130px 0 80px;
    min-height: auto;
  }

  .hero h1 {
    max-width: 100%;
  }

  .hero-meta {
    margin-top: 48px;
    gap: 24px;
  }

  .scroll-hint {
    display: none;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card.featured {
    grid-column: span 1;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tl-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tl-row:hover {
    padding-left: 0;
  }

  .sec-head {
    margin-bottom: 40px;
  }

  .page-head {
    padding: 136px 0 56px;
  }

  .contact {
    padding: 88px 0 76px;
  }
}

/* ---------- Focus visible (keyboard) ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.nav-links a:focus-visible,
.btn:focus-visible,
.nav-cta:focus-visible,
.social-pill:focus-visible,
.filter-btn:focus-visible,
.skill-pill:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-label);
  font-size: 13px;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

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

  .js .reveal,
  .js .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .js .line-mask > span {
    transform: none;
  }
}

/* ==========================================================================
   桌面壁纸背景
   --------------------------------------------------------------------------
   用法：<body class="bg-photo">
         <div class="bg-fixed"></div>   ← 固定壁纸（滚动时始终可见）
         <div class="bg-veil"></div>    ← 极淡纸色蒙版（只为压对比度）
   去掉 body 上的 bg-photo 即恢复纯纸色背景。
   --------------------------------------------------------------------------
   关键点：
     1. .bg-fixed 用 position:fixed —— 不随页面滚动，一直看得见壁纸
     2. 壁纸本身已预先抬亮 + 轻微柔化（desktop-bg-fixed.jpg），
        所以蒙版可以做得很淡，不会遮掉画面
     3. .bg-veil 也是 fixed —— 蒙版不随滚动漂移，全页对比度一致
   ========================================================================== */

body.bg-photo {
  position: relative;
  background-color: var(--bg);
}

/* 固定壁纸层 */
body.bg-photo .bg-fixed {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("../img/desktop-bg-fixed.jpg");
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
}

/* 极淡蒙版：0.08 → 0.26，只压对比度，不遮画面 */
body.bg-photo .bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(244, 241, 236, 0.04) 0%,
    rgba(244, 241, 236, 0.12) 46%,
    rgba(244, 241, 236, 0.18) 100%
  );
}

/* 首屏：只留一层很轻的径向蒙版，让标题更实 */
body.bg-photo .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 68% 76% at 24% 46%,
    rgba(250, 248, 245, 0.52) 0%,
    rgba(250, 248, 245, 0.40) 42%,
    rgba(250, 248, 245, 0.14) 72%,
    rgba(250, 248, 245, 0) 100%
  );
}

/* 有壁纸时，光球会糊在图上，去掉 */
body.bg-photo .hero-orb {
  display: none;
}

body.bg-photo .ambient {
  opacity: 0.16;
}

/* 玻璃导航：背景变亮后需要更实一点才压得住 */
body.bg-photo .nav-inner {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(18, 18, 26, 0.10);
}

body.bg-photo .nav.scrolled .nav-inner {
  background: rgba(255, 255, 255, 0.90);
}

/* 卡片与面板：略实一点，避免壁纸透进正文 */
body.bg-photo .work-card,
body.bg-photo .skill-card,
body.bg-photo .panel,
body.bg-photo .auth-card {
  background: rgba(255, 255, 255, 0.97);
}

/* 正文段落加一层极轻的纸色雾，保证长段文字的可读性 */
body.bg-photo .about-text p,
body.bg-photo .tl-body p,
body.bg-photo .contact .lede,
body.bg-photo .sec-head .lede,
body.bg-photo .page-head .lede {
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.55);
}

/* ---------- 移动端：屏幕小、文字密，蒙版稍厚一点 ---------- */
@media (max-width: 760px) {
  body.bg-photo .bg-fixed {
    background-position: 46% 26%;
  }

  body.bg-photo .bg-veil {
    background: linear-gradient(
      180deg,
      rgba(244, 241, 236, 0.16) 0%,
      rgba(244, 241, 236, 0.28) 50%,
      rgba(244, 241, 236, 0.36) 100%
    );
  }

  body.bg-photo .hero::before {
    background: radial-gradient(
      ellipse 92% 62% at 50% 42%,
      rgba(250, 248, 245, 0.46) 0%,
      rgba(250, 248, 245, 0.30) 55%,
      rgba(250, 248, 245, 0) 100%
    );
  }
}

/* ---------- 壁纸背景下的小字对比度补偿 ---------- */
body.bg-photo .label,
body.bg-photo .footer-note,
body.bg-photo .footer-links a,
body.bg-photo .work-year,
body.bg-photo .stat-label,
body.bg-photo .field .hint,
body.bg-photo .auth-foot {
  color: #5c5c66;
}

body.bg-photo .sec-kicker .num {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(28, 107, 118, 0.22);
}

body.bg-photo .label-accent {
  color: var(--accent);
}

/* 页脚加一层薄雾，避免小字糊在壁纸上 */
body.bg-photo .footer {
  background: rgba(250, 248, 245, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/* 分类筛选按钮 */
body.bg-photo .filter-btn {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(18, 18, 26, 0.14);
}

body.bg-photo .filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbfaf8;
}

/* 技能标签 / 作品标签 */
body.bg-photo .tag,
body.bg-photo .skill-pill {
  background: rgba(255, 255, 255, 0.78);
}

/* 壁纸背景下，长段正文再压深一档 */
body.bg-photo .about-text p,
body.bg-photo .tl-body p,
body.bg-photo .work-desc,
body.bg-photo .lede {
  color: #3a3a44;
}

body.bg-photo .tl-body .tl-role {
  color: #14606a;
}

body.bg-photo .tl-time {
  color: #5c5c66;
}

/* ==========================================================================
   日记 & 照片
   ========================================================================== */

/* ---------- 日记列表 ---------- */
.entry-list {
  display: grid;
  gap: 0;
}

.entry-item {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 40px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.5s var(--ease);
}

.entry-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s var(--ease);
}

.entry-item:hover::before {
  transform: scaleY(1);
}

.entry-item:hover {
  padding-left: 18px;
}

.entry-date {
  font-family: var(--font-label);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-top: 6px;
  line-height: 1.5;
}

.entry-date .d {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.entry-main h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 48;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 10px;
  transition: color 0.4s var(--ease);
}

.entry-item:hover .entry-main h3 {
  color: var(--accent);
}

.entry-excerpt {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 66ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(48, 136, 152, 0.10);
  border: 1px solid rgba(48, 136, 152, 0.20);
  font-family: var(--font-label);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.mood-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.photo-count {
  font-family: var(--font-label);
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.photo-count svg {
  width: 13px;
  height: 13px;
}

.private-chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(180, 101, 63, 0.10);
  border: 1px solid rgba(180, 101, 63, 0.25);
  font-family: var(--font-label);
  font-size: 10.5px;
  color: var(--warm);
  letter-spacing: 0.04em;
}

/* 月份分组标题 */
.month-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 44px 0 8px;
}

.month-head:first-child {
  padding-top: 0;
}

.month-head .m {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  letter-spacing: -0.02em;
}

.month-head .n {
  font-family: var(--font-label);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.month-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-bottom: 7px;
}

/* ---------- 照片墙（CSS 瀑布流） ---------- */
.photo-wall {
  columns: 3;
  column-gap: 16px;
}

.photo-tile {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-deep);
  cursor: zoom-in;
  border: 1px solid var(--line);
}

.photo-tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease);
}

.photo-tile:hover img {
  transform: scale(1.04);
}

.photo-tile .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 12px;
  background: linear-gradient(transparent, rgba(18, 18, 26, 0.72));
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.photo-tile:hover .cap {
  opacity: 1;
  transform: none;
}

.photo-tile .cap .date {
  display: block;
  font-family: var(--font-label);
  font-size: 10.5px;
  opacity: 0.72;
  margin-top: 3px;
  letter-spacing: 0.05em;
}

/* ---------- 页面右上角「⋯」与多选管理 ---------- */

.page-manage-btn {
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 950;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  color: var(--ink-2);
  box-shadow: 0 10px 30px rgba(18, 18, 26, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}
.page-manage-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.page-manage-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
body.is-selecting .page-manage-btn {
  display: none;
}

.select-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1800;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 18px;
  border-radius: 999px;
  background: rgba(24, 24, 30, 0.92);
  color: #fbfaf8;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.select-bar.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
/* 多选时把 toast 抬到工具条上方，避免重叠 */
body.is-selecting .photo-toast {
  bottom: 96px;
}
/* 多选时隐藏「添加」方块，避免误触 */
body.is-selecting .photo-add-tile,
body.is-selecting .entry-add-tile {
  display: none;
}
.select-bar .sb-count {
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding-right: 4px;
}
.select-bar button {
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.select-bar .sb-del {
  border: 0;
  background: #b4453a;
  color: #fff;
}
.select-bar .sb-del:hover:not(:disabled) {
  background: #9c3a30;
}
.select-bar .sb-del:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.select-bar .sb-cancel {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: transparent;
  color: #fff;
}
.select-bar .sb-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 选中标记 */
.select-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(18, 18, 26, 0.42);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.photo-tile.is-selected .select-check,
.entry-item.is-selected .select-check {
  background: var(--accent);
  border-color: var(--accent);
}
.photo-tile.is-selected img {
  filter: brightness(0.7);
}
.photo-tile.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.is-selecting .photo-tile {
  cursor: pointer;
}
.is-selecting .photo-tile:hover img {
  transform: none;
}

/* 日记条目：标记放右侧垂直居中，避免压住日期 */
.entry-item .select-check {
  top: 50%;
  right: 14px;
  left: auto;
  transform: translateY(-50%);
}
.entry-item.is-selected {
  background: var(--accent-wash);
  border-radius: 10px;
}
.entry-item.is-selected .entry-main h3 {
  color: var(--accent);
}
.is-selecting .entry-item:hover {
  padding-left: 0;
}
.is-selecting .entry-item::before {
  display: none;
}

/* 确认弹窗 */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 12, 16, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0.22s;
}
.confirm-overlay.open {
  opacity: 1;
  visibility: visible;
}
.confirm-panel {
  width: min(400px, 100%);
  padding: 26px 26px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s var(--ease);
}
.confirm-overlay.open .confirm-panel {
  transform: none;
}
.confirm-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--ink);
}
.confirm-msg {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 22px;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-actions button {
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.confirm-cancel {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
}
.confirm-cancel:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.confirm-ok {
  border: 0;
  background: var(--ink);
  color: #fbfaf8;
}
.confirm-ok:hover {
  background: var(--accent);
}
.confirm-ok.is-danger {
  background: #b4453a;
}
.confirm-ok.is-danger:hover {
  background: #9c3a30;
}

@media (max-width: 760px) {
  .page-manage-btn {
    top: 84px;
    right: 14px;
    width: 38px;
    height: 38px;
  }
  .select-bar {
    bottom: 16px;
    width: calc(100% - 28px);
    justify-content: space-between;
  }
}

@media (max-width: 1000px) {
  .photo-wall {
    columns: 2;
  }
}

@media (max-width: 620px) {
  .photo-wall {
    columns: 1;
  }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: rgba(12, 12, 16, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(1200px, 92vw);
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lb-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 0 24px;
}

.lb-cap .date {
  display: block;
  font-family: var(--font-label);
  font-size: 11px;
  opacity: 0.6;
  margin-top: 5px;
  letter-spacing: 0.08em;
}

.lb-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 18px;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.lb-close {
  top: 24px;
  right: 24px;
}

.lb-prev {
  left: 24px;
  top: 50%;
  margin-top: -23px;
}

.lb-next {
  right: 24px;
  top: 50%;
  margin-top: -23px;
}

@media (max-width: 700px) {
  .lb-prev,
  .lb-next {
    display: none;
  }
}

/* ---------- 日记正文 ---------- */
.entry-hero {
  padding: 158px 0 44px;
}

.entry-hero .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.entry-hero h1 {
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 24ch;
}

.prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--ink);
}

.prose p {
  margin-bottom: 1.5em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.entry-gallery {
  margin-top: 54px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.entry-gallery .photo-tile {
  margin-bottom: 0;
}

.entry-gallery.single {
  grid-template-columns: 1fr;
}

.entry-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 70px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.entry-nav a {
  display: block;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease);
}

.entry-nav a:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.entry-nav .dir {
  font-family: var(--font-label);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}

.entry-nav .t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 40;
  line-height: 1.3;
}

.entry-nav .right {
  text-align: right;
}

@media (max-width: 620px) {
  .entry-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .entry-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 0;
  }

  .entry-date .d {
    font-size: 20px;
    margin-bottom: 0;
  }

  .entry-gallery {
    grid-template-columns: 1fr;
  }

  .entry-nav {
    grid-template-columns: 1fr;
  }

  .entry-nav .right {
    text-align: left;
  }
}

/* ---------- 写作后台 ---------- */
.editor-card {
  padding: 34px 34px 36px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(18, 18, 26, 0.07);
}

.editor-card textarea {
  width: 100%;
  min-height: 320px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.editor-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28, 107, 118, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 107, 118, 0.12);
}

.field input[type="date"] {
  cursor: pointer;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.char-count {
  font-family: var(--font-label);
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
}

/* 上传区 */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(48, 136, 152, 0.05);
}

.dropzone .dz-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent);
}

.dropzone .dz-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 40;
  margin-bottom: 6px;
}

.dropzone .dz-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.upload-queue {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.uq-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 13px;
}

.uq-item img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.uq-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.uq-state {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.uq-state.ok {
  color: var(--accent);
}

.uq-state.err {
  color: #9c2f26;
}

/* 统计条 */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 560px;
}

.stat-strip .n {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-strip .l {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* 空状态 */
.empty-state {
  padding: 90px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line-strong);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 48;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 22px;
}

/* ==========================================================================
   认证页面（登录 / 注册 / 个人中心）
   ========================================================================== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 150px 24px 80px;
  position: relative;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  padding: 44px 40px 40px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(18, 18, 26, 0.10);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}

.auth-head {
  text-align: center;
  margin-bottom: 30px;
}

.auth-head .label {
  display: block;
  margin-bottom: 14px;
}

.auth-head h1 {
  font-size: 34px;
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 72;
  letter-spacing: -0.028em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.auth-head p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.auth-tab {
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(18, 18, 26, 0.09);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}

.field input::placeholder {
  color: #b4b4bc;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28, 107, 118, 0.12);
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fbfaf8;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease), opacity 0.3s var(--ease);
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(28, 107, 118, 0.26);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.auth-msg {
  display: none;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 4px;
}

.auth-msg.show {
  display: block;
}

.auth-msg.error {
  background: rgba(180, 60, 50, 0.08);
  border: 1px solid rgba(180, 60, 50, 0.22);
  color: #9c2f26;
}

.auth-msg.ok {
  background: rgba(28, 107, 118, 0.08);
  border: 1px solid rgba(28, 107, 118, 0.22);
  color: var(--accent);
}

.auth-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-foot a {
  color: var(--accent);
  border-bottom: 1px solid rgba(28, 107, 118, 0.3);
}

.nav-links a.is-authed {
  color: var(--accent);
  background: var(--accent-wash);
}

/* ---------- 个人中心 ---------- */
.account-wrap {
  padding: 160px 0 110px;
  min-height: 100vh;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 44px;
}

.account-profile-meta {
  min-width: 0;
}

.account-profile-meta .label {
  display: block;
  margin-bottom: 14px;
}

.account-profile-meta h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: 12px;
}

/* 写作台等页面的页头（沿用原 account-head 样式） */
.account-head {
  margin-bottom: 46px;
}

.account-head .label {
  display: block;
  margin-bottom: 16px;
}

.account-head h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 300;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 14px;
}

/* 侧栏（当前会话 / 安全说明）弱化，降低视觉重量 */
.panel-muted {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 34px rgba(18, 18, 26, 0.04);
}

.panel-muted .info-row {
  padding: 11px 0;
}

@media (max-width: 620px) {
  .account-profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

.account-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 26px;
  align-items: start;
}

.panel {
  padding: 30px 30px 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(18, 18, 26, 0.06);
}

.panel h2 {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-row dt {
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.info-row dd {
  font-size: 14.5px;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}

.avatar-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #fff;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.btn-ghost {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.4s var(--ease);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-danger:hover {
  border-color: #b43c32;
  color: #b43c32;
}

.account-note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auth-wrap {
    padding: 120px 18px 60px;
  }

  .auth-card {
    padding: 34px 24px 30px;
  }

  .auth-head h1 {
    font-size: 28px;
  }

  .account-wrap {
    padding: 130px 0 80px;
  }

  .info-row {
    flex-direction: column;
    gap: 5px;
  }

  .info-row dd {
    text-align: left;
  }
}

/* ==========================================================================
   照片「+ 添加」方块
   ========================================================================== */

.photo-add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 240px;
  margin-bottom: 16px;
  padding: 24px 16px;
  border-radius: 14px;
  border: 2px dashed rgba(28, 107, 118, 0.38);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-2);
  break-inside: avoid;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease),
    color 0.4s var(--ease), transform 0.4s var(--ease);
}

.photo-add-tile:hover {
  border-color: var(--accent);
  background: rgba(48, 136, 152, 0.07);
  color: var(--accent);
  transform: translateY(-2px);
}

.photo-add-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.photo-add-tile .pa-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(48, 136, 152, 0.13);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}

.photo-add-tile:hover .pa-icon {
  background: rgba(48, 136, 152, 0.16);
  transform: scale(1.06);
}

.photo-add-tile .pa-label {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.5;
}

/* 空状态时更高一些，成为视觉主体 */
.photo-add-tile.is-empty {
  min-height: 320px;
  background: rgba(255, 255, 255, 0.72);
}

.photo-add-tile.is-empty .pa-icon {
  width: 62px;
  height: 62px;
  font-size: 36px;
}

/* 上传中 */
.photo-add-tile.uploading {
  pointer-events: none;
  border-color: var(--accent);
  background: rgba(48, 136, 152, 0.08);
  color: var(--accent);
}

.photo-add-tile.uploading .pa-icon {
  animation: paSpin 1.1s linear infinite;
}

@keyframes paSpin {
  to {
    transform: rotate(360deg);
  }
}

.photo-add-tile.done {
  border-color: rgba(28, 107, 118, 0.5);
  color: var(--accent);
}

/* 网格布局里（日记配图）也能用 */
.entry-gallery .photo-add-tile {
  margin-bottom: 0;
  min-height: 160px;
}

/* 上传进度浮层 */
.photo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 1500;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(18, 18, 26, 0.88);
  color: #fff;
  font-family: var(--font-label);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.photo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 照片墙为空时：不分栏，让「+」方块撑满整行 */
.photo-wall.is-empty {
  columns: 1;
}

.photo-wall.is-empty .photo-add-tile {
  min-height: 380px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 620px) {
  .photo-wall.is-empty .photo-add-tile {
    min-height: 300px;
  }
}

/* ==========================================================================
   日记「+ 写一篇」方块（与照片「+」同一套视觉）
   ========================================================================== */

.entry-add-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 2px dashed rgba(28, 107, 118, 0.38);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease),
    color 0.4s var(--ease), transform 0.4s var(--ease);
}

.entry-add-tile:hover {
  border-color: var(--accent);
  background: rgba(48, 136, 152, 0.07);
  color: var(--accent);
  transform: translateY(-2px);
}

.entry-add-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.entry-add-tile .pa-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(48, 136, 152, 0.13);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}

.entry-add-tile:hover .pa-icon {
  background: rgba(48, 136, 152, 0.18);
  transform: scale(1.06);
}

.entry-add-tile .pa-label {
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* 空列表：竖排放大，成为唯一入口 */
.entry-add-tile.is-empty {
  flex-direction: column;
  gap: 16px;
  min-height: 320px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.72);
}

.entry-add-tile.is-empty .pa-icon {
  width: 62px;
  height: 62px;
  font-size: 36px;
}

.entry-add-tile.is-empty .pa-label {
  font-size: 14px;
}

@media (max-width: 620px) {
  .entry-add-tile.is-empty {
    min-height: 260px;
  }
}

/* ==========================================================================
   日记评论
   字体严格沿用设计系统：Fraunces（标题/头像）/ Inter（正文）/ Space Grotesk（标签时间）
   ========================================================================== */

.comments {
  max-width: 68ch;
  margin-top: 76px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.comments-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}

.comments-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  font-variation-settings: "SOFT" 35, "WONK" 1, "opsz" 60;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.comments-head .count {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.comments-sub {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 30px;
}

/* ---------- 列表 ---------- */
.comment-list {
  display: grid;
  gap: 0;
}

.comment-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.comment-item:last-child {
  border-bottom: 0;
}

.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  user-select: none;
}

.comment-item.guest .comment-avatar {
  background: linear-gradient(135deg, #b9b3ac, #9a938c);
}

.comment-main {
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.comment-name {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.comment-badge {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-wash);
  color: var(--accent);
  border: 1px solid rgba(48, 136, 152, 0.2);
}

.comment-time {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.comment-del {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease);
}

.comment-item:hover .comment-del {
  opacity: 1;
}

.comment-del:hover {
  color: #b43c32;
}

.comment-text {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  word-break: break-word;
  white-space: pre-wrap;
}

.comment-empty {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  padding: 24px 0 8px;
}

/* ---------- 表单 ---------- */
.comment-form {
  margin-top: 30px;
  padding: 24px 24px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.comment-form .field {
  margin-bottom: 14px;
}

.comment-form textarea {
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28, 107, 118, 0.12);
}

.cf-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.cf-count {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-left: auto;
}

.cf-actions .btn {
  padding: 11px 24px;
  font-size: 13px;
}

@media (max-width: 620px) {
  .comments {
    margin-top: 54px;
    padding-top: 30px;
  }

  .comment-item {
    grid-template-columns: 34px 1fr;
    gap: 12px;
  }

  .comment-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .comment-form {
    padding: 18px 16px 16px;
  }

  .comment-del {
    opacity: 1;
  }
}

/* ==========================================================================
   个人中心：邮箱内联编辑 / 头像上传 / 改密弹窗
   ========================================================================== */

.email-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
}

.inline-edit {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-label);
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.inline-edit:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.inline-edit[hidden] {
  display: none;
}

.inline-email {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
  margin-top: 4px;
}
.inline-email[hidden] {
  display: none;
}
.inline-email input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
}
.inline-email input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28, 107, 118, 0.12);
}
.inline-save,
.inline-cancel {
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.inline-save {
  border: 0;
  background: var(--ink);
  color: #fbfaf8;
}
.inline-save:hover {
  background: var(--accent);
}
.inline-cancel {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
}
.inline-cancel:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.inline-msg {
  display: none;
  width: 100%;
  text-align: right;
  font-size: 12px;
  margin-top: 2px;
}
.inline-msg.show {
  display: block;
}
.inline-msg.error {
  color: #9c2f26;
}
.inline-msg.ok {
  color: var(--accent);
}

/* 只读字段旁的说明（如用户名不可改） */
.inline-hint {
  margin-left: 8px;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* 头像 */
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.avatar-wrap .avatar-badge {
  margin-bottom: 0;
}
.avatar-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #fff;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 107, 118, 0.22);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.avatar-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(28, 107, 118, 0.3);
}
.avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-badge img[hidden] {
  display: none;
}
.avatar-badge.is-uploading {
  opacity: 0.5;
  pointer-events: none;
}
.avatar-change {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.avatar-change:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
}

/* 改密弹窗 */
.pw-dialog {
  width: min(460px, calc(100vw - 32px));
  max-width: 460px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(18, 18, 26, 0.28);
}
.pw-dialog::backdrop {
  background: rgba(18, 18, 26, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.pw-dialog-inner {
  display: grid;
  gap: 16px;
  padding: 28px 26px 24px;
}
.pw-dialog-inner h2 {
  margin: 0;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pw-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.pw-dialog-actions .auth-submit {
  margin-top: 0;
  flex: 1;
}
.pw-dialog-actions .btn-ghost {
  flex-shrink: 0;
}
.pw-dialog .account-note {
  margin-top: 0;
}

@media (max-width: 760px) {
  .email-cell {
    justify-content: flex-start;
  }
  .inline-email {
    justify-content: flex-start;
  }
  .inline-msg {
    text-align: left;
  }
  .pw-dialog-inner {
    padding: 24px 20px 20px;
  }
  .pw-dialog-actions {
    flex-direction: column-reverse;
  }
  .pw-dialog-actions .btn-ghost {
    width: 100%;
  }
}

/* ==========================================================================
   搜索栏（日记 / 照片）
   ========================================================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 0 0 18px;
  padding: 0 14px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-strong);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}
.search-bar:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}
.search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
}
.search-bar input::placeholder {
  color: var(--muted);
}
.search-bar input::-webkit-search-cancel-button {
  display: none;
}
.search-clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(18, 18, 26, 0.06);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.search-clear[hidden] {
  display: none;
}
.search-clear:hover {
  background: rgba(18, 18, 26, 0.12);
  color: var(--ink);
}
body.bg-photo .search-bar {
  background: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   骨架屏
   ========================================================================== */
.skeleton-entry {
  height: 92px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    rgba(18, 18, 26, 0.05) 30%,
    rgba(18, 18, 26, 0.09) 50%,
    rgba(18, 18, 26, 0.05) 70%
  );
  background-size: 220% 100%;
  animation: skeletonShimmer 1.3s ease-in-out infinite;
}
.skeleton-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    rgba(18, 18, 26, 0.05) 30%,
    rgba(18, 18, 26, 0.09) 50%,
    rgba(18, 18, 26, 0.05) 70%
  );
  background-size: 220% 100%;
  animation: skeletonShimmer 1.3s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -20% 0;
  }
}

/* ==========================================================================
   主题切换按钮
   ========================================================================== */
.theme-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease);
}
.theme-toggle:hover {
  background: rgba(18, 18, 26, 0.06);
  color: var(--ink);
  transform: translateY(-1px);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   暗色主题
   ========================================================================== */
html[data-theme="dark"] {
  --bg: #14141a;
  --bg-deep: #0e0e13;
  --surface: #1b1b22;
  --surface-warm: #202028;
  --ink: #ecebe6;
  --ink-2: #b7b6c0;
  --muted: #8a8994;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #5fb6c4;
  --accent-mid: #7fc9d4;
  --accent-soft: #4a8b96;
  --accent-wash: rgba(95, 182, 196, 0.14);
  --warm: #d98b63;
  --warm-wash: rgba(217, 139, 99, 0.14);
  --glass-bg: rgba(20, 20, 26, 0.66);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

html[data-theme="dark"] body.bg-photo {
  background-color: var(--bg);
}

/* 壁纸压暗，只留一点纹理 */
html[data-theme="dark"] body.bg-photo .bg-fixed {
  opacity: 0.18;
}
html[data-theme="dark"] body.bg-photo .bg-veil {
  background: linear-gradient(
    180deg,
    rgba(12, 12, 16, 0.72) 0%,
    rgba(12, 12, 16, 0.82) 50%,
    rgba(12, 12, 16, 0.9) 100%
  );
}
html[data-theme="dark"] body.bg-photo .hero::before {
  background: radial-gradient(
    ellipse 68% 76% at 24% 46%,
    rgba(20, 20, 26, 0.6) 0%,
    rgba(20, 20, 26, 0.45) 42%,
    rgba(20, 20, 26, 0.15) 72%,
    rgba(20, 20, 26, 0) 100%
  );
}
html[data-theme="dark"] body.bg-photo .ambient {
  opacity: 0.3;
}

/* 导航 */
html[data-theme="dark"] .nav-inner,
html[data-theme="dark"] body.bg-photo .nav-inner {
  background: rgba(22, 22, 28, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .nav.scrolled .nav-inner,
html[data-theme="dark"] body.bg-photo .nav.scrolled .nav-inner {
  background: rgba(18, 18, 24, 0.92);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.42);
}
html[data-theme="dark"] .nav-links a:hover {
  background: rgba(255, 255, 255, 0.07);
}
html[data-theme="dark"] .nav-menu {
  background: #202028;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .nav-menu a:hover,
html[data-theme="dark"] .nav-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}
html[data-theme="dark"] .nav.open .nav-links {
  background: #1b1b22;
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* 深底浅字按钮：暗色下换成强调色 + 深字 */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .nav-cta,
html[data-theme="dark"] .auth-submit,
html[data-theme="dark"] .inline-save,
html[data-theme="dark"] .filter-btn.active,
html[data-theme="dark"] body.bg-photo .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0e13;
}
html[data-theme="dark"] .nav-cta:hover,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .auth-submit:hover,
html[data-theme="dark"] .inline-save:hover {
  background: var(--accent-mid);
}

/* 卡片 / 面板 / 表单 */
html[data-theme="dark"] .panel,
html[data-theme="dark"] body.bg-photo .panel,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] body.bg-photo .auth-card,
html[data-theme="dark"] .editor-card,
html[data-theme="dark"] .comment-form,
html[data-theme="dark"] .pw-dialog,
html[data-theme="dark"] .entry-nav a,
html[data-theme="dark"] .uq-item {
  background: #1b1b22;
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .panel-muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .empty-state {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .dropzone {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .photo-add-tile,
html[data-theme="dark"] .entry-add-tile {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .photo-add-tile.is-empty,
html[data-theme="dark"] .entry-add-tile.is-empty {
  background: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .hero-eyebrow {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .work-badge,
html[data-theme="dark"] .portrait-note {
  background: rgba(20, 20, 26, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] body.bg-photo .sec-kicker .num {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(95, 182, 196, 0.3);
}
html[data-theme="dark"] body.bg-photo .filter-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] body.bg-photo .tag,
html[data-theme="dark"] body.bg-photo .skill-pill {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] body.bg-photo .footer {
  background: rgba(16, 16, 22, 0.55);
}
html[data-theme="dark"] .search-bar,
html[data-theme="dark"] body.bg-photo .search-bar {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .search-bar:focus-within {
  background: #202028;
  border-color: var(--accent);
}
html[data-theme="dark"] .search-clear {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-2);
}
html[data-theme="dark"] .search-clear:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}
html[data-theme="dark"] .skeleton-entry,
html[data-theme="dark"] .skeleton-photo {
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 70%
  );
  background-size: 220% 100%;
}

/* 输入框 focus 时的纯白底，暗色下改深 */
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .editor-card textarea:focus,
html[data-theme="dark"] .comment-form textarea:focus,
html[data-theme="dark"] .inline-email input:focus {
  background: var(--bg-deep);
  box-shadow: 0 0 0 3px rgba(95, 182, 196, 0.16);
}
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .editor-card textarea::placeholder,
html[data-theme="dark"] .comment-form textarea::placeholder {
  color: #6f6e7a;
}

/* 壁纸背景下的小字与正文颜色 */
html[data-theme="dark"] body.bg-photo .label,
html[data-theme="dark"] body.bg-photo .footer-note,
html[data-theme="dark"] body.bg-photo .footer-links a,
html[data-theme="dark"] body.bg-photo .work-year,
html[data-theme="dark"] body.bg-photo .stat-label,
html[data-theme="dark"] body.bg-photo .field .hint,
html[data-theme="dark"] body.bg-photo .auth-foot,
html[data-theme="dark"] body.bg-photo .tl-time {
  color: #9a99a4;
}
html[data-theme="dark"] body.bg-photo .about-text p,
html[data-theme="dark"] body.bg-photo .tl-body p,
html[data-theme="dark"] body.bg-photo .work-desc,
html[data-theme="dark"] body.bg-photo .lede,
html[data-theme="dark"] body.bg-photo .page-head .lede {
  color: #c9c8d2;
  text-shadow: none;
}
html[data-theme="dark"] body.bg-photo .tl-body .tl-role,
html[data-theme="dark"] body.bg-photo .label-accent {
  color: var(--accent);
}
html[data-theme="dark"] body.bg-photo .auth-foot a {
  color: var(--accent);
}

/* ==========================================================================
   移动端触控与可读性
   ========================================================================== */
@media (max-width: 760px) {
  .filter-btn {
    min-height: 44px;
  }
  .theme-toggle,
  .nav-avatar {
    width: 40px;
    height: 40px;
  }
  .search-bar {
    max-width: none;
    height: 46px;
  }
  /* iOS 聚焦输入框时字号 <16px 会自动放大页面，这里统一提到 16px */
  .search-bar input,
  .comment-form textarea {
    font-size: 16px;
  }
  .nav.open .nav-links a {
    min-height: 46px;
  }
}

/* ==========================================================================
   尊重「减少动效」偏好
   ========================================================================== */
@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;
  }
  .skeleton-entry,
  .skeleton-photo {
    animation: none;
  }
}

/* ==========================================================================
   个人主页（登录后）：资料标签 / 数据概览 / 快捷操作
   ========================================================================== */
.account-profile-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.account-role {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  border: 1px solid rgba(48, 136, 152, 0.2);
}
.account-email {
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--ink-2);
  word-break: break-all;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(18, 18, 26, 0.04);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
a.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(18, 18, 26, 0.08);
}
.stat-card .n {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-card .l {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.quick-panel {
  margin-bottom: 26px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}
.quick-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease),
    background 0.3s var(--ease), transform 0.3s var(--ease);
}
.quick-tile:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
  transform: translateY(-1px);
}
.quick-tile .qt-arrow {
  color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.quick-tile:hover .qt-arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.quick-tile.is-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbfaf8;
}
.quick-tile.is-primary .qt-arrow {
  color: rgba(255, 255, 255, 0.7);
}
.quick-tile.is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0e13;
}
.quick-tile.is-primary:hover .qt-arrow {
  color: #0e0e13;
}
html[data-theme="dark"] .quick-tile.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0e13;
}
html[data-theme="dark"] .quick-tile.is-primary .qt-arrow {
  color: #0e0e13;
}

/* ==========================================================================
   关于页：订阅表单
   ========================================================================== */
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 8px auto 0;
}
.subscribe-label {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.subscribe-row {
  display: flex;
  gap: 10px;
}
.subscribe-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-warm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}
.subscribe-row input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.subscribe-row .btn {
  flex-shrink: 0;
  padding: 13px 24px;
}
.subscribe-msg {
  min-height: 18px;
  margin: 0;
  font-family: var(--font-label);
  font-size: 12.5px;
  text-align: left;
}
.subscribe-msg.ok {
  color: var(--accent);
}
.subscribe-msg.err {
  color: #b43c32;
}
.contact-note {
  margin-top: 18px;
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--muted);
}

/* ==========================================================================
   个人主页：站点数据（管理员）
   ========================================================================== */
.data-panel {
  margin-top: 26px;
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.data-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px solid var(--line);
}
.data-grid .dn {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.data-grid .dl {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.data-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.data-lists h3 {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.data-lists ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.data-lists li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.data-lists li span:last-child {
  color: var(--muted);
}
.data-empty {
  font-family: var(--font-label);
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .data-lists {
    grid-template-columns: 1fr;
  }
  .subscribe-row {
    flex-direction: column;
  }
  .subscribe-row .btn {
    width: 100%;
  }
}
.action-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

html[data-theme="dark"] .stat-card {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] a.stat-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

@media (max-width: 760px) {
  .account-stats {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 16px 14px;
    gap: 6px;
  }
  .stat-card .n {
    font-size: 24px;
  }
  .account-side {
    gap: 20px;
  }
}

/* ==========================================================================
   移动端细节优化（最后加载，覆盖前面的通用规则）
   ========================================================================== */
@media (max-width: 760px) {
  /* 固定导航：手机上提高底色不透明度，滚动时文字不透出 */
  body .nav-inner,
  body.bg-photo .nav-inner,
  .nav.scrolled .nav-inner,
  body.bg-photo .nav.scrolled .nav-inner {
    background: rgba(253, 252, 250, 0.94);
  }
  html[data-theme="dark"] body .nav-inner,
  html[data-theme="dark"] body.bg-photo .nav-inner,
  html[data-theme="dark"] .nav.scrolled .nav-inner,
  html[data-theme="dark"] body.bg-photo .nav.scrolled .nav-inner {
    background: rgba(24, 24, 30, 0.94);
  }

  /* 关于页 4:5 竖版头像在手机上不必占满整屏 */
  .portrait {
    max-width: 280px;
  }

  /* 灯箱按钮加大，便于触控 */
  .lb-btn {
    width: 52px;
    height: 52px;
  }
  .lb-close {
    top: 14px;
    right: 14px;
  }
  .lb-prev {
    left: 8px;
    margin-top: -26px;
  }
  .lb-next {
    right: 8px;
    margin-top: -26px;
  }

  /* 底部工具条避开 iPhone 底部安全区 */
  .select-bar {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  body.is-selecting .photo-toast {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* 搜索与筛选之间的留白收紧一点，首屏能多看到内容 */
  .search-bar {
    margin-bottom: 20px;
  }
  .filter-bar {
    margin-bottom: 32px;
  }

  /* 页脚避开安全区 */
  .footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* 超窄屏：按钮铺满，筛选按钮缩小 */
@media (max-width: 380px) {
  .hero-actions {
    gap: 10px;
  }
  .hero-actions .btn,
  .hero-actions .btn-ghost {
    width: 100%;
    justify-content: center;
  }
  .filter-btn {
    font-size: 12px;
    padding: 7px 12px;
  }
  .search-bar input {
    font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
  }
}
