/* ===== 墨金书卷 =====
   米白纸底 + 墨黑衬线标题 + 单一金铜强调色。
   气质：沉稳、可信、有文化底蕴。 */
:root {
  --bg: #f7f4ee;
  --bg-card: #fffdf8;
  --border: #e6e0d2;
  --text: #1c1a17;
  --text-dim: #78716a;
  --gold: #b8860b;
  --gold-dark: #8a6508;
  --gold-soft: #f3ead2;

  --serif: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --shadow: 0 2px 10px rgba(50, 42, 25, 0.05);
  --shadow-lift: 0 12px 26px rgba(50, 42, 25, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); text-decoration: underline; }

/* ===== 全页背景：极淡金色数字/字母流动 ===== */
.matrix-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

main { position: relative; z-index: 1; }

/* ===== Hero（左文字 + 右侧敲键盘人物，互不重叠） ===== */
.hero {
  max-width: 1500px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5rem;
}

.hero-text { max-width: 620px; flex-shrink: 0; }

/* 右侧：线条剪影的人伏案敲击笔记本，屏幕里循环打字，
   呼应「编程 / 投资 / 写作」三重身份，不与左侧文字重叠 */
.hero-figure {
  position: relative;
  width: clamp(280px, 34vw, 520px);
  aspect-ratio: 1;
  flex-shrink: 0;
}

.hacker-svg {
  width: 100%;
  height: 100%;
  color: var(--gold);
  opacity: 0.55;
}
.hacker-svg circle,
.hacker-svg path,
.hacker-svg rect { stroke: currentColor; }
.hacker-screen { fill: var(--bg-card); }

.hacker-terminal {
  position: absolute;
  left: 31%;
  top: 30%;
  width: 46%;
  height: 36%;
  padding: 0.3rem 0.35rem;
  overflow: visible;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: clamp(0.55rem, 1vw, 0.72rem);
  color: var(--gold-dark);
  white-space: nowrap;
}

.hacker-lines {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.hacker-cursor {
  color: var(--gold);
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.masthead {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.5em;
  color: var(--gold);
  margin-bottom: 2rem;
  animation: rise 0.6s ease-out both;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  animation: rise 0.6s ease-out 0.1s both;
}

.rule {
  width: 3rem;
  height: 2px;
  border: none;
  background: var(--gold);
  margin: 0 0 1.5rem;
  animation: rise 0.6s ease-out 0.2s both;
}

.roles {
  list-style: none;
  margin-bottom: 2rem;
  animation: rise 0.6s ease-out 0.25s both;
}
.roles li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 2.1;
}
.roles li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.5rem;
  height: 2px;
  background: var(--gold);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  animation: rise 0.6s ease-out 0.35s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.7rem;
  border-radius: 6px;
  font-size: 0.98rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--gold);
  color: #fffdf8;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}
.btn-primary:hover { background: var(--gold-dark); color: #fffdf8; }

.btn-ghost {
  border: 1.5px solid var(--text);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ===== 通用板块 ===== */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.section + .section { border-top: 1px solid var(--border); }

.section h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}
.section h2::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--gold);
  margin-bottom: 1rem;
}

/* ===== 作品卡片 ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 12rem;
  padding: 1.5rem 1.4rem 1.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  text-decoration: none;
  color: var(--text);
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift);
}

.card-no {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.card h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  letter-spacing: 0.03em;
}

.card p { color: var(--text-dim); font-size: 0.88rem; flex: 1; }

.card-tags span {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  margin: 0.15rem 0.3rem 0.15rem 0;
  background: var(--gold-soft);
  color: var(--gold-dark);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  margin-left: 0.4rem;
  background: var(--gold-soft);
  color: var(--gold-dark);
  border-radius: 4px;
  font-size: 0.72rem;
  vertical-align: middle;
}

/* ===== 联系 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.contact-card {
  padding: 1.25rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift);
}

.contact-card p { color: var(--text-dim); font-size: 0.85rem; }

.contact-card .contact-label {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  margin: 0.7rem 0 0.2rem;
}

.contact-card .contact-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.05em;
}

.qr {
  width: 100%;
  max-width: 128px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.mail-icon {
  width: 100%;
  max-width: 128px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 8px;
}

.copy {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.3rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}
.copy:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ===== 动效偏好与移动端 ===== */
@media (prefers-reduced-motion: reduce) {
  .masthead, .hero h1, .rule, .roles, .hero-actions { animation: none; }
  .hacker-cursor { animation: none; }
}

@media (max-width: 900px) {
  .hero-figure { display: none; }
  .hero { justify-content: center; padding: 1.5rem; }
}

@media (max-width: 700px) {
  .cards, .contact-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
  .hero { min-height: auto; padding: 4rem 1.5rem 2.5rem; }
  .section { padding: 2rem 1.5rem; }
  .cards, .contact-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
}
