/* ========== CSS 变量 ========== */
:root {
  --color-accent: #EF3212;
  --color-bg: #D9D9D9;
  --color-surface: #002E58;
  --color-text: #F2E2D5;
  --color-text-muted: rgba(242, 226, 213, 0.55);
  --color-border: rgba(242, 226, 213, 0.12);
  --color-tag-bg: rgba(242, 226, 213, 0.08);
  --max-width: 1560px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 160px;
  --space-xxl: 200px;
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 首页花纹背景（仅 hero 区域） */
.hero-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cdefs%3E%3Cpattern id='p' width='120' height='120' patternUnits='userSpaceOnUse'%3E%3Crect width='120' height='120' fill='none'/%3E%3C!-- 菱形网格 --%3E%3Cpolyline points='60,0 120,60 60,120 0,60 60,0' fill='none' stroke='%2306598F' stroke-width='0.7' opacity='0.35'/%3E%3Cpolyline points='60,20 100,60 60,100 20,60 60,20' fill='none' stroke='%2306598F' stroke-width='0.5' opacity='0.3'/%3E%3C!-- 十字交叉线 --%3E%3Cline x1='0' y1='60' x2='120' y2='60' stroke='%2306598F' stroke-width='0.5' opacity='0.25'/%3E%3Cline x1='60' y1='0' x2='60' y2='120' stroke='%2306598F' stroke-width='0.5' opacity='0.25'/%3E%3C!-- 四角弧线 --%3E%3Cpath d='M0 0 Q30 0 30 30' fill='none' stroke='%2306598F' stroke-width='0.7' opacity='0.35'/%3E%3Cpath d='M120 0 Q90 0 90 30' fill='none' stroke='%2306598F' stroke-width='0.7' opacity='0.35'/%3E%3Cpath d='M0 120 Q30 120 30 90' fill='none' stroke='%2306598F' stroke-width='0.7' opacity='0.35'/%3E%3Cpath d='M120 120 Q90 120 90 90' fill='none' stroke='%2306598F' stroke-width='0.7' opacity='0.35'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='120' height='120' fill='url(%23p)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul { list-style: none; }

/* ========== 容器 ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 72px;
}

/* ========== 白色内容栏（贯穿页面中央） ========== */
.page-content {
  max-width: var(--max-width);
  margin: 105px auto 0;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 105px);
  padding-bottom: 80px;
}

/* ========== 左侧竖排导航 ========== */
/* ========== 导航栏外层容器 ========== */
.side-nav-wrapper {
  position: fixed;
  left: calc(50% - var(--max-width) / 2);
  top: 105px;
  transform: translate(64px, 0);
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-nav-wrapper.revealed {
  transform: translate(calc(-100% + 64px), 0);
}

.side-nav-wrapper.revealed:hover {
  transform: translate(calc(-100% + 39px), 0);
}

.side-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  background: var(--color-accent);
  border-radius: 24px 0 0 24px;
  padding: 31px 65px 258px 24px;
}

.side-nav-logo {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 48px;
}

.tetrahedron {
  animation: tetraSpin 6s ease-in-out infinite;
  transform-origin: center center;
}

.side-nav-name {
  color: #002E58;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  max-width: 48px;
}

@keyframes tetraSpin {
  0%   { transform: rotateY(0deg) rotateX(10deg) rotateZ(0deg); }
  25%  { transform: rotateY(120deg) rotateX(-5deg) rotateZ(8deg); }
  50%  { transform: rotateY(240deg) rotateX(15deg) rotateZ(-5deg); }
  75%  { transform: rotateY(300deg) rotateX(-10deg) rotateZ(12deg); }
  100% { transform: rotateY(360deg) rotateX(10deg) rotateZ(0deg); }
}

.side-nav-name:hover {
  opacity: 0.7;
}

.side-nav-line {
  display: block;
  width: 1.5px;
  height: 32px;
  background: rgba(0, 46, 88, 0.3);
}

.side-nav-link {
  writing-mode: vertical-rl;
  font-size: 0.97rem;
  font-weight: 600;
  color: #F2E2D5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: opacity 0.2s ease;
}

.side-nav-link:hover,
.side-nav-link.active {
  opacity: 0.7;
}

.side-nav-block {
  display: block;
  width: 4px;
  height: 48px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-top: 4px;
}

/* ========== 导航栏下方装饰图形 ========== */
.side-nav-deco {
  position: absolute;
  top: calc(100% - 25px);
  left: 0;
  right: 0;
  height: 100px;
  background: #06598F;
  border-radius: 0 0 0 24px;
}

/* 滚动进度指示器 */
.scroll-indicator {
  position: absolute;
  right: -6px;
  top: 0;
  width: 8px;
  height: 8px;
  background: #F2E2D5;
  border-radius: 50%;
  z-index: 10;
  transition: top 0.15s ease-out;
  box-shadow: 0 0 0 3px rgba(242, 226, 213, 0.2);
}

/* ========== 右上角滚动 Logo ========== */
.scroll-logo {
  position: fixed;
  top: 85px;
  right: calc(50% - var(--max-width) / 2 + 72px);
  z-index: 10;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.scroll-logo.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-logo-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: block;
  transition: transform 0.2s ease;
}

.scroll-logo-btn:hover {
  transform: scale(1.1);
}

/* Work 弹出菜单 */
.work-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: var(--color-accent);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.work-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.work-menu-link {
  display: block;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #F2E2D5;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.work-menu-link:hover {
  background: rgba(0,0,0,0.15);
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 120px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 72px;
  width: 100%;
  text-align: center;
}

.hero-accent {
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  margin: 0 auto var(--space-lg);
}

.hero-title {
  font-family: 'Smiley Sans', var(--font-stack);
  font-size: clamp(3.8rem, 9vw, 7.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 5px;
  margin-bottom: var(--space-md);
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-50px);
}

.hero-title.animate-in {
  animation: heroReveal 1s ease forwards;
}

@keyframes heroReveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hero-title--muted {
  color: var(--color-text-muted);
  font-weight: 400;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: rgba(242, 226, 213, 0.5);
  font-weight: 400;
}

/* ========== 自我介绍 ========== */
.intro-section {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 80px;
  align-items: stretch;
}

.intro-text {
  font-size: 1.15rem;
  line-height: 2;
  color: var(--color-text);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-text p {
  margin-bottom: var(--space-md);
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.intro-divider {
  width: 2px;
  height: 100%;
  background: #06598F;
  border-radius: 1px;
  align-self: center;
  transform: translateX(70px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-ornament {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  padding: 4px;
  border-radius: 50%;
}

.intro-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-photo {
  width: 100%;
  max-width: 360px;
  border-radius: 12px;
  display: block;
}

/* ========== 通用区块 ========== */
.section {
  padding: 120px 0;
}

/* ========== 区块标题行 ========== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  min-width: 24px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  margin-left: var(--space-sm);
  align-self: center;
}

/* ========== 作品展示 ========== */
.project {
  margin-bottom: 100px;
}

.project:last-of-type {
  margin-bottom: 0;
}

/* ========== 作品分类 ========== */
.work-category {
  margin-bottom: 120px;
}

.work-category:last-child {
  margin-bottom: 0;
}

.work-category-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.work-category-line {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-lg);
}

.project-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0A385E 0%, #0D3F68 40%, #0B3A62 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.project-placeholder-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #AAA;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 2px;
  object-fit: contain;
}

.project-img {
  width: 100%;
  border-radius: 2px;
}

/* 作品信息区 */
.project-detail {
  margin-top: var(--space-md);
}

.project-detail-line {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-md);
}

.project-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr;
  gap: var(--space-md);
}

.project-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.project-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.project-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 100px;
  background: var(--color-tag-bg);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* ========== 简历 ========== */
.resume-block {
  margin-bottom: 100px;
}

.resume-block:last-child {
  margin-bottom: 0;
}

.resume-heading {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.resume-list li {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.resume-list li:first-child {
  padding-top: 0;
}

.resume-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.resume-period {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  min-width: 140px;
  padding-top: 2px;
}

.resume-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resume-title {
  font-weight: 600;
  font-size: 1rem;
}

.resume-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ========== 技能 ========== */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag--skill {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  padding: 6px 16px;
  font-size: 0.75rem;
}

/* ========== 作品展开详情 ========== */
.project-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-stack);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 100px;
  margin: var(--space-md) auto 0;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.project-toggle:hover {
  border-color: var(--color-accent);
  background: rgba(242, 226, 213, 0.05);
}

.project-toggle-icon {
  font-size: 1.1rem;
  transition: transform 0.35s ease;
}

.project.open .project-toggle-icon {
  transform: rotate(45deg);
}

.project-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project.open .project-expanded {
  max-height: 8000px;
}

.project-expanded-inner {
  padding-top: var(--space-lg);
}

.project-expanded-text {
  margin-top: var(--space-md);
}

/* ========== 作品幻灯片 ========== */
.project-slider {
  position: relative;
  overflow: visible;
  border-radius: 4px;
  width: 80%;
  text-align: left;
}

.project-slides {
  position: relative;
  min-height: 300px;
}

.project-slide {
  width: 100%;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-slide.active {
  display: block;
  opacity: 1;
}

.pdf-viewer {
  border: none;
  border-radius: 4px;
  display: block;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.slider-prev { left: 12px; }
.slider-next { right: 12px; }

.slider-dots {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  width: 33.33%;
  z-index: 2;
}

.slider-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
}

.slider-dot.active {
  background: #fff;
}

.project-expanded-text h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.project-expanded-text p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.design-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 80px;
  width: 60%;
}

.design-point h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.design-point p {
  font-size: 0.85rem;
}

/* ========== 横向滚动组件 ========== */
.hscroll-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.hscroll-track::-webkit-scrollbar {
  height: 6px;
}

.hscroll-track::-webkit-scrollbar-track {
  background: rgba(242, 226, 213, 0.05);
  border-radius: 3px;
}

.hscroll-track::-webkit-scrollbar-thumb {
  background: rgba(242, 226, 213, 0.2);
  border-radius: 3px;
}

.hscroll-img {
  flex-shrink: 0;
  width: calc((100% - 48px) / 5);
  scroll-snap-align: start;
  border-radius: 4px;
  height: auto;
}

/* ========== 用户画像卡片 ========== */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.persona-card {
  background: #06598F;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: var(--space-md);
}

.persona-card h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #F2E2D5;
  margin-bottom: 8px;
}

.persona-card p {
  font-size: 0.8rem;
  color: rgba(242, 226, 213, 0.7);
  line-height: 1.6;
}

/* ========== 联系 ========== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(242, 226, 213, 0.12);
  border: 1px solid rgba(242, 226, 213, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-lg) var(--space-md);
  background: rgba(242, 226, 213, 0.04);
  transition: background 0.25s ease;
}

a.contact-item:hover {
  background: rgba(242, 226, 213, 0.08);
}

.contact-icon {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-all;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

/* ========== 页脚 ========== */
.footer {
  padding: var(--space-md) 0 var(--space-lg);
  background: var(--color-bg);
  position: relative;
  z-index: 2;
}

.footer-line {
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin-bottom: var(--space-md);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.back-top {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.back-top:hover {
  color: var(--color-accent);
}

/* ========== 从右入场动画 ========== */
.slide-in {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide-in.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== 滚动渐显 ========== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero-inner {
    padding: 0 var(--space-md);
  }

  .hero {
    min-height: 90vh;
    padding-bottom: 80px;
  }

  .section {
    padding: 100px 0;
  }

  .section-head {
    margin-bottom: var(--space-lg);
  }

  .section-title {
    font-size: 1.5rem;
  }

  .project {
    margin-bottom: var(--space-xl);
  }

  .project-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .resume-list li {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .resume-period {
    min-width: auto;
  }

  .side-nav {
    display: none;
  }

  .scroll-logo {
    right: var(--space-sm);
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .intro-divider {
    width: 60%;
    height: 1px;
    min-height: unset;
    justify-self: center;
  }

  .intro-photo {
    max-width: 240px;
  }
}
