/* ============================================================
 * 作品集前端 · 视觉照搬 ram-clef/portfolio
 * 暗 / 亮双主题、鼠标光晕、背景光球、玻璃卡、3D 倾斜头像卡、
 * 卡片 hover 上浮动效、时间线、滚动渐显。中文字体：思源宋体 + 思源黑体。
 * 项目按 type 分页签（手机 / PC / 可视化），点击卡片打开详情弹窗（viewer.js）。
 * ============================================================ */

/* ===== 字体 ===== */
:root {
  --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* ===== THEME VARIABLES ===== */
:root[data-theme="dark"] {
  --bg: #050507;
  --surface: #0f0f0f;
  --card: #141414;
  --card-bg: rgba(20,20,20,0.6);
  --card-border: rgba(255,255,255,0.10);
  --card-border-hover: rgba(255,255,255,0.25);
  --nav-bg: rgba(10,10,10,0.85);
  --nav-border: rgba(255,255,255,0.08);
  --teal: #e4e4e7;
  --text: #ffffff;
  --muted: #cbd5e6;
  --sky: #e2e8f0;
  --sky2: #d1d5db;
  --stat-bar-bg: rgba(10,10,10,0.8);
  --stat-border: rgba(255,255,255,0.06);
  --section-alt: rgba(255,255,255,0.02);
  --profile-card-bg: #111111;
  --profile-card-border: rgba(255,255,255,0.15);
  --profile-stat-bg: rgba(0,0,0,0.4);
  --profile-stat-border: rgba(255,255,255,0.15);
  --contact-bg: linear-gradient(135deg, rgba(5,5,7,0.8) 0%, rgba(30,30,40,0.6) 100%);
  --footer-bg: #030303;
  --footer-text: #cbd5e6;
  --tag-bg: rgba(255,255,255,0.07);
  --tag-color: #e2e8f0;
  --tag-border: rgba(255,255,255,0.14);
  --timeline-border: rgba(255,255,255,0.08);
  --toggle-bg: #1e1e2e;
  --toggle-border: rgba(255,255,255,0.2);
  --toggle-icon-color: #e2e8f0;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --btn-primary-bg: #ffffff;
  --btn-primary-color: #0a0a0a;
  --btn-teal-bg: #e4e4e7;
  --btn-teal-color: #0a0a0a;
}

:root[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --card: #ffffff;
  --card-bg: rgba(255,255,255,0.85);
  --card-border: rgba(0,0,0,0.10);
  --card-border-hover: rgba(0,0,0,0.25);
  --nav-bg: rgba(245,245,247,0.92);
  --nav-border: rgba(0,0,0,0.08);
  --teal: #374151;
  --text: #111827;
  --muted: #374151;
  --sky: #4b5563;
  --sky2: #6b7280;
  --stat-bar-bg: rgba(255,255,255,0.9);
  --stat-border: rgba(0,0,0,0.07);
  --section-alt: rgba(0,0,0,0.02);
  --profile-card-bg: #ffffff;
  --profile-card-border: rgba(0,0,0,0.12);
  --profile-stat-bg: rgba(0,0,0,0.04);
  --profile-stat-border: rgba(0,0,0,0.10);
  --contact-bg: linear-gradient(135deg, #f0f0f5 0%, #e8eaf0 100%);
  --footer-bg: #1f2937;
  --footer-text: #9ca3af;
  --tag-bg: rgba(0,0,0,0.06);
  --tag-color: #374151;
  --tag-border: rgba(0,0,0,0.12);
  --timeline-border: rgba(0,0,0,0.08);
  --toggle-bg: #e5e7eb;
  --toggle-border: rgba(0,0,0,0.15);
  --toggle-icon-color: #374151;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
  --btn-primary-bg: #111827;
  --btn-primary-color: #ffffff;
  --btn-teal-bg: #374151;
  --btn-teal-color: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  position: relative;
  width: 52px; height: 28px;
  background: var(--toggle-bg);
  border: 1.5px solid var(--toggle-border);
  border-radius: 999px;
  cursor: pointer;
  display: flex; align-items: center;
  padding: 3px;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--text); }
.toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s cubic-bezier(.23,1.15,.32,1), background 0.3s;
  font-size: 11px; line-height: 1; color: var(--bg); flex-shrink: 0;
}
[data-theme="light"] .toggle-thumb { transform: translateX(24px); }
.toggle-icons {
  position: absolute; inset: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 6px; pointer-events: none;
}
.toggle-icons span { font-size: 10px; opacity: 0.5; color: var(--toggle-icon-color); transition: opacity 0.3s; }
[data-theme="dark"] .toggle-icons span:first-child { opacity: 0.2; }
[data-theme="dark"] .toggle-icons span:last-child { opacity: 0.9; }
[data-theme="light"] .toggle-icons span:first-child { opacity: 0.9; }
[data-theme="light"] .toggle-icons span:last-child { opacity: 0.2; }

/* ===== MOUSE GLOW ===== */
#mouse-glow {
  position: fixed; top: 0; left: 0;
  width: 800px; height: 800px; border-radius: 50%;
  pointer-events: none; z-index: 1;
  transform: translate(-50%,-50%);
  will-change: transform; transition: opacity 0.4s ease;
}
[data-theme="dark"] #mouse-glow {
  background: radial-gradient(circle, rgba(20,184,166,0.07) 0%, rgba(99,102,241,0.04) 30%, transparent 60%);
}
[data-theme="light"] #mouse-glow {
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, rgba(14,165,233,0.05) 30%, transparent 60%);
}

/* ===== BACKGROUND ORBS ===== */
.bg-orb {
  position: fixed; border-radius: 50%; filter: blur(90px);
  z-index: 0; pointer-events: none;
  animation: floatOrb 20s infinite ease-in-out alternate;
}
[data-theme="dark"] .orb-1 { width:500px;height:500px;background:rgba(14,165,233,0.12);top:-10%;left:-10%;animation-duration:25s;opacity:0.6; }
[data-theme="dark"] .orb-2 { width:600px;height:600px;background:rgba(139,92,246,0.12);bottom:-20%;right:-10%;animation-duration:32s;animation-delay:-5s;opacity:0.6; }
[data-theme="dark"] .orb-3 { width:400px;height:400px;background:rgba(20,184,166,0.1);top:30%;left:50%;animation-duration:28s;animation-delay:-12s;opacity:0.6; }
[data-theme="light"] .orb-1 { width:500px;height:500px;background:rgba(99,102,241,0.07);top:-10%;left:-10%;animation-duration:25s;opacity:1; }
[data-theme="light"] .orb-2 { width:600px;height:600px;background:rgba(139,92,246,0.06);bottom:-20%;right:-10%;animation-duration:32s;animation-delay:-5s;opacity:1; }
[data-theme="light"] .orb-3 { width:400px;height:400px;background:rgba(14,165,233,0.07);top:30%;left:50%;animation-duration:28s;animation-delay:-12s;opacity:1; }
@keyframes floatOrb {
  0%   { transform:translate(0,0) scale(1) rotate(0deg); }
  33%  { transform:translate(80px,60px) scale(1.1) rotate(15deg); }
  66%  { transform:translate(-40px,120px) scale(0.9) rotate(-10deg); }
  100% { transform:translate(-80px,-40px) scale(1.05) rotate(5deg); }
}

/* ===== NAV ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 52px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  gap: 20px;
  transition: background 0.4s, border-color 0.4s;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 900;
  color: var(--text); text-decoration: none; letter-spacing: -0.5px;
  transition: color 0.3s;
}
.nav-logo .dot { color: var(--teal); margin: 0 1px; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--sky); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 16px; }
section { position: relative; z-index: 2; }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 52px 80px;
}
.hero-container {
  max-width: 1200px;
  display: flex; align-items: center;
  gap: 80px; flex-wrap: wrap; justify-content: center;
}
.profile-3d-wrap { perspective: 1200px; flex-shrink: 0; z-index: 10; }
.profile-3d-card {
  width: 340px;
  background: var(--profile-card-bg);
  border-radius: 32px; padding: 36px 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  transform-style: preserve-3d;
  border: 1px solid var(--profile-card-border);
  text-align: center; position: relative; will-change: transform;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.profile-3d-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
[data-theme="light"] .profile-3d-card::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.6), transparent 60%);
}
.profile-avatar-box {
  width: 188px; height: 188px; border-radius: 50%;
  border: 3px solid var(--teal);
  box-shadow: 0 0 0 6px rgba(0,0,0,0.05), 0 15px 35px rgba(0,0,0,0.2);
  margin: 0 auto 20px; overflow: hidden;
  transform: translateZ(60px);
  background: #1e1e1e; transition: border-color 0.3s;
}
.profile-avatar-box img { width:100%;height:100%;object-fit:cover; }
.profile-name-card {
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  margin-bottom: 6px; transform: translateZ(40px); transition: color 0.3s;
}
.profile-role-card {
  font-size: 0.85rem; color: var(--text); font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 14px; transform: translateZ(30px); transition: color 0.3s;
}
.profile-location {
  font-size: 0.8rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transform: translateZ(20px); transition: color 0.3s;
}
.profile-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--card-border-hover), transparent);
  margin: 18px 0; opacity: 0.5; transform: translateZ(10px);
  transition: background 0.3s;
}
.profile-stat-row {
  display: flex; justify-content: space-around;
  margin-top: 10px; transform: translateZ(50px);
  background: var(--profile-stat-bg);
  padding: 15px 5px; border-radius: 16px;
  border: 1px solid var(--profile-stat-border);
  transition: background 0.3s, border-color 0.3s;
}
.p-stat { text-align: center; }
.p-stat-num {
  font-family: var(--font-mono), monospace; font-size: 1.5rem;
  font-weight: 900; color: var(--text) !important;
  transition: color 0.3s;
}
.p-stat-label {
  font-size: 0.68rem; color: var(--muted) !important;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
  transition: color 0.3s;
}
.hero-inner { flex: 1; max-width: 600px; }
.hero-tag {
  display: inline-block; font-family: var(--font-mono), monospace;
  font-size: 0.68rem; color: var(--teal);
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 16px; border: 1.5px solid var(--card-border);
  border-radius: 30px; margin-bottom: 22px;
  background: var(--card-bg);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -1.5px; color: var(--text); margin-bottom: 10px;
  transition: color 0.3s;
}
.hero-name .accent { color: var(--teal); }
.hero-title {
  font-family: var(--font-mono), monospace; font-size: 0.82rem;
  color: var(--sky); margin-bottom: 18px; letter-spacing: 0.3px;
  transition: color 0.3s;
}
.hero-desc {
  font-size: 1rem; color: var(--muted);
  line-height: 1.75; margin-bottom: 36px; font-weight: 300;
  transition: color 0.3s;
}
.hero-links { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 40px;
  font-size: 0.83rem; font-weight: 600; text-decoration: none;
  transition: all 0.28s cubic-bezier(.23,1.15,.32,1);
  font-family: var(--font-sans);
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-color); box-shadow: 0 4px 18px rgba(0,0,0,0.15); transition: background 0.3s, color 0.3s, transform 0.28s, box-shadow 0.28s; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.btn-teal { background: var(--btn-teal-bg); color: var(--btn-teal-color); box-shadow: 0 4px 18px rgba(0,0,0,0.1); transition: background 0.3s, color 0.3s, transform 0.28s, box-shadow 0.28s; }
.btn-teal:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--card-border); transition: border-color 0.3s, color 0.3s, transform 0.28s, box-shadow 0.28s; }
.btn-outline:hover { border-color: var(--text); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex; justify-content: center;
  background: var(--stat-bar-bg);
  backdrop-filter: blur(10px);
  flex-wrap: wrap; overflow: hidden;
  border-top: 1px solid var(--stat-border);
  border-bottom: 1px solid var(--stat-border);
  transition: background 0.4s, border-color 0.4s;
}
.stat { text-align: center; padding: 36px 48px; flex: 1; min-width: 140px; border-right: 1px solid var(--stat-border); transition: background 0.3s, border-color 0.4s; }
.stat:hover { background: var(--section-alt); }
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-serif);
  font-size: 2.8rem; font-weight: 900;
  color: var(--text) !important; line-height: 1;
  transition: color 0.3s;
}
.stat-label { font-size: 0.75rem; color: var(--muted) !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-top: 10px; transition: color 0.3s; }

/* ===== SECTIONS ===== */
.section-wrap { max-width: 1200px; margin: 0 auto; padding: 90px 52px; }
.section-label { font-family: var(--font-mono), monospace; font-size: 0.68rem; color: var(--teal); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 10px; transition: color 0.3s; }
.section-title { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -1px; color: var(--text); margin-bottom: 52px; transition: color 0.3s; }
.section-title span { color: var(--teal); }
.alt { background: var(--section-alt); transition: background 0.4s; }

/* ===== TABS ===== */
.tab-nav { display: flex; gap: 6px; margin-bottom: 40px; border-bottom: 2px solid var(--card-border); flex-wrap: wrap; transition: border-color 0.3s; }
.tab-btn {
  padding: 10px 22px; background: none; border: none;
  color: var(--sky); font-family: var(--font-sans);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  transition: all 0.2s; border-radius: 6px 6px 0 0;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); background: var(--section-alt); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--section-alt); }
.tab-content { display: none; }
.tab-content.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* ===== PROJECT CARDS ===== */
.project-card {
  background: var(--card-bg);
  backdrop-filter: blur(5px);
  border: 1px solid var(--card-border);
  border-radius: 20px; padding: 18px;
  transition: transform 0.35s cubic-bezier(.23,1.15,.32,1), box-shadow 0.35s, border-color 0.3s, background 0.4s;
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  cursor: pointer; text-align: left;
  font-family: var(--font-sans);
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--text), var(--teal));
  opacity: 0; transition: opacity 0.3s;
}
.project-card:hover { transform: translateY(-10px) scale(1.01); box-shadow: 0 28px 56px rgba(0,0,0,0.2); border-color: var(--card-border-hover); }
.project-card:hover::before { opacity: 1; }

.project-cover {
  position: relative; width: 100%; aspect-ratio: 16/10;
  border-radius: 14px; overflow: hidden; margin-bottom: 16px;
  background: var(--card-border);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.23,1.15,.32,1); }
.project-card:hover .project-cover img { transform: scale(1.06); }
.project-cover .cover-gen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  color: #fff; padding: 8% 10%; box-sizing: border-box; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.project-cover .cover-gen__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; line-height: 1.3; }

.project-type {
  display: inline-block; font-family: var(--font-mono), monospace;
  font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 12px; font-weight: 500;
}
.type-app      { background: rgba(14,165,233,0.15); color: #38bdf8; border: 1px solid rgba(14,165,233,0.4); }
.type-admin     { background: rgba(139,92,246,0.15); color: #a855f7; border: 1px solid rgba(139,92,246,0.4); }
.type-dashboard { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.4); }
.type-miniapp  { background: rgba(212,175,55,0.16);  color: #e6c067; border: 1px solid rgba(212,175,55,0.45); }
[data-theme="light"] .type-app      { color: #0369a1; background: rgba(14,165,233,0.12); }
[data-theme="light"] .type-admin     { color: #7c3aed; background: rgba(139,92,246,0.12); }
[data-theme="light"] .type-dashboard { color: #15803d; background: rgba(34,197,94,0.12); }
[data-theme="light"] .type-miniapp  { color: #a9852b; background: rgba(212,175,55,0.14); }

.project-title { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 700; color: var(--text); margin-bottom: 8px; transition: color 0.3s; }
.project-desc { font-size: 0.82rem; color: var(--sky); line-height: 1.6; margin-bottom: 14px; transition: color 0.3s; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono), monospace; font-size: 0.6rem; padding: 3px 10px; border-radius: 20px; background: var(--tag-bg); color: var(--tag-color); border: 1px solid var(--tag-border); transition: background 0.3s, color 0.3s, border-color 0.3s; }

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.skill-group {
  background: var(--card-bg); backdrop-filter: blur(5px);
  border: 1px solid var(--card-border); border-radius: 20px; padding: 24px 22px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(.23,1.15,.32,1), background 0.4s, border-color 0.4s;
  position: relative; overflow: hidden;
}
.skill-group::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.skill-group:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 48px rgba(0,0,0,0.2); border-color: var(--card-border-hover); }
.skill-group:hover::after { opacity: 1; }
.skill-group-title {
  font-family: var(--font-mono), monospace; font-size: 0.68rem;
  color: var(--text); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 14px; font-weight: 500; transition: color 0.3s;
}
.skill-list { list-style: none; }
.skill-list li { font-size: 0.85rem; color: var(--sky); padding: 6px 0; border-bottom: 1px solid var(--card-border); font-weight: 400; transition: color 0.3s, border-color 0.3s; }
.skill-list li:last-child { border-bottom: none; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--timeline-border); position: relative; transition: transform 0.3s, border-color 0.4s; }
.timeline-item:hover { transform: translateX(10px); }
.timeline-item:last-child { border-bottom: none; }
.timeline-left { width: 200px; flex-shrink: 0; }
.timeline-period { font-family: var(--font-mono), monospace; font-size: 0.68rem; color: var(--text); letter-spacing: 0.5px; font-weight: 500; margin-bottom: 6px; transition: color 0.3s; }
.timeline-company { font-size: 0.82rem; color: var(--muted); font-weight: 500; transition: color 0.3s; }
.timeline-right { flex: 1; }
.timeline-role { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 12px; transition: color 0.3s; }
.timeline-points { list-style: none; }
.timeline-points li { font-size: 0.85rem; color: var(--sky); padding: 4px 0 4px 18px; position: relative; line-height: 1.6; transition: color 0.3s; }
.timeline-points li::before { content: '›'; position: absolute; left: 0; color: var(--text); font-size: 1rem; font-weight: 700; }

/* ===== CONTACT ===== */
#contact { background: var(--contact-bg); transition: background 0.4s; }
.contact-inner { text-align: center; }
.contact-inner .section-label { display: inline-block; }
.contact-inner .section-title { text-align: center; }
.contact-desc { max-width: 560px; margin: 0 auto 36px; color: var(--sky); font-size: 1rem; line-height: 1.75; transition: color 0.3s; }
.contact-inner .hero-links { justify-content: center; }

/* 联系我：微信入口，鼠标移入（或键盘聚焦）浮出二维码 + 微信号 */
.contact-wechat { position: relative; display: inline-flex; align-items: center; cursor: pointer; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(34,197,94,0.45); background: rgba(34,197,94,0.15); color: #4ade80; font: inherit; font-size: 14px; transition: background .25s ease; }
.contact-wechat:hover, .contact-wechat:focus { background: rgba(34,197,94,0.28); outline: none; }
.contact-wechat__pop { position: absolute; bottom: calc(100% + 12px); left: 50%; opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-50%) translateY(6px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--card); border: 1px solid rgba(128,128,128,0.3); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.28); transition: all .25s ease; z-index: 20; }
.contact-wechat:hover .contact-wechat__pop, .contact-wechat:focus .contact-wechat__pop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.contact-wechat__qr { width: 140px; height: 140px; border-radius: 10px; display: block; background: #fff; object-fit: contain; }
.contact-wechat__id { font-size: 13px; color: var(--text); white-space: nowrap; }

/* ===== FOOTER ===== */
footer { background: var(--footer-bg); color: var(--footer-text); text-align: center; padding: 28px; font-size: 0.78rem; font-family: var(--font-mono), monospace; letter-spacing: 0.5px; transition: background 0.4s, color 0.4s; }
footer a { color: #9ca3af; text-decoration: none; transition: 0.2s; }
footer a:hover { color: #ffffff; text-decoration: underline; }

/* ===== PROJECT MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.62); backdrop-filter: blur(8px); }
.modal__card {
  position: relative; z-index: 1; width: min(1080px, 100%);
  max-height: 92vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--card-border); border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.modal__card::-webkit-scrollbar { width: 8px; }
.modal__card::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 8px; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--surface); color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer; transition: all 0.2s;
}
.modal__close:hover { border-color: var(--text); transform: rotate(90deg); }
#modalBody { padding: 0; }
/* 弹窗内的查看器：外层弹窗已经是卡片，内层 viewer 不再重复画边框/圆角，避免「两张卡」叠在一起 */
#modalBody .viewer__card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
/* 查看器顶栏右侧留出弹窗关闭键（×）的位置，让全屏按钮排在它左边，不再重叠 */
#modalBody .viewer:not(:fullscreen) .viewer__bar { padding-right: 72px; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.82rem; }
  #hero { padding: 100px 20px 60px; }
  .hero-container { gap: 36px; }
  .section-wrap { padding: 60px 24px; }
  .stat { padding: 28px 20px; }
  .timeline-item { flex-direction: column; gap: 8px; }
  .timeline-item:hover { transform: none; }
  .timeline-left { width: 100%; }
  .profile-3d-card { width: 320px; padding: 32px 20px; }
  .profile-avatar-box { width: 160px; height: 160px; }
  #mouse-glow { display: none; }
  .bg-orb { display: none; }
}

/* ============================================================
 * 演示查看器（viewer.js）· 用 ram-clef 主题变量重写，确保截图查看器正常
 * ============================================================ */
.viewer { position: relative; background: transparent; }
.viewer__card {
  background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,.04) 0%, var(--bg) 70%);
  border: 1px solid var(--card-border); border-radius: 24px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--card-border); min-height: 56px; position: relative; z-index: 3; }
.viewer__bar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.viewer__toc, .viewer__fs, .viewer__close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; flex: 0 0 auto; }
.viewer__toc:hover, .viewer__fs:hover, .viewer__close:hover { border-color: var(--text); }
.viewer__toc svg, .viewer__fs svg, .viewer__close svg { width: 16px; height: 16px; overflow: visible; }
.viewer__caption { font-size: 14px; color: var(--muted); text-align: center; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__fs { display: inline-flex; }
.viewer__close { display: none; }
.viewer__stage { position: relative; min-height: 460px; padding: 40px; display: flex; align-items: center; justify-content: center; background: transparent; overflow: hidden; }
.viewer__stage.is-loading::after { content: "图片加载中…"; position: absolute; color: var(--muted); font-size: 14px; }
.frame--tv { width: min(900px, 100%); padding: 14px; border-radius: 16px; background: #07090f; box-shadow: 0 16px 32px rgba(0,0,0,.22), 0 4px 10px rgba(0,0,0,.10); position: relative; margin-bottom: 56px; }
.frame--tv .frame__scroll { border-radius: 4px; background: #0f1320; }
.frame--tv::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -28px; width: 90px; height: 28px; background: linear-gradient(180deg, #2b2f3b, #15181f); }
.frame--tv::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -38px; width: 230px; height: 12px; background: #1b1e28; border-radius: 6px; box-shadow: 0 14px 24px rgba(0,0,0,.32); }
.frame--phone { width: 300px; padding: 12px; border-radius: 44px; background: #111; box-shadow: 0 14px 28px rgba(0,0,0,.20), 0 3px 8px rgba(0,0,0,.10), inset 0 0 0 2px #2a2a2e; position: relative; }
.frame--phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 100px; height: 24px; background: #000; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); z-index: 3; }
.frame--phone .frame__scroll { border-radius: 32px; aspect-ratio: 390 / 844; }
.frame__scroll { background: #fff; border-radius: inherit; overflow: hidden; }
.frame--phone .frame__scroll { background: #000; }
.frame--tv .frame__scroll { background: #0f1320; aspect-ratio: 16 / 10; }
.frame__scroll img { width: 100%; height: auto; display: block; will-change: transform; }
.frame__scroll { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.frame__scroll::-webkit-scrollbar { display: none; }
.frame__scroll.is-panning { overflow: hidden; }
.frame__anim { position: relative; width: 100%; height: auto; display: block; overflow: hidden; }
.frame__anim > img { position: relative; z-index: 1; }
.frame__anim > .frame__next { position: absolute; inset: 0; margin: auto; z-index: 2; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; transition: opacity .28s linear; }
.frame__anim > .frame__next.is-show { opacity: 1 !important; }
.viewer__toc-popup { position: fixed; inset: 0; z-index: 100; background: transparent; display: block; }
.viewer__toc-popup[hidden] { display: none; }
.viewer__toc-box[hidden] { display: none; }
.viewer__toc-box { position: absolute; background: var(--surface); border: 1px solid var(--card-border); border-radius: 22px; box-shadow: var(--shadow-card); width: min(320px, calc(100% - 24px)); max-height: min(520px, calc(100vh - 120px)); overflow: hidden; display: flex; flex-direction: column; z-index: 101; }
.viewer__toc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--card-border); font-size: 14px; font-weight: 600; color: var(--text); }
.viewer__toc-head button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--card-border); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.viewer__toc-list { list-style: none; margin: 0; padding: 12px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.viewer__toc-list::-webkit-scrollbar { display: none; }
.viewer__toc-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.viewer__toc-list li:hover { background: var(--section-alt); color: var(--text); }
.viewer__toc-list li.is-active { background: var(--section-alt); color: var(--text); font-weight: 600; }
.viewer__toc-list .toc-no { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 22px; }
.viewer__toc-list li.is-active .toc-no { color: var(--text); }
.viewer__zoombar { display: none; position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 100; gap: 6px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 4px; backdrop-filter: blur(10px); }
.viewer__zoombar button { width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s, transform .2s; }
.viewer__zoombar button:hover { background: rgba(255,255,255,.28); transform: scale(1.05); }
.viewer__zoombar button:active { transform: scale(.95); }
.viewer__zoombar svg { width: 18px; height: 18px; }
.viewer__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 58px; height: 58px; border-radius: 50%; border: none; background: rgba(255,255,255,.85); color: #111; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: background .2s, transform .2s, opacity .2s; }
.viewer__arrow--prev { left: 24px; }
.viewer__arrow--next { right: 24px; }
.viewer__arrow:hover:not(:disabled) { background: #fff; transform: translateY(-50%) scale(1.08); }
.viewer__arrow:disabled { opacity: 0; pointer-events: none; }
.viewer__nav { display: flex; align-items: center; justify-content: center; padding: 16px 0 20px; background: transparent; }
.viewer__ind { font-size: 13px; color: var(--muted); min-width: 56px; text-align: center; }
.viewer__dots { display: flex; gap: 7px; }
.viewer__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--card-border); transition: background .2s; }
.viewer__dots i.is-active { background: var(--text); width: 18px; border-radius: 4px; }
.viewer:fullscreen { width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; background: #000; border: none; box-shadow: none; }
.viewer:fullscreen .viewer__card { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #000; border: none; border-radius: 0; box-shadow: none; overflow: visible; }
.viewer:fullscreen .viewer__bar { border-bottom: none; background: transparent; position: absolute; top: 0; left: 0; right: 0; padding: 16px; min-height: 0; z-index: 20; }
.viewer:fullscreen .viewer__fs { display: none; }
.viewer:fullscreen .viewer__toc, .viewer:fullscreen .viewer__close { display: inline-flex; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); position: relative; z-index: 2; }
.viewer:fullscreen .viewer__toc:hover, .viewer:fullscreen .viewer__close:hover { background: rgba(255,255,255,.22); }
.viewer:fullscreen .viewer__caption { display: block; color: rgba(255,255,255,.82); font-size: 14px; text-align: center; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 150px); }
.viewer:fullscreen .viewer__stage { flex: 1; min-height: 0; padding: 0; background: #000; cursor: grab; }
.viewer:fullscreen .viewer__stage:active { cursor: grabbing; }
.viewer:fullscreen .frame--tv, .viewer:fullscreen .frame--phone { margin-bottom: 0; padding: 0; background: transparent; box-shadow: none; border: none; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer:fullscreen .frame--tv::before, .viewer:fullscreen .frame--tv::after, .viewer:fullscreen .frame--phone::before { display: none; }
.viewer:fullscreen .frame--tv .frame__scroll, .viewer:fullscreen .frame--phone .frame__scroll { background: transparent; border-radius: 0; width: 100%; }
.viewer:fullscreen .frame__scroll img, .viewer:fullscreen .frame__scroll .frame__next { width: var(--fs-w, 100%); max-width: none; height: auto; object-fit: initial; margin: 0 auto; display: block; flex: none; }
.viewer:fullscreen .frame__scroll { max-height: calc(100vh - 100px); overflow-y: auto; display: flex; align-items: center; justify-content: center; scrollbar-width: none; -ms-overflow-style: none; }
.viewer:fullscreen .frame__scroll.is-long { align-items: flex-start; }   /* 仅长图顶部对齐+可滚动；普通图(PC/可视化)居中 */
.viewer:fullscreen .frame__scroll::-webkit-scrollbar { display: none; }
.viewer:fullscreen .frame--phone { --fs-w: min(96vw, calc(96vh * 390 / 844)); }
.viewer:fullscreen .frame--tv { --fs-w: min(calc(100vw - 220px), calc((100vh - 200px) * 16 / 10)); }
.viewer:fullscreen .frame__scroll.is-panning { overflow: hidden; }
.viewer:fullscreen .frame__scroll.is-long.is-panning img { transform-origin: center top; }   /* 长图放大以顶部为锚点，避免内容下移；普通图保持中心缩放 */
.viewer:fullscreen .frame__anim { width: 100%; height: auto; display: flex; align-items: flex-start; justify-content: center; }
.viewer:fullscreen .frame__scroll img { transform-origin: center center; }
.viewer:fullscreen .viewer__nav { display: none; }
.viewer:fullscreen .viewer__zoombar { display: flex; }
