/* ==========================================================================
   MakerMake · Design Token System
   Theme: 暗色摄影画廊 —— 中性炭黑底 + 暖铜强调，衬托暖调作品
   所有颜色、字号、间距、动效统一由 token 驱动
   ========================================================================== */

:root {
  /* ---- 色板：中性暗底 ---- */
  --bg:            #0f0f11;
  --bg-deep:       #0a0a0c;
  --surface:       #17171a;
  --surface-2:     #1f1f24;
  --surface-3:     #26262c;
  --border:        #2a2a31;
  --border-strong: #3a3a44;

  /* ---- 色板：文字（暖白，与暖调作品同一色温） ---- */
  --text:    #f0ebe2;
  --text-2:  #c4beb4;
  --muted:   #8b857c;
  --muted-2: #6a655e;

  /* ---- 色板：强调色 ---- */
  --accent:      #e0a468;
  --accent-hi:   #f0bd85;
  --accent-dim:  #b8824b;
  --accent-2:    #6f88d8;
  --accent-soft: rgba(224, 164, 104, 0.12);
  --accent-line: rgba(224, 164, 104, 0.32);
  --accent-glow: rgba(224, 164, 104, 0.28);

  /* ---- 语义色 ---- */
  --video:      #e79a5c;
  --video-soft: rgba(231, 154, 92, 0.14);

  /* ---- 间距：8 点网格 ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* ---- 字号 ---- */
  --fs-xs:  12px;
  --fs-sm:  13.5px;
  --fs-base: 16px;
  --fs-md:  17px;
  --fs-lg:  19px;
  --fs-xl:  22px;
  --fs-2xl: 27px;
  --fs-3xl: 34px;
  --fs-4xl: 46px;

  /* ---- 字体族 ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    'Liberation Mono', monospace;

  /* ---- 圆角 ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* ---- 阴影 / 层次 ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 44px -12px rgba(0, 0, 0, 0.62);
  --shadow-xl: 0 40px 88px -20px rgba(0, 0, 0, 0.75);

  /* ---- 动效 ---- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms var(--ease);
  --t-base: 220ms var(--ease);
  --t-slow: 420ms var(--ease);

  /* ---- 布局 ---- */
  --max: 1200px;
  --max-readable: 720px;
  --nav-h: 66px;

  /* ---- 层级 ---- */
  --z-nav: 50;
  --z-progress: 60;
  --z-fab: 70;
  --z-modal: 100;
  --z-drawer: 120;
}

/* ==========================================================================
   基础重置
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--sp-6));
  -webkit-text-size-adjust: 100%;
}

::selection { background: rgba(224, 164, 104, 0.28); color: #fff; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.72;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* 统一可见焦点环，键盘可达性 */
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -160%);
  z-index: 200;
  background: var(--accent);
  color: #1a1208;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: transform var(--t-base);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ==========================================================================
   顶部导航
   ========================================================================== */

header.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(15, 15, 17, 0.78);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: var(--sp-4);
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.brand-mark {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent-hi), var(--accent-dim));
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
/* 胶片孔隐喻：中央一道竖向暗槽 */
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px 11px;
  border-radius: 2px;
  background: rgba(20, 12, 4, 0.55);
}
.brand-sub {
  font-size: var(--fs-xs);
  color: var(--muted-2);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 15px;
  color: var(--muted);
}
.nav-links a {
  position: relative;
  padding: 8px 15px;
  border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent-hi); background: var(--accent-soft); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 3px;
  transform: translateX(-50%);
  width: 14px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* 汉堡按钮：仅移动端显示 */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.nav-toggle:hover { border-color: var(--border-strong); background: var(--surface-2); }
.nav-toggle span {
  display: block;
  width: 17px; height: 1.5px;
  border-radius: 2px;
  background: var(--text-2);
  transition: transform var(--t-base), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 26px;
  min-height: 46px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-base),
              background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(140deg, var(--accent-hi), var(--accent));
  color: #1c1206;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 18px -4px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px -6px var(--accent-glow);
  background: linear-gradient(140deg, #f7c894, var(--accent-hi));
}

.btn-ghost { border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent-line);
  color: var(--text);
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 92px 0 84px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
/* 暖色光晕 + 极细网格，营造暗房工作台质感 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 82% -12%, rgba(224, 164, 104, 0.16), transparent 62%),
    radial-gradient(620px 380px at 4% 108%, rgba(111, 136, 216, 0.11), transparent 62%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(680px 420px at 60% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(680px 420px at 60% 40%, #000 20%, transparent 78%);
}
.hero > .wrap { position: relative; z-index: 1; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: var(--sp-16);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 5px 14px;
  border-radius: var(--r-full);
  margin-bottom: var(--sp-6);
}
.hero-eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-4xl);
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.grad {
  background: linear-gradient(96deg, var(--accent-hi) 8%, var(--accent) 48%, #c98f56 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  margin: 0 0 var(--sp-8);
  max-width: 34em;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.78;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-10);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}
.hero-stats > div { min-width: 78px; }
.stat-num {
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: var(--sp-1);
  letter-spacing: 0.03em;
}

/* Hero 图像：厚边框模拟相纸冲印
   用 Wrapper 承载比例，img 自己撑满 —— 避免 aspect-ratio 与 height 冲突导致拉伸 */
.hero-art { position: relative; padding-bottom: 12%; }
.hero-art .art-main,
.hero-art .art-float {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xl);
}
.hero-art .art-main {
  aspect-ratio: 1 / 1;
  animation: fadeUp 700ms var(--ease) both;
}
.hero-art .art-main img,
.hero-art .art-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-art .art-float {
  position: absolute;
  width: 43%;
  aspect-ratio: 1 / 1;
  left: -6%;
  bottom: 0;
  border-radius: var(--r-lg);
  border: 6px solid var(--bg);
  box-shadow: var(--shadow-lg);
  transform: rotate(-3.5deg);
  animation: fadeUp 700ms 140ms var(--ease) both;
  transition: transform var(--t-slow);
}
.hero-art:hover .art-float { transform: rotate(-1.5deg) translateY(-6px); }

/* ==========================================================================
   区块与标题
   ========================================================================== */

section.block { padding: var(--sp-20) 0; }
section.block.tight { padding-top: 0; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.block-head h2 {
  position: relative;
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.018em;
  padding-left: var(--sp-4);
}
.block-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.block-head .more {
  font-size: var(--fs-sm);
  color: var(--muted);
  transition: color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.block-head .more:hover { color: var(--accent-hi); transform: translateX(2px); }

/* ==========================================================================
   作品画廊 —— 自适应比例，零裁切
   ========================================================================== */

/* 采用 masonry 式列布局：卡片按内容自然高度排列，
   1:1 图像与 16:9 视频混排时不会互相撑出空白 */
.grid {
  columns: 3;
  column-gap: var(--sp-6);
}
.grid .card { break-inside: avoid; margin-bottom: var(--sp-6); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
  animation: fadeUp 500ms var(--ease) both;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}

/* 关键修复：按真实比例呈现，不再强制 4:3 裁切 */
.card-thumb {
  position: relative;
  aspect-ratio: var(--thumb-ratio, 1 / 1);
  background: var(--bg-deep);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.card:hover .card-thumb img { transform: scale(1.04); }
/* 底部渐隐，让徽标与元信息始终可读 */
.card-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.72), transparent);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}
.card:hover .card-thumb::after { opacity: 1; }

.badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.badge.video {
  color: var(--video);
  border-color: rgba(231, 154, 92, 0.42);
  background: rgba(30, 18, 8, 0.72);
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge.video::before { animation: pulse 2.2s ease-in-out infinite; }

.card-body {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}
.card-body h3 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.008em;
  transition: color var(--t-fast);
}
.card:hover .card-body h3 { color: var(--accent-hi); }
.card-meta {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-3);
}
.card-more {
  font-size: var(--fs-xs);
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t-base), transform var(--t-base);
}
.card:hover .card-more { opacity: 1; transform: translateX(0); }

.grid .card:nth-child(2) { animation-delay: 60ms; }
.grid .card:nth-child(3) { animation-delay: 120ms; }
.grid .card:nth-child(4) { animation-delay: 180ms; }
.grid .card:nth-child(5) { animation-delay: 240ms; }
.grid .card:nth-child(6) { animation-delay: 300ms; }

/* ==========================================================================
   笔记列表
   ========================================================================== */

.post-list { display: flex; flex-direction: column; gap: var(--sp-1); }

.post-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.post-item:hover { background: var(--surface); border-color: var(--border); }

.post-date {
  font-size: var(--fs-xs);
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  padding-top: 5px;
  letter-spacing: 0.02em;
}
.post-main { min-width: 0; }
.post-title {
  display: inline;
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.008em;
  transition: color var(--t-fast);
}
.post-item:hover .post-title { color: var(--accent-hi); }
.post-excerpt {
  margin-top: var(--sp-2);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.68;
  max-width: 62ch;
}
.tag {
  display: inline-block;
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 1px 9px;
  border-radius: var(--r-full);
  margin-left: var(--sp-3);
  vertical-align: 2px;
  white-space: nowrap;
}
.post-item::after {
  content: "→";
  position: absolute;
  right: var(--sp-5);
  top: 50%;
  transform: translate(10px, -50%);
  opacity: 0;
  color: var(--accent);
  transition: opacity var(--t-base), transform var(--t-base);
}
.post-item:hover::after { opacity: 1; transform: translate(0, -50%); }

/* ==========================================================================
   筛选 chips
   ========================================================================== */

.filters {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.chip {
  padding: 8px 17px;
  min-height: 38px;
  border-radius: var(--r-full);
  font-size: 14px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.chip.active {
  background: var(--accent-soft);
  color: var(--accent-hi);
  border-color: var(--accent-line);
  font-weight: 500;
}

/* ==========================================================================
   文章正文
   ========================================================================== */

.prose {
  max-width: var(--max-readable);
  font-size: var(--fs-md);
  line-height: 1.82;
  color: var(--text-2);
}
.prose h1 {
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.3;
  margin: var(--sp-3) 0 var(--sp-4);
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--text);
}
.prose h2 {
  position: relative;
  font-size: var(--fs-xl);
  margin: var(--sp-12) 0 var(--sp-4);
  font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.42;
  color: var(--text);
  padding-left: var(--sp-4);
  border-left: 2px solid var(--accent);
  scroll-margin-top: calc(var(--nav-h) + var(--sp-6));
}
.prose h2:hover::after {
  content: "#";
  position: absolute;
  left: -2px; top: 50%;
  transform: translate(-100%, -50%);
  padding-right: 10px;
  color: var(--accent-dim);
  opacity: 0.55;
  font-size: 0.85em;
}
.prose h3 {
  font-size: var(--fs-lg);
  margin: var(--sp-8) 0 var(--sp-3);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.008em;
}
.prose p { margin: 0 0 var(--sp-5); }
.prose strong { color: var(--text); font-weight: 600; }
.prose p > code,
.prose li > code {
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-hi);
}

/* ---------- 数据表格 ---------- */
.table-scroll {
  margin: 0 0 var(--sp-6);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 520px;
}
.table-scroll th {
  padding: 11px 14px;
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-scroll td {
  padding: 10px 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.table-scroll tbody tr:last-child td { border-bottom: none; }
.table-scroll tbody tr { transition: background var(--t-fast); }
.table-scroll tbody tr:hover { background: var(--surface-2); }

/* 涨跌着色：涨红跌绿。用法：正文里写 <span class="num-up">+37%</span>
   —— 不做全局正则自动着色，避免把「内存 -17%」这类普通描述误判 */
.num-up { color: #e5484d; font-weight: 600; }
.num-down { color: #2fbf71; font-weight: 600; }
.prose a:not(.btn) {
  color: var(--accent-hi);
  border-bottom: 1px solid var(--accent-line);
  transition: border-color var(--t-fast);
}
.prose a:not(.btn):hover { border-bottom-color: var(--accent-hi); }

.prose pre {
  position: relative;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-5);
  padding-right: var(--sp-12);
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.78;
  margin: 0 0 var(--sp-6);
  tab-size: 2;
}
.prose pre::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent 85%);
}
.prose code { font-family: var(--font-mono); }
.prose pre code { color: #cfc7ba; }

.copy-code {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.prose pre:hover .copy-code { opacity: 1; }
.copy-code:hover { color: var(--accent-hi); border-color: var(--accent-line); }
.copy-code.done { color: #74c69d; border-color: rgba(116, 198, 157, 0.4); opacity: 1; }

.prose ul, .prose ol { margin: 0 0 var(--sp-6); padding-left: var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); padding-left: var(--sp-1); }
.prose li::marker { color: var(--accent-dim); }

.prose blockquote {
  margin: 0 0 var(--sp-6);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-5);
  border-left: 2px solid var(--accent-line);
  color: var(--muted);
  font-style: normal;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-12) 0;
}

.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--muted);
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

/* 上下篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-16); }
.post-nav a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-5);
  font-size: 14.5px;
  line-height: 1.55;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.post-nav a:hover {
  border-color: var(--accent-line);
  background: var(--surface);
  transform: translateY(-2px);
}
.post-nav a.r { text-align: right; }
.post-nav span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted-2);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   文章页：进度条 / 目录 / 回到顶部
   ========================================================================== */

.progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-hi));
  box-shadow: 0 0 12px var(--accent-glow);
  z-index: var(--z-progress);
  transition: width 90ms linear;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: var(--sp-16);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-8));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  font-size: var(--fs-sm);
  line-height: 1.6;
  max-height: calc(100vh - var(--nav-h) - var(--sp-16));
  overflow-y: auto;
}
.toc-title {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.toc a {
  display: block;
  position: relative;
  color: var(--muted);
  padding: 6px 0 6px 13px;
  line-height: 1.5;
  transition: color var(--t-fast);
}
.toc a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: height var(--t-base);
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-hi); }
.toc a.active::before { height: 60%; }

.totop {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--t-base), transform var(--t-base),
              color var(--t-fast), border-color var(--t-fast);
  z-index: var(--z-fab);
  backdrop-filter: blur(8px);
}
.totop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.totop:hover { color: var(--accent-hi); border-color: var(--accent-line); }

/* ==========================================================================
   作品详情弹层
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(6, 6, 8, 0.86);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}
.modal.open { display: flex; animation: fadeIn 200ms var(--ease) both; }

.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  box-shadow: var(--shadow-xl);
  animation: fadeUp 260ms var(--ease) both;
}

.modal-media {
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}
.modal-media img {
  width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
}

.modal-info {
  padding: var(--sp-8) var(--sp-8) var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.modal-info h3 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.018em;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) 0 0; }
.modal-tags .tag { margin: 0; }

.modal-section-label {
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  margin: var(--sp-6) 0 var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 3;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(23, 23, 26, 0.9);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.modal-close:hover { color: var(--accent-hi); border-color: var(--accent-line); transform: rotate(90deg); }

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-5);
  font-size: 14px;
  margin: 0;
}
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; color: var(--text-2); font-variant-numeric: tabular-nums; }

.prompt-box {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-size: var(--fs-sm);
  line-height: 1.68;
  color: #cfc7ba;
  font-family: var(--font-mono);
  max-height: 170px;
  overflow-y: auto;
  word-break: break-word;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-copy:hover { background: rgba(224, 164, 104, 0.2); color: var(--accent-hi); }
.btn-copy.done { color: #74c69d; border-color: rgba(116, 198, 157, 0.4); background: rgba(116, 198, 157, 0.12); }

.modal-note {
  font-size: 14px;
  line-height: 1.72;
  color: var(--text-2);
  margin: 0;
}

.modal-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.modal-navbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.modal-navbtn:hover { color: var(--accent-hi); border-color: var(--accent-line); }
.modal-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  line-height: 1.6;
}

/* ==========================================================================
   关于页
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-16);
  align-items: start;
}
.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}
.spec-card + .spec-card { margin-top: var(--sp-6); }
.spec-card-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
.spec-card-label::before {
  content: "";
  width: 3px; height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.spec-table tr:last-child td { border-bottom: none; padding-bottom: 0; }
.spec-table td:first-child {
  color: var(--muted);
  width: 92px;
  white-space: nowrap;
  padding-right: var(--sp-4);
}

.link-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.link-pill:hover {
  color: var(--accent-hi);
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

/* ==========================================================================
   页脚
   ========================================================================== */

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--sp-10) 0;
  color: var(--muted);
  font-size: 14px;
  margin-top: var(--sp-16);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}
.footer-inner .fn-brand { color: var(--text-2); font-weight: 500; }
.footer-meta { font-size: var(--fs-xs); color: var(--muted-2); }

.empty {
  color: var(--muted);
  padding: var(--sp-16) 0;
  text-align: center;
  font-size: 15px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}

/* ==========================================================================
   动效
   ========================================================================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1); }
}

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

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1080px) {
  .hero-inner { gap: var(--sp-12); }
  .post-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: var(--sp-12); }
  .grid { columns: 2; }
}

@media (max-width: 920px) {
  .hero { padding: 68px 0 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: var(--sp-10); }
  .hero-art { max-width: 540px; }
  .about-grid { grid-template-columns: 1fr; gap: var(--sp-10); }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .toc {
    position: static;
    order: -1;
    max-height: none;
    margin-bottom: var(--sp-8);
  }
  .progress { top: var(--nav-h); }
}

@media (max-width: 760px) {
  :root { --sp-20: 56px; --sp-16: 44px; }
  .wrap { padding: 0 var(--sp-5); }

  /* 移动端抽屉导航 */
  .nav-toggle { display: flex; flex-shrink: 0; }
  .brand { margin-right: auto; }
  .brand-sub { display: none; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--sp-5));
    right: calc(-1 * var(--sp-5));
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-5) var(--sp-6);
    background: rgba(15, 15, 17, 0.98);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base), transform var(--t-base);
    z-index: var(--z-drawer);
  }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { padding: 13px var(--sp-4); border-radius: var(--r-md); }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--accent-soft); }

  .hero { padding: 52px 0 44px; }
  .hero h1 { font-size: clamp(27px, 8.4vw, 34px); }
  .hero p.lead { font-size: var(--fs-base); }
  .hero-stats { gap: var(--sp-8); margin-top: var(--sp-8); padding-top: var(--sp-6); }
  .stat-num { font-size: var(--fs-xl); }
  .hero-art { padding-bottom: 16%; }
  .hero-art .float { width: 40%; left: -3%; border-width: 4px; }

  .grid { columns: 1; }

  .post-item { grid-template-columns: 1fr; gap: var(--sp-2); padding: var(--sp-5) var(--sp-4); }
  .post-date { padding-top: 0; }
  .post-item::after { display: none; }
  .post-excerpt { font-size: var(--fs-sm); }
  .post-nav { grid-template-columns: 1fr; margin-top: var(--sp-10); }

  .modal { padding: 0; }
  .modal-box {
    grid-template-columns: 1fr;
    border-radius: 0;
    max-height: 100dvh;
    height: 100dvh;
    border: none;
  }
  .modal-media img { max-height: 46dvh; }
  .modal-info { padding: var(--sp-6) var(--sp-5) var(--sp-10); }
  .modal-close { position: fixed; top: var(--sp-3); right: var(--sp-3); }
  .modal-hint { display: none; }
  .modal-navbar .modal-navbtn { flex: 1; justify-content: center; }

  .totop { bottom: var(--sp-5); right: var(--sp-5); width: 42px; height: 42px; }

  .block-head h2 { font-size: var(--fs-xl); }
  .filters { gap: var(--sp-2); }
  .chip { padding: 7px 14px; font-size: var(--fs-sm); min-height: 36px; }

  .prose { font-size: var(--fs-base); }
  .prose h2 { margin-top: var(--sp-10); }
  .copy-code { opacity: 1; }
}

@media (max-width: 400px) {
  .btn { padding: 11px 18px; font-size: 14px; }
  .brand { font-size: var(--fs-base); }
  .hero-stats { gap: var(--sp-6); }
}

/* 打印 */
@media print {
  header.nav, .totop, .progress, .toc, footer, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
}
