:root {
  --ink: #17221d;
  --muted: #738078;
  --paper: #f3f5ed;
  --white: #ffffff;
  --forest: #173d32;
  --forest-dark: #102e26;
  --lime: #d8f99d;
  --line: #dfe4dc;
  --serif: Georgia, "Times New Roman", serif;
  --mono: Consolas, "SFMono-Regular", monospace;
  --shadow: 0 28px 80px rgba(20, 49, 39, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
#magicCanvas { position: fixed; inset: 0; z-index: 20; width: 100%; height: 100%; opacity: .92; pointer-events: none; transition: opacity .3s ease; }
body.page-leaving #magicCanvas { opacity: 0; }

.intro-shell {
  display: grid;
  grid-template-columns: 56% 44%;
  min-height: 100vh;
  min-height: 100svh;
  transition: transform .56s cubic-bezier(.76, 0, .24, 1), opacity .56s ease;
  will-change: transform;
}
body.page-leaving .intro-shell { opacity: .85; transform: translateX(-100vw); }

.intro-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 38px clamp(40px, 5.5vw, 86px) 30px;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 86% 18%, rgba(216, 249, 157, .09), transparent 27%),
    radial-gradient(circle at 8% 90%, rgba(109, 151, 114, .12), transparent 30%),
    linear-gradient(145deg, #1b493b 0%, var(--forest) 50%, var(--forest-dark) 100%);
}
.intro-main::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
  pointer-events: none;
}
.intro-main::after { position: absolute; right: -210px; bottom: -250px; width: 560px; height: 560px; border: 1px solid rgba(216, 249, 157, .09); border-radius: 50%; content: ""; }
.intro-brand, .intro-footer, .intro-content { position: relative; z-index: 2; }
.intro-brand { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--forest); background: var(--lime); font-family: var(--serif); font-size: 25px; font-weight: 700; }
.brand-name { font-size: 11px; font-weight: 700; letter-spacing: 2.3px; }
.brand-meta { color: rgba(255, 255, 255, .35); font-family: var(--mono); font-size: 8px; letter-spacing: 1.4px; }

.intro-content { width: min(100%, 620px); margin: auto 0; padding: 58px 0 52px; animation: intro-rise .7s .08s both; }
.intro-kicker { display: flex; align-items: center; gap: 11px; color: var(--lime); font-size: 9px; font-weight: 600; letter-spacing: 2.2px; }
.intro-kicker > span { width: 30px; height: 1px; background: var(--lime); }
.intro-content h1 { margin-top: 23px; font-size: clamp(54px, 5.8vw, 82px); font-weight: 400; line-height: 1.22; letter-spacing: -3px; }
.intro-content h1 strong { color: var(--lime); font-weight: 550; }
.intro-role { margin-top: 22px; color: rgba(255, 255, 255, .9); font-size: clamp(16px, 1.6vw, 22px); font-weight: 400; letter-spacing: .5px; }
.intro-role span { margin-inline: 8px; color: var(--lime); font-family: var(--serif); font-style: italic; }
.intro-description { max-width: 540px; margin-top: 20px; color: rgba(255, 255, 255, .55); font-size: 13px; line-height: 2; }
.intro-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.intro-tags span { padding: 6px 11px; border: 1px solid rgba(216, 249, 157, .14); border-radius: 20px; color: rgba(230, 245, 220, .72); background: rgba(255, 255, 255, .035); font-size: 9px; }

.enter-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 252px;
  min-height: 62px;
  margin-top: 37px;
  padding: 7px 8px 7px 25px;
  border-radius: 14px;
  color: var(--forest);
  background: var(--lime);
  box-shadow: 0 15px 35px rgba(5, 26, 19, .2);
  font-size: 14px;
  font-weight: 650;
  transition: transform .25s, box-shadow .25s, background .25s;
}
.button-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 10px; color: var(--lime); background: var(--forest); }
.button-icon svg { width: 22px; height: 22px; transition: transform .25s; }
.enter-button:hover { background: #e3ffb0; box-shadow: 0 20px 42px rgba(5, 26, 19, .28); transform: translateY(-3px); }
.enter-button:hover .button-icon svg { transform: translateX(3px); }
.enter-button.is-entering { pointer-events: none; }
.enter-button.is-entering .button-icon svg { animation: arrow-pulse .7s infinite alternate; }
.intro-footer { display: flex; justify-content: space-between; gap: 20px; color: rgba(255, 255, 255, .28); font-family: var(--mono); font-size: 8px; letter-spacing: 1.3px; }

.intro-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 38px clamp(28px, 3.5vw, 54px) 30px;
  overflow: hidden;
  background: radial-gradient(circle at 72% 30%, #e4edda 0%, transparent 37%), var(--paper);
}
.visual-status { position: relative; z-index: 5; display: flex; justify-content: space-between; gap: 15px; color: #7c8a76; font-family: var(--mono); font-size: 8px; letter-spacing: 1px; }
.visual-status > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.visual-status i { width: 6px; height: 6px; border-radius: 50%; background: #7da75d; box-shadow: 0 0 0 4px rgba(125, 167, 93, .12); }
.photo-composition { position: relative; display: grid; flex: 1; min-height: 570px; place-items: center; }
.visual-orbit { position: absolute; display: block; border: 1px solid #d4dfca; border-radius: 50%; }
.orbit-one { width: min(480px, 95%); aspect-ratio: 1; }
.orbit-two { width: min(380px, 76%); aspect-ratio: 1; border-style: dashed; transform: rotate(25deg); }

.intro-code-card {
  position: absolute;
  top: 14%;
  left: -4%;
  z-index: 1;
  width: min(325px, 74%);
  overflow: hidden;
  border-radius: 18px;
  color: #dce9df;
  background: #142f27;
  box-shadow: 0 24px 55px rgba(23, 61, 50, .2);
  transform: rotate(-12deg);
  animation: code-arrive .8s .15s both;
}
.code-card-header { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #8da398; font-family: var(--mono); font-size: 8px; }
.window-dots { display: flex; gap: 5px; }
.window-dots span { width: 7px; height: 7px; border-radius: 50%; background: #537164; }
.window-dots span:first-child { background: #d28d74; }
.window-dots span:nth-child(2) { background: #d6bd74; }
.window-dots span:last-child { background: #91b77a; }
.code-card-body { padding: 21px 16px; font-family: var(--mono); font-size: 9px; line-height: 2.1; }
.code-card-body p { display: grid; grid-template-columns: 24px 1fr; }
.code-card-body p > span { color: #49685b; }
.code-card-body code { white-space: nowrap; }
.code-card-body b { color: #a8c9e2; font-weight: 400; }
.code-card-body em { color: var(--lime); font-style: normal; }
.code-card-body i { color: #e7bb84; font-style: normal; }
.code-card-footer { display: flex; justify-content: space-between; padding: 11px 15px; border-top: 1px solid rgba(255, 255, 255, .08); color: #89a77a; font-family: var(--mono); font-size: 7px; letter-spacing: 1px; }

.intro-photo-card {
  position: relative;
  z-index: 2;
  width: min(350px, 76%);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  transform: translateX(36px) rotate(3deg);
  animation: photo-arrive .85s .2s both;
  backdrop-filter: blur(12px);
}
.intro-photo-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg, #dfe8d5, #b9cdb0); }
.intro-photo-frame > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.intro-photo-card:hover img { transform: scale(1.03); }
.intro-photo-fallback { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; color: #6d8163; text-align: center; }
.intro-photo-fallback > span { font-family: var(--serif); font-size: 58px; font-style: italic; }
.intro-photo-fallback small { font-size: 8px; letter-spacing: 3px; }
.intro-photo-caption { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; gap: 12px; padding: 55px 18px 18px; color: var(--white); background: linear-gradient(transparent, rgba(12, 38, 30, .78)); font-size: 8px; font-weight: 600; letter-spacing: 1.4px; }
.visual-note { position: absolute; right: 1%; bottom: 11%; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 14px 17px; border-radius: 13px; color: var(--white); background: var(--forest); box-shadow: 0 18px 40px rgba(23, 61, 50, .2); font-size: 10px; line-height: 1.6; transform: rotate(-4deg); }
.visual-note > span { color: var(--lime); font-size: 23px; }
.visual-note strong { color: var(--lime); font-size: 12px; font-weight: 500; }
.visual-footer { position: relative; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 13px; color: #8b9884; font-family: var(--mono); font-size: 7px; letter-spacing: 1.3px; }
.visual-footer i { width: 3px; height: 3px; border-radius: 50%; background: #a5b49d; }

:focus-visible { outline: 3px solid rgba(216, 249, 157, .6); outline-offset: 4px; }
@keyframes intro-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes code-arrive { from { opacity: 0; transform: translateX(-25px) rotate(-16deg); } to { opacity: 1; transform: translateX(0) rotate(-12deg); } }
@keyframes photo-arrive { from { opacity: 0; transform: translate(55px, 25px) rotate(6deg); } to { opacity: 1; transform: translate(36px, 0) rotate(3deg); } }
@keyframes arrow-pulse { to { transform: translateX(4px); } }

/* 卡片与照片统一使用独立的 translate 属性，保留原有旋转和叠放位置。 */
.intro-code-card, .intro-photo-card, .visual-note, .intro-tags span {
  translate: 0 0;
  transition: translate .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease, border-color .28s ease;
}
.intro-photo-frame > img { transition: transform .45s ease, translate .3s cubic-bezier(.2, .8, .2, 1); }

@media (hover: hover) and (pointer: fine) {
  .intro-code-card:hover, .intro-photo-card:hover, .visual-note:hover, .intro-tags span:hover { translate: 0 -6px; }
  .intro-code-card:hover, .intro-photo-card:hover { box-shadow: 0 32px 75px rgba(20, 49, 39, .2); }
  .intro-tags span:hover { border-color: rgba(216, 249, 157, .34); }
  .intro-photo-card:hover img { translate: 0 -4px; }
}

@media (max-width: 1080px) {
  .intro-shell { grid-template-columns: 54% 46%; }
  .intro-main { padding-inline: 44px; }
  .intro-content h1 { font-size: 58px; }
  .intro-code-card { left: -7%; }
  .intro-photo-card { width: min(320px, 78%); transform: translateX(25px) rotate(3deg); }
  @keyframes photo-arrive { from { opacity: 0; transform: translate(45px, 25px) rotate(6deg); } to { opacity: 1; transform: translate(25px, 0) rotate(3deg); } }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .intro-shell { display: block; }
  .intro-main { min-height: 100vh; min-height: 100svh; padding: 30px 36px; }
  .intro-content { max-width: 640px; }
  .intro-content h1 { font-size: clamp(54px, 10vw, 74px); }
  .intro-visual { min-height: 720px; padding: 30px 36px; }
  .photo-composition { min-height: 610px; }
  .intro-code-card { left: 9%; }
  .intro-photo-card { width: 340px; }
  .visual-note { right: 10%; }
}

@media (max-width: 520px) {
  .intro-main { padding: 24px 22px; }
  .brand-meta { display: none; }
  .intro-content { padding: 56px 0 44px; }
  .intro-kicker { font-size: 7px; letter-spacing: 1.6px; }
  .intro-content h1 { margin-top: 20px; font-size: clamp(48px, 15vw, 64px); letter-spacing: -2px; }
  .intro-role { font-size: 15px; line-height: 1.8; }
  .intro-role span { margin-inline: 4px; }
  .intro-description { font-size: 12px; }
  .enter-button { width: 100%; min-width: 0; }
  .intro-footer { font-size: 7px; }
  .intro-visual { min-height: 620px; padding: 26px 20px; }
  .visual-status { font-size: 6px; }
  .photo-composition { min-height: 530px; }
  .intro-code-card { top: 12%; left: -3%; width: 260px; }
  .code-card-body { padding: 16px 12px; font-size: 7px; }
  .intro-photo-card { width: min(285px, 82%); transform: translateX(15px) rotate(3deg); }
  .visual-note { right: 0; bottom: 9%; }
  @keyframes photo-arrive { from { opacity: 0; transform: translate(35px, 25px) rotate(6deg); } to { opacity: 1; transform: translate(15px, 0) rotate(3deg); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
