/* ============================================================
   廖枭驰 个人网站 — 设计系统 v2（2026-11-22 艺术向重构）
   基调：纸感暖底 + 墨色 + 靛蓝点缀；标题衬线宋体 = 杂志感；
   照片即内容：拍立得英雄照、手机截图叠放、生活画廊
   ============================================================ */

:root {
  --paper: #f7f4ee;
  --surface: #fffdf8;
  --ink: #1c1a16;
  --ink-2: #5b564d;
  --ink-3: #a49d90;
  --line: #e6e1d6;
  --accent: #4f46e5;
  --accent-soft: #eceafe;
  --accent-deep: #3730a3;
  --coral: #e07a5f;
  --gold: #b45309;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28,26,22,.05), 0 10px 30px rgba(28,26,22,.07);
  --shadow-lg: 0 2px 6px rgba(28,26,22,.06), 0 20px 50px rgba(28,26,22,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgba(28,26,22,.035) 1px, transparent 1px);
  background-size: 22px 22px;
}
img { display: block; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247,244,238,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: 1px; }
.brand-dot { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  transition: background .2s;
}
.nav-cta:hover { background: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 72px 24px 0; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(79,70,229,.08), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(224,122,95,.07), transparent 60%);
}
.hero-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center;
}
.hero-badge {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border: 1px solid #cdc9f7;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero-name {
  font-family: var(--serif); font-size: clamp(52px, 8vw, 88px);
  font-weight: 700; letter-spacing: 4px; line-height: 1.1;
}
.hero-en { font-size: 15px; color: var(--ink-3); margin-top: 10px; letter-spacing: .5px; }
.hero-line { font-size: 17px; color: var(--ink-2); margin: 22px 0 30px; }
.hero-actions { display: flex; gap: 12px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 12px 26px; border-radius: 999px; transition: all .2s; cursor: pointer; border: none;
  font-family: var(--sans);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(79,70,229,.35); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* 证件照头像（工作向首页） */
.hero-avatar-wrap { position: relative; display: flex; justify-content: center; align-items: center; }
.hero-avatar {
  width: min(300px, 72vw); aspect-ratio: 1; border-radius: 50%;
  overflow: hidden; border: 6px solid var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--line);
  position: relative;
}
.hero-avatar::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px dashed rgba(79,70,229,.35);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-tag {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Section 头 ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 72px 24px 0; }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 10px; }
.sec-no {
  font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 2px 12px; letter-spacing: 1px;
}
.section-title { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: 2px; }
.sec-sub { color: var(--ink-3); font-size: 14px; margin-left: auto; }
.section-sub { color: var(--ink-2); font-size: 15px; margin: 14px 0 26px; max-width: 800px; }

/* ---------- 教育 ---------- */
.edu-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin-top: 26px; }
.edu-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.edu-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.edu-flag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-deep); border: 1px solid #cdc9f7;
}
.edu-head h3 { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.edu-time { font-size: 13px; color: var(--ink-3); }
.edu-points { list-style: none; }
.edu-points li { font-size: 14px; color: var(--ink-2); margin-bottom: 9px; padding-left: 16px; position: relative; }
.edu-points li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* 证书交互区 */
.cert-box { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 20px; }
.cert-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.cert-tab {
  font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 7px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--ink-2); cursor: pointer; transition: all .2s;
}
.cert-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cert-stage { position: relative; }
.cert-thumb { display: none; cursor: zoom-in; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.cert-thumb.active { display: block; }
.cert-thumb img { width: 100%; max-height: 420px; object-fit: cover; object-position: top; transition: transform .4s ease; }
.cert-thumb:hover img { transform: scale(1.02); }
.cert-thumb figcaption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(28,26,22,.55));
  color: #fff; font-size: 12px; text-align: center;
}
.cert-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); }

/* ---------- 工作经历 ---------- */
.exp-timeline { margin-top: 26px; position: relative; padding-left: 26px; }
.exp-timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--accent), var(--line));
}
.exp-card { position: relative; }
.exp-dot {
  position: absolute; left: -26px; top: 12px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.exp-body {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.exp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.exp-top h3 { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.exp-date { font-size: 13px; color: var(--ink-3); }
.exp-sub { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 14px; }
.exp-points { list-style: none; margin-bottom: 14px; }
.exp-points li { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; padding-left: 16px; position: relative; }
.exp-points li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* ---------- 项目 ---------- */
.project-featured {
  display: grid; grid-template-columns: .9fr 1.1fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg); margin: 26px 0 22px;
}
.project-media {
  position: relative; min-height: 460px; overflow: hidden;
  background:
    radial-gradient(500px 300px at 50% 0%, rgba(79,70,229,.14), transparent 70%),
    radial-gradient(400px 300px at 80% 100%, rgba(224,122,95,.10), transparent 70%),
    #17151f;
}
/* 三张手机截图叠放 */
.phone-stack { position: absolute; inset: 0; }
.phone-stack img {
  position: absolute; bottom: -34px; width: 41%; cursor: zoom-in;
  border-radius: 20px 20px 0 0; border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 18px 44px rgba(0,0,0,.5); transition: all .35s ease;
}
.phone-stack img:nth-child(1) { left: 8%; transform: rotate(-6deg); z-index: 1; }
.phone-stack img:nth-child(2) { left: 30%; transform: rotate(0deg) translateY(10px); z-index: 3; }
.phone-stack img:nth-child(3) { right: 7%; transform: rotate(6deg); z-index: 2; }
.phone-stack img:hover { transform: translateY(-14px) rotate(0deg); z-index: 5; }
.media-tag {
  position: absolute; top: 16px; left: 16px; z-index: 6;
  background: rgba(28,26,22,.78); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 999px; backdrop-filter: blur(4px);
}
.project-body { padding: 34px; }
.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.project-top h3 { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.project-date { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.project-desc { font-size: 14.5px; color: var(--ink-2); margin-bottom: 16px; }
.feature-list { list-style: none; margin-bottom: 16px; }
.feature-list li { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; padding-left: 18px; position: relative; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; font-size: 12px; top: 2px; }
.tech-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tech-chips span {
  font-size: 12px; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px;
}
.project-links { display: flex; gap: 16px; align-items: center; }
.link-btn { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }
.link-ghost { color: var(--ink-3); text-decoration: none; font-size: 14px; }
.link-ghost:hover { color: var(--ink-2); }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-pending {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.pending-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px;
}
.project-pending h3 { font-family: var(--serif); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.project-pending .project-desc { font-size: 13.5px; margin: 10px 0 16px; flex-grow: 1; }
.pending-badge {
  align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--gold);
  background: #fdf0d5; border: 1px solid #f3d9a4; padding: 4px 10px; border-radius: 999px;
}

/* ---------- 代码复现 ---------- */
.playground {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 30px;
}
.pg-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 24px; }
.pg-field { display: flex; flex-direction: column; gap: 6px; }
.pg-field label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pg-field select {
  font-family: var(--sans); font-size: 14px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
  min-width: 110px; outline: none;
}
.pg-field select:focus { border-color: var(--accent); }
.pg-result { min-height: 120px; }
.pg-placeholder { color: var(--ink-3); font-size: 14px; padding: 24px 0; text-align: center; }
.pg-headline { font-size: 32px; font-weight: 800; margin-bottom: 4px; font-family: var(--serif); }
.pg-headline small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 10px; font-family: var(--sans); }
.pg-note { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.pg-bars { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.pg-bar-row { display: grid; grid-template-columns: 64px 1fr 72px; align-items: center; gap: 12px; font-size: 13px; }
.pg-bar-track { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; height: 14px; overflow: hidden; }
.pg-bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.fill-win { background: linear-gradient(90deg, #4f46e5, #6366f1); }
.fill-tie { background: #d6d1c5; }
.fill-lose { background: #e9e4d8; }

/* ---------- 生活页 ---------- */
.life-hero {
  padding: 88px 24px 40px; text-align: center;
  background:
    radial-gradient(800px 400px at 50% -20%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(600px 300px at 90% 80%, rgba(224,122,95,.08), transparent 60%);
}
.life-kicker {
  font-family: var(--serif); font-size: 14px; letter-spacing: 6px;
  color: var(--coral); text-transform: uppercase; margin-bottom: 10px;
}
.life-title { font-family: var(--serif); font-size: clamp(40px, 7vw, 64px); font-weight: 700; letter-spacing: 6px; }
.life-sub { color: var(--ink-2); font-size: 15.5px; margin-top: 18px; line-height: 2; }
.hobby-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 26px; }
.hobby-tag {
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; box-shadow: var(--shadow);
}
.foot-link { color: var(--accent); text-decoration: none; }
.foot-link:hover { text-decoration: underline; }

/* ---------- 画廊 ---------- */
.life-grid {
  margin-top: 28px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  grid-auto-flow: dense;
}
.life-item {
  position: relative; border-radius: 14px; overflow: hidden; cursor: zoom-in;
  box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--line);
}
.life-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.life-item:hover img { transform: scale(1.05); }
.life-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px;
  background: linear-gradient(transparent, rgba(28,26,22,.62));
  color: #fff; font-size: 12.5px; letter-spacing: 1px;
}
.life-item.tall { grid-row: span 2; }
.life-item img { aspect-ratio: 3/4; }
.life-item.tall img { aspect-ratio: 2/3; height: 100%; }
.dance-slot {
  border: 1.5px dashed var(--line); border-radius: 14px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 220px; cursor: default;
}
.dance-inner { padding: 20px; }
.dance-emoji { font-size: 34px; display: block; margin-bottom: 8px; }
.dance-inner b { font-family: var(--serif); font-size: 16px; letter-spacing: 2px; }
.dance-inner p { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
/* 视频卡：定制封面，点击才播放 */
.life-item.video-tile {
  position: relative; background: #17151f; cursor: pointer; overflow: hidden;
  aspect-ratio: 3/4; /* 关键：封面是绝对定位，容器必须有高度，否则整卡塌陷 */
}
.life-item.video-tile video { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.video-cover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; color: #fff;
  background:
    radial-gradient(340px 220px at 28% 18%, rgba(255,255,255,.16), transparent 62%),
    radial-gradient(300px 220px at 82% 88%, rgba(224,122,95,.28), transparent 65%),
    linear-gradient(152deg, #4f46e5 0%, #6d28d9 52%, #312e81 100%);
}
.video-cover:hover { background:
    radial-gradient(340px 220px at 28% 18%, rgba(255,255,255,.20), transparent 62%),
    radial-gradient(300px 220px at 82% 88%, rgba(224,122,95,.32), transparent 65%),
    linear-gradient(152deg, #4338ca 0%, #6d28d9 52%, #312e81 100%);
}
.cover-emoji { font-size: 48px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); }
.cover-title { font-family: var(--serif); font-size: 18px; letter-spacing: 4px; font-weight: 700; }
.cover-play {
  font-size: 12.5px; padding: 7px 18px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(4px); letter-spacing: 1px;
}
.cover-cap {
  position: absolute; bottom: 16px; left: 0; right: 0;
  font-size: 12px; letter-spacing: 3px; color: rgba(255,255,255,.75);
}
/* 兴趣爱好双列 */
.life-grid.half { grid-template-columns: repeat(2, 1fr); }

/* ---------- 联系 ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }
.contact-card {
  display: flex; gap: 16px; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: all .2s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.contact-card b { display: block; font-size: 14px; color: var(--ink); }
.contact-card p { font-size: 13px; color: var(--ink-3); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 24px; text-align: center;
  color: var(--ink-3); font-size: 13px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(18,16,12,.92); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-img {
  max-width: min(92vw, 1100px); max-height: 80vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: lbIn .25s ease;
}
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.lb-cap { color: #e8e4da; font-size: 14px; margin-top: 14px; letter-spacing: 1px; }
.lb-close {
  position: absolute; top: 22px; right: 26px; background: none; border: none;
  color: #fff; font-size: 26px; cursor: pointer; opacity: .8;
}
.lb-close:hover { opacity: 1; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.08); border: none; color: #fff;
  font-size: 44px; width: 56px; height: 56px; border-radius: 50%;
  cursor: pointer; opacity: .7; transition: opacity .2s;
}
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo-wrap { order: -1; }
  .edu-grid { grid-template-columns: 1fr; }
  .project-featured { grid-template-columns: 1fr; }
  .project-media { min-height: 420px; }
  .project-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .life-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hero { padding-top: 48px; }
}
