/* ============================================================
   全屏滚动个人作品集 · 浅色系样式
   参照 Northbound Studio：背景 #eceee9 / 文字 #121513
   修改提示：配色集中在 :root，图片在 index.html 的 style 里替换。
   ============================================================ */

:root {
  --bg: #eceee9;                          /* 浅米灰主背景 */
  --surface: #f5f6f2;                     /* 更浅的面板/控件底 */
  --fg: #121513;                          /* 近黑墨色文字 */
  --muted: rgba(18, 21, 19, 0.62);
  --line: rgba(18, 21, 19, 0.16);
  --accent: #365646;                      /* 低饱和深松绿，克制强调 */
  --nav-w: 96px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* 滚动交给 .scroll-container */
}

/* ---------- 右上角语言切换 ---------- */
.lang-switch {
  position: fixed;
  top: 24px;
  right: 30px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(245, 246, 242, 0.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  font-size: 13px;
  letter-spacing: 1px;
}
.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  padding: 2px 4px;
  transition: color 0.25s;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button.active { color: var(--accent); font-weight: 700; }
.lang-switch .sep { color: var(--line); }

/* ---------- 左侧滚轮式滚动指示器 ---------- */
.side-nav {
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 9px;
  border-radius: 999px;
  background: rgba(245, 246, 242, 0.72);
  border: 1px solid rgba(18, 21, 19, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  user-select: none;
}

.side-nav .wheel {
  color: var(--accent);
  transition: transform 0.1s linear;
}

.side-nav .track {
  position: relative;
  width: 2px;
  height: 180px;
  background: var(--line);
  border-radius: 2px;
}
.side-nav .track-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.15s var(--ease);
}

.side-nav .dots {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.side-nav .dots a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.side-nav .dots a span {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  transition: all 0.3s var(--ease);
  flex: none;
}
.side-nav .dots a em {
  position: absolute;
  left: 18px;
  top: 50%;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(245, 246, 242, 0.94);
  opacity: 0;
  transform: translateY(-50%) translateX(-6px);
  transition: all 0.3s var(--ease);
  pointer-events: none;
}
.side-nav .dots a:hover em,
.side-nav .dots a.active em { opacity: 1; transform: translateY(-50%) translateX(0); }
.side-nav .dots a.active { color: var(--fg); }
.side-nav .dots a.active span {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.25);
}

/* ---------- 全屏滚动容器 ---------- */
.scroll-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }

.panel {
  position: relative;
  height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: var(--bg);
}

.panel .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  transition: transform 6s var(--ease);
}
.panel:hover .bg { transform: scale(1.12); }

/* 浅色遮罩：文字区浅底深字，右侧仍露出全屏大图 */
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(236, 238, 233, 0.95) 0%,
    rgba(236, 238, 233, 0.78) 42%,
    rgba(236, 238, 233, 0.16) 100%);
}
#contact .overlay {
  background: radial-gradient(ellipse at center,
    rgba(236, 238, 233, 0.93) 0%,
    rgba(236, 238, 233, 0.70) 55%,
    rgba(236, 238, 233, 0.32) 100%);
}

/* ---------- 首页 ---------- */
.hero { justify-content: flex-start; padding-left: calc(var(--nav-w) + 8vw); }
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.kicker {
  font-size: 14px; letter-spacing: 6px; color: var(--accent);
  margin-bottom: 18px;
}
.name {
  font-size: clamp(48px, 9vw, 120px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--fg);
}
.role {
  margin-top: 22px;
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--fg);
}
.intro {
  margin-top: 18px;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.scroll-cue {
  position: absolute;
  bottom: 38px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 12px; letter-spacing: 3px;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue .cue-line {
  width: 1px; height: 40px;
  background: linear-gradient(var(--accent), transparent);
  animation: cue 1.8s infinite;
}
@keyframes cue { 0%{opacity:0; transform:scaleY(0.3)} 50%{opacity:1} 100%{opacity:0; transform:translateY(14px) scaleY(0.6)} }

/* ---------- 关于 ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; }
.about-media { position: relative; height: 100%; }
.about-media .bg { position: absolute; inset: 0; }
.about-text {
  padding: 6vh 8vw;
  background: var(--surface);
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
  scrollbar-width: none;
}
.about-text::-webkit-scrollbar { display: none; }
.about-text h2 {
  font-size: clamp(34px, 5vw, 64px);
  margin-bottom: 22px;
}
.about-text p { color: var(--muted); line-height: 1.85; margin-bottom: 14px; font-size: 16px; }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.skills li {
  border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; color: var(--fg);
}
.ai-block {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.ai-block h3 {
  font-size: 22px; color: var(--accent);
  margin-bottom: 12px; letter-spacing: 1px;
}
.ai-block p { font-size: 14.5px; line-height: 1.8; }
/* AI 应用：默认只显示标题，悬停/点击展开内容 */
.ai-block { outline: none; cursor: help; }
.ai-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.55s var(--ease), opacity 0.35s var(--ease);
}
.ai-block:hover .ai-content,
.ai-block:focus .ai-content,
.ai-block:focus-within .ai-content {
  max-height: 360px;
  opacity: 1;
}

/* ---------- 工作经历（竖向时间线） ---------- */
.experience {
  flex-direction: column; justify-content: flex-start;
  padding: 4vh 8vw 4vh calc(var(--nav-w) + 4vw);
  overflow-y: auto; background: var(--bg);
}
.exp-head { margin-bottom: 14px; flex: 0 0 auto; }
.exp-head h2 { font-size: clamp(30px, 4vw, 48px); }
.exp-head p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.timeline {
  position: relative;
  max-width: 980px;
  padding-left: 30px;
}
.timeline::before {
  content: ""; position: absolute;
  left: 6px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line);
}
.job { position: relative; margin-bottom: 11px; }
.job:last-child { margin-bottom: 0; }
.job-node {
  position: absolute; left: -30px; top: 7px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  z-index: 1;
}
.job-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 20px;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.job:hover .job-body {
  border-color: rgba(54, 86, 70, 0.5);
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(18, 21, 19, 0.05);
}
.job-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.job-company { font-size: clamp(19px, 2.4vw, 26px); color: var(--fg); }
.job-years {
  font-size: 13px; color: var(--accent);
  letter-spacing: 1px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.job-role {
  font-size: 13px; color: var(--fg); font-weight: 600;
  margin: 4px 0 8px;
}
.job-projects {
  list-style: none; margin-bottom: 7px;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 3px 24px;
}
.job-projects li {
  position: relative; padding-left: 14px;
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.job-projects li::before {
  content: "\25B6"; position: absolute; left: 0; top: 0;
  font-size: 7px; color: var(--accent); line-height: 2.1;
}
.job-duties p {
  font-size: 12.5px; color: var(--muted);
  line-height: 1.6; margin-bottom: 3px;
}
/* 工作经历：默认只显示公司 + 时间，悬停/点击展开详情 */
.job { outline: none; cursor: help; }
.job-extra {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.3s var(--ease);
}
.job:hover .job-extra,
.job:focus .job-extra,
.job:focus-within .job-extra {
  max-height: 520px;
  opacity: 1;
}
.job:hover .job-body,
.job:focus .job-body,
.job:focus-within .job-body {
  border-color: rgba(54, 86, 70, 0.5);
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(18, 21, 19, 0.05);
}

/* ---------- 作品 ---------- */
.works { flex-direction: column; justify-content: flex-start; padding: 5vh 8vw 5vh calc(var(--nav-w) + 4vw); overflow-y: auto; background: var(--bg); }
.works-head { margin-bottom: 26px; }
.works-head h2 { font-size: clamp(32px, 5vw, 60px); }
.works-head p { color: var(--muted); margin-top: 12px; font-size: 15px; }
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}
.work {
  position: relative;
  height: 23vh;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover; background-position: center;
  background-color: #d8dbd3;
  text-decoration: none; color: #fff;
  display: flex; align-items: flex-end;
}
.work.has-video { background-image: linear-gradient(135deg, #d5d8cf, #b9beb2); }
.work.has-video::before {
  content: "\25B6";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px; color: #fff; opacity: .85;
  z-index: 1;
}
.work::after {
  content: ""; position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75));
  transition: background 0.4s;
  pointer-events: none;
}
.work:hover::after { background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.80)); }
.work-meta { position: relative; z-index: 2; padding: 22px; }
.work-meta h3 { font-size: 22px; margin-bottom: 4px; }
.work-meta p { font-size: 13px; opacity: 0.82; letter-spacing: 1px; }

/* 作品卡片右上角的视频角标（项目内含视频时显示） */
.work-video-badge {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 2px;
  border-radius: 50%;
  background: rgba(18, 21, 19, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  pointer-events: none;
  transition: background 0.3s, transform 0.3s;
}
.work:hover .work-video-badge { background: rgba(54, 86, 70, 0.92); transform: scale(1.08); }

/* 马赛克封面：canvas 在最底层，鼠标起伏由 js/works.js 驱动 */
.work.has-mosaic { background-color: #eceee9; cursor: crosshair; }
.work.has-mosaic::after { background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,0.72)); }
.work.has-mosaic:hover::after { background: linear-gradient(180deg, rgba(0,0,0,0.06) 40%, rgba(0,0,0,0.78)); }
.mosaic-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ---------- 联系 ---------- */
.contact { justify-content: center; text-align: center; }
.contact-content { position: relative; z-index: 2; }
.contact-content h2 { font-size: clamp(40px, 7vw, 90px); color: var(--fg); }
.contact-content .lead { color: var(--muted); margin: 18px 0 36px; font-size: 18px; }
/* 联系区：无外框，与标题同一套浅色系 */
.contact-actions {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(36px, 7vw, 90px); flex-wrap: wrap;
}
.email-contact { display: flex; }
.email-link, .form-entry {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 6px 10px;
  text-decoration: none;
  transition: transform 0.35s var(--ease);
}
.email-link:hover, .form-entry:hover { transform: translateY(-3px); }
.email-label {
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: 2px;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.2;
}
.email-address {
  font-size: clamp(14px, 1.7vw, 19px);
  letter-spacing: 0.3px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: border-color 0.3s, color 0.3s;
}
.email-link:hover .email-address { color: var(--accent); border-color: var(--accent); }
.form-entry-value {
  font-size: clamp(14px, 1.7vw, 19px);
  color: var(--muted);
  transition: color 0.3s;
}
.form-entry:hover .form-entry-value { color: var(--accent); }
.copyright { margin-top: 50px; font-size: 13px; color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .side-nav { left: 12px; gap: 12px; padding: 14px 7px; }
  .side-nav .track { height: 130px; }
  .side-nav .dots a em { display: none; }
  .hero { padding-left: 22vw; }
  .about { grid-template-columns: 1fr; }
  .about-media { display: none; }
  .about-text { padding: 8vh 6vw 8vh 22vw; }
  .experience { padding: 8vh 6vw 8vh 22vw; }
  .job-projects { grid-template-columns: 1fr; }
  .job-top { flex-direction: column; gap: 6px; }
  .works { padding: 8vh 6vw 8vh 22vw; }
  .works-grid { grid-template-columns: 1fr; }
  .work { height: 26vh; }
  .contact-actions { gap: 28px; }
  .email-label { font-size: 24px; }
  .email-address, .form-entry-value { font-size: 14px; }
}

/* ---------- 作品下级详情（全屏 / 浅色） ---------- */
.work-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(236, 238, 233, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
  overflow-y: auto;
  color: var(--fg);
}
.work-detail.open { opacity: 1; visibility: visible; }

.detail-inner { max-width: 1100px; margin: 0 auto; padding: 84px 24px 120px; }
.detail-head { text-align: center; margin-bottom: 30px; }
.detail-head h2 { font-size: clamp(28px, 5vw, 52px); color: var(--fg); }
.detail-count { color: var(--muted); margin-top: 10px; font-size: 14px; letter-spacing: 1px; }

.detail-media { display: flex; flex-direction: column; gap: 18px; }
.detail-media img,
.detail-media video {
  width: 100%;
  border-radius: 10px;
  background: #dfe2da;
  display: block;
}

.detail-close {
  position: fixed;
  top: 22px; right: 28px;
  z-index: 101;
  background: rgba(245, 246, 242, 0.9);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 1px;
}
.detail-close:hover { background: #fff; }

.detail-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(245, 246, 242, 0.9);
  color: var(--fg);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.detail-nav:hover { background: #fff; }
.detail-nav.prev { left: 20px; }
.detail-nav.next { right: 20px; }

@media (max-width: 860px) {
  .detail-nav.prev { left: 8px; }
  .detail-nav.next { right: 8px; }
  .detail-inner { padding: 72px 14px 90px; }
}
