:root {
  --text: #1b1611;
  --muted: #6a5742;
  --accent: #a7482b;
  --gold: #a8873a;
  --cream: rgba(255, 252, 247, 0.94);
  --line: rgba(79, 57, 33, 0.14);
  --shadow: 0 24px 70px rgba(37, 24, 12, 0.16);
  --viewport-block: 100vh;
}

@supports (height: 100dvh) {
  :root {
    --viewport-block: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: var(--viewport-block);
  background:
    radial-gradient(circle at top right, rgba(215, 160, 92, 0.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(167, 72, 43, 0.16), transparent 34%),
    linear-gradient(135deg, #f4ecdf 0%, #f7f3ea 48%, #efe7da 100%);
  color: var(--text);
  font-family: 'Source Han Serif SC', 'Source Han Serif CN', serif;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.055'/%3E%3C/svg%3E");
  opacity: 0.45;
  z-index: 0;
}

a {
  color: inherit;
}

.backdrop-orbit {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

.backdrop-orbit-a {
  width: 360px;
  height: 360px;
  top: 8vh;
  right: -120px;
  background: radial-gradient(circle, rgba(167, 72, 43, 0.22), transparent 70%);
}

.backdrop-orbit-b {
  width: 440px;
  height: 440px;
  bottom: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(168, 135, 58, 0.18), transparent 68%);
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: var(--viewport-block);
  padding: 0;
}

.resume-container {
  width: 100%;
  min-height: var(--viewport-block);
}

.resume-story {
  display: grid;
  gap: 0;
}

.resume-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: var(--viewport-block);
  padding: clamp(36px, 5vw, 84px);
  background:
    radial-gradient(circle at top right, rgba(215, 160, 92, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(255, 248, 237, 0.98) 0%, rgba(245, 236, 222, 0.96) 100%);
}

.project-topline,
.chip-label,
.timeline-period,
.timeline-location,
.education-degree,
.nav-pill,
.hero-kicker {
  font-family: 'IBM Plex Mono', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chip-label {
  font-size: 11px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: clamp(28px, 3.5vw, 56px);
  align-items: center;
}

.hero-main {
  position: relative;
  padding: clamp(18px, 2vw, 28px) 0;
}

.hero-main::before {
  content: '';
  position: absolute;
  inset: auto auto 8% -5%;
  width: min(58vw, 760px);
  height: min(58vw, 760px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 247, 231, 0.72) 0%, rgba(255, 247, 231, 0.22) 48%, transparent 72%);
  filter: blur(12px);
  z-index: -1;
  pointer-events: none;
}

.hero-carousel,
.timeline-card,
.project-card,
.education-card,
.impact-card,
.skill-card {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.hero-kicker {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--accent);
}

.resume-name {
  margin: 0;
  font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', 'DFKai-SB', 'Source Han Serif SC', serif;
  font-size: clamp(58px, 8vw, 108px);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #1f1711 0%, #6f4a1f 36%, #bd9350 68%, #f1ddad 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 24px rgba(94, 63, 28, 0.06);
}

.resume-name-en {
  margin: 12px 0 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 2.6vw, 34px);
  color: var(--gold);
}

.resume-title {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.55;
  color: var(--muted);
}

.hero-side {
  display: grid;
  gap: 18px;
}

.hero-carousel {
  padding: 18px;
}

.carousel-stage {
  position: relative;
  height: clamp(320px, 34vw, 500px);
  min-height: 360px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(167, 72, 43, 0.08), rgba(168, 135, 58, 0.12));
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.45s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.carousel-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.carousel-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.carousel-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(73, 48, 24, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(106, 87, 66, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.contact-strip,
.tag-row,
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-strip {
  margin-top: 24px;
}

.contact-chip,
.tag,
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
}

.contact-chip {
  padding: 10px 14px;
  background: rgba(167, 72, 43, 0.08);
  text-decoration: none;
  color: var(--muted);
}

.contact-chip.is-link:hover,
.nav-pill:hover,
.carousel-arrow:hover {
  transform: translateY(-1px);
}

.chip-label {
  color: var(--accent);
}

.timeline-body h3,
.project-card h3,
.education-card h3,
.impact-card h3,
.skill-card h3 {
  margin: 10px 0 0;
  font-size: 26px;
  line-height: 1.22;
}

.nav-pill {
  padding: 10px 16px;
  border: 1px solid rgba(73, 48, 24, 0.12);
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.section-nav {
  margin-top: 2px;
}

.content-section {
  scroll-margin-top: 24px;
  padding: 56px clamp(40px, 6vw, 96px);
  border-top: 1px solid rgba(79, 57, 33, 0.12);
  background: rgba(255, 251, 245, 0.88);
}

.materials-section {
  background:
    radial-gradient(circle at top right, rgba(215, 160, 92, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 242, 0.96) 0%, rgba(250, 241, 229, 0.94) 100%);
}

.materials-layout {
  display: grid;
  gap: 24px;
}

.materials-header h2,
.materials-toolbar h3,
.materials-empty h4 {
  margin: 0;
}

.materials-kicker,
.materials-panel-label,
.practice-entry-meta,
.material-meta {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.materials-kicker,
.materials-panel-label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--accent);
}

.materials-copy,
.materials-toolbar p,
.practice-entry-summary,
.materials-empty p,
.materials-feedback {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.practice-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.practice-entry,
.materials-workspace,
.material-card {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.practice-entry {
  width: 100%;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-entry:hover,
.practice-entry.is-active {
  transform: translateY(-2px);
  border-color: rgba(167, 72, 43, 0.25);
  box-shadow: 0 28px 80px rgba(37, 24, 12, 0.18);
}

.practice-entry-title {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.practice-entry-summary {
  display: block;
  min-height: 58px;
}

.practice-entry-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--gold);
}

.practice-entry-meta strong {
  color: var(--accent);
}

.materials-workspace {
  padding: 28px;
}

.materials-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.materials-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.materials-upload-btn,
.material-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(73, 48, 24, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.materials-upload-btn:hover,
.material-action:hover {
  transform: translateY(-1px);
}

.materials-upload-btn {
  background: linear-gradient(135deg, rgba(167, 72, 43, 0.92), rgba(184, 135, 76, 0.92));
  color: #fff9f2;
  border-color: transparent;
}

.materials-upload-btn:disabled,
.material-action:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.materials-feedback {
  padding: 14px 16px;
  border-radius: 18px;
  margin-top: 18px;
}

.materials-feedback.is-success {
  background: rgba(168, 135, 58, 0.12);
  color: #6b4f18;
}

.materials-feedback.is-error {
  background: rgba(167, 72, 43, 0.1);
  color: #8d381f;
}

.materials-list-shell {
  margin-top: 22px;
}

.materials-empty {
  padding: 28px;
  border-radius: 24px;
  border: 1px dashed rgba(73, 48, 24, 0.16);
  background: rgba(255, 255, 255, 0.56);
}

.materials-list {
  display: grid;
  gap: 14px;
}

.material-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
}

.material-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  word-break: break-word;
}

.material-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--gold);
}

.material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.material-action.is-danger {
  color: #8d381f;
  border-color: rgba(167, 72, 43, 0.18);
}

.material-action.is-link {
  color: var(--text);
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.timeline-list,
.project-grid,
.education-grid,
.impact-grid,
.skills-grid {
  display: grid;
  gap: 18px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-period {
  font-size: 12px;
  color: var(--accent);
}

.timeline-location {
  font-size: 12px;
  color: var(--gold);
}

.timeline-role,
.education-major,
.education-period,
.education-notes,
.project-desc,
.impact-role,
.impact-period,
.impact-notes,
.bullet-list,
.skill-level {
  color: var(--muted);
}

.timeline-role,
.education-major,
.impact-role {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.75;
}

.bullet-list {
  margin: 16px 0 0;
  padding-left: 20px;
  line-height: 1.85;
}

.bullet-list li + li {
  margin-top: 8px;
}

.project-grid,
.education-grid,
.impact-grid,
.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card,
.education-card,
.impact-card,
.skill-card {
  padding: 24px;
}

.project-topline,
.education-degree,
.impact-period {
  font-size: 16px;
}

.project-topline {
  color: var(--accent);
}

.education-degree {
  margin: 0;
  color: var(--accent);
}

.education-period,
.education-notes,
.project-desc,
.impact-period,
.impact-notes {
  margin: 14px 0 0;
  line-height: 1.85;
}

.tag {
  padding: 8px 16px;
  background: rgba(168, 135, 58, 0.12);
  font-size: 14px;
  color: #6b4f18;
  border-radius: 999px;
  font-weight: 500;
}

.skill-items {
  margin-top: 18px;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(73, 48, 24, 0.12);
}

.skill-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.skill-name {
  font-weight: 700;
}

.skill-level {
  text-align: right;
}

.error-state {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 96px);
  padding: 48px;
  text-align: center;
}

.error-state h1 {
  margin: 12px 0 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 5vw, 56px);
}

.error-state p:last-child {
  max-width: 520px;
  margin: 16px 0 0;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .carousel-stage {
    min-height: 480px;
    height: 55vw;
  }
}

@media (max-width: 860px) {
  .resume-hero,
  .hero-carousel,
  .timeline-card,
  .project-card,
  .education-card,
  .impact-card,
  .skill-card {
    padding: 22px;
  }

  .resume-name {
    font-size: clamp(42px, 14vw, 64px);
  }

  .project-topline,
  .skill-item,
  .carousel-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .carousel-controls {
    display: flex;
    gap: 12px;
  }

  .project-grid,
  .education-grid,
  .impact-grid,
  .skills-grid,
  .practice-entry-grid,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 32px 22px;
  }

  .carousel-stage {
    min-height: 360px;
    height: 60vw;
  }

  .materials-toolbar,
  .material-card,
  .material-actions,
  .practice-entry-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .materials-workspace {
    padding: 22px;
  }
}

/* Slide deck overrides */

body {
  overflow: hidden;
}

.site-shell,
.resume-container {
  height: var(--viewport-block);
}

.resume-container {
  overflow-y: auto;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.resume-container::-webkit-scrollbar {
  display: none;
}

.resume-deck {
  position: relative;
}

.page-panel {
  position: relative;
  min-height: var(--viewport-block);
  height: var(--viewport-block);
  padding: clamp(30px, 4.5vw, 68px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(215, 160, 92, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 248, 237, 0.98) 0%, rgba(247, 239, 226, 0.94) 100%);
}

#profile.page-panel,
#projects.page-panel {
  height: auto;
  overflow: visible;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

.no-scrollbar {
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

#profile.page-panel {
  padding-top: clamp(16px, 2vw, 28px);
  padding-bottom: clamp(16px, 2vw, 28px);
}

#profile.page-panel::-webkit-scrollbar,
#projects.page-panel::-webkit-scrollbar {
  display: none;
}

#profile.page-panel .page-shell,
#projects.page-panel .page-shell {
  height: auto;
}

.page-shell {
  width: min(100%, 1480px);
  height: 100%;
  margin: 0 auto;
}

.page-panel .page-shell > * {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.58s ease, transform 0.78s cubic-bezier(0.2, 0.72, 0.18, 1);
}

.page-panel.is-visible .page-shell > * {
  opacity: 1;
  transform: none;
}

.page-panel.is-visible .page-shell > *:nth-child(2) {
  transition-delay: 0.08s;
}

.page-panel.is-visible .page-shell > *:nth-child(3) {
  transition-delay: 0.16s;
}

.page-nav {
  position: fixed;
  top: 50%;
  right: 28px;
  z-index: 12;
  display: grid;
  gap: 12px;
  transform: translateY(-50%);
}

.page-nav-dot {
  position: relative;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(106, 87, 66, 0.24);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.page-nav-dot span {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.page-nav-dot:hover,
.page-nav-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.page-nav-dot:hover span,
.page-nav-dot.is-active span {
  opacity: 1;
}

.intro-page {
  background:
    radial-gradient(circle at top right, rgba(215, 160, 92, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(255, 248, 237, 0.98) 0%, rgba(245, 236, 222, 0.96) 100%);
}

.intro-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
}

.journey-band,
.story-card,
.profile-card {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.88);
  box-shadow: var(--shadow);
}

.journey-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px 28px;
}

.page-kicker,
.journey-period {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: 'IBM Plex Mono', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journey-heading h2,
.page-header h2,
.materials-header h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.05;
}

.journey-heading p:last-child,
.page-header p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.journey-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.journey-step {
  padding: 18px 18px 20px;
  border-radius: 24px;
  background: rgba(255, 247, 236, 0.84);
  border: 1px solid rgba(167, 72, 43, 0.08);
}

.journey-step h3 {
  margin: 0;
  font-size: 24px;
}

.journey-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.story-page,
.practice-page,
.profile-page {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(145deg, rgba(255, 250, 242, 0.98) 0%, rgba(245, 236, 222, 0.94) 100%);
}

.story-shell,
.practice-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
}

.page-header {
  display: grid;
  gap: 6px;
}

.story-grid,
.profile-grid {
  min-height: 0;
}

.experience-page {
  padding-top: clamp(24px, 3.2vw, 44px);
  padding-bottom: clamp(24px, 3vw, 40px);
}

.experience-page .story-shell {
  gap: 16px;
}

.experience-page .page-header {
  gap: 4px;
}

.experience-page .page-header p:last-child {
  margin-top: 6px;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
  grid-auto-rows: minmax(0, 1fr);
}

.timeline-card.story-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 8px;
  align-content: start;
  padding: 18px 18px 16px;
  min-height: 0;
  height: 100%;
  grid-column: span 2;
}

.experience-grid > .timeline-card.story-card:nth-child(4):nth-last-child(2) {
  grid-column: 2 / span 2;
}

.project-card-body,
.materials-list-shell {
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.timeline-meta {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.timeline-period {
  font-size: 16px;
  line-height: 1.55;
}

.timeline-location {
  font-size: 18px;
  white-space: nowrap;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: visible;
  padding-top: 10px;
  padding-right: 0;
}

.timeline-body h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.14;
}

.timeline-role {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.55;
}

.timeline-body .tag-row {
  margin-top: auto;
  padding-top: 20px;
}

.bullet-list-compact {
  margin-top: 14px;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.7;
}

.bullet-list-compact li {
  display: block;
}

.bullet-list-compact li + li {
  margin-top: 10px;
}

.project-grid-slide {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
  grid-auto-rows: auto;
}

.project-card.story-card,
.skill-card.story-card,
.profile-card.story-card {
  padding: 22px;
}

.project-card.story-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-column: span 2;
  min-height: 0;
  height: 100%;
}

.project-card-body {
  display: flex;
  flex-direction: column;
}

.project-card-body .tag-row {
  margin-top: auto;
  padding-top: 16px;
}

.project-grid-slide > .project-card.story-card:nth-child(4):nth-last-child(2) {
  grid-column: 2 / span 2;
}

.project-card.story-card.project-card-accent {
  min-height: 280px;
}

.project-card-accent.story-card {
  background:
    radial-gradient(circle at top right, rgba(252, 220, 116, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(74, 111, 156, 0.86) 0%, rgba(111, 151, 197, 0.8) 48%, rgba(214, 181, 103, 0.18) 100%);
  border-color: rgba(198, 164, 92, 0.24);
  box-shadow: 0 22px 44px rgba(47, 73, 110, 0.14);
}

.project-card h3 {
  margin: 12px 0 8px;
  font-size: 26px;
  line-height: 1.14;
}

.project-card-accent .project-topline,
.project-card-accent h3,
.project-card-accent .project-desc {
  color: rgba(247, 240, 222, 0.96);
}

.project-period {
  font-weight: 600;
}

.project-card-accent .tag {
  background: rgba(244, 211, 132, 0.18);
  color: #fff1c6;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
}

.profile-skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-aside {
  display: grid;
  gap: 18px;
}

.profile-points {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-points p {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.profile-points p::before {
  content: '';
  position: absolute;
  top: 0.82em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.profile-tags {
  margin-top: 14px;
}

/* 找到我：生活照与联系方式 */
.profile-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.life-photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 10px 0;
}

.life-photo-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  aspect-ratio: 3 / 4;
  background: rgba(0, 0, 0, 0.02);
}

.life-photo-card-offset {
  transform: translateY(24px);
}

.life-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.life-photo-card:hover .life-photo-img {
  transform: scale(1.05);
}

.life-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.contact-card .contact-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.contact-card .contact-chip {
  padding: 14px 16px;
  background: rgba(167, 72, 43, 0.04);
  border-radius: 12px;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
}

/* FAQ 手风琴样式 */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  border-bottom: 1px dashed rgba(73, 48, 24, 0.12);
  padding-bottom: 12px;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 0;
  list-style: none; /* 去除原生三角箭头 */
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  font-family: monospace;
  font-size: 18px;
  color: var(--accent);
  transition: transform 0.3s ease;
}

details[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 8px 0 4px;
  padding-right: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.practice-shell #materials-portal-root {
  height: 100%;
}

.materials-layout {
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.materials-workspace {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.materials-copy {
  max-width: 760px;
}

.materials-list-shell {
  max-height: 34vh;
}

.story-grid > *,
.journey-timeline > *,
.practice-entry-grid > *,
.materials-list > *,
.profile-skills-grid > *,
.profile-aside > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.7s ease;
}

.page-panel.is-visible .story-grid > *,
.page-panel.is-visible .journey-timeline > *,
.page-panel.is-visible .practice-entry-grid > *,
.page-panel.is-visible .materials-list > *,
.page-panel.is-visible .profile-skills-grid > *,
.page-panel.is-visible .profile-aside > * {
  opacity: 1;
  transform: none;
}

.page-panel.is-visible .story-grid > *:nth-child(2),
.page-panel.is-visible .journey-timeline > *:nth-child(2),
.page-panel.is-visible .practice-entry-grid > *:nth-child(2),
.page-panel.is-visible .materials-list > *:nth-child(2),
.page-panel.is-visible .profile-skills-grid > *:nth-child(2),
.page-panel.is-visible .profile-aside > *:nth-child(2) {
  transition-delay: 0.08s;
}

.page-panel.is-visible .story-grid > *:nth-child(3),
.page-panel.is-visible .journey-timeline > *:nth-child(3),
.page-panel.is-visible .materials-list > *:nth-child(3) {
  transition-delay: 0.16s;
}

@media (max-width: 1366px) and (pointer: coarse) {
  .page-panel,
  .resume-hero.page-panel {
    padding-left: clamp(24px, 3.6vw, 40px);
    padding-right: clamp(24px, 3.6vw, 40px);
  }

  .journey-band,
  .profile-grid,
  .project-grid-slide {
    grid-template-columns: 1fr;
  }

  .experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 16px;
  }

  .timeline-card.story-card,
  .experience-grid > .timeline-card.story-card:nth-child(4),
  .experience-grid > .timeline-card.story-card:nth-child(5),
  .project-card.story-card,
  .project-grid-slide > .project-card.story-card:nth-child(4),
  .project-grid-slide > .project-card.story-card:nth-child(5) {
    grid-column: auto;
  }

  .timeline-card.story-card,
  .project-card.story-card {
    height: auto;
    min-height: clamp(240px, 28vw, 340px);
  }

  .timeline-card.story-card,
  .project-card.story-card,
  .skill-card.story-card,
  .profile-card.story-card {
    padding: 20px;
  }

  .project-card-body,
  .materials-list-shell {
    max-height: none;
  }

  .timeline-body h3,
  .project-card h3,
  .skill-card h3,
  .profile-card h3 {
    font-size: 20px;
  }

  .page-nav {
    right: 14px;
  }
}

@media (max-width: 1180px) {
  #intro.page-panel,
  #profile.page-panel,
  #projects.page-panel {
    height: auto;
    overflow: visible;
  }

  #profile.page-panel .page-shell,
  #projects.page-panel .page-shell {
    height: auto;
  }

  .journey-band,
  .profile-grid,
  .project-grid-slide {
    grid-template-columns: 1fr;
  }

  .project-card-body,
  .materials-list-shell {
    max-height: none;
  }

  .experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .timeline-card.story-card,
  .experience-grid > .timeline-card.story-card:nth-child(4),
  .experience-grid > .timeline-card.story-card:nth-child(5),
  .project-card.story-card,
  .project-grid-slide > .project-card.story-card:nth-child(4),
  .project-grid-slide > .project-card.story-card:nth-child(5) {
    grid-column: auto;
  }

  .page-nav {
    right: 18px;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .site-shell {
    height: auto;
  }

  .resume-container {
    height: auto;
    min-height: 0;
    overflow-y: visible;
    scroll-snap-type: none;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .page-panel,
  .resume-hero.page-panel {
    height: auto;
    min-height: var(--viewport-block);
    padding: clamp(22px, 6vw, 30px) clamp(16px, 5vw, 22px) calc(24px + env(safe-area-inset-bottom, 0px));
    overflow: visible;
  }

  .page-shell {
    height: auto;
  }

  .intro-shell,
  .story-shell,
  .practice-shell {
    height: auto;
    gap: 18px;
  }

  .hero-grid {
    gap: 22px;
  }

  .hero-main {
    padding: 0;
  }

  .hero-kicker {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .journey-timeline,
  .profile-skills-grid,
  .practice-entry-grid {
    grid-template-columns: 1fr;
  }

  .experience-grid,
  .project-grid-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }

  .timeline-card.story-card,
  .experience-grid > .timeline-card.story-card:nth-child(4),
  .experience-grid > .timeline-card.story-card:nth-child(5),
  .project-card.story-card,
  .project-grid-slide > .project-card.story-card:nth-child(4),
  .project-grid-slide > .project-card.story-card:nth-child(5) {
    grid-column: auto;
  }

  .timeline-card.story-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .resume-name {
    font-size: clamp(46px, 17vw, 68px);
    letter-spacing: 0.02em;
  }

  .resume-name-en {
    font-size: clamp(20px, 7vw, 28px);
  }

  .resume-title {
    max-width: none;
    margin-top: 14px;
    font-size: clamp(16px, 5.4vw, 22px);
    line-height: 1.68;
  }

  .contact-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .contact-chip {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 14px;
  }

  .contact-chip span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .hero-carousel {
    padding: 14px;
  }

  .carousel-stage {
    height: clamp(220px, 54vw, 300px);
    min-height: clamp(220px, 54vw, 300px);
    border-radius: 18px;
  }

  .carousel-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }

  .carousel-dots {
    min-width: 0;
    gap: 8px;
  }

  .journey-band {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px 18px;
  }

  .journey-step {
    padding: 16px;
  }

  .journey-step h3 {
    font-size: 20px;
  }

  .practice-entry {
    padding: 20px;
  }

  .practice-entry-summary {
    min-height: 0;
  }

  .materials-layout {
    height: auto;
    grid-template-rows: auto;
    gap: 18px;
  }

  .materials-workspace {
    padding: 18px;
    grid-template-rows: auto auto auto;
  }

  .materials-toolbar-actions {
    width: 100%;
  }

  .materials-upload-btn {
    width: 100%;
  }

  .materials-list-shell,
  .project-card-body {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .story-grid,
  .profile-grid,
  .profile-skills-grid,
  .project-grid-slide {
    gap: 14px;
  }

  .timeline-card.story-card,
  .project-card.story-card,
  .skill-card.story-card,
  .profile-card.story-card {
    height: 100%;
    padding: 16px;
  }

  .timeline-meta,
  .project-topline {
    flex-wrap: wrap;
  }

  .project-topline {
    flex-direction: row;
    align-items: center;
    gap: 8px 12px;
  }

  .timeline-location {
    font-size: 14px;
    white-space: normal;
  }

  .timeline-body h3,
  .project-card h3,
  .skill-card h3,
  .profile-card h3 {
    font-size: 18px;
    line-height: 1.22;
  }

  .timeline-period,
  .project-topline {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .timeline-role,
  .bullet-list-compact,
  .project-desc,
  .tag {
    font-size: 13px;
  }

  .timeline-role,
  .project-desc {
    line-height: 1.6;
  }

  .project-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
  }

  .bullet-list-compact li {
    -webkit-line-clamp: 2;
  }

  .tag-row {
    gap: 8px;
  }

  .tag {
    padding: 6px 10px;
  }

  .page-header p:last-child,
  .journey-heading p:last-child,
  .materials-copy,
  .materials-toolbar p,
  .practice-entry-summary {
    font-size: 15px;
    line-height: 1.75;
  }

  .page-nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-panel,
  .resume-hero.page-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-carousel,
  .journey-band,
  .practice-entry,
  .materials-workspace,
  .timeline-card.story-card,
  .project-card.story-card,
  .skill-card.story-card,
  .profile-card.story-card {
    border-radius: 22px;
  }

  .resume-title {
    font-size: 18px;
  }

  .timeline-period,
  .timeline-location,
  .project-topline,
  .journey-period {
    font-size: 12px;
  }
}

/* --- Mobile/iPad Horizontal Slider Layout --- */
@media (max-width: 1180px) {
  .experience-grid,
  .project-grid-slide {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 16px !important;
    padding-bottom: 24px !important;
    /* Optional: pull out margins to bleed into screen padding */
    margin-left: -4px !important;
    margin-right: -4px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .experience-grid::-webkit-scrollbar,
  .project-grid-slide::-webkit-scrollbar {
    display: none !important; /* Safari and Chrome */
  }

  .experience-grid > .timeline-card.story-card,
  .project-grid-slide > .project-card.story-card {
    flex: 0 0 calc(100% - 28px) !important;
    min-width: 280px !important;
    max-width: 600px !important;
    scroll-snap-align: center !important;
    grid-column: auto !important;
    height: auto !important;
  }
}

@media (max-width: 860px) {
  .experience-page,
  .projects-page {
    min-height: auto;
  }

  .experience-grid,
  .project-grid-slide {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
  }

  .experience-grid > .timeline-card.story-card,
  .project-grid-slide > .project-card.story-card {
    flex: initial !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    align-self: start;
  }

  .timeline-card.story-card,
  .project-card.story-card,
  .skill-card.story-card,
  .profile-card.story-card {
    height: auto;
  }

  .timeline-card.story-card {
    grid-template-rows: auto auto;
  }

  .project-card.story-card {
    grid-template-rows: auto auto auto;
  }
}
