:root {
  color-scheme: light;
  --ink: #14181f;
  --ink-2: #2d3440;
  --muted: #6a7280;
  --line: #d9dee7;
  --paper: #fbf8f2;
  --surface: #ffffff;
  --amber: #f4b647;
  --coral: #d94f45;
  --teal: #168a91;
  --green: #24795a;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(20, 24, 31, .12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

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

input,
textarea,
select,
button {
  font: inherit;
}

main {
  min-height: calc(100vh - 136px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(251, 248, 242, .92);
  border-bottom: 1px solid rgba(20, 24, 31, .1);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--ink);
  border: 2px solid var(--amber);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: var(--ink-2);
  font-size: 14px;
  flex-wrap: wrap;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--coral);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(217, 79, 69, .22);
}

.button:hover,
button:hover {
  filter: brightness(.96);
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button-light {
  color: var(--ink);
  background: var(--amber);
  box-shadow: 0 10px 24px rgba(244, 182, 71, .25);
}

.button-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--teal);
  border: 1px solid rgba(22, 138, 145, .35);
  background: rgba(22, 138, 145, .08);
  border-radius: 999px;
  font-weight: 700;
}

.hero {
  min-height: clamp(560px, 82vh, 820px);
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center right;
  color: #fff;
  padding: clamp(42px, 8vw, 96px) clamp(20px, 5vw, 76px);
}

.hero-inner {
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--amber);
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

h4 {
  margin: 18px 0 8px;
  color: var(--ink-2);
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(17px, 2vw, 22px);
}

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

.hero-metrics {
  display: flex;
  gap: 10px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.hero-metrics span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(20, 24, 31, .42);
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
}

.section,
.dashboard-head,
.page-title,
.composer,
.story-hero,
.pricing-grid,
.auth-panel,
.content-page,
.install-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: 70px 0;
}

.band {
  width: 100%;
  padding-inline: max(20px, calc((100% - 1180px) / 2));
  background: #fff;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-head p,
.page-title p,
.dashboard-head p,
.composer-copy p,
.content-page p {
  color: var(--muted);
}

.feature-grid,
.character-grid,
.story-list,
.pricing-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature,
.story-card,
.character,
.episode,
.price-card,
.panel,
.form-card,
.install-card {
  background: var(--surface);
  border: 1px solid rgba(20, 24, 31, .1);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(20, 24, 31, .07);
}

.feature,
.story-card,
.character,
.episode,
.price-card,
.panel {
  padding: 22px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 30px;
  align-items: center;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-list span {
  padding: 12px 14px;
  background: #fff;
  border-left: 4px solid var(--teal);
  box-shadow: 0 6px 22px rgba(20, 24, 31, .08);
}

.flash {
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash-success {
  color: var(--green);
  border-color: rgba(36, 121, 90, .25);
  background: rgba(36, 121, 90, .08);
}

.flash-danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, .25);
  background: rgba(180, 35, 24, .08);
}

.flash-warning {
  color: #9a5c00;
  border-color: rgba(244, 182, 71, .4);
  background: rgba(244, 182, 71, .15);
}

.auth-panel,
.install-shell {
  display: grid;
  place-items: start center;
  padding: 70px 0;
}

.form-card,
.install-card {
  width: min(520px, 100%);
  padding: 28px;
}

.form-card.wide,
.install-card {
  width: 100%;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 138, 145, .14);
}

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

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

.muted {
  color: var(--muted);
}

.dashboard-head,
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 54px 0 24px;
}

.stats-row {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stats-row div {
  padding: 20px;
  color: #fff;
  background: var(--ink);
  border-top: 4px solid var(--amber);
}

.stats-row strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.stats-row span {
  color: rgba(255, 255, 255, .74);
}

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

.story-card {
  display: grid;
  min-height: 220px;
  align-content: space-between;
}

.story-card h3 a:hover {
  color: var(--coral);
}

.story-card footer,
.meta-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 36px;
  background: #fff;
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 64px 0;
}

.cost-box {
  margin-top: 20px;
  padding: 16px;
  color: #fff;
  background: var(--ink);
  border-left: 5px solid var(--amber);
}

.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  padding: 62px 0 26px;
}

.story-hero aside {
  padding: 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  border-top: 4px solid var(--amber);
}

.story-hero aside p {
  color: rgba(255, 255, 255, .78);
}

.inline-form {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.character dl {
  margin: 12px 0 0;
}

.character dt {
  color: var(--teal);
  font-weight: 800;
}

.character dd {
  margin: 0 0 8px;
}

.episode-list {
  display: grid;
  gap: 18px;
}

.episode-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.episode-title span {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 32px;
  background: var(--amber);
  font-weight: 900;
}

.hook {
  color: var(--coral);
  font-weight: 800;
}

.prompt-list {
  display: grid;
  gap: 8px;
}

.copy-chip {
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(22, 138, 145, .08);
  border: 1px solid rgba(22, 138, 145, .22);
  box-shadow: none;
  text-align: left;
  font-weight: 500;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 20px 0 70px;
}

.price-card strong {
  display: block;
  margin: 10px 0;
  font-size: 42px;
  color: var(--coral);
}

.admin-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 20px;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list a {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.row-form {
  display: inline-flex;
  gap: 6px;
  margin: 0 6px 6px 0;
  align-items: center;
}

.row-form input {
  width: 120px;
  min-height: 34px;
}

.row-form button {
  min-height: 34px;
  padding: 0 10px;
  box-shadow: none;
}

.content-page {
  padding: 70px 0;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 30px 20px;
  color: var(--muted);
  border-top: 1px solid rgba(20, 24, 31, .1);
}

.install-shell {
  min-height: 100vh;
}

.install-card {
  max-width: 880px;
}

.install-form h2 {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-header,
  .dashboard-head,
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .feature-grid,
  .story-list,
  .character-grid,
  .pricing-grid,
  .stats-row,
  .split,
  .composer,
  .story-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 640px;
    background-position: center;
  }
}

@media (max-width: 560px) {
  .section,
  .dashboard-head,
  .page-title,
  .composer,
  .story-hero,
  .content-page,
  .auth-panel {
    width: min(100% - 28px, 1180px);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-card,
  .install-card,
  .feature,
  .story-card,
  .character,
  .episode,
  .price-card,
  .panel {
    padding: 18px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-actions .button {
    width: 100%;
  }
}

