/* ===== 基础变量 (Brittany Chiang 风格) ===== */
:root {
  --bg: #0a192f;          /* 深蓝黑背景 */
  --bg-light: #112240;    /* 卡片/次级背景 */
  --bg-lightest: #233554; /* 更深一级背景 */
  --text-main: #ccd6f6;   /* 主文字(浅灰白) */
  --text-secondary: #8892b0; /* 次级文字(柔和灰) */
  --accent: #64ffda;      /* 强调色(青绿) */
  --font-sans: 'Calibre', 'Inter', 'San Francisco', 'SF Pro Text', -apple-system, system-ui, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --navy-shadow: rgba(2, 12, 27, 0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 鼠标跟随光点(桌面端) */
.cursor-dot {
  position: fixed;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(100, 255, 218, 0.08);
  border: 1px solid rgba(100, 255, 218, 0.25);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
}
.cursor-dot.is-active {
  width: 60px;
  height: 60px;
  background: rgba(100, 255, 218, 0.15);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ===== 版式容器 ===== */
.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  width: 320px;
  flex-shrink: 0;
  min-height: 100vh;
  padding: 100px 50px 50px 40px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.main {
  flex: 1;
  padding: 100px 30px 80px 90px;
  max-width: 760px;
}

/* ===== 侧边栏 ===== */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 60px;
}
.brand-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 1px;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.brand-name:hover { color: var(--accent); }

.brand-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.brand-title div { display: block; }

.side-nav { list-style: none; margin-bottom: 40px; width: 100%; }

.side-nav li { margin-bottom: 18px; }

.side-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 18px;
  transition: color 0.25s, transform 0.25s;
  padding: 4px 0;
}
.side-nav a .nav-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--text-secondary);
  opacity: 0.5;
  transition: width 0.25s, background 0.25s, opacity 0.25s;
}
.side-nav a:hover,
.side-nav a.is-active {
  color: var(--accent);
  transform: translateX(4px);
}
.side-nav a:hover .nav-line,
.side-nav a.is-active .nav-line {
  width: 56px;
  background: var(--accent);
  opacity: 1;
}

/* ===== Hero ===== */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.6rem;
  transition: background 0.25s, color 0.25s;
  cursor: pointer;
}
.btn:hover { background: rgba(100, 255, 218, 0.1); }

/* ===== 分区标题 ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 100px 0 50px;
  white-space: nowrap;
}
.section-title .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
}
.section-title h2 {
  font-size: 1.7rem;
  color: var(--text-main);
  font-weight: 600;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-lightest);
  margin-left: 10px;
}

/* ===== 关于 / 合并后的 Hero+简介 ===== */
.hero-combined .eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.hero-combined h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}
.hero-combined h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-secondary);
  margin: 10px 0 36px;
}
.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.about-text strong { color: var(--accent); }
.hero-combined .btn { margin-top: 20px; }

/* ===== 技能 ===== */
.skills-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
.skill-category {
  background: var(--bg-light);
  border-radius: 6px;
  padding: 24px;
  transition: background 0.25s, transform 0.25s;
}
.skill-category:hover {
  background: var(--bg-lightest);
  transform: translateY(-4px);
}
.skill-category h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}
.skill-category p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: justify;
  text-justify: inter-ideograph;
}
/* 严格两端对齐：允许在英文单词内部断行，缩小行尾空隙 */
.skill-justify-strict {
  text-justify: inter-ideograph;
}
/* AI工具卡片：点击展开 */
.skill-toggle {
  cursor: pointer;
  user-select: none;
  grid-column: span 3;
}
@media (max-width: 768px) {
  .skill-toggle { grid-column: span 1; }
}
.skill-toggle-head { display: flex; align-items: center; justify-content: space-between; }
.skill-arrow { position: relative; width: 14px; height: 14px; flex: 0 0 14px; }
.skill-arrow::before,
.skill-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--accent);
  transition: transform 0.25s ease;
}
.skill-arrow::before { width: 14px; height: 1.5px; transform: translate(-50%, -50%); }
.skill-arrow::after { width: 1.5px; height: 14px; transform: translate(-50%, -50%); }
.skill-toggle[aria-expanded="true"] .skill-arrow::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.skill-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
.skill-toggle[aria-expanded="true"] .skill-details { max-height: 1200px; opacity: 1; margin-top: 14px; }
.skill-summary {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-top: 4px;
}
.skill-hint {
  white-space: nowrap;
}

/* 视频弹窗 */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.video-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.video-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  cursor: pointer;
}
.video-modal-content {
  position: relative;
  width: 50%;
  max-width: 900px;
  background: var(--bg-light);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.video-modal-content video {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}
.video-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
@media (max-width: 768px) {
  .video-modal-content { width: 88%; }
  .video-close { top: -32px; font-size: 1.5rem; }
}

.skill-detail-block {
  padding: 14px 0;
  border-top: 1px solid rgba(100, 255, 218, 0.12);
}

.skill-detail-item {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.skill-link {
  display: block;
  width: fit-content;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.skill-note {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ===== 经历 (Brittany Chiang 风格，可点击展开) ===== */
.experience-group { margin-bottom: 56px; }
.experience-group-title {
  font-size: 1.1rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-lightest);
}
.experience-list { margin-top: 10px; }
.experience-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  margin-bottom: 16px;
  align-items: start;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 18px 16px;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  color: inherit;
}
.experience-row:hover {
  background: rgba(17, 34, 64, 0.6);
  transform: translateY(-2px);
}
/* 无展开内容的经历条目（教育经历）：不做可点击效果 */
.experience-row:not(:has(.experience-details)) {
  cursor: default;
  transition: none;
}
.experience-row:not(:has(.experience-details)):hover {
  background: transparent;
  transform: none;
}
.experience-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.experience-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-top: 4px;
}
.experience-main { width: 100%; }
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.experience-header h4,
.experience-header .company-name {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 600;
}
.experience-role-above {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.experience-roles {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.experience-role {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.experience-role-title {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}
.experience-role-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  padding-top: 2px;
}
.exp-arrow {
  font-size: 0.85rem;
  color: var(--accent);
  transition: transform 0.25s;
  flex-shrink: 0;
  margin-top: 2px;
}
.experience-degree {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 4px;
}
.experience-school {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 8px;
}
.experience-row[aria-expanded="true"] .exp-arrow {
  transform: rotate(180deg);
}
.experience-summary p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}
.experience-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}
.experience-row[aria-expanded="true"] .experience-details {
  max-height: 400px;
  opacity: 1;
}
.experience-details p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  padding-top: 12px;
}

/* ===== 作品卡片网格 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.project-card {
  background: var(--bg-light);
  border-radius: 6px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, background 0.25s;
}
.project-card:hover {
  transform: translateY(-6px);
  background: var(--bg-lightest);
}
.project-card h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 10px;
  font-weight: 600;
  transition: color 0.2s;
}
.project-card:hover h3 { color: var(--accent); }
.project-card .desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 22px;
  flex: 1;
}
.project-card .tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.project-card .tech span { position: relative; }
.project-card .tech span::after { content: ''; }

/* to be continued 占位卡片 */
.project-card.tbc-card {
  justify-content: center;
  align-items: center;
  min-height: 220px;
  cursor: default;
  background: transparent;
  border: 1px dashed rgba(100,255,218,0.25);
}
.project-card.tbc-card:hover {
  transform: none;
  background: rgba(100,255,218,0.04);
}
.project-card.tbc-card:hover h3 { color: inherit; }
.tbc-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tbc-line {
  width: 40px;
  height: 1px;
  background: rgba(100,255,218,0.35);
}
.tbc-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0.9;
  letter-spacing: 1.2px;
  margin: 0;
  text-transform: capitalize;
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 120px;
  text-align: center;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.footer a { color: var(--accent); }
.footer .heart { color: var(--accent); }

/* ===== 详情页 ===== */
.detail-hero {
  margin-bottom: 40px;
}
.detail-hero .back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 40px;
}
.detail-hero .back-link:hover { text-decoration: underline; }
.detail-hero .eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.detail-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-main);
}
.detail-hero .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 16px 0 24px;
  max-width: 620px;
}
.detail-hero .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-hero .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--bg-lightest);
  background: var(--bg-light);
  border-radius: 4px;
  padding: 6px 12px;
}

.detail-cover {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--bg-lightest);
  margin-bottom: 40px;
  display: block;
}

.detail-section {
  margin-bottom: 40px;
}
.detail-section h2 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 16px;
}
.detail-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.detail-section ul {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 20px;
  margin-bottom: 14px;
}
.detail-section li { margin-bottom: 8px; }
.detail-section strong { color: var(--text-main); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    position: static;
    padding: 40px 30px 10px;
    text-align: left;
  }
  .brand-title { margin-bottom: 20px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
  .side-nav li { margin-bottom: 0; }
  .social-links { margin-top: 10px; }
  .main { padding: 30px 24px 60px; max-width: 100%; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-list { grid-template-columns: 1fr; }
  .experience-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding: 16px 14px;
  }
  .experience-date { padding-top: 0; }
  .experience-group-title { margin-bottom: 18px; }
  .section-title { margin-top: 70px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
}

/* ===== 新版：方案A 2×2 紧凑封面卡片（pc2；旧版长卡片样式保留可回退） ===== */
.project-card.pc2 {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--bg-lightest);
}
.project-card.pc2 .pc2-pic {
  position: relative;
  height: 150px;
  flex: 0 0 150px;
  overflow: hidden;
  background: var(--bg-lightest);
}
.project-card.pc2 .pc2-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.project-card.pc2:hover .pc2-pic img { transform: scale(1.04); }
.project-card.pc2 .pc2-arrow {
  position: absolute;
  right: 12px;
  top: 10px;
  color: var(--accent);
  font-size: 1rem;
  background: rgba(10, 25, 47, 0.75);
  border-radius: 6px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.25s;
}
.project-card.pc2:hover .pc2-arrow { opacity: 1; }
.project-card.pc2 .pc2-body {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card.pc2 .pc2-body h3 { font-size: 1rem; margin-bottom: 8px; }
.project-card.pc2 .pc2-body .desc {
  font-size: 0.8rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card.pc2 .pc2-body .tech { margin-top: auto; font-size: 0.68rem; }
