:root {
  --bg: #eef2f7;
  --bg-strong: #e6edf5;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-tint: #eef8f5;
  --ink: #111827;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #d9e2ec;
  --line-strong: #c7d3df;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --success: #168056;
  --warning: #b7791f;
  --danger: #c2413b;
  --sidebar: #111827;
  --sidebar-2: #172033;
  --sidebar-line: rgba(255, 255, 255, 0.09);
  --shadow: 0 14px 38px rgba(17, 24, 39, 0.08);
  --shadow-strong: 0 22px 60px rgba(17, 24, 39, 0.14);
  --brand-red: #d92d45;
  --brand-gold: #f59e0b;
  --brand-cyan: #0ea5a3;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(230, 237, 245, 0.9), rgba(238, 242, 247, 0.94)),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 12px;
  overflow-y: auto;
  color: #e5edf7;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(15, 118, 110, 0.08)),
    var(--sidebar);
  border-right: 1px solid var(--sidebar-line);
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin-bottom: 12px;
  padding: 9px 10px 16px;
  color: #ffffff;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 4px;
  color: #a7b5c6;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding-bottom: 18px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin: 8px 4px 0;
  padding: 7px 9px;
  color: #a9b7c9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  list-style: none;
}

.nav-group::-webkit-details-marker {
  display: none;
}

.nav-group::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.nav-section[open] .nav-group {
  color: #d8e6f6;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
}

.nav-section[open] .nav-group::after {
  transform: rotate(45deg);
}

.nav-section-items {
  display: grid;
  gap: 4px;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px 8px 16px;
  color: #dbe4f0;
  border: 1px solid transparent;
  border-radius: 8px;
}

.side-nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 10px;
  background: #526174;
  border-radius: 50%;
}

.side-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.side-nav a.active {
  color: #ffffff;
  background: rgba(15, 118, 110, 0.24);
  border-color: rgba(45, 212, 191, 0.22);
}

.side-nav a.active::before {
  background: #2dd4bf;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.12);
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
}

.topbar strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.nav-toggle {
  display: none;
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 260px;
  padding: 6px 10px;
  overflow: hidden;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  width: min(1360px, calc(100% - 48px));
  margin: 24px auto 44px;
}

.page-title,
.section-header,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.command-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(15, 118, 110, 0.9)),
    var(--sidebar);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-strong);
}

.command-hero h1 {
  margin-bottom: 8px;
}

.command-hero .muted,
.command-hero .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.command-hero .ghost-link {
  color: #e6fffb;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.command-hero .button-link {
  color: #0f172a;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.command-hero .button-link:hover {
  color: #0f172a;
  background: #e9fff9;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  margin-bottom: 8px;
  font-size: 24px;
}

h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

p {
  line-height: 1.7;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.panel,
.metric,
.metric-card,
.card,
.media-card,
.entitlement-card,
.mini-plan,
.plan-card,
.provider-block,
.feature-toggle,
.pay-box,
.upload-progress {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
}

.narrow {
  max-width: 620px;
  margin-inline: auto;
}

.metrics,
.metric-grid,
.entitlement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.entitlement-card {
  min-height: 112px;
  padding: 18px;
}

.metric span,
.metric-card span,
.entitlement-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong,
.metric-card strong,
.entitlement-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.metric strong {
  color: var(--primary-strong);
}

form {
  display: grid;
  gap: 12px;
}

.grid-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  margin-bottom: 18px;
}

.engine-config-form {
  gap: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.feature-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 12px;
  background: var(--surface-soft);
}

.feature-toggle strong,
.feature-toggle small {
  display: block;
}

.feature-toggle small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.provider-block {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(238, 242, 247, 0), var(--bg) 46%);
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

input,
select,
textarea,
button {
  min-height: 38px;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.15);
  border-color: var(--primary);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 7px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

button,
.button-link {
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

button:hover,
.button-link:hover {
  color: #ffffff;
  background: var(--primary-strong);
}

.ghost-link {
  color: var(--primary-strong);
  background: var(--surface-tint);
  border: 1px solid #b9e4dc;
}

.ghost-link:hover {
  background: #dff4ef;
}

.is-pressing {
  transform: translateY(1px);
}

.small-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 13px;
}

.danger-button {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 8px 18px rgba(194, 65, 59, 0.16);
}

.danger-button:hover {
  background: #9f302b;
}

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

.table-scroll table {
  border: 0;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 11px;
  border-bottom: 1px solid #e7edf3;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475569;
  background: #f8fafc;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: #fbfdff;
}

td form {
  display: inline-grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 8px;
  margin-left: 8px;
}

.action-cell,
.table-actions,
.inline,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.action-cell form,
.inline-form {
  margin: 0;
}

.inline-form select {
  min-width: 180px;
}

.filter-tabs,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.filter-tabs a,
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.filter-tabs a.active,
.tabs a.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #315785;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
}

.status-approved,
.status-success {
  color: var(--success);
  background: #e8f7ef;
}

.status-generated,
.status-pending,
.status-running {
  color: #8a5a12;
  background: #fff7e8;
}

.status-rejected,
.status-failed,
.status-canceled {
  color: var(--danger);
  background: #fff1f0;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  color: var(--success);
  background: #eefbf5;
  border: 1px solid #b8ead6;
  border-radius: 8px;
}

.flash.error,
.flash.danger {
  color: var(--danger);
  background: #fff1f0;
  border-color: #ffc8c2;
}

.flash.warning {
  color: var(--warning);
  background: #fff7e8;
  border-color: #f8d79b;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 6px 10px;
  color: #315785;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 13px;
}

.cards,
.media-grid,
.plan-grid,
.plan-strip,
.checkbox-grid {
  display: grid;
  gap: 16px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.media-card,
.mini-plan,
.plan-card {
  padding: 18px;
}

.media-grid,
.plan-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 18px;
}

.media-card {
  display: grid;
  gap: 10px;
}

.media-card img,
.cover-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f3f6fa;
  border-radius: 7px;
}

.compact-media-grid {
  grid-template-columns: repeat(4, 58px);
  gap: 6px;
}

.compact-media-card {
  padding: 0;
  overflow: hidden;
}

.compact-media-card img {
  aspect-ratio: 1 / 1;
  border-radius: 7px;
}

.cover-preview img {
  width: min(360px, 100%);
  border: 1px solid var(--line);
}

.media-placeholder {
  display: grid;
  width: 100%;
  min-height: 92px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.pay-box {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  background: var(--surface-soft);
  border-style: dashed;
  justify-items: center;
  text-align: center;
}

.pay-box code,
.code-block {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.payment-qr {
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mobile-pay-link {
  display: none;
}

.upload-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-status div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.upload-status span {
  color: var(--muted);
}

.auth-body,
.admin-auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(217, 45, 69, 0.16), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(14, 165, 163, 0.14), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eef4f8 46%, #fff7f4 100%);
}

.ai-login {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  padding: 22px clamp(16px, 4vw, 56px) 36px;
}

.login-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
}

.login-brand {
  display: inline-grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.login-brand:hover {
  color: var(--ink);
}

.login-brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-gold));
  border-radius: 12px;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(217, 45, 69, 0.22);
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.login-admin-link {
  padding: 9px 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(199, 211, 223, 0.9);
  border-radius: 999px;
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.02fr) minmax(300px, 0.88fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(22px, 4vw, 48px);
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(34px, 7vh, 76px) 0 0;
}

.login-stage {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.ai-orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.04) 0 1px, transparent 1px 72px);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

.ai-orbit span {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(199, 211, 223, 0.85);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.ai-orbit span:nth-child(1) {
  top: 42px;
  left: 36px;
  background: linear-gradient(135deg, #fff, #fff0f2);
}

.ai-orbit span:nth-child(2) {
  right: 34px;
  top: 92px;
  background: linear-gradient(135deg, #fff, #eaf8f7);
}

.ai-orbit span:nth-child(3) {
  right: 96px;
  bottom: 48px;
  background: linear-gradient(135deg, #fff, #fff8e8);
}

.prompt-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 88%);
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(199, 211, 223, 0.9);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(18px);
}

.prompt-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--brand-cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(14, 165, 163, 0.14);
}

.prompt-input {
  margin: 18px 0;
  padding: 18px 20px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.7;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.prompt-grid div {
  min-height: 86px;
  padding: 13px;
  background: #fff;
  border: 1px solid #e4eaf0;
  border-radius: 12px;
}

.prompt-grid strong,
.prompt-grid span {
  display: block;
}

.prompt-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-copy h1 {
  max-width: 560px;
  margin: 12px 0 16px;
  color: #0f172a;
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.05;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.capability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.capability-row span {
  padding: 9px 12px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(199, 211, 223, 0.9);
  border-radius: 999px;
}

.login-card,
.admin-auth-panel {
  padding: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(199, 211, 223, 0.92);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.login-card h2,
.admin-auth-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.login-card form,
.admin-auth-panel form {
  display: grid;
  gap: 14px;
}

.login-card input,
.admin-auth-panel input {
  height: 46px;
  margin-top: 7px;
  background: #fff;
}

.login-card button,
.admin-auth-panel button {
  height: 48px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-cyan));
}

.login-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
}

.login-flashes {
  margin-bottom: 14px;
}

.admin-auth-body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-auth-shell {
  width: min(420px, 100%);
}

.admin-auth-panel .login-brand {
  margin-bottom: 28px;
}

.admin-auth-panel .ghost-link {
  display: inline-block;
  margin-top: 18px;
}

.login-workspace {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 44px);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(28px, 5vw, 64px);
  width: min(1180px, 100%);
  min-height: calc(100vh - clamp(36px, 8vw, 88px));
  margin: 0 auto;
  align-items: center;
}

.login-workspace::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 38%),
    linear-gradient(225deg, rgba(37, 99, 235, 0.10), transparent 36%),
    repeating-linear-gradient(90deg, rgba(17, 24, 39, 0.035) 0 1px, transparent 1px 84px);
}

.login-product {
  display: grid;
  gap: clamp(34px, 6vh, 68px);
  min-width: 0;
}

.login-positioning h1 {
  max-width: 720px;
  margin: 12px 0 18px;
  color: #0f172a;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.login-positioning p {
  max-width: 560px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.75;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 780px;
}

.login-flow div {
  min-height: 138px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(199, 211, 223, 0.86);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

.login-flow span,
.login-flow strong,
.login-flow small {
  display: block;
}

.login-flow span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.login-flow strong {
  margin-top: 18px;
  color: #0f172a;
  font-size: 16px;
}

.login-flow small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.login-card {
  width: 100%;
  padding: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(199, 211, 223, 0.94);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(18px);
}

.login-card-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--primary-strong);
  background: #e7f6f3;
  border: 1px solid #cce9e3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.login-security-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-card h2 {
  margin: 18px 0 8px;
  color: #0f172a;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.login-card label {
  color: var(--ink-soft);
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding-inline: 13px;
  background: #fff;
  border-color: #cfd8e3;
}

.login-card input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--primary);
}

.login-card button {
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.22);
}

.login-package-section {
  width: min(1180px, 100%);
  margin: clamp(28px, 5vw, 54px) auto 0;
  padding: clamp(22px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(199, 211, 223, 0.86);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(17, 24, 39, 0.10);
}

.login-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.login-section-head h2 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 38px);
}

.login-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.login-package-card {
  display: grid;
  gap: 18px;
  min-height: 246px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-package-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
}

.login-package-price {
  margin: 12px 0 4px;
  color: var(--primary-strong);
  font-size: 30px;
  font-weight: 800;
}

.login-package-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-package-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}

.login-package-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
}

.login-package-empty {
  grid-column: 1 / -1;
  min-height: 120px;
}

.auth-landing {
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.94), rgba(232, 240, 248, 0.95)),
    var(--bg);
}

.landing-page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
}

.landing-brand {
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.landing-brand:hover {
  color: var(--ink);
}

.landing-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.22);
}

.landing-brand strong,
.landing-brand small {
  display: block;
}

.landing-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.landing-nav nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-nav nav a {
  padding: 8px 11px;
  color: var(--ink-soft);
  border-radius: 8px;
}

.landing-nav nav a:hover {
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.78);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  min-height: 620px;
  padding: clamp(44px, 8vw, 92px) 0 34px;
}

.landing-copy {
  min-width: 0;
}

.landing-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--primary-strong);
  background: #e7f6f3;
  border: 1px solid #cce9e3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.landing-copy h1 {
  max-width: 820px;
  margin: 18px 0 18px;
  color: #0f172a;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}

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

.landing-login-card {
  width: 100%;
  padding: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(199, 211, 223, 0.95);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.15);
}

.landing-login-card h2 {
  margin: 18px 0 8px;
  color: #0f172a;
  font-size: 28px;
}

.landing-login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.landing-login-card form {
  display: grid;
  gap: 14px;
}

.landing-login-card label {
  color: var(--ink-soft);
  font-weight: 700;
}

.landing-login-card input {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: #fff;
  border-color: #cfd8e3;
}

.landing-login-card button {
  height: 50px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.22);
}

.landing-login-card .agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.landing-login-card .agreement-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 3px;
}

.landing-login-card .agreement-check a {
  color: var(--primary-strong);
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

.agreement-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.agreement-modal[hidden] {
  display: none;
}

.agreement-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
}

.agreement-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, calc(100vw - 32px));
  height: min(780px, 86vh);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(199, 211, 223, 0.95);
  border-radius: 12px;
  box-shadow: 0 34px 100px rgba(15, 23, 42, 0.28);
}

.agreement-dialog-head,
.agreement-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(248, 250, 252, 0.96);
}

.agreement-dialog-head {
  border-bottom: 1px solid var(--line);
}

.agreement-dialog-head h2 {
  margin: 10px 0 0;
  color: #0f172a;
  font-size: 22px;
}

.agreement-close {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink-soft);
  background: #ffffff;
  border-color: var(--line);
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
}

.agreement-close:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.agreement-frame {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 0;
}

.agreement-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.legal-page {
  padding-bottom: 54px;
}

.legal-panel {
  margin-top: clamp(28px, 5vw, 58px);
  padding: clamp(24px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(199, 211, 223, 0.95);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.12);
}

.legal-panel h1 {
  margin: 18px 0 12px;
  color: #0f172a;
  font-size: clamp(34px, 5vw, 54px);
}

.legal-panel h2 {
  margin: 30px 0 10px;
  color: #0f172a;
  font-size: 20px;
}

.legal-panel p,
.legal-panel li {
  color: var(--ink-soft);
  line-height: 1.85;
}

.legal-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.login-session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.login-session-actions .button-link,
.login-session-actions .ghost-link {
  width: 100%;
  min-height: 48px;
}

.register-page {
  min-height: 100vh;
}

.register-hero {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
}

.register-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.register-proof-grid article {
  min-height: 158px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(199, 211, 223, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

.register-proof-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--primary-strong);
  background: #e7f6f3;
  border: 1px solid #cce9e3;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.register-proof-grid strong {
  display: block;
  margin-top: 16px;
  color: #0f172a;
  font-size: 17px;
}

.register-proof-grid p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.landing-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.landing-module-grid article,
.landing-plan-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(199, 211, 223, 0.92);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
}

.landing-module-grid article {
  min-height: 178px;
  padding: 22px;
}

.landing-module-grid span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.landing-module-grid h2 {
  margin: 18px 0 10px;
  color: #0f172a;
  font-size: 24px;
}

.landing-module-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.landing-plan-section {
  margin-top: clamp(34px, 6vw, 72px);
}

.landing-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.landing-section-head h2 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: clamp(28px, 4vw, 48px);
}

.landing-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.landing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.landing-plan-card {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 360px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(199, 211, 223, 0.95);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.landing-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 26px 64px rgba(17, 24, 39, 0.13);
}

.landing-plan-top {
  display: grid;
  gap: 8px;
}

.landing-plan-top h3 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.25;
}

.landing-plan-price {
  margin: 0;
  color: var(--primary-strong);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.05;
}

.landing-plan-card small {
  color: var(--muted);
  font-size: 13px;
}

.landing-plan-summary {
  min-height: 52px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.landing-plan-lines {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.landing-plan-lines li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.landing-plan-lines strong {
  color: var(--ink);
  font-weight: 750;
  text-align: right;
}

.landing-plan-empty {
  min-height: 150px;
}

@media (max-width: 1120px) {
  .login-hero {
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  }

  .login-stage {
    display: none;
  }
}

@media (max-width: 820px) {
  .ai-login {
    padding: 18px 16px 28px;
  }

  .login-nav {
    align-items: flex-start;
  }

  .login-hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .login-copy h1 {
    font-size: 36px;
  }

  .login-card {
    padding: 20px;
  }
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-product {
    gap: 28px;
  }

  .login-flow {
    grid-template-columns: 1fr;
  }

  .login-section-head,
  .login-package-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    max-width: 520px;
  }

  .landing-hero,
  .landing-section-head,
  .landing-module-grid,
  .register-proof-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 0;
    padding-top: 44px;
  }
}

@media (max-width: 560px) {
  .login-workspace {
    padding: 16px;
  }

  .login-positioning h1 {
    font-size: 34px;
  }

  .login-positioning p {
    font-size: 15px;
  }

  .login-card {
    padding: 22px;
  }

  .landing-page {
    width: min(100% - 24px, 1200px);
    padding-top: 14px;
  }

  .landing-nav {
    align-items: flex-start;
  }

  .landing-nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .landing-copy h1 {
    font-size: 38px;
  }

  .landing-copy p {
    font-size: 15px;
  }

  .landing-login-card,
  .landing-module-grid article,
  .landing-plan-card,
  .register-proof-grid article {
    padding: 20px;
  }

  .register-proof-grid {
    gap: 10px;
    margin-top: 22px;
  }

  .register-proof-grid article {
    min-height: 0;
  }

  .agreement-modal {
    padding: 12px;
  }

  .agreement-dialog {
    width: 100%;
    height: 90vh;
    border-radius: 10px;
  }

  .agreement-dialog-head,
  .agreement-dialog-actions {
    padding: 14px;
  }

  .agreement-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agreement-dialog-actions button,
  .agreement-dialog-actions .ghost-link {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .payment-qr,
  .desktop-only {
    display: none;
  }

  .mobile-pay-link {
    display: inline-flex;
  }
}

.code-block {
  margin: 10px 0 0;
  padding: 10px 12px;
  color: #f9fafb;
  background: #111827;
  border-radius: 7px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: #e3e9f1;
  border-radius: 999px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.mini-progress {
  flex-basis: 100%;
  min-width: 180px;
  margin-top: 6px;
}

.mini-progress .progress-track {
  height: 8px;
}

.progress-label {
  display: block;
  margin-top: 4px;
}

.preview-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.review-panel {
  position: sticky;
  top: 96px;
}

.review-meta {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}

.review-meta dt {
  color: var(--muted);
}

.review-meta dd {
  margin: 0;
}

.review-actions {
  display: grid;
  gap: 10px;
}

.wechat-preview {
  display: grid;
  justify-items: center;
}

.wechat-preview-phone {
  width: min(430px, 100%);
  overflow: hidden;
  background: #f1f2f5;
  border: 1px solid #d8dee8;
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
}

.wechat-preview-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  color: #111827;
  text-align: center;
  background: #ededed;
}

.wechat-article {
  min-height: 680px;
  padding: 22px 18px 34px;
  background: #ffffff;
}

.wechat-article h1 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.35;
}

.wechat-byline {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  color: #8c8c8c;
  font-size: 13px;
}

.wechat-cover {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 4px;
}

.wechat-digest {
  padding: 10px 12px;
  color: #626b77;
  background: #f7f8fa;
  border-left: 3px solid #d0d7de;
}

.wechat-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.85;
}

.wechat-content img {
  max-width: 100%;
  height: auto;
}

.price,
.plan-price {
  color: var(--primary-strong);
  font-weight: 800;
}

.price {
  font-size: 26px;
}

.subscription-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 26px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(37, 99, 235, 0.9)),
    var(--sidebar);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow-strong);
}

.subscription-hero .eyebrow,
.subscription-hero p {
  color: rgba(255, 255, 255, 0.78);
}

.subscription-hero .ghost-link {
  color: #e6fffb;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.subscription-hero h1 {
  margin: 6px 0 8px;
  font-size: 30px;
}

.plan-card {
  display: grid;
  gap: 16px;
}

.plan-card.current {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 18px 44px rgba(15, 118, 110, 0.14);
}

.plan-card.disabled-plan {
  opacity: 0.72;
}

.plan-card button:disabled {
  color: #667085;
  cursor: not-allowed;
  background: #e5e7eb;
  border-color: #d0d5dd;
  box-shadow: none;
}

.plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-price {
  margin: 0;
  font-size: 34px;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-soft);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 999px;
}

.prompt-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.prompt-hero,
.creation-hero {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(6, 22, 33, 0.98), rgba(14, 96, 88, 0.94) 48%, rgba(29, 78, 216, 0.9)),
    #0b1520;
  border-color: rgba(125, 211, 252, 0.2);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.2);
}

.prompt-hero > *,
.creation-hero > * {
  position: relative;
  z-index: 1;
}

.prompt-hero h1,
.creation-hero h1 {
  color: #ffffff;
}

.prompt-hero .eyebrow,
.prompt-hero .muted,
.creation-hero .eyebrow,
.creation-hero .muted {
  color: rgba(255, 255, 255, 0.82);
}

.layout-hero {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(37, 99, 235, 0.12)),
    #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.layout-hero {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(7, 21, 31, 0.98), rgba(13, 84, 78, 0.94) 56%, rgba(30, 64, 175, 0.88)),
    #0b1520;
  border-color: rgba(125, 211, 252, 0.18);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.22);
}

.layout-hero h1 {
  color: #ffffff;
}

.layout-hero .eyebrow,
.layout-hero .muted {
  color: rgba(255, 255, 255, 0.82);
}

.layout-hero .ghost-link {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.32);
}

.layout-hero .ghost-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.prompt-studio {
  grid-template-columns: 320px minmax(0, 1fr);
}

.prompt-rail {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.prompt-rail .eyebrow,
.prompt-rail h2 {
  color: #ffffff;
}

.prompt-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.prompt-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
}

.prompt-category-item:hover,
.prompt-category-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.prompt-category-item span {
  display: grid;
  gap: 2px;
}

.prompt-category-item small {
  color: rgba(255, 255, 255, 0.56);
}

.prompt-category-item em {
  min-width: 26px;
  padding: 3px 7px;
  color: #d1fae5;
  background: rgba(15, 118, 110, 0.45);
  border-radius: 999px;
  font-style: normal;
  text-align: center;
}

.prompt-category-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.prompt-category-form label {
  color: rgba(255, 255, 255, 0.78);
}

.prompt-category-form input {
  background: rgba(255, 255, 255, 0.96);
}

.prompt-builder {
  border-color: rgba(37, 99, 235, 0.14);
}

.prompt-sidebar {
  position: sticky;
  top: 96px;
}

.prompt-category-list {
  display: grid;
}

.prompt-main {
  min-width: 0;
}

.prompt-generate-form {
  align-items: start;
}

.prompt-advanced {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-advanced summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.prompt-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.prompt-asset-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.prompt-asset-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.prompt-asset-card p {
  min-height: 52px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.prompt-card {
  display: grid;
  gap: 12px;
}

.prompt-card-head,
.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.prompt-card .inline-form {
  display: flex;
}

.prompt-card .inline-form select {
  min-width: 120px;
}

.prompt-progress-panel,
.operation-progress-panel {
  border-color: rgba(15, 118, 110, 0.28);
}

.prompt-preview {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.prompt-preview summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}

.prompt-preview pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.form-wide {
  grid-column: 1 / -1;
}

.creation-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.creation-panel {
  display: grid;
  gap: 18px;
}

.creation-results {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.creation-progress-panel {
  border-color: rgba(15, 118, 110, 0.28);
}

.creation-suggestions .mini-plan {
  min-height: 180px;
}

.suggestion-history {
  display: grid;
  gap: 16px;
}

.suggestion-batch {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.suggestion-batch-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.suggestion-batch-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.suggestion-batch-head .muted {
  overflow-wrap: anywhere;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-row a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475569;
  background: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.tab-row a.active,
.tab-row a:hover {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--primary);
  background: #ecfeff;
}

.inline-edit summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}

.compact-form {
  min-width: min(760px, calc(100vw - 48px));
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.creation-complete-card {
  border-color: rgba(15, 118, 110, 0.28);
  background: #f0fdfa;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  animation: toast-in 0.18s ease-out;
}

.toast-card.success {
  border-left-color: #0f766e;
}

.toast-card.error {
  border-left-color: #dc2626;
}

.toast-card span {
  color: var(--muted);
  line-height: 1.5;
}

.toast-card.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.layout-studio {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
  width: 100%;
}

.layout-settings-panel,
.layout-editor-panel {
  position: sticky;
  top: 96px;
}

.layout-editor-panel {
  min-width: 0;
  width: 100%;
}

.layout-settings-panel {
  display: grid;
  gap: 14px;
}

.layout-settings-panel label {
  min-width: 0;
}

.range-grid {
  display: grid;
  gap: 12px;
}

.range-grid label {
  gap: 8px;
}

.range-grid label > span {
  color: var(--muted);
  font-size: 12px;
}

.range-grid input[type="range"] {
  width: 100%;
  min-height: 28px;
  padding: 0;
}

.layout-toolbar,
.layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-toolbar .small-button {
  min-width: 38px;
  padding-inline: 9px;
  font-weight: 800;
}

.layout-editor-panel textarea {
  width: 100%;
  min-height: 620px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.65;
}

.layout-actions {
  align-items: center;
  justify-content: flex-start;
}

.draft-save-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.draft-save-box button:disabled {
  color: #667085;
  cursor: not-allowed;
  background: #e5e7eb;
  border-color: #d0d5dd;
  box-shadow: none;
}

.layout-diagnostics {
  display: grid;
  gap: 8px;
  padding: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.layout-diagnostics strong {
  color: var(--ink);
}

.layout-preview-shell {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.layout-phone {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  width: min(380px, 100%);
  height: min(820px, calc(100vh - 126px));
  min-height: 720px;
  padding: 14px 12px 18px;
  overflow: hidden;
  background: #080b12;
  border: 1px solid #1f2937;
  border-radius: 46px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.layout-phone::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 2;
  width: 112px;
  height: 28px;
  background: #020617;
  border-radius: 999px;
  transform: translateX(-50%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.layout-phone::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 8px;
  z-index: 2;
  width: 118px;
  height: 4px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  transform: translateX(50%);
}

.layout-phone header {
  display: grid;
  gap: 6px;
  padding: 58px 22px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-radius: 34px 34px 0 0;
}

.layout-phone header strong {
  color: #111827;
  line-height: 1.45;
}

.layout-phone header span {
  color: var(--muted);
  font-size: 13px;
}

.layout-preview-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 22px 34px;
  background: #ffffff;
  border-radius: 0 0 34px 34px;
}

.layout-preview-content img {
  max-width: 100%;
  height: auto;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkbox-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-card span {
  display: grid;
  gap: 4px;
}

.check-card small {
  color: var(--muted);
}

.error-inline {
  display: block;
  max-width: 280px;
  margin-top: 6px;
  color: #b42318;
  line-height: 1.4;
}

.danger-note {
  margin: 18px 0;
  padding: 12px 14px;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  line-height: 1.6;
}

.ops-chart {
  display: block;
  width: 100%;
  min-height: 260px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.detail-grid dt {
  color: var(--muted);
  background: var(--surface-soft);
}

.detail-grid dd {
  min-width: 0;
  background: #ffffff;
  overflow-wrap: anywhere;
}

.detail-grid dt:nth-last-of-type(1),
.detail-grid dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.pagination-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(286px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-strong);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .page {
    width: min(100% - 28px, 1360px);
  }

  .command-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-hero .button-link,
  .command-hero .ghost-link {
    width: 100%;
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }

  .review-panel {
    position: static;
  }

  .prompt-workspace {
    grid-template-columns: 1fr;
  }

  .prompt-studio,
  .creation-workspace,
  .layout-studio {
    grid-template-columns: 1fr;
  }

  .prompt-sidebar {
    position: static;
  }

  .prompt-rail,
  .layout-settings-panel,
  .layout-editor-panel,
  .layout-phone {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 12px 14px;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }

  .account-chip {
    max-width: 100%;
  }

  .page-title,
  .section-header,
  .section-head,
  .subscription-hero,
  .plan-card-head {
    flex-direction: column;
  }

  .feature-toggle {
    grid-template-columns: 1fr;
  }

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

  .detail-grid dt {
    border-bottom: 0;
  }

  .suggestion-batch-head {
    flex-direction: column;
  }

  td form {
    margin: 8px 0 0;
  }

  .draft-save-box {
    grid-template-columns: 1fr;
  }
}
