.portal-page {
  --portal-max: 1120px;
  background:
    linear-gradient(var(--border), var(--border)) 0 0 / 1px 100% no-repeat,
    var(--background);
  background-position-x: max(24px, calc((100vw - var(--portal-max)) / 2));
}

.portal-page a {
  color: inherit;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 64px;
  padding-inline: max(24px, calc((100vw - var(--portal-max)) / 2));
  background: oklch(1 0 0 / 0.94);
  backdrop-filter: blur(12px);
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  margin-right: 28px;
}

.portal-nav a,
.back-to-play {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 690;
  text-decoration: none;
}

.portal-nav a:hover,
.back-to-play:hover {
  color: var(--ink);
}

.back-to-play {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

#portal-main {
  overflow: hidden;
}

.portal-hero,
.portal-section,
.play-return,
.portal-footer {
  width: min(var(--portal-max), calc(100% - 48px));
  margin-inline: auto;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  min-height: min(770px, calc(100vh - 64px));
  padding: clamp(80px, 11vw, 132px) 0;
}

.portal-kicker,
.section-label {
  margin: 0 0 18px;
  color: var(--mint-ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-kicker span {
  margin-right: 7px;
  color: var(--mint-strong);
  font-size: 0.64rem;
}

.hero-copy h1 {
  max-width: 10.5ch;
  margin: 0;
  font-size: clamp(3.25rem, 7.5vw, 6.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.portal-lede {
  max-width: 590px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.6vw, 1.22rem);
  line-height: 1.75;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 760;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 120ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.portal-button:hover {
  transform: translateY(-1px);
}

.portal-button-primary {
  background: var(--ink);
  color: white !important;
}

.portal-button-primary:hover {
  background: var(--mint-ink);
}

.portal-button-quiet {
  border-color: var(--border);
  background: var(--background);
  color: var(--ink);
}

.portal-button-quiet:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.platform-note {
  max-width: 54ch;
  margin: 15px 0 0;
  color: var(--muted-light);
  font-size: 0.78rem;
}

.pet-scene {
  position: relative;
  aspect-ratio: 0.95;
  min-height: 420px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, transparent 24px, oklch(0.87 0.009 235 / 0.42) 25px, transparent 26px) 0 0 / 52px 52px,
    linear-gradient(transparent 24px, oklch(0.87 0.009 235 / 0.42) 25px, transparent 26px) 0 0 / 52px 52px,
    var(--surface);
  overflow: hidden;
}

.pet-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: oklch(1 0 0 / 0.84);
}

.pet-window-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
}

.pet-window-bar i:nth-child(2) { background: var(--sand-base); }
.pet-window-bar i:nth-child(3) { background: var(--mint-base); }

.pet-window-bar span {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.pet-bubble {
  position: absolute;
  top: 20%;
  left: 8%;
  width: min(210px, 58%);
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-medium) var(--radius-medium) var(--radius-medium) 2px;
  background: var(--background);
  font-size: 0.82rem;
  font-weight: 680;
  box-shadow: 0 12px 34px oklch(0.22 0.025 279 / 0.07);
  animation: bubble-float 4s ease-in-out infinite;
}

.pixel-pet {
  position: absolute;
  right: 13%;
  bottom: 21%;
  width: 128px;
  height: 116px;
  filter: drop-shadow(0 20px 18px oklch(0.3 0.075 164 / 0.18));
  animation: pet-breathe 3.2s ease-in-out infinite;
}

.pet-face,
.pet-ear,
.pet-foot {
  position: absolute;
  display: block;
  background: var(--mint-strong);
}

.pet-face {
  inset: 18px 0 10px;
  border-radius: 24px 24px 17px 17px;
}

.pet-ear {
  top: 4px;
  width: 34px;
  height: 38px;
  border-radius: 10px 10px 2px 2px;
}

.pet-ear-left { left: 9px; transform: rotate(-8deg); }
.pet-ear-right { right: 9px; transform: rotate(8deg); }

.pet-eye,
.pet-mouth {
  position: absolute;
  display: block;
  background: var(--ink);
}

.pet-eye {
  top: 38px;
  width: 12px;
  height: 16px;
  border-radius: 4px;
}

.pet-eye-left { left: 32px; }
.pet-eye-right { right: 32px; }

.pet-mouth {
  left: 50%;
  top: 66px;
  width: 17px;
  height: 7px;
  border-radius: 0 0 12px 12px;
  transform: translateX(-50%);
}

.pet-foot {
  bottom: 0;
  width: 42px;
  height: 21px;
  border-radius: 5px 5px 13px 13px;
}

.pet-foot-left { left: 15px; }
.pet-foot-right { right: 15px; }

.pet-dock {
  position: absolute;
  right: 7%;
  bottom: 6%;
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: oklch(1 0 0 / 0.82);
}

.pet-dock i {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--surface-strong);
}

.pet-dock i:nth-child(2) { background: var(--mint-soft); }
.pet-dock i:nth-child(3) { background: var(--sand-soft); }

.portal-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1.32fr);
  gap: clamp(46px, 8vw, 108px);
  padding: clamp(82px, 10vw, 128px) 0;
  border-top: 1px solid var(--border);
}

.section-intro {
  align-self: start;
}

.section-intro h2,
.play-return h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.section-intro > p:last-child {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.feature-list {
  border-top: 1px solid var(--border-strong);
}

.feature-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.feature-index {
  color: var(--mint-strong);
  font-size: 0.72rem;
  font-weight: 820;
}

.feature-row h3 {
  margin: -5px 0 7px;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.feature-row p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.feature-tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.download-section {
  position: relative;
}

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

.download-option {
  position: relative;
  display: flex;
  min-height: 270px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--background);
  flex-direction: column;
}

.download-option[data-recommended="true"] {
  border-color: var(--mint-strong);
  background: linear-gradient(145deg, var(--mint-soft), var(--background) 62%);
}

.download-option[data-recommended="true"]::before {
  content: "这台设备";
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint-ink);
  color: white;
  font-size: 0.66rem;
  font-weight: 750;
}

.download-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.os-glyph {
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  place-items: center;
  font-size: 1.35rem;
  font-weight: 760;
}

.download-heading h3 {
  margin: 0;
  font-size: 1.36rem;
}

.download-heading p {
  margin: 3px 0 0;
  color: var(--muted-light);
  font-size: 0.78rem;
}

.download-option .portal-button {
  width: 100%;
  margin-top: auto;
}

.recommendation {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.download-trust {
  grid-column: 2;
  margin-top: -72px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.download-trust p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.download-trust a,
.guide-content a {
  color: var(--mint-ink);
  font-weight: 700;
  text-underline-offset: 3px;
}

.quick-start-section {
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1.32fr);
  background: linear-gradient(90deg, transparent 0, transparent calc((100vw - var(--portal-max)) / -2), var(--surface) calc((100vw - var(--portal-max)) / -2));
}

.quick-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.quick-steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 17px;
  padding: 0 0 28px;
}

.quick-steps li:not(:last-child) > span::after {
  content: "";
  position: absolute;
  top: 38px;
  bottom: -29px;
  left: 50%;
  width: 1px;
  background: var(--border);
}

.quick-steps li > span {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--background);
  color: var(--mint-ink);
  font-size: 0.76rem;
  font-weight: 800;
  place-items: center;
}

.quick-steps h3 {
  margin: 2px 0 5px;
  font-size: 1rem;
}

.quick-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.guide-stack {
  border-top: 1px solid var(--border-strong);
}

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

.guide-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 20px 2px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 760;
  list-style: none;
}

.guide-item summary::-webkit-details-marker {
  display: none;
}

.guide-item summary small {
  display: block;
  margin-bottom: 3px;
  color: var(--mint-strong);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-item summary i {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.guide-item summary i::before,
.guide-item summary i::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 1px;
  width: 16px;
  height: 2px;
  background: var(--ink);
  transition: transform 160ms var(--ease-out);
}

.guide-item summary i::after { transform: rotate(90deg); }
.guide-item[open] summary i::after { transform: rotate(0deg); }

.guide-content {
  padding: 0 42px 32px 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.guide-content ol,
.guide-content ul {
  margin: 0;
  padding-left: 1.25rem;
}

.guide-content li {
  margin: 0 0 10px;
  padding-left: 5px;
  line-height: 1.65;
}

.guide-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.84em;
}

.privacy-note {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px solid oklch(0.76 0.145 164 / 0.34);
  border-radius: var(--radius-small);
  background: var(--mint-soft);
  color: var(--mint-ink);
  line-height: 1.62;
}

.guide-links {
  margin: 18px 0 0;
}

.platform-help {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.platform-help section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.platform-help h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.platform-help p {
  line-height: 1.65;
}

.platform-help p:first-of-type { margin-top: 0; }
.platform-help p:last-child { margin-bottom: 0; }

.play-return {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(72px, 9vw, 104px) 0;
  border-top: 1px solid var(--border);
}

.play-return h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 24px 0 max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted-light);
  font-size: 0.76rem;
}

.portal-footer a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

@keyframes pet-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-5px) scaleY(0.985); }
}

@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (max-width: 880px) {
  .portal-nav {
    display: none;
  }

  .back-to-play {
    margin-left: auto;
  }

  .portal-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy h1 {
    max-width: 11ch;
  }

  .pet-scene {
    width: min(100%, 560px);
    min-height: 390px;
  }

  .portal-section {
    grid-template-columns: 1fr;
  }

  .section-intro {
    max-width: 620px;
  }

  .download-trust {
    grid-column: 1;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .portal-page {
    background-image: none;
  }

  .portal-header {
    min-height: 58px;
    padding-inline: max(16px, env(safe-area-inset-left));
  }

  .portal-header .brand > span:last-child {
    font-size: 0.9rem;
  }

  .back-to-play {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.74rem;
  }

  .portal-hero,
  .portal-section,
  .play-return,
  .portal-footer {
    width: calc(100% - 32px);
  }

  .portal-hero {
    gap: 48px;
    padding: 62px 0 72px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .portal-lede {
    margin-top: 22px;
    font-size: 1rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 28px;
  }

  .portal-button {
    width: 100%;
  }

  .pet-scene {
    min-height: 330px;
    aspect-ratio: 1;
  }

  .pixel-pet {
    right: 10%;
    width: 112px;
    height: 102px;
  }

  .pet-bubble {
    top: 18%;
    left: 6%;
  }

  .pet-dock {
    right: 5%;
  }

  .portal-section {
    gap: 44px;
    padding: 72px 0;
  }

  .section-intro h2 {
    font-size: 2.55rem;
  }

  .feature-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 11px;
  }

  .feature-tag {
    grid-column: 2;
    justify-self: start;
  }

  .download-grid,
  .platform-help {
    grid-template-columns: 1fr;
  }

  .download-option {
    min-height: 238px;
    padding: 22px;
  }

  .guide-content {
    padding-right: 2px;
  }

  .play-return {
    align-items: stretch;
    flex-direction: column;
    padding: 72px 0;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .hero-copy h1 {
    font-size: 2.85rem;
  }

  .pet-scene {
    min-height: 300px;
  }

  .pet-bubble {
    width: 56%;
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-pet,
  .pet-bubble {
    animation: none;
  }
}
