:root {
  --primary: #0b2d5b;
  --primary-hover: #1e3a8a;
  --primary-light: rgba(37, 99, 235, 0.05);

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);

  --bg-main: #f8fafc;
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: transparent;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ========= Global Tech Background ======== */
.site-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.page-detail .site-bg {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.bg-base {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 78% 28%, rgba(37,99,235,0.10), transparent 34%),
    radial-gradient(circle at 92% 72%, rgba(34,211,238,0.08), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 42%, #eef6ff 100%);
}
.bg-base::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
}

.bg-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.36;
  animation: auroraBreath 22s ease-in-out infinite;
  z-index: 1;
}
.bg-aurora-1 {
  width: 60vw;
  height: 60vw;
  right: -10vw;
  bottom: -10vw;
  background: rgba(59, 130, 246, 0.12);
}
.bg-aurora-2 {
  width: 50vw;
  height: 50vw;
  right: 15vw;
  top: -15vw;
  background: rgba(34, 211, 238, 0.1);
  animation-duration: 28s;
  animation-delay: -5s;
}

@keyframes auroraBreath {
  0%, 100% {
    opacity: 0.28;
    transform: scale(1);
  }
  50% {
    opacity: 0.42;
    transform: scale(1.04);
  }
}

.bg-fiber-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  mix-blend-mode: normal;
}

body.page-home .bg-fiber-svg {
  opacity: 0.88;
}

body.page-detail .bg-fiber-svg {
  opacity: 0.52;
}

.fiber-bundle {
  transform-origin: 74% 60%;
}

.fiber-bundle path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.fiber-ambient,
.fiber-silk,
.fiber-micro,
.fiber-highlight {
  transform-box: fill-box;
  transform-origin: 74% 60%;
  will-change: transform, opacity;
}

.fiber-ambient {
  opacity: 0.75;
  animation: fiberFloatSlow 28s ease-in-out infinite;
}

.fiber-ambient path {
  stroke: url(#ambientGradient);
  stroke-width: 6.5;
  opacity: 0.06;
  filter: url(#ambientBlur);
}

.fiber-silk {
  animation: fiberFloat 24s ease-in-out infinite;
}

.fiber-silk path {
  stroke: url(#silkGradient);
  stroke-width: 0.62;
  opacity: 0.52;
  filter: url(#tinyGlow);
}

.fiber-silk path:nth-child(3n) {
  stroke-width: 0.5;
  opacity: 0.44;
}

.fiber-silk path:nth-child(4n) {
  stroke-width: 0.78;
  opacity: 0.58;
}

.fiber-silk path:nth-child(7n) {
  stroke-width: 0.48;
  opacity: 0.38;
  filter: none;
}

.fiber-micro {
  animation: fiberFloatMicro 32s ease-in-out infinite;
}

.fiber-micro path {
  stroke: rgba(96, 165, 250, 0.32);
  stroke-width: 0.32;
  opacity: 0.34;
}

.fiber-micro path:nth-child(2n) {
  stroke: rgba(59, 130, 246, 0.28);
  stroke-width: 0.24;
  opacity: 0.28;
}

.fiber-micro path:nth-child(5n) {
  stroke: rgba(255, 255, 255, 0.36);
  stroke-width: 0.4;
  opacity: 0.4;
}

.fiber-highlight path {
  stroke: url(#highlightGradient);
  stroke-width: 0.44;
  opacity: 0.52;
  filter: url(#smallGlow);
  stroke-dasharray: 160 620;
  stroke-dashoffset: 760;
  animation: highlightFlow 26s ease-in-out infinite;
}

.fiber-highlight path:nth-child(2n) {
  stroke-width: 0.36;
  stroke-dasharray: 120 720;
}

body.page-detail .fiber-highlight {
  opacity: 0.48;
}

@keyframes fiberFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-14px, -6px, 0) scale(1.006);
  }
}

@keyframes fiberFloatSlow {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-20px, -8px, 0) scale(1.01);
  }
}

@keyframes fiberFloatMicro {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(-10px, -4px, 0);
    opacity: 1;
  }
}

@keyframes highlightFlow {
  0% {
    stroke-dashoffset: 760;
    opacity: 0.3;
  }
  45% {
    opacity: 0.58;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.3;
  }
}

.bg-sparkles {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.page-detail .bg-sparkles {
  opacity: 0.52;
}
.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(96, 165, 250, 0.2);
  animation: particleFloat 24s ease-in-out infinite;
  opacity: 0;
}

@keyframes particleFloat {
  0% { transform: translate3d(0, 0, 0) scale(0.82); opacity: 0; }
  24% { opacity: 0.24; }
  52% { transform: translate3d(-8px, -30px, 0) scale(1.02); opacity: 0.36; }
  76% { opacity: 0.18; }
  100% { transform: translate3d(-16px, -58px, 0) scale(0.86); opacity: 0; }
}

@media (max-width: 768px) {
  .bg-aurora-1, .bg-aurora-2 { filter: blur(60px); opacity: 0.32; }
  body.page-home .bg-fiber-svg,
  body.page-detail .bg-fiber-svg,
  .bg-fiber-svg { opacity: 0.36; }
  .fiber-ambient,
  .fiber-silk,
  .fiber-micro,
  .fiber-highlight { animation: none; }
  .fiber-highlight,
  .fiber-micro,
  .bg-sparkles { display: none; }
  .fiber-ambient { opacity: 0.35; }
  .fiber-ambient path { opacity: 0.05; filter: url(#ambientBlur); }
  .fiber-silk path { opacity: 0.28; filter: none; }
  .fiber-silk path:nth-child(n + 18) { display: none; }
}

@keyframes techPulse {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

img {
  display: block;
  max-width: 100%;
}
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.relative {
  position: relative;
}
.z-10 {
  z-index: 10;
}
.text-center {
  text-align: center;
}
.font-mono {
  font-family: var(--font-mono);
}
.mt-24 {
  margin-top: 24px;
}
.pt-4 {
  margin-top: 16px;
}

/* ======== Animations ======== */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.05);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.35s var(--ease-spring);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 {
  transition-delay: 60ms;
}
.delay-2 {
  transition-delay: 120ms;
}
.delay-3 {
  transition-delay: 180ms;
}
.delay-4 {
  transition-delay: 240ms;
}

.section-reveal {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.section-reveal.visible {
  opacity: 1;
}

.hover-lift {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ======== Nav ======== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar .nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar .nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.navbar .nav-back:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(-2px);
  box-shadow: var(--shadow-sm);
}
.navbar .logo {
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.5px;
}
.navbar .nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.navbar a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.navbar a:hover {
  color: var(--accent);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
}

/* ======== Hero ======== */
.hero {
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg-grid {
  display: none;
}
.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(
    ellipse at center,
    var(--accent-soft) 0%,
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
.pulse-dot.green {
  background: #10b981;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-statement {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 24px;
}

.hero .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Hero Stats Card */
.hero-stats {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-top: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.stat-box {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.stat-unit {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}
.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 24px;
}

.hero .lead {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 32px;
  line-height: 1.8;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.chip {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.chip.primary {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
}

.ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: var(--bg-main);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  border-color: var(--primary);
}

/* ======== Sections & Layout ======== */
section {
  padding: 80px 0;
}
section.alt {
  background: rgba(15, 23, 42, 0.3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 48px;
}
.section-eyebrow {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}
.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

/* ======== Bento Cards ======== */
.bento-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.about-grid .icon-wrap {
  width: 48px;
  height: 48px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 20px;
}
.about-grid h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 600;
}
.about-grid p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

/* Projects Section */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.project-card {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.project-card:hover .project-cover img {
  transform: scale(1.05);
}
.project-card:hover .cover-overlay {
  opacity: 1;
}
.project-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}
.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-spring);
}
.cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 58, 95, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}
.view-btn {
  background: var(--text-main);
  color: var(--bg-main);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transform: translateY(10px);
  transition: transform 0.3s;
}
.project-card:hover .view-btn {
  transform: translateY(0);
}

.project-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-main);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.badge.primary {
  background: var(--primary);
  color: var(--bg-main);
  border-color: var(--primary);
  border: none;
}
.badge.outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.project-card h3 {
  font-size: 20px;
  color: var(--text-main);
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.project-card .desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
  flex: 1;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.metric .m-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}
.metric .m-val.text-accent,
.metric .m-val.highlight {
  color: var(--accent);
}
.metric .m-lbl {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ======== Timeline ======== */
.timeline-container {
  position: relative;
  padding-left: 24px;
}
.timeline-line {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 40px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -29px;
  top: 12px;
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-main);
}
.timeline-dot.inactive {
  border-color: var(--text-light);
}

.achievement-box {
  background: var(--primary-light);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  color: var(--text-main);
  margin-top: 24px;
}
.achievement-box.soft {
  background: var(--bg-main);
  border-style: dashed;
}
.achievement-box .highlight {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid var(--accent-soft);
  margin: 0 4px;
}

.timeline-content {
  flex: 1;
  padding: 28px;
}
.timeline-content .period {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 500;
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}
.title-row h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}
.bg-note {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  font-style: italic;
}

.task-list {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.task-list li {
  margin-bottom: 8px;
  line-height: 1.7;
  padding-left: 4px;
}

.highlight-box {
  padding: 16px 20px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.6;
}
.highlight-box strong {
  color: var(--primary);
}
.highlight-box .strong {
  font-weight: 600;
  color: var(--primary);
}
.highlight-box.alt {
  background: transparent;
}

/* ======== Education ======== */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.edu-header h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.edu-header .tag {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--border-light);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: normal;
}
.edu-card .major {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 12px;
  font-weight: 500;
}
.edu-card .honor {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.edu-card .honor svg {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ======== Footer ======== */
footer {
  background: transparent;
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.footer-info .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 16px;
  display: inline-block;
}
.footer-info p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.7;
}
.footer-left .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 16px;
  display: inline-block;
}
.footer-left p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.7;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
  transition: opacity 0.2s;
}
.contact-btn:hover {
  opacity: 0.8;
}
.contact-btn.primary {
  background: var(--primary);
  color: var(--bg-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
}
.contact-btn.primary:hover {
  background: var(--primary-hover);
  opacity: 1;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s;
}
.contact-pill:hover {
  border-color: var(--primary);
}
.contact-pill.primary {
  background: var(--primary);
  color: var(--bg-main);
  border-color: var(--primary);
}
.contact-pill.primary:hover {
  background: var(--primary-hover);
}

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 13px;
  color: var(--text-light);
}
.divider-vline {
  width: 1px;
  height: 12px;
  background: var(--border);
}

/* ====================================================
   Project Detail Pages (xm1.html, xm2.html)
   ==================================================== */

.detail-hero {
  padding: 48px 0 64px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: transparent;
}
.hero-bg-grid.subtle {
  display: none;
}

.detail-hero .margin-btm {
  margin-bottom: 24px;
}
.detail-hero h1 {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
  margin-top: 24px;
  margin-bottom: 16px;
  line-height: 1.2;
}
.detail-hero .tagline {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 800px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 20px 24px;
  margin-bottom: 48px;
  background: var(--bg-card);
  box-shadow: none;
  border-color: var(--border-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-item .m-lbl {
  font-size: 12px;
  color: var(--text-light);
}
.meta-item .m-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kpi-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.kpi-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 8px;
}
.kpi-num .arrow {
  color: var(--text-light);
  font-weight: 400;
  font-size: 20px;
}
.kpi-num.accent {
  color: var(--accent);
}
.kpi-num .unit {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 500;
}
.kpi-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.max-w-content {
  max-width: 800px;
}
.reading-section {
  padding: 64px 0;
}

.prose-block {
  margin-top: 100px;
  margin-bottom: 100px;
}
.prose-block:first-child {
  margin-top: 0;
}
.prose-block:last-child {
  margin-bottom: 0;
}

.article-block {
  margin-bottom: 64px;
}
.prose-block h2,
.article-block h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 64px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prose-block h2:first-child {
  margin-top: 24px;
}
.article-block h2 .marker {
  font-size: 14px;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-weight: 500;
  padding-top: 4px;
}
.prose-block p,
.article-block p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}
.prose-figure {
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
}
.prose-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.prose-figure figcaption {
  padding: 12px 16px 14px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid rgba(226, 232, 240, 0.86);
}
.article-block p strong {
  color: var(--text-main);
  font-weight: 600;
}

.quote-box {
  background: var(--bg-main);
  border-left: 3px solid var(--primary);
  padding: 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
}
.quote-box strong {
  display: block;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--primary);
}
.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.clean-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-muted);
}
.clean-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

ul.task-list {
  padding-left: 0;
  list-style: none;
}
ul.task-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
ul.task-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: bold;
}

.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}
.s-item {
  display: flex;
  gap: 16px;
}
.s-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}
.s-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  margin-top: 4px;
}
.s-content p {
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 0;
}

.diagram-bento {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.d-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}
.d-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.d-tag {
  padding: 12px 16px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border);
  font-weight: 500;
}
.d-tag.strong {
  background: var(--primary);
  color: var(--bg-main);
  border: none;
}
.d-tag.alert {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  color: #b91c1c;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bento-card.minimal {
  padding: 24px;
  box-shadow: none;
  background: var(--bg-main);
}
.bento-card.minimal h3 {
  font-size: 15px;
  margin-bottom: 8px;
}
.bento-card.minimal p {
  font-size: 14px;
  margin-bottom: 0;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.r-item {
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.r-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.r-item p {
  font-size: 14.5px;
  margin-bottom: 0;
}

/* ======== Segmented Control (Gallery Filters) ======== */
.segmented-control {
  display: inline-flex;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  margin: 0 auto 32px;
}
.segmented-control button {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.segmented-control button .count {
  font-size: 11px;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-muted);
}
.segmented-control button:hover {
  color: var(--text-main);
}
.segmented-control button.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.segmented-control button.active .count {
  color: var(--primary);
  background: var(--bg-main);
}
.gallery-toggle {
  justify-content: center;
} /* Flex container alignment */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: auto;
  background: var(--bg-main);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img {
  transform: scale(1.03);
}
.overlay-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  pointer-events: none;
}

/* ======== Lightbox ======== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 40px;
  backdrop-filter: blur(8px);
}
.lightbox.active {
  display: flex;
  animation: fadeUp 0.3s ease;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-close {
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 24px;
}
.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 20px;
}
.lightbox-prev {
  left: 24px;
}
.lightbox-next {
  right: 24px;
}
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ======== Custom Layouts & Components ======== */
/* Hero Grid */
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 48px; }
.hero-content { z-index: 2; }
.hero-visual { position: relative; width: 100%; aspect-ratio: 1; display: flex; justify-content: center; align-items: center; }
.star-map { position: relative; width: 100%; height: 100%; border-radius: 50%; opacity: 0.9; 
  background-image: 
    linear-gradient(to right, var(--accent-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--accent-soft) 1px, transparent 1px);
  background-size: 40px 40px; 
}
.star-map::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 50%, var(--bg-main) 100%); z-index: 1; pointer-events: none; }
@keyframes floatNode {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-6px);
  }
}

.sm-node { position: absolute; background: white; border: 1px solid var(--border); color: var(--primary); padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; transform: translate(-50%, -50%); transition: all 0.3s; box-shadow: var(--shadow-sm); z-index: 2; white-space: nowrap; animation: floatNode 4s ease-in-out infinite; }
.sm-node.center { left: 50%; top: 50%; font-size: 16px; font-weight: 700; background: var(--primary); color: white; border-color: var(--primary); padding: 12px 24px; text-align: center; animation-duration: 5s; }
.sm-node.n1 { left: 20%; top: 20%; animation-delay: 0s; }
.sm-node.n2 { left: 80%; top: 15%; animation-delay: 0.4s; }
.sm-node.n3 { left: 85%; top: 50%; animation-delay: 0.8s; }
.sm-node.n4 { left: 75%; top: 85%; animation-delay: 1.2s; }
.sm-node.n5 { left: 50%; top: 88%; animation-delay: 1.6s; }
.sm-node.n6 { left: 25%; top: 80%; animation-delay: 2s; }
.sm-node.n7 { left: 10%; top: 55%; animation-delay: 2.4s; }
.sm-node.n8 { left: 50%; top: 10%; animation-delay: 2.8s; display: none; }

/* Methodology */
.methodology-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.method-card { position: relative; overflow: hidden; padding: 24px; }
.method-card .step-num { font-size: 48px; font-family: var(--font-mono); font-weight: 700; color: var(--border); position: absolute; top: -10px; right: 16px; opacity: 0.5; }
.method-card h3 { margin-top: 16px; margin-bottom: 8px; font-size: 18px; color: var(--text-main); position: relative; z-index: 2; }
.method-card p { font-size: 14px; margin: 0; color: var(--text-muted); position: relative; z-index: 2; line-height: 1.6; }

/* Cap Tags */
.cap-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.cap-tag { background: var(--bg-main); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; font-size: 12px; color: var(--accent); font-weight: 500; }

/* KV List */
.project-kv-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.kv-item { display: flex; justify-content: space-between; font-size: 14px; }
.kv-item .k { color: var(--text-muted); flex-shrink: 0; margin-right: 16px; }
.kv-item .v { color: var(--text-main); font-weight: 500; text-align: right; }

/* Project Overview Card */
.project-overview { margin-top: 32px; margin-bottom: 64px; }
.overview-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) {
  .overview-grid { grid-template-columns: 2.5fr 1fr; }
}
.overview-card { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 32px; box-shadow: var(--shadow-sm); }
.overview-card h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 16px; font-weight: 500; }
.overview-card .overview-list { display: flex; flex-direction: column; gap: 24px; }
.overview-card .overview-item { display: flex; flex-direction: column; gap: 8px; }
.overview-card .overview-item .k { font-size: 14px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.overview-card .overview-item .v { font-size: 15px; color: var(--text-main); font-weight: 500; line-height: 1.5; }

/* Max Content Width for Project Articles */
.max-w-content { max-width: 860px; margin: 0 auto; }

/* Callout Boxes */
.callout-box {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.callout-box.warning { border-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.callout-box.info { border-color: var(--accent); background: var(--accent-soft); }
.callout-box .callout-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; color: var(--text-main); }
.callout-box p, .callout-box ul { margin: 0; font-size: 15px; color: var(--text-muted); }
.callout-box ul { padding-left: 20px; }
.callout-box li { margin-bottom: 4px; }
.callout-box li:last-child { margin-bottom: 0; }

/* Result Box */
.result-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--primary-light);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 24px;
}
@media (min-width: 640px) {
  .result-box { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.result-box .r-col h3 { font-size: 16px; color: var(--primary); margin-bottom: 12px; }
.result-box .r-col p { font-size: 15px; color: var(--text-main); margin: 0; line-height: 1.6; }
.result-box .r-col strong { color: var(--accent); }

/* Arch Box */
.arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.arch-title { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 24px; font-family: var(--font-mono); letter-spacing: 2px;}
.arch-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.arch-tag { padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 500; background: var(--primary-light); color: var(--primary); border: 1px solid var(--accent-soft); }
.arch-tag.highlight { background: var(--accent); color: white; border-color: var(--accent); }
.arch-tag.outline { background: transparent; border: 1px dashed var(--accent); color: var(--accent); }
.arch-tag.light { background: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border); }

/* ======== Responsive ======== */
@media (max-width: 880px) {
  .hero {
    padding: 64px 0 48px;
  }
  .hero h1 {
    font-size: 40px;
  }
  .hero-statement {
    font-size: 18px;
  }
  .hero-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }
  .stat-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .about-grid,
  .project-grid,
  .edu-grid,
  .kpi-board,
  .methodology-grid,
  .lab-grid,
  .hero-grid,
  .grid-2-col {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    gap: 32px;
  }
  .hero-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    aspect-ratio: auto;
    height: auto;
    justify-content: flex-start;
  }
  .star-map {
    display: none;
  }
  .sm-node, .sm-node.center {
    position: static;
    transform: none;
    font-size: 12px;
    padding: 6px 12px;
    display: inline-block;
    box-shadow: none;
    animation: none;
  }
  .sm-node.n8 { display: inline-block; }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .navbar .nav-links.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }

  .detail-meta {
    flex-direction: column;
    gap: 16px;
  }
  .lightbox {
    padding: 16px;
  }
  .lightbox-prev {
    left: 8px;
  }
  .lightbox-next {
    right: 8px;
  }
}
@media (max-width: 480px) {
  .hero h1 {
    font-size: 32px;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .ctas {
    flex-direction: column;
    width: 100%;
  }
  .ctas .btn {
    width: 100%;
  }
}

/* ======== Project Brief ======== */
.project-brief {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 32px;
}
.brief-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.b-lbl {
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
  letter-spacing: 0.04em;
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  width: fit-content;
}
.b-val {
  font-size: 15px;
  color: var(--text-main);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 团队明细：在 project-brief 内独占整行 */
.brief-item.brief-team {
  flex-basis: 100%;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}
.team-detail-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 12px;
  width: 100%;
}
.team-col-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-light);
}
.team-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.team-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
  gap: 12px;
}
.team-list li:last-child {
  border-bottom: none;
}
.team-list .role {
  color: var(--text-main);
  line-height: 1.5;
}
.team-list .count {
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.team-list .count.part-time {
  color: var(--text-muted);
  font-weight: 500;
}
@media (max-width: 768px) {
  .team-detail-inline {
    grid-template-columns: 1fr;
  }
}

/* ======== Other Projects（其他项目轻量横排卡片）======== */
#other-projects {
  padding: 80px 0;
}
.other-grid-frame {
  position: relative;
  margin-top: 48px;
}
.grid-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s var(--ease-spring);
}
.grid-nav:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.08);
}
.grid-nav:disabled {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.85);
}
/* 按钮放在卡片边界外侧 —— viewport 越宽越在外面 */
.grid-nav-prev { left: -64px; }
.grid-nav-next { right: -64px; }
@media (max-width: 1240px) {
  /* viewport 不够宽时按钮回到 frame 内边缘 */
  .grid-nav-prev { left: -8px; }
  .grid-nav-next { right: -8px; }
}
@media (max-width: 720px) {
  .grid-nav-prev { left: 4px; }
  .grid-nav-next { right: 4px; }
  .grid-nav { width: 40px; height: 40px; }
}
.other-grid {
  display: flex;
  flex-direction: row;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px 16px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* 隐藏滚动条：由鼠标滚轮 / 触摸板 / 触摸 / 左右按钮控制 */
  scrollbar-width: none;
}
.other-grid::-webkit-scrollbar { display: none; }
.other-grid > a {
  flex: 0 0 380px;
  scroll-snap-align: start;
  opacity: 0.78;
  filter: saturate(0.85);
  transform: scale(0.97);
}
.other-grid > a:hover,
.other-grid > a:focus-visible {
  opacity: 1;
  filter: saturate(1);
  transform: scale(1);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);
  z-index: 1;
}
@media (max-width: 720px) {
  .other-grid > a {
    flex-basis: 88vw;
  }
}
.other-card {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.other-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  width: fit-content;
  letter-spacing: 0.02em;
}
.other-card h3 {
  font-size: 20px;
  margin: 0;
  color: var(--text-main);
  line-height: 1.4;
}
.other-card .desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.other-kv {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.other-kv .kv-row {
  display: flex;
  font-size: 13px;
  gap: 12px;
  line-height: 1.6;
}
.other-kv .k {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 88px;
  font-weight: 500;
}
.other-kv .v {
  color: var(--text-main);
}
@media (max-width: 768px) {
  .other-grid {
    grid-template-columns: 1fr;
  }
  .other-card {
    padding: 24px;
  }
}

/* 个人项目卡片：可点击跳 GitHub */
a.personal-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
a.personal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.personal-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.personal-card .github-link {
  display: inline-flex;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s, transform 0.2s;
}
a.personal-card:hover .github-link {
  color: var(--primary);
  transform: translate(2px, -2px);
}
.personal-card code {
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}

/* ============== Other Project Link Cards (clickable to subpage) ============== */
a.other-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease, border-color 0.2s ease;
}
/* 注：a.other-card-link 的 hover 选中态由 .other-grid > a:hover 统一控制 */
a.other-card-link .project-cover {
  aspect-ratio: 16/9;
}
a.other-card-link .project-cover img {
  /* 顶部对齐——避免标题被 16:9 裁剪到（旅行/社区封面用的是 PPT 第一页，标题在顶部）*/
  object-position: center top;
}
a.other-card-link:hover .project-cover img {
  transform: scale(1.04);
}
.other-card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.other-card-cta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}
.other-card-cta .arrow {
  font-size: 18px;
  transition: transform 0.2s var(--ease-spring);
}
a.other-card-link:hover .other-card-cta .arrow {
  transform: translateX(4px);
}

/* ============== Detail Subpage Prose Helpers (shared by xm1/xm2/archiai/tourism) ============== */
.mt-24 { margin-top: 24px; }

.styled-list { list-style: none; padding-left: 0; margin: 0; }
.styled-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.7;
}
.styled-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.styled-list li strong { color: var(--text-main); font-weight: 600; }

.step-list { display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
.step-item {
  display: flex;
  gap: 18px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.step-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.step-list .step-num {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-mono);
}
.step-content { flex: 1; }
.step-content h3 { font-size: 16px; margin: 0 0 6px; color: var(--text-main); font-weight: 600; }
.step-content p { font-size: 14.5px; margin: 0; color: var(--text-muted); line-height: 1.65; }

.grid-card-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) {
  .grid-card-2 { grid-template-columns: 1fr 1fr; }
}

.bento-card.inner {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.bento-card.inner p { font-size: 14.5px; color: var(--text-muted); line-height: 1.7; margin: 0; }
.bento-card.inner p strong { color: var(--text-main); }

.icon-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text-main);
  margin-bottom: 12px;
}
.icon-title svg { flex-shrink: 0; color: var(--primary); }

