:root, [data-theme="dark"] {
  /* 夏日暮色：深海军蓝底 + 珊瑚/沙金/海沫点缀 */
  --bg: #0c1118;
  --bg-deep: #070a0f;
  --surface: rgba(255, 248, 231, 0.04);
  --surface-strong: rgba(255, 248, 231, 0.07);
  --border: rgba(255, 248, 231, 0.08);
  --border-hover: rgba(255, 248, 231, 0.18);
  --ice: #7a9ca8;
  --silver: #fff8e7;
  --violet: #e89a8c;
  --ice-dim: rgba(122, 156, 168, 0.65);
  --silver-dim: rgba(255, 248, 231, 0.55);
  --violet-dim: rgba(232, 154, 140, 0.5);
  --header-bg: rgba(12, 17, 24, 0.65);
  --footer-bg: rgba(12, 17, 24, 0.7);
  --star-color: 255, 248, 231;
  --nebula-1: rgba(232, 154, 140, 0.14);
  --nebula-2: rgba(122, 156, 168, 0.1);
  --nebula-3: rgba(232, 154, 140, 0.06);
  --sun: #f2c46a;
  --sea: #7a9ca8;
  --coral: #e89a8c;
  --sand: #d4c4a8;
  --sky: #9fb4c7;

  --radius: 1rem;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  /* 夏日白昼：暖沙纸白底 + 海蓝/珊瑚/阳光金 */
  --bg: #f7f4ed;
  --bg-deep: #ede8dd;
  --surface: rgba(36, 38, 43, 0.035);
  --surface-strong: rgba(36, 38, 43, 0.06);
  --border: rgba(36, 38, 43, 0.1);
  --border-hover: rgba(36, 38, 43, 0.22);
  --ice: #4a7a8a;
  --silver: #2b2622;
  --violet: #c46a5c;
  --ice-dim: rgba(74, 122, 138, 0.72);
  --silver-dim: rgba(43, 38, 34, 0.62);
  --violet-dim: rgba(196, 106, 92, 0.55);
  --header-bg: #f7f4ed;
  --footer-bg: #f7f4ed;
  --star-color: 115, 118, 125;
  --nebula-1: rgba(196, 106, 92, 0.1);
  --nebula-2: rgba(74, 122, 138, 0.08);
  --nebula-3: rgba(196, 106, 92, 0.06);
  --sun: #e9a93e;
  --sea: #4a7a8a;
  --coral: #c46a5c;
  --sand: #b8a88c;
  --sky: #7a9aaa;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 主题切换瞬间：禁用所有过渡，切换完一帧后自动恢复（由 space.js 控制） */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--silver);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: color 0.4s ease, background 0.4s ease;
}



/* 主内容区 */
main {
  position: relative;
  z-index: 1;
}

/* Hero 主视觉 — 参考 abc 布局，三段严格贴窗口四角 */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  padding: 0;
  margin: 0;
  max-width: none;
}

.hero-orbit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  z-index: 1;
}

/* 落日背景只在暗色模式显示，亮色下避免风格割裂 */
[data-theme="light"] .hero-orbit {
  display: none;
}

.orbit-system {
  width: min(90vh, 90vw);
  height: min(90vh, 90vw);
  max-width: 900px;
  max-height: 900px;
  will-change: transform; /* 呼吸动画走独立合成层，避免逐帧重绘 */
}

.orbit-system circle[stroke],
.orbit-system ellipse[stroke],
.orbit-system path[stroke] {
  transition: stroke 0.6s ease;
}

.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 8vw;
}

.hero-title {
  font-family: "Lobster", cursive;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--silver);
  text-align: left;
}

/* 右侧插画 — 拍立得堆叠 */
.polaroid-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* 列宽锁定为容器宽，防止被图片固有尺寸撑爆 */
  width: min(24vw, 280px);
  flex-shrink: 0;
  cursor: pointer;
}

/* 点击换片时的翻片动画 */
.polaroid-stack.switch-anim .hero-image.front img {
  animation: polaroid-switch 0.45s ease;
}

@keyframes polaroid-switch {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  35% {
    transform: scale(0.94) rotate(-1.5deg);
    opacity: 0.55;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.hero-image {
  grid-area: 1 / 1; /* 三层叠在同一格 */
  position: relative;
  width: 100%;
  margin: 0;
  background: var(--silver); /* 暗色下与文字同色，亮色下覆盖为白纸 */
  padding: 10px;
  padding-bottom: 52px; /* 相纸底部留白，可写日期或留言 */
  border-radius: 3px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-image.back {
  transform: rotate(-7deg) translate(-16px, -6px) scale(0.97);
  z-index: 1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.hero-image.mid {
  transform: rotate(4.5deg) translate(10px, 2px);
  z-index: 2;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.36);
}

.hero-image.front {
  transform: rotate(-2deg) translate(-3px, 5px);
  z-index: 3;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.25);
}

.polaroid-stack:hover .hero-image.front {
  transform: rotate(0deg) translate(-3px, 8px);
}

[data-theme="light"] .hero-image {
  background: #fff;
}

.hero-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f2efe9;
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 0 6vw;
  }

  .polaroid-stack {
    width: min(52vw, 240px);
  }

  .hero-image.back {
    transform: rotate(-6deg) translate(-10px, -4px);
  }

  .hero-image.mid {
    transform: rotate(3deg) translate(6px, 2px);
  }

  .hero-image.front {
    transform: rotate(-1deg) translate(-2px, 4px);
  }
}

.hero-subtitle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18%;
  text-align: center;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  letter-spacing: 0.12em;
  color: var(--silver-dim);
  font-weight: 300;
}

/* 旧标题分词样式已弃用，保留选择器避免未清理引用时报错 */
.title-word,
.title-deep,
.title-white,
.title-x {
  display: none;
}

.hero-actions {
  position: absolute;
  bottom: 6%;
  right: 4vw;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Lead 引语 — hero 下方的独立盒子 */
.lead {
  text-align: left;
  padding: 5rem 4vw;
  max-width: 1280px;
  margin: 0 auto;
}

.lead-text {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--silver-dim);
  line-height: 1.85;
  font-weight: 300;
  max-width: 520px;
}

.lead-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* 按钮 — 克制几何，无胶囊/无发光 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--surface);
  color: var(--silver);
  border-color: var(--border-hover);
}

.btn-primary:hover {
  background: var(--surface-strong);
  color: var(--ice);
  border-color: var(--ice-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--silver-dim);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--silver);
  border-color: var(--border-hover);
  background: var(--surface);
}

.btn-mail {
  background: var(--bg-deep);
  color: var(--silver);
  border-color: var(--border-hover);
  flex-shrink: 0;
}

.btn-mail:hover {
  background: var(--surface);
  color: var(--ice);
  border-color: var(--ice-dim);
}

.apply-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.apply-input {
  flex: 1 1 220px;
  max-width: 360px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--silver);
  padding: 0.75rem 1rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.apply-input::placeholder {
  color: var(--silver-dim);
}

.apply-input:focus {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

/* 通用区块 */
section {
  padding: 5rem 4vw;
  max-width: 1280px;
  margin: 0 auto;
}

.section-head {
  text-align: left;
  margin-bottom: 3rem;
}

.section-index {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--ice-dim);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  color: var(--silver);
  margin-bottom: 0.8rem;
}

.section-desc {
  color: var(--silver-dim);
  max-width: 520px;
  font-size: 1rem;
}

/* Mission 理念 — 纯文本流，类 Markdown */
.mission h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  color: var(--silver);
  margin-bottom: 0.6rem;
}

.mission h2 + p {
  color: var(--silver-dim);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 520px;
}

.mission p {
  color: var(--silver-dim);
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 0.6rem 0;
}

.mission p strong {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--silver);
}

/* Explore 轨迹 */
.explore-visual {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}

.explore {
  position: relative;
  z-index: 1;
}

.explore .section-head,
.explore .site-list {
  position: relative;
  z-index: 1;
}

.trajectory {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.site-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  border-top: 1px solid var(--border);
}

.site-list-item {
  border-bottom: 1px solid var(--border);
}

.site-list-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 0;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.site-list-item a:hover {
  color: var(--ice);
}

.site-list-item a[aria-disabled="true"] {
  pointer-events: none;
}

.site-list-item h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--silver);
  flex-shrink: 0;
}

.site-list-item p {
  color: var(--silver-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: right;
}

@media (max-width: 640px) {
  .site-list-item a {
    flex-direction: column;
    gap: 0.3rem;
  }

  .site-list-item p {
    text-align: left;
  }
}

/* 夏日二级域名示例列表 */
.subdomain-list {
  list-style: none;
  border-top: 1px solid var(--border);
}

.subdomain-list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--silver);
}

.subdomain-list-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  flex-shrink: 0;
}

.subdomain-list-meta {
  color: var(--silver-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: right;
}

@media (max-width: 640px) {
  .subdomain-list-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .subdomain-list-meta {
    text-align: left;
  }
}

/* 页脚 */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 3.5rem 4vw;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  text-align: right;
}

.footer-brand {
  font-family: "Lobster", cursive;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--silver);
  opacity: 0.9;
  margin: 0;
}

.footer-slogan {
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--silver-dim);
  margin: 0;
  opacity: 0.75;
}

.footer-copy {
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--silver-dim);
  margin: 0;
}

.footer-beian {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ice-dim);
  text-decoration: none;
  margin: 0;
}

.footer-beian:hover {
  color: var(--ice);
}

/* 响应式 */
@media (max-width: 768px) {
  .hero {
    padding: 0;
  }

  .hero-content {
    max-width: 100%;
  }

  section {
    padding: 4rem 4vw;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-right {
    align-items: center;
    text-align: center;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--silver-dim);
}

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
