/* ============================================================
   初的小站 — 精细版
   视觉语言：墨色 ink + 纸色 paper + 酸性青柠 lime（编辑极简）
   主题：亮色 / 深色 双态，CSS 变量驱动
   ============================================================ */

:root {
  --bg: #f4f5ef;
  --ink: #18231f;
  --text-2: #4f5853;
  --muted: #6c746f;
  --muted-2: #8a938b;
  --line: #d8ddd5;
  --line-soft: #e5e9e0;
  --lime: #c8e86b;
  --lime-dark: #9ab83f;
  --lime-ink: #26331a;
  --serif-accent: #56715f;
  --paper-deep: #e9ece4;
  --shadow: 0 20px 50px -22px rgba(24, 35, 31, .28);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'DM Mono', Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1210;
  --ink: #e8ece6;
  --text-2: #aebbb0;
  --muted: #87948a;
  --muted-2: #5f6b62;
  --line: #26312b;
  --line-soft: #1b241f;
  --lime: #c8e86b;
  --lime-dark: #b9d85f;
  --lime-ink: #0d1210;
  --serif-accent: #9db8a6;
  --paper-deep: #141b17;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; }

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

/* 细颗粒噪点层（轻柔的电影颗粒质感） */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

:focus-visible { outline: 2px solid var(--lime-dark); outline-offset: 3px; border-radius: 2px; }

.page-shell { overflow: hidden; }
.section-wrap { width: min(1160px, calc(100% - 80px)); margin: 0 auto; }

/* ===== 顶部阅读进度条 ===== */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--lime-dark), var(--lime));
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}

/* ===== 站点头部 ===== */
.site-header {
  width: min(1160px, calc(100% - 80px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: border-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--lime);
  font: 500 12px var(--mono); letter-spacing: .02em;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); box-shadow: var(--shadow); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy span { color: var(--muted); font: 11px var(--mono); }

.main-nav { display: flex; gap: 34px; margin-left: 60px; font-size: 12px; color: var(--text-2); }
.main-nav a { position: relative; padding: 6px 0; }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: var(--lime-dark);
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: transparent; cursor: pointer;
  color: var(--text-2);
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--lime); }
.icon-btn:active { transform: scale(.94); }
.menu-toggle { display: none; }

.header-contact {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  color: var(--ink);
}
.header-contact svg { width: 15px; height: 15px; }

/* 通用文字链接 hover 过渡 */
.main-nav a, .header-contact, .text-link, .read-link, .contact-links a, .copy-email, .site-footer a {
  transition: color .2s ease;
}
.main-nav a:hover, .header-contact:hover, .text-link:hover, .read-link:hover,
.contact-links a:hover, .copy-email:hover, .site-footer a:hover {
  color: var(--lime-dark);
}

/* ===== 移动端菜单 ===== */
.mobile-nav {
  position: fixed;
  top: 88px; left: 0; right: 0; z-index: 55;
  display: grid;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 20px;
  gap: 2px;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.mobile-nav.open { opacity: 1; transform: none; visibility: visible; }
.mobile-nav a {
  padding: 14px 6px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { color: var(--lime-dark); }

/* ===== Hero ===== */
.hero {
  min-height: 615px;
  padding: 87px 0 102px;
  display: grid;
  grid-template-columns: 1.03fr .97fr;
  align-items: center;
  gap: 72px;
}
.eyebrow {
  margin: 0 0 24px;
  color: var(--muted);
  font: 500 11px var(--mono);
  letter-spacing: .11em;
}
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  margin: 0 9px 1px 0;
  background: var(--lime-dark);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(154, 184, 63, .14);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(154, 184, 63, .14); } 50% { box-shadow: 0 0 0 8px rgba(154, 184, 63, .06); } }

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 590px;
  margin-bottom: 25px;
  font-size: 78px; line-height: 1.03;
  letter-spacing: -.06em; font-weight: 700;
}
h1 em { color: var(--serif-accent); font-family: var(--serif); font-weight: 400; letter-spacing: -.06em; }
.hero-intro {
  max-width: 500px; margin-bottom: 31px;
  color: var(--muted); font-size: 14px; line-height: 1.9;
}
.hero-actions { display: flex; align-items: center; gap: 26px; margin-bottom: 54px; }

.button {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 47px; padding: 0 19px;
  font-size: 12px; font-weight: 700;
  position: relative; overflow: hidden;
}
.button svg { width: 16px; height: 16px; transition: transform .25s ease; }
.button-primary { background: var(--ink); color: var(--lime); }
.button-primary:hover { background: #33423a; }
.button-primary:hover svg, .button-primary:hover [data-lucide] { transform: translate(2px, -2px); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: #48564d; font-size: 12px; font-weight: 700;
}
:root[data-theme="dark"] .text-link { color: #aebbb0; }
.text-link svg { width: 14px; height: 14px; transition: transform .25s ease; }
.text-link:hover svg { transform: translate(2px, 2px); }

.hero-meta { display: flex; gap: 24px; color: var(--muted); font: 11px var(--mono); }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; }

.hero-visual { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-top: 16px; }
.visual-topline {
  display: flex; justify-content: space-between; margin-bottom: 11px;
  color: var(--muted-2); font: 10px var(--mono); letter-spacing: .08em;
}
.visual-signal { display: inline-flex; align-items: center; gap: 5px; color: var(--lime-dark); }
.visual-signal svg { width: 12px; height: 12px; }
.visual-frame {
  position: relative; height: 385px; overflow: hidden;
  background: var(--ink);
  transform: translateZ(0);
}
.visual-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.68) contrast(1.06);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1), filter .6s ease;
}
.hero-visual:hover .visual-frame img { transform: scale(1.035); filter: saturate(.8) contrast(1.05); }
.visual-frame:after {
  content: ''; position: absolute; inset: 0;
  background: rgba(17, 28, 23, .08);
  pointer-events: none;
}
.visual-caption {
  position: absolute; z-index: 1; left: 28px; bottom: 25px;
  display: flex; align-items: flex-start; gap: 17px; color: #fff;
}
.visual-caption span { color: var(--lime); font: 11px var(--mono); }
.visual-caption strong { font: 25px/1.12 var(--serif); letter-spacing: -.02em; }
.visual-note {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0 0; color: var(--muted); font: 10px var(--mono);
}
.visual-note strong { color: var(--text-2); font: 12px var(--sans); }

/* ===== 跑马灯 ticker ===== */
.ticker { background: var(--ink); color: var(--lime); overflow: hidden; }
.ticker-track {
  display: flex; width: max-content;
  gap: 29px;
  min-height: 54px; align-items: center;
  font: 11px var(--mono); letter-spacing: .13em;
  animation: marquee 30s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group { display: flex; align-items: center; gap: 29px; }
.ticker-dot { color: #6d7d69; font-size: 15px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== 内容区块 ===== */
.content-section { padding: 112px 0 120px; }
.section-heading {
  display: flex; align-items: end; justify-content: space-between;
  padding-bottom: 29px; border-bottom: 1px solid var(--line);
}
.section-heading .eyebrow { margin-bottom: 16px; }
h2 { margin-bottom: 0; font-size: 41px; letter-spacing: -.055em; line-height: 1.1; }
.section-side-note { color: var(--muted); font: 10px var(--mono); }

.notes-grid { display: grid; grid-template-columns: 1.48fr 1fr 1fr; border-bottom: 1px solid var(--line); }
.note-card {
  min-height: 310px; padding: 28px 26px 27px 0;
  display: flex; gap: 21px;
  border-right: 1px solid var(--line);
  transition: background .3s ease;
}
.note-card + .note-card { padding-left: 25px; }
.note-card:last-child { border-right: 0; }
.note-card:hover { background: var(--paper-deep); }
.note-card.note-featured:hover { background: linear-gradient(135deg, rgba(200, 232, 107, .10), transparent 60%); }
.note-index { color: var(--muted-2); font: 11px var(--mono); }
.note-body { display: flex; flex-direction: column; align-items: flex-start; }
.note-tag { margin-bottom: 17px; color: var(--lime-dark); font: 10px var(--mono); letter-spacing: .04em; }
.note-body h3 {
  max-width: 310px; margin-bottom: 15px;
  font-size: 20px; line-height: 1.31; letter-spacing: -.035em;
}
.note-body > p:not(.note-tag) { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.read-link {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  color: #47564d; font-size: 11px; font-weight: 700;
}
:root[data-theme="dark"] .read-link { color: #aebbb0; }
.read-link svg { width: 13px; height: 13px; transition: transform .25s ease; }
.read-link:hover svg { transform: translate(2px, -2px); }

.projects-section { padding-top: 0; }
.project-list { border-bottom: 1px solid var(--line); }
.project-row {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 26px; align-items: center;
  padding: 29px 0; border-bottom: 1px solid var(--line);
  transition: padding .3s ease;
}
.project-row:last-child { border-bottom: 0; }
.project-row:hover { padding-left: 12px; }
.project-number {
  color: var(--muted-2); font: 11px var(--mono);
  transition: color .25s ease, transform .25s ease;
}
.project-row:hover .project-number { color: var(--lime-dark); transform: translateY(-1px); }
.project-title-line { display: flex; align-items: baseline; gap: 13px; margin-bottom: 9px; }
.project-title-line h3 { margin: 0; font-size: 23px; letter-spacing: -.04em; transition: color .25s ease; }
.project-row:hover .project-title-line h3 { color: var(--lime-dark); }
.project-status { color: var(--muted-2); font: 10px var(--mono); }
.project-info > p { max-width: 670px; margin-bottom: 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.project-tags span {
  padding: 5px 8px; color: var(--muted); border: 1px solid var(--line);
  font: 10px var(--mono);
  transition: border-color .2s ease, color .2s ease;
}
.project-row:hover .project-tags span { border-color: var(--lime-dark); color: var(--lime-dark); }
.download-button {
  display: inline-flex; align-items: center; gap: 9px;
  min-width: 98px; justify-content: center; height: 39px;
  border: 1px solid var(--line); font-size: 11px; font-weight: 700;
  transition: all .22s ease;
}
.download-button svg { width: 14px; height: 14px; transition: transform .22s ease; }
.download-button:hover { border-color: var(--ink); background: var(--ink); color: var(--lime); }
.download-button:hover svg { transform: translateY(1px); }
.download-button.disabled { color: var(--muted-2); border-color: var(--line); cursor: not-allowed; }

/* ===== About ===== */
.about-section {
  display: grid; grid-template-columns: 1fr 1fr; gap: 103px; align-items: center;
  padding: 105px 0 124px;
}
.about-photo {
  aspect-ratio: 1 / 1; max-width: 410px; overflow: hidden;
  background: var(--paper-deep);
  position: relative;
}
.about-photo::after {
  content: '';
  position: absolute; inset: 0;
  border: 1px solid rgba(24, 35, 31, .06);
  pointer-events: none;
}
.about-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) saturate(.4);
  transition: filter .6s ease, transform .8s cubic-bezier(.2, .8, .2, 1);
}
.about-photo:hover img { filter: grayscale(.2) saturate(.9); transform: scale(1.03); }
.about-copy h2 {
  max-width: 460px; margin-bottom: 26px;
  font-family: var(--serif); font-size: 60px; font-weight: 400;
  letter-spacing: -.045em; color: var(--serif-accent);
}
.about-copy > p:not(.eyebrow) { max-width: 440px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.contact-links {
  display: flex; flex-wrap: wrap; gap: 15px 24px; margin-top: 31px;
  padding-top: 21px; border-top: 1px solid var(--line);
}
.contact-links a, .copy-email {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none;
  color: var(--text-2); font-size: 11px; font-weight: 700; cursor: pointer;
}
.contact-links svg { width: 14px; height: 14px; color: var(--lime-dark); }

/* ===== Footer ===== */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 27px; border-top: 1px solid var(--line);
  color: var(--muted); font: 10px var(--mono);
}
.site-footer a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.footer-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-left .beian { gap: 0; color: var(--muted); }
.footer-left .beian-icon { width: 14px; height: auto; margin-right: 5px; }
.site-footer svg { width: 13px; height: 13px; }

/* ===== 返回顶部按钮 ===== */
.to-top {
  position: fixed;
  right: 26px; bottom: 26px; z-index: 65;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--lime);
  border: 0; cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(16px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background .2s ease;
}
.to-top svg { width: 17px; height: 17px; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--lime-dark); color: var(--lime-ink); }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 29px; z-index: 75;
  padding: 12px 17px;
  background: var(--ink); color: var(--lime);
  font: 11px var(--mono);
  opacity: 0; transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Hero 入场编排（仅此一处，克制） ===== */
.rv { opacity: 0; }
.rv-1 { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .05s forwards; }
.rv-2 { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .12s forwards; }
.rv-3 { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .2s forwards; }
.rv-4 { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .28s forwards; }
.rv-5 { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .36s forwards; }
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ===== 响应式 ===== */
@media (max-width: 800px) {
  .section-wrap, .site-header { width: min(100% - 40px, 590px); }
  .site-header { height: 76px; }
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
  .icon-btn { width: 44px; height: 44px; }
  .brand-mark { width: 42px; height: 42px; }
  .header-actions { gap: 8px; }
  .mobile-nav { top: 76px; }
  .text-link, .read-link, .contact-links a, .copy-email, .header-contact {
    min-height: 44px; align-items: center;
  }
  .hero { grid-template-columns: 1fr; gap: 50px; padding: 63px 0 79px; }
  h1 { font-size: 61px; }
  .hero-intro { max-width: 540px; }
  .hero-actions { margin-bottom: 35px; }
  .hero-visual { padding-top: 0; }
  .visual-frame { height: min(78vw, 370px); }
  .content-section { padding: 78px 0 83px; }
  .section-heading { align-items: start; gap: 20px; }
  h2 { font-size: 36px; }
  .notes-grid { grid-template-columns: 1fr; }
  .note-card, .note-card + .note-card { min-height: unset; padding: 27px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .note-card:last-child { border-bottom: 0; }
  .note-body h3 { max-width: none; }
  .project-row { grid-template-columns: 35px 1fr; gap: 14px; }
  .project-row:hover { padding-left: 6px; }
  .download-button { grid-column: 2; justify-self: start; }
  .about-section { grid-template-columns: 1fr; gap: 48px; padding: 82px 0 91px; }
  .about-photo { max-width: none; width: min(100%, 410px); }
  .to-top { right: 18px; bottom: 18px; width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  .section-wrap, .site-header { width: calc(100% - 32px); }
  .header-contact span { display: none; }
  .hero-meta { flex-direction: column; gap: 10px; }
  h1 { font-size: 49px; }
  .about-copy h2 { font-size: 49px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 19px; }
  .section-heading { flex-direction: column; }
  .section-side-note { margin-top: -5px; }
  .project-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 14px; }
}

/* 尊重系统减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv, .rv-1, .rv-2, .rv-3, .rv-4, .rv-5 { animation: none; opacity: 1; }
  .ticker-track { animation: none; }
  .status-dot { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
