/* ============================================================
   aojiang.space v2 — Apple-level Personal Site
   Pure CSS, no frameworks, 60fps
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dark theme (default) */
  --bg:            #000000;
  --bg-1:          #0a0a0a;
  --bg-2:          #111111;
  --bg-glass:      rgba(255,255,255,0.04);
  --border:        rgba(255,255,255,0.08);
  --border-hover:  rgba(255,255,255,0.20);
  --text-1:        rgba(255,255,255,0.92);
  --text-2:        rgba(255,255,255,0.55);
  --text-3:        rgba(255,255,255,0.30);
  --accent:        #ffffff;
  --accent-glow:   rgba(255,255,255,0.12);
  --nav-bg:        rgba(0,0,0,0.72);
  --card-bg:       rgba(255,255,255,0.03);
  --shadow:        rgba(0,0,0,0.6);

  /* Transition */
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:        0.3s;
  --t-base:        0.6s;
  --t-slow:        1s;
}

[data-theme="light"] {
  --bg:            #f5f5f7;
  --bg-1:          #ffffff;
  --bg-2:          #f0f0f2;
  --bg-glass:      rgba(255,255,255,0.72);
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.25);
  --text-1:        rgba(0,0,0,0.90);
  --text-2:        rgba(0,0,0,0.52);
  --text-3:        rgba(0,0,0,0.28);
  --accent:        #1d1d1f;
  --accent-glow:   rgba(0,0,0,0.08);
  --nav-bg:        rgba(245,245,247,0.80);
  --card-bg:       rgba(0,0,0,0.02);
  --shadow:        rgba(0,0,0,0.12);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}

::selection { background: rgba(255,255,255,0.15); }
[data-theme="light"] ::selection { background: rgba(0,0,0,0.12); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* ---------- Boot Screen ---------- */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  transition: background 0s;
}

/* 浅色模式开屏 */
[data-theme="light"] #boot-screen {
  background: #f5f5f7;
}
[data-theme="light"] .boot-glow {
  background: radial-gradient(circle, rgba(120,140,255,0.10) 0%, transparent 70%);
}
[data-theme="light"] .boot-name-cn {
  color: #1d1d1f;
}
[data-theme="light"] .boot-name-en {
  color: rgba(0,0,0,0.25);
}

.boot-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1);   opacity: 0.4; }
  50%       { transform: scale(1.3); opacity: 1;   }
}

.boot-name-cn {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.05);
  animation: bootReveal var(--t-slow) var(--ease-out) 0.8s forwards;
  position: relative;
  z-index: 1;
}

.boot-name-en {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5em;
  color: rgba(255,255,255,0.35);
  opacity: 0;
  filter: blur(6px);
  animation: bootReveal 0.8s var(--ease-out) 1.1s forwards;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

@keyframes bootReveal {
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

.boot-screen-exit {
  animation: bootExit 0.6s var(--ease-out) forwards;
}

@keyframes bootExit {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ---------- Navbar ---------- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 48px;
  background: transparent;
  transition: background var(--t-fast) var(--ease-out),
              backdrop-filter var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  border-bottom: 1px solid transparent;
  opacity: 0;
}

#navbar.visible {
  opacity: 1;
  transition: opacity var(--t-base) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              backdrop-filter var(--t-fast) var(--ease-out);
}

#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-color: var(--border);
}

.nav-logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-1);
  flex: 1;
  transition: opacity var(--t-fast);
}
.nav-logo:hover { opacity: 0.65; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 450;
  transition: color var(--t-fast);
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-1); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 36px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: color var(--t-fast), background var(--t-fast);
  font-size: 16px;
}
.theme-toggle:hover { color: var(--text-1); background: var(--bg-glass); }

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}
.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text-1);
  transition: transform var(--t-fast) var(--ease-out),
              opacity var(--t-fast);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out);
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-size: 36px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.02em;
  opacity: 0.85;
  transition: opacity var(--t-fast);
}
.mobile-menu a:hover { opacity: 1; }

/* ---------- Hero ---------- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 48px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse 80% 60% at 20% 40%,
    rgba(80,80,120,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 60%,
    rgba(40,40,80,0.10) 0%, transparent 60%);
  animation: gradientDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}
[data-theme="light"] .hero-bg {
  background: radial-gradient(ellipse 80% 60% at 20% 40%,
    rgba(160,170,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 80% 60%,
    rgba(200,160,255,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 60% 20%,
    rgba(130,210,220,0.10) 0%, transparent 50%);
}

@keyframes gradientDrift {
  0%   { transform: translate(0%, 0%) rotate(0deg); }
  100% { transform: translate(2%, 3%) rotate(2deg); }
}

/* Hero decorative elements */
.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Floating orbs — 深色模式 */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 1;
}
.hero-orb-1 {
  width: 460px; height: 460px;
  top: 8%; right: 5%;
  background: radial-gradient(circle, rgba(100,100,255,0.50) 0%, rgba(100,100,255,0.15) 45%, transparent 70%);
  animation: orbFloat1 12s ease-in-out infinite alternate;
}
.hero-orb-2 {
  width: 340px; height: 340px;
  top: 50%; right: 14%;
  background: radial-gradient(circle, rgba(170,70,230,0.45) 0%, rgba(170,70,230,0.12) 45%, transparent 70%);
  animation: orbFloat2 15s ease-in-out infinite alternate;
}
.hero-orb-3 {
  width: 220px; height: 220px;
  top: 25%; right: 32%;
  background: radial-gradient(circle, rgba(50,200,220,0.42) 0%, rgba(50,200,220,0.10) 45%, transparent 70%);
  animation: orbFloat3 10s ease-in-out infinite alternate;
}

/* 浅色模式光球 — 用柔和的粉蓝/薰衣草/薄荷色调 */
[data-theme="light"] .hero-orb-1 {
  background: radial-gradient(circle, rgba(120,140,255,0.32) 0%, rgba(120,140,255,0.08) 45%, transparent 70%);
}
[data-theme="light"] .hero-orb-2 {
  background: radial-gradient(circle, rgba(200,130,255,0.28) 0%, rgba(200,130,255,0.06) 45%, transparent 70%);
}
[data-theme="light"] .hero-orb-3 {
  background: radial-gradient(circle, rgba(80,210,200,0.26) 0%, rgba(80,210,200,0.05) 45%, transparent 70%);
}
[data-theme="light"] .hero-orb { opacity: 1; filter: blur(50px); }

@keyframes orbFloat1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 20px) scale(1.08); }
}
@keyframes orbFloat2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(25px, -15px) scale(0.92); }
}
@keyframes orbFloat3 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-15px, -25px) scale(1.12); }
}

/* Floating geometric shapes */
.hero-geo {
  position: absolute;
  border: 1.5px solid rgba(255,255,255,0.22);
  opacity: 0.8;
}
.hero-geo-1 {
  width: 72px; height: 72px;
  top: 18%; right: 15%;
  border-radius: 16px;
  transform: rotate(25deg);
  animation: geoSpin 20s linear infinite;
}
.hero-geo-2 {
  width: 44px; height: 44px;
  top: 60%; right: 8%;
  border-radius: 50%;
  animation: geoFloat 8s ease-in-out infinite alternate;
}
.hero-geo-3 {
  width: 28px; height: 28px;
  top: 38%; right: 42%;
  border-radius: 5px;
  transform: rotate(45deg);
  animation: geoFloat 6s ease-in-out infinite alternate-reverse;
}

/* 浅色几何体 */
[data-theme="light"] .hero-geo { border-color: rgba(0,0,0,0.14); opacity: 0.7; }

@keyframes geoSpin {
  to { transform: rotate(385deg); }
}
@keyframes geoFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  100% { transform: translateY(-20px) rotate(18deg); opacity: 0.35; }
}

/* Ring decoration */
.hero-ring {
  position: absolute;
  width: 360px; height: 360px;
  top: 15%; right: 2%;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.16);
  opacity: 0.45;
  animation: ringPulse 8s ease-in-out infinite alternate;
}
@keyframes ringPulse {
  0%   { transform: scale(1); opacity: 0.45; }
  100% { transform: scale(1.15); opacity: 0.20; }
}
[data-theme="light"] .hero-ring {
  border-color: rgba(0,0,0,0.12);
  opacity: 0.35;
}

/* Dot grid decoration */
.hero-dots {
  position: absolute;
  width: 160px; height: 160px;
  bottom: 16%; right: 22%;
  opacity: 0.45;
  background-image: radial-gradient(circle, rgba(255,255,255,0.45) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  animation: dotsDrift 12s ease-in-out infinite alternate;
}
@keyframes dotsDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-12px, 12px); }
}
[data-theme="light"] .hero-dots {
  background-image: radial-gradient(circle, rgba(0,0,0,0.22) 1.2px, transparent 1.2px);
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
}

.hero-title {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 24px;
  opacity: 0;
  filter: blur(8px);
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-2);
  font-weight: 400;
  line-height: 1.55;
  max-width: 520px;
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(12px);
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  opacity: 0;
  transform: translateY(12px);
}

.hero-tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.hero-tag:hover { border-color: var(--border-hover); color: var(--text-2); }

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(12px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
  transform: translateY(-2px);
}

/* Hero reveal animations (triggered by JS after boot) */
.hero-animate .hero-eyebrow {
  animation: fadeUp var(--t-base) var(--ease-out) 0s forwards;
}
.hero-animate .hero-title {
  animation: blurReveal var(--t-slow) var(--ease-out) 0.15s forwards;
}
.hero-animate .hero-subtitle {
  animation: fadeUp var(--t-base) var(--ease-out) 0.35s forwards;
}
.hero-animate .hero-tags {
  animation: fadeUp var(--t-base) var(--ease-out) 0.5s forwards;
}
.hero-animate .hero-cta {
  animation: fadeUp var(--t-base) var(--ease-out) 0.65s forwards;
}

@keyframes blurReveal {
  to { opacity: 1; filter: blur(0); }
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Section Shared ---------- */
.section {
  padding: 140px 48px;
  position: relative;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text-1);
}

/* Scroll reveal base state */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out),
              filter var(--t-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Stagger children */
.reveal-group > *:nth-child(1) { transition-delay: 0s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.4s; }

/* ---------- Projects ---------- */
#projects {
  padding: 120px 48px;
  background: var(--bg-1);
}

#projects .section-header {
  max-width: 900px;
  margin: 0 auto 64px;
}

.projects-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Card */
.project-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
}
.project-card:hover {
  border-color: var(--border-hover);
}
.project-card.expanded {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px var(--shadow);
}

/* Header (clickable) */
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.project-card-header:hover {
  background: var(--bg-glass);
}

.project-card-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.project-card-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  min-width: 24px;
}

.project-card-title {
  font-size: 20px;
  font-weight: 650;
  color: var(--text-1);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.project-card-sub {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

/* Arrow (rotates on expand) */
.project-card-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-fast),
              color var(--t-fast);
}
.project-card.expanded .project-card-arrow {
  transform: rotate(180deg);
  border-color: var(--border-hover);
  color: var(--text-1);
}

/* Body (collapsible) */
.project-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out),
              padding 0.5s var(--ease-out),
              opacity 0.4s var(--ease-out);
  padding: 0 32px;
  opacity: 0;
}
.project-card.expanded .project-card-body {
  max-height: 600px;
  padding: 0 32px 28px;
  opacity: 1;
}

.project-card-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-top: 4px;
}

.project-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-tag {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.project-tag:hover {
  border-color: var(--border-hover);
  color: var(--text-2);
}

/* ---------- About ---------- */
#about {
  background: var(--bg);
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 60px;
}

.about-quote {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text-1);
  margin-bottom: 32px;
}

.about-quote em {
  font-style: normal;
  color: var(--text-2);
}

.about-intro {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 48px;
}

.about-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  transition: border-color var(--t-fast);
}
.timeline-item:last-child { border-bottom: 1px solid var(--border); }

.timeline-year {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  width: 44px;
  flex-shrink: 0;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.timeline-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}

.about-philosophy {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  margin-top: 48px;
}

.philosophy-text {
  font-size: 17px;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 12px;
}

.philosophy-author {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ---------- Contact ---------- */
#contact {
  background: var(--bg-1);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 60px;
}

.contact-headline {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-1);
  margin-bottom: 24px;
}

.contact-sub {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 380px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-2);
  transition: color var(--t-fast);
}
.contact-info-item:hover { color: var(--text-1); }

.contact-info-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Contact Right */
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qq-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  transition: all var(--t-fast) var(--ease-out);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
}
.qq-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--shadow);
}

.qq-btn-icon {
  width: 40px;
  height: 40px;
  background: #1677ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.wechat-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  gap: 20px;
  align-items: center;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.wechat-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px var(--shadow);
}

.wechat-qr {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  flex-shrink: 0;
}

.wechat-info h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.wechat-info p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}
.wechat-id {
  font-size: 13px;
  color: var(--text-3);
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* ---------- Messages (留言板) ---------- */
#messages {
  background: var(--bg);
  padding: 120px 48px;
}

.messages-header {
  max-width: 1100px;
  margin: 0 auto 60px;
}

.message-form-wrap {
  max-width: 1100px;
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.message-field-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  position: relative;
}

.form-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  display: block;
  transition: color var(--t-fast);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-1);
  font-family: inherit;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  resize: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }

.form-input:focus,
.form-textarea:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea { min-height: 80px; }

.btn-send {
  height: 48px;
  padding: 0 28px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  align-self: end;
}
.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.messages-list {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-bubble {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  opacity: 0;
  transform: translateY(12px);
  animation: msgIn 0.5s var(--ease-out) forwards;
}

.message-pinned {
  border-color: rgba(255,214,10,0.25);
  background: rgba(255,214,10,0.04);
}
[data-theme="light"] .message-pinned {
  border-color: rgba(180,140,0,0.30);
  background: rgba(180,140,0,0.05);
}

@keyframes msgIn {
  to { opacity: 1; transform: translateY(0); }
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.msg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.msg-time {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.msg-text {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
}

.msg-empty {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  padding: 48px 0;
}

.msg-loading {
  text-align: center;
  padding: 32px 0;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- Messages Pagination ---------- */
.messages-pagination {
  max-width: 1100px;
  margin: 40px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.msg-page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
  font-family: inherit;
}
.msg-page-btn:hover:not(.active):not(:disabled) {
  border-color: var(--border-hover);
  color: var(--text-1);
  background: var(--bg-glass);
}
.msg-page-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.msg-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.msg-page-info {
  font-size: 13px;
  color: var(--text-3);
  padding: 0 12px;
}

/* ---------- Footer ---------- */
footer {
  padding: 40px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-3);
}

.footer-loc {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* ---------- Responsive ---------- */

/* ---- Tablet & below (900px) ---- */
@media (max-width: 900px) {
  /* Navbar */
  #navbar { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Hero */
  #hero { padding: 120px 24px 80px; }

  /* 装饰元素缩小 */
  .hero-orb-1 { width: 250px; height: 250px; right: 5%; }
  .hero-orb-2 { width: 180px; height: 180px; right: 15%; }
  .hero-orb-3 { width: 120px; height: 120px; right: 30%; }
  .hero-ring { width: 200px; height: 200px; right: 2%; }
  .hero-dots { width: 80px; height: 80px; right: 18%; bottom: 15%; }
  .hero-geo-1 { width: 40px; height: 40px; right: 12%; top: 18%; }
  .hero-geo-2 { width: 24px; height: 24px; right: 8%; top: 60%; }
  .hero-geo-3 { display: none; }

  /* Sections */
  .section { padding: 100px 24px; }
  #projects { padding: 100px 24px; }
  #projects .section-header { margin-bottom: 48px; }
  #messages { padding: 100px 24px; }

  /* Project cards */
  .project-card-header { padding: 22px 20px; }
  .project-card.expanded .project-card-body { padding: 0 20px 22px; }
  .project-card-num { display: none; }

  /* About */
  .about-layout { grid-template-columns: 1fr; gap: 48px; }

  /* Contact */
  .contact-layout { grid-template-columns: 1fr; gap: 48px; }
  .contact-headline { font-size: clamp(28px, 7vw, 44px); }
  .wechat-card { flex-direction: column; text-align: center; }
  .wechat-qr { margin: 0 auto; }

  /* Messages */
  .message-form-wrap { grid-template-columns: 1fr; }
  .message-row { grid-template-columns: 1fr; }
  .btn-send { width: 100%; text-align: center; }

  /* Footer */
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 28px 24px; }
}

/* ---- Mobile (560px) ---- */
@media (max-width: 560px) {
  /* Boot */
  .boot-name-cn { font-size: 38px; }

  /* Hero */
  #hero { padding: 100px 20px 60px; min-height: auto; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.15em; }
  .hero-tags { gap: 8px; }
  .hero-tag { font-size: 11px; padding: 3px 10px; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; justify-content: center; padding: 14px 24px; }

  /* 隐藏大部分装饰，只留一个淡光球 */
  .hero-orb-1 { width: 200px; height: 200px; opacity: 0.2; right: -20%; top: 10%; }
  .hero-orb-2, .hero-orb-3 { display: none; }
  .hero-ring, .hero-dots { display: none; }
  .hero-geo-1 { display: none; }
  .hero-geo-2 { width: 18px; height: 18px; right: 10%; top: 70%; opacity: 0.2; }

  /* Section */
  .section { padding: 80px 20px; }
  #projects { padding: 80px 20px; }
  #messages { padding: 80px 20px; }

  /* Section titles */
  .section-title { font-size: clamp(24px, 7vw, 32px); }

  /* Project cards - 更大的触控区域 */
  .project-card-header { padding: 20px 16px; }
  .project-card-title { font-size: 17px; }
  .project-card-sub { font-size: 12px; }
  .project-card.expanded .project-card-body { padding: 0 16px 20px; }
  .project-card-desc { font-size: 14px; line-height: 1.65; }

  /* About */
  .about-layout { padding-top: 40px; }
  .about-quote { font-size: clamp(20px, 5.5vw, 26px); }
  .about-intro { font-size: 15px; }
  .about-philosophy { padding: 20px; margin-top: 36px; }
  .philosophy-text { font-size: 15px; }
  .timeline-item { padding: 16px 0; gap: 16px; }
  .timeline-year { width: 38px; font-size: 12px; }
  .timeline-content h4 { font-size: 14px; }
  .timeline-content p { font-size: 13px; }

  /* Contact */
  #contact { background: var(--bg-1); }
  .contact-layout { padding-top: 40px; }
  .contact-headline { font-size: clamp(26px, 8vw, 36px); }
  .contact-sub { font-size: 15px; margin-bottom: 32px; }
  .qq-btn { padding: 16px 20px; }
  .wechat-card { padding: 20px; }
  .wechat-qr { width: 80px; height: 80px; }

  /* Messages form */
  .messages-header { margin-bottom: 40px; }
  .message-form-wrap { margin-bottom: 40px; }
  .form-input { padding: 12px 14px; font-size: 14px; }
  .btn-send { height: 44px; font-size: 14px; }
  .message-bubble { padding: 16px 18px; }
  .msg-text { font-size: 14px; }

  /* Footer */
  .footer-copy, .footer-loc { font-size: 12px; }
  footer { padding: 24px 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
