:root {
  color-scheme: light;
  --ink: #23212f;
  --muted: #6f6a7e;
  --paper: #fffaf0;
  --panel: #ffffff;
  --rose: #ff7f9f;
  --coral: #ffb16c;
  --mint: #8ee6c8;
  --sky: #78c7ff;
  --violet: #8d83ff;
  --line: #efe4d4;
  --shadow: 0 18px 48px rgba(78, 55, 94, 0.16);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(120, 199, 255, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 127, 159, 0.1) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
}

body:has(dialog[open]) {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(255, 127, 159, 0.28);
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a:hover {
  color: var(--ink);
  background: #fff2c4;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 36px;
  align-items: center;
  min-height: clamp(520px, 72vh, 720px);
  padding: 32px 0 60px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: #946c00;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(4.6rem, 10vw, 8.8rem);
  line-height: 0.9;
}

.subtitle {
  margin-bottom: 20px;
  color: #f05f82;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 900;
}

.hero-text {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

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

.primary-action,
.secondary-action,
.tab-button,
.copy-button,
.generate-button,
.card-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

.primary-action,
.secondary-action {
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), #ff9156);
  box-shadow: 0 14px 26px rgba(255, 127, 159, 0.28);
}

.secondary-action {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.hero-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 360px;
  min-width: 0;
}

.stage-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 177, 108, 0.9), rgba(120, 199, 255, 0.85)),
    radial-gradient(circle at 24% 20%, #fff8ce 0 12%, transparent 13%);
  box-shadow: var(--shadow);
}

.stage-frame::before,
.stage-frame::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  background: rgba(35, 33, 47, 0.82);
  height: 38px;
}

.stage-frame::before {
  top: 0;
}

.stage-frame::after {
  bottom: 0;
}

.stage-sun {
  position: absolute;
  width: 98px;
  height: 98px;
  top: 72px;
  right: 72px;
  border-radius: 50%;
  background: #fff3a8;
  box-shadow: 0 0 0 14px rgba(255, 243, 168, 0.28);
}

.stage-character {
  position: absolute;
  width: 120px;
  height: 178px;
  left: 46%;
  bottom: 70px;
  border-radius: 54px 54px 26px 26px;
  background:
    radial-gradient(circle at 50% 32px, #ffd8b7 0 30px, transparent 31px),
    linear-gradient(#ffe16a 0 58%, #ff7f9f 58%);
  transform: translateX(-50%);
  box-shadow: inset 0 -16px 0 rgba(35, 33, 47, 0.08);
}

.stage-character::before,
.stage-character::after {
  content: "";
  position: absolute;
  top: 78px;
  width: 18px;
  height: 82px;
  border-radius: 999px;
  background: #ffd8b7;
}

.stage-character::before {
  left: -10px;
  transform: rotate(12deg);
}

.stage-character::after {
  right: -10px;
  transform: rotate(-12deg);
}

.stage-camera {
  position: absolute;
  width: 142px;
  height: 88px;
  left: 16%;
  bottom: 110px;
  border-radius: 8px;
  background: #26233a;
  box-shadow: 18px 22px 0 rgba(35, 33, 47, 0.16);
}

.stage-camera::before {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  top: 17px;
  left: 42px;
  border-radius: 50%;
  border: 10px solid #78c7ff;
  background: #1b1830;
}

.stage-camera::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 32px;
  top: 26px;
  right: -52px;
  clip-path: polygon(0 0, 100% 18%, 100% 82%, 0 100%);
  background: #26233a;
}

.stage-shadow {
  position: absolute;
  width: 58%;
  height: 24px;
  left: 23%;
  bottom: 50px;
  border-radius: 50%;
  background: rgba(35, 33, 47, 0.16);
}

.section-heading {
  margin: 20px 0 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.atlas-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  column-gap: 24px;
  align-items: start;
}

.atlas-section .section-heading,
.toolbar,
.shot-grid {
  grid-column: 1;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  background: rgba(255, 250, 240, 0.88);
  backdrop-filter: blur(14px);
}

.tabs {
  position: sticky;
  top: 96px;
  z-index: 5;
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 3;
  gap: 8px;
  width: 150px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(78, 55, 94, 0.14);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
}

.tabs::before {
  content: "Filters";
  padding: 3px 2px 5px;
  color: #946c00;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tab-button {
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.12;
  text-align: left;
}

.tab-label,
.tab-zh {
  display: block;
}

.tab-label {
  font-size: 0.78rem;
}

.tab-zh {
  margin-top: 2px;
  font-size: 0.86rem;
}

.tab-button[aria-selected="true"] {
  color: #fff;
  border-color: transparent;
  background: #23212f;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(100%, 360px);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.search-box span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 10px 0 64px;
}

.shot-card,
.formula-card,
.starter-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(78, 55, 94, 0.08);
}

.shot-card {
  display: grid;
  overflow: hidden;
}

.shot-visual {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(145deg, var(--card-a), var(--card-b)),
    #f4f0ff;
}

.shot-visual:has(img.is-missing)::before {
  content: "";
  position: absolute;
  width: 44%;
  height: 54%;
  left: 11%;
  bottom: 10%;
  border-radius: 50% 50% 24% 24%;
  background:
    radial-gradient(circle at 50% 21%, #ffd9bd 0 16%, transparent 17%),
    linear-gradient(#ffe16a 0 58%, #ff7f9f 58%);
  box-shadow: 70px -22px 0 -34px rgba(255, 255, 255, 0.52);
}

.shot-visual:has(img.is-missing)::after {
  content: "";
  position: absolute;
  right: 10%;
  bottom: 16%;
  width: 32%;
  height: 24%;
  border-radius: 8px;
  background:
    radial-gradient(circle at 44% 50%, #8ee6c8 0 18%, #23212f 19% 33%, transparent 34%),
    #23212f;
  transform: rotate(var(--tilt));
}

.shot-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-visual img.is-missing {
  display: none;
}

.shot-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 6px;
  color: #23212f;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  font-weight: 900;
}

.shot-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.shot-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.shot-title-row h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.shot-title-row p,
.shot-brief,
.formula-card p,
.starter-item p {
  color: var(--muted);
  line-height: 1.55;
}

.shot-title-row p,
.shot-brief,
.starter-item p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.category-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  color: #4f3000;
  background: #fff0b8;
  font-size: 0.74rem;
  font-weight: 900;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--muted);
  background: #f4f0ff;
  font-size: 0.75rem;
  font-weight: 750;
}

.card-button,
.copy-button,
.generate-button {
  width: 100%;
  color: #fff;
  background: #23212f;
}

.copy-button {
  background: #f05f82;
}

.generate-button {
  background: #23212f;
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.generate-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.starter-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 62px;
}

.starter-item {
  padding: 14px;
}

.starter-item strong {
  display: block;
  margin-bottom: 6px;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 72px;
}

.formula-card {
  padding: 18px;
}

.formula-card h3 {
  margin-bottom: 10px;
}

.formula-card code,
.dialog-panel code {
  display: block;
  overflow-x: auto;
  padding: 12px;
  border-radius: var(--radius);
  color: #23212f;
  background: #fff6d8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 28px 0 38px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer span,
.site-footer a {
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.shot-dialog {
  width: min(1180px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fffaf0;
  box-shadow: var(--shadow);
}

.shot-dialog::backdrop {
  background: rgba(35, 33, 47, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(35, 33, 47, 0.88);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.dialog-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 0;
  align-items: start;
}

.dialog-panel .shot-visual {
  min-height: 0;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.dialog-panel .shot-visual img {
  object-fit: contain;
  background: #fffaf0;
}

.dialog-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: calc((min(1180px, 100vw - 28px) - 340px) * 9 / 16);
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 240, 184, 0.55), rgba(255, 255, 255, 0.9)),
    #fff;
}

.dialog-copy h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

.dialog-copy p {
  margin-bottom: 0;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  line-height: 1.55;
}

.detail-list dt {
  color: var(--ink);
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
}

.dialog-hint {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dialog-hint span {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 8;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: #23212f;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stage {
    order: -1;
    min-height: 300px;
  }

  .shot-grid,
  .formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .starter-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .atlas-section {
    display: block;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tabs {
    position: static;
    display: flex;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    order: 2;
    padding: 0 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .tabs::before {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 42px;
    padding: 0 13px;
    text-align: center;
    white-space: nowrap;
  }

  .search-box {
    order: 1;
    width: 100%;
  }

  .dialog-panel {
    grid-template-columns: 1fr;
  }

  .dialog-copy {
    min-height: 0;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(1180px, calc(100% - 20px));
  }

  .topbar {
    align-items: flex-start;
  }

  .nav-links {
    max-width: 55%;
    overflow-x: auto;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .hero {
    padding-top: 14px;
  }

  h1 {
    font-size: clamp(3.7rem, 16vw, 4.4rem);
    overflow-wrap: anywhere;
  }

  .hero-stage {
    min-height: 0;
  }

  .stage-camera {
    transform: scale(0.82);
    transform-origin: left bottom;
  }

  .shot-grid,
  .starter-list,
  .formula-grid {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    line-height: 1.12;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }
}
