/* ============================================================
   NOVA · 个人主页
   风格：纸感编辑排版（Editorial / Paper）— 墨黑 + 纸白 + 朱红
   ============================================================ */

:root {
  --paper: #f2efe7;
  --paper-2: #eae6db;
  --ink: #16130f;
  --ink-soft: #3b352c;
  --muted: #6f6858;
  --line: rgba(22, 19, 15, .14);
  --line-strong: rgba(22, 19, 15, .3);
  --accent: #d8401f;
  --accent-soft: rgba(216, 64, 31, .1);
  --grid: rgba(22, 19, 15, .045);

  --font-display: "Helvetica Neue", "Arial Black", Arial, "Microsoft YaHei", sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --ease: cubic-bezier(.22, .68, .16, 1);
  --pad: clamp(20px, 5vw, 56px);
  --max: 1180px;
}

[data-theme="dark"] {
  --paper: #100e0b;
  --paper-2: #17140f;
  --ink: #f2ece0;
  --ink-soft: #d8d0c1;
  --muted: #9a927f;
  --line: rgba(242, 236, 224, .13);
  --line-strong: rgba(242, 236, 224, .32);
  --accent: #ff5b35;
  --accent-soft: rgba(255, 91, 53, .12);
  --grid: rgba(242, 236, 224, .05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  font-size: .92em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: .1em .4em;
  border-radius: 3px;
}
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }

/* ---------------- 顶部进度条 ---------------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 2px; width: 0;
  background: var(--accent);
}

/* ---------------- 自定义光标 ---------------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 70;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, width .25s var(--ease), height .25s var(--ease),
              margin .25s var(--ease), background-color .25s;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .cursor { mix-blend-mode: screen; }
.cursor.on { opacity: 1; }
.cursor.grow {
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  background: var(--accent-soft);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------------- 导航 ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease),
              backdrop-filter .4s;
}
.nav.stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  line-height: 1;
  transition: transform .4s var(--ease), background-color .4s;
}
.brand:hover .brand-mark { transform: rotate(-8deg); background: var(--accent); }
.brand-text {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .28em; font-weight: 600;
}
.brand-text em { font-style: normal; color: var(--muted); letter-spacing: 0; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative;
  padding: 6px 12px;
  font-size: 13px; letter-spacing: .12em;
  color: var(--ink-soft);
  transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.theme-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 50%;
  cursor: pointer;
  transition: transform .5s var(--ease), border-color .3s, background-color .3s;
}
.theme-btn:hover { transform: rotate(35deg); border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .theme-btn svg { transform: rotate(180deg); }

/* ---------------- 通用区块 ---------------- */
main { position: relative; z-index: 1; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 140px) var(--pad);
}
.section-head { margin-bottom: clamp(36px, 5vw, 64px); }

.label {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 14px;
  position: relative;
}
.label::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 46px; height: 1px; background: var(--accent);
}

.h2 {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.h2.big { font-size: clamp(36px, 7vw, 84px); line-height: 1.06; letter-spacing: -.045em; }

/* ---------------- 首屏 ---------------- */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100svh;
  padding: 120px var(--pad) 80px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(72px, 13.5vw, 168px);
  font-weight: 800;
  line-height: .82;
  letter-spacing: -.055em;
  margin-left: -.045em;
  background: linear-gradient(178deg, var(--ink) 35%, color-mix(in srgb, var(--ink) 55%, var(--paper)) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  margin-top: 26px;
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 600;
  letter-spacing: .01em;
}
.desc {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.9;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  font-size: 14px; letter-spacing: .08em; font-weight: 600;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background-color .3s var(--ease), color .3s var(--ease),
              transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px var(--accent);
}
.btn-line { border-color: var(--line-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); transform: translateY(-2px); }

.status {
  display: flex; align-items: center; gap: 10px;
  margin-top: 34px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.status .sep { opacity: .45; }
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2fa36b; position: relative;
}
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid #2fa36b; opacity: .55;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .7; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

/* ---------------- 证件卡 ---------------- */
.hero-card { position: relative; justify-self: center; width: min(100%, 340px); }
.card-shadow {
  position: absolute; inset: 0;
  background: var(--ink); opacity: .09;
  transform: rotate(4deg) translate(10px, 12px);
  transition: transform .6s var(--ease);
}
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  padding: 18px 18px 20px;
  transform: rotate(-2.4deg);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
  box-shadow: 0 1px 0 var(--line);
}
.hero-card:hover .card { transform: rotate(0deg) translateY(-6px); box-shadow: 0 24px 50px -26px rgba(0,0,0,.45); }
.hero-card:hover .card-shadow { transform: rotate(6deg) translate(14px, 16px); }

.card-head {
  display: flex; justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.portrait {
  margin: 18px 0;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% 25%, var(--accent-soft), transparent 62%);
}
.ring-dash { animation: dash 26s linear infinite; transform-origin: 100px 100px; }
@keyframes dash { to { transform: rotate(360deg); } }

.card-meta { display: grid; gap: 7px; }
.card-meta div {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px;
  border-top: 1px dashed var(--line);
  padding-top: 7px;
}
.card-meta dt { color: var(--muted); }
.card-meta dd { font-weight: 600; }
.card-meta .live { color: #2fa36b; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; }

/* ---------------- 滚动提示 ---------------- */
.scroll-hint {
  position: absolute; left: var(--pad); bottom: 26px;
  display: flex; align-items: center; gap: 12px;
  color: var(--muted);
}
.scroll-hint .line {
  display: block; width: 56px; height: 1px; background: var(--line-strong);
  position: relative; overflow: hidden;
}
.scroll-hint .line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--accent);
  animation: sweep 2.6s var(--ease) infinite;
}
@keyframes sweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ---------------- 关于 ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.about-text p { color: var(--ink-soft); font-size: 16px; line-height: 1.95; }
.about-text p + p { margin-top: 20px; }
.about-text strong {
  color: var(--ink);
  box-shadow: inset 0 -.42em 0 var(--accent-soft);
}

.about-side { display: grid; gap: 0; border-top: 1px solid var(--line); }
.pref {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: grid; gap: 6px;
}
.pref .mono { color: var(--accent); font-size: 10px; }
.pref p { font-size: 14px; color: var(--ink-soft); line-height: 1.7; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--line);
  border: 1px solid var(--line);
}
.stats li {
  list-style: none;
  background: var(--paper);
  padding: 26px 22px;
  display: grid; gap: 6px;
}
.stats b {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 800; line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.stats span { font-size: 12.5px; color: var(--muted); }

/* ---------------- 能力 ---------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.skill {
  background: var(--paper);
  padding: 28px 26px 30px;
  position: relative;
  transition: background-color .35s var(--ease);
}
.skill::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.skill:hover { background: var(--paper-2); }
.skill:hover::before { transform: scaleX(1); }
.skill .idx { color: var(--muted); }
.skill h3 {
  margin: 12px 0 10px;
  font-size: 19px; font-weight: 700; letter-spacing: -.01em;
}
.skill p {
  font-size: 13.8px; line-height: 1.85; color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chips span {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
}

/* ---------------- 作品 ---------------- */
.works {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.work {
  display: block;
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
  transition: transform .45s var(--ease), border-color .35s, box-shadow .45s var(--ease);
}
.work:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, .5);
}
.thumb { aspect-ratio: 16 / 10; overflow: hidden; background: #0b0a12; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s var(--ease);
}
.work:hover .thumb img { transform: scale(1.04); }

.thumb-wip {
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 10px,
      var(--line) 10px 11px),
    var(--paper);
  color: var(--muted);
}

.work-body { padding: 22px 24px 24px; }
.work-top {
  display: flex; justify-content: space-between;
  color: var(--muted);
  margin-bottom: 10px;
}
.work-body h3 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.work-body p { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}
.more.muted { color: var(--muted); }
.more .arrow { transition: transform .3s var(--ease); }
.work:hover .more .arrow { transform: translate(3px, -3px); }

.work-link { display: block; }
.work-foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.like {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.like:hover { color: var(--accent); border-color: var(--accent); }
.like svg { transition: transform .3s var(--ease); }
.like:active svg { transform: scale(.86); }
.like.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.like.on svg { fill: var(--accent); }
.like.off { opacity: .45; cursor: not-allowed; }
.like.bump svg { animation: like-pop .45s var(--ease); }
@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---------------- 最近 ---------------- */
.log { border-top: 1px solid var(--line); }
.log li {
  list-style: none;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 18px; align-items: center;
  padding: 20px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color .3s, padding-left .3s var(--ease);
}
.log li:hover { background: var(--paper-2); padding-left: 20px; }
.log .date { color: var(--muted); }
.log .task { font-size: 15px; color: var(--ink-soft); }
.log .tag {
  font-size: 10px; letter-spacing: .12em;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.log li:first-child .tag { color: var(--accent); border-color: var(--accent); }

/* ---------------- 联系 ---------------- */
.contact { text-align: left; border-top: 1px solid var(--line); }
.contact .h2 { margin-top: 20px; }
.contact-sub {
  margin-top: 22px; max-width: 42ch;
  color: var(--muted); font-size: 16px; line-height: 1.9;
}

/* ---------------- 页脚 ---------------- */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.foot-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 24px var(--pad);
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  justify-content: space-between;
  color: var(--muted);
}
.foot-inner .mono { font-size: 10px; letter-spacing: .14em; }

/* ---------------- 滚动入场 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse::after, .ring-dash, .scroll-hint .line::after { animation: none; }
}

/* ---------------- 留言板 / 登录 ---------------- */
.gb {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 0;
  margin-top: 40px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}
.gb-panel { padding: clamp(18px, 2.4vw, 28px); }
.gb-panel + .gb-panel { border-left: 1px solid var(--line); }

.gb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}
.gb-head .mono { color: var(--muted); }
#gbState { color: var(--accent); }

.gb-tip {
  font-size: 10px; letter-spacing: .06em; line-height: 1.8;
  color: var(--muted); margin-bottom: 14px; text-transform: none;
}
.gb-row { display: flex; gap: 8px; margin-bottom: 10px; }
.gb-row-end { justify-content: space-between; align-items: center; margin: 10px 0 0; }

.gb-input, .gb-area {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong);
  padding: 10px 12px; outline: none;
  transition: border-color .3s var(--ease);
}
.gb-input::placeholder, .gb-area::placeholder { color: var(--muted); opacity: .8; }
.gb-input:focus, .gb-area:focus { border-color: var(--accent); }
.gb-area { width: 100%; resize: vertical; line-height: 1.7; }

.gb-btn {
  flex: 0 0 auto; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; white-space: nowrap;
  padding: 10px 14px; color: var(--ink);
  background: transparent; border: 1px solid var(--ink);
  transition: background .25s var(--ease), color .25s var(--ease), opacity .25s var(--ease);
}
.gb-btn:hover { background: var(--ink); color: var(--paper); }
.gb-btn-solid { background: var(--ink); color: var(--paper); }
.gb-btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.gb-btn:disabled { opacity: .38; cursor: not-allowed; }
.gb-btn:disabled:hover { background: transparent; color: var(--ink); }
.gb-btn-solid:disabled:hover { background: var(--ink); color: var(--paper); }

.gb-who { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.gb-who b { color: var(--accent); }
#userBox .gb-btn { width: 100%; }

.gb-note { font-size: 10px; color: var(--muted); letter-spacing: .06em; }

.gb-list { list-style: none; margin-top: 18px; border-top: 1px solid var(--line); max-height: 420px; overflow-y: auto; }
.gb-empty {
  padding: 22px 0; font-size: 13px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: .06em;
}
.msg-item { padding: 14px 0; border-bottom: 1px solid var(--line); position: relative; }
.msg-top { display: flex; align-items: baseline; gap: 10px; }
.msg-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.msg-time { color: var(--muted); font-size: 10px; }
.msg-body { font-size: 14px; color: var(--ink-soft); line-height: 1.8; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.gb-del {
  margin-top: 6px; cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--muted); background: none; border: none; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.gb-del:hover { color: var(--accent); }

.gb-offline {
  margin-top: 14px; font-size: 10px; color: var(--accent); letter-spacing: .1em;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 104px; gap: 44px; }
  .hero-card { justify-self: start; width: min(78%, 320px); }
  .scroll-hint { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gb { grid-template-columns: 1fr; }
  .gb-panel + .gb-panel { border-left: none; border-top: 1px solid var(--line); }
}

@media (max-width: 700px) {
  body { font-size: 15px; }
  .nav-links { display: none; }
  .works { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 74px 1fr; row-gap: 8px; }
  .log .tag { grid-column: 2; justify-self: start; }
  .display { font-size: clamp(64px, 21vw, 96px); }
  .foot-inner { font-size: 10px; }
}
