:root {
  color-scheme: light;
  --brand: #e9414f;
  --brand-soft: #fff1f3;
  --brand-hover: #d93645;
  --brand-dark: #b92634;
  --accent: #0f8f8a;
  --accent-soft: #e8f7f6;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #fbfbfc;
  --border: #e6e8ec;
  --border-strong: #d0d5dd;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
  --error-bg: #fef3f2;
  --error-text: #b42318;
  --warning-bg: #fffaeb;
  --warning-text: #b54708;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(233, 65, 79, 0.06), transparent 32rem),
    radial-gradient(circle at top right, rgba(15, 143, 138, 0.06), transparent 28rem),
    var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

@media (min-width: 769px) {
  .page-with-sidebar .back-link,
  .page-with-sidebar .topbar-actions .button-link[href="/"] {
    display: none;
  }
}

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

h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 720;
}

button,
.btn,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  font-weight: 650;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(233, 65, 79, 0.2);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover,
.download-link:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  border-color: #e5e7eb;
  background: #f5f6f8;
  color: var(--text-light);
  box-shadow: none;
}

button:disabled:hover {
  border-color: #e5e7eb;
  background: #f5f6f8;
  color: var(--text-light);
  transform: none;
  box-shadow: none;
}

button.secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-color: #e5e7eb;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #374151;
  padding: 0 16px;
  box-shadow: var(--shadow-xs);
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

button.secondary:hover,
.btn-secondary:hover {
  border-color: rgba(233, 65, 79, 0.28);
  background: var(--brand-soft);
  color: var(--brand);
}

button:disabled,
button:disabled:hover,
button.secondary:disabled,
button.secondary:disabled:hover,
.btn:disabled,
.btn:disabled:hover,
.btn-secondary:disabled,
.btn-secondary:disabled:hover {
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  border-color: #e5e7eb;
  background: #f5f6f8;
  color: var(--text-light);
  box-shadow: none;
}

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

.payment-return-page {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  gap: 16px;
  place-items: center;
  padding: 24px;
}

.payment-return-card {
  width: min(100%, 460px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-weight: 760;
}

.brand-heading img {
  width: 32px;
  height: 32px;
}

.payment-return-panel {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.payment-return-panel p {
  color: var(--text-muted);
}

.payment-return-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 720;
}

.payment-return-links {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.payment-return-links div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.payment-return-links .btn {
  min-height: 34px;
  padding: 0 14px;
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 560;
  box-shadow: none;
}

.payment-return-links .btn:hover {
  border-color: rgba(233, 65, 79, 0.22);
  background: rgba(255, 241, 243, 0.62);
  color: var(--brand);
}

button.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
}

.page-with-sidebar {
  --sidebar-width: 200px;
}

.page-with-sidebar.sidebar-collapsed {
  --sidebar-width: 57px;
}

.page-with-sidebar .app-shell {
  width: min(1400px, calc(100% - var(--sidebar-width) - 48px));
  margin-left: calc(var(--sidebar-width) + 24px);
  margin-right: 24px;
  transition: width 0.1s ease, margin-left 0.1s ease;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: flex;
  overflow: hidden;
  width: var(--sidebar-width, 260px);
  flex-direction: column;
  gap: 0;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  padding: 0;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
  transition: width 0.1s ease, padding 0.1s ease;
}

.sidebar-header {
  display: flex;
  position: relative;
  min-height: auto;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 10px;
}

.sidebar-brand {
  display: flex;
  position: relative;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  color: var(--text-main);
  min-width: 0;
  padding-right: 50px;
}

.sidebar-logo-wrap {
  display: grid;
  position: static;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  background: transparent;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sidebar-title,
.sidebar-subtitle {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.sidebar-brand-text,
.sidebar-link-text {
  position: absolute;
  min-width: max-content;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-brand-text {
  left: 41px;
  top: 50%;
  transform: translateY(-50%);
}

.sidebar-link-text {
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}

.sidebar-subtitle {
  margin-top: 1px;
  color: #6b7280;
  font-size: 9px;
  font-weight: 600;
}

.sidebar-nav {
  display: grid;
  gap: 0;
  margin-top: 12px;
  padding-right: 18px;
  padding-left: 18px;
  padding-top: 0;
}

.sidebar-link {
  position: relative;
  display: flex;
  min-height: 45px;
  align-items: center;
  overflow: hidden;
  gap: 0;
  margin-bottom: 3px;
  border-radius: 14px;
  color: #475569;
  padding: 0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link:hover {
  background: #f8fafc;
  color: #111827;
  transform: translateX(2px);
}

.sidebar-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-link.active::before {
  display: none;
}

.sidebar-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(45%) sepia(12%) saturate(620%) hue-rotate(176deg) brightness(91%) contrast(89%);
}

.sidebar-icon.sidebar-icon-ai {
  width: 35px;
  height: 35px;
  flex-basis: 40px;
  padding: 2.5px;
}

.sidebar-link.active .sidebar-icon {
  filter: brightness(0) saturate(100%) invert(38%) sepia(75%) saturate(2495%) hue-rotate(329deg) brightness(95%) contrast(92%);
}

.sidebar-collapse-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.sidebar-collapse-button:hover {
  border-color: transparent;
  background: #f3f4f6;
  transform: none;
}

.sidebar-collapse-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  object-position: center;
  transform: scale(1.2);
  transform-origin: center;
}

.sidebar-collapsed .app-sidebar {
  align-items: center;
  padding: 0 10px;
}

.sidebar-collapsed .sidebar-header {
  justify-content: center;
  width: 100%;
  padding: 14px 0 10px;
}

.sidebar-collapsed .sidebar-brand {
  flex: 0 0 auto;
  justify-content: center;
  padding-right: 0;
}

.sidebar-collapsed .sidebar-logo-wrap {
  position: relative;
  width: 34px;
  height: 34px;
}

.sidebar-collapsed .sidebar-logo {
  width: 34px;
  height: 34px;
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-link-text {
  position: absolute;
  width: auto;
  height: auto;
  overflow: hidden;
  clip: auto;
  opacity: 0;
  white-space: nowrap;
}

.sidebar-collapsed .sidebar-nav {
  width: 100%;
  padding-right: 0;
  padding-left: 0;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  min-height: 45px;
  gap: 0;
  padding: 0;
}

.sidebar-collapsing.sidebar-collapsed .sidebar-header {
  justify-content: flex-start;
  padding: 14px 12px 10px;
}

.sidebar-collapsing.sidebar-collapsed .sidebar-brand {
  justify-content: flex-start;
}

.sidebar-collapsing.sidebar-collapsed .sidebar-nav {
  padding-right: 18px;
  padding-left: 18px;
}

.sidebar-collapsing.sidebar-collapsed .sidebar-link {
  justify-content: flex-start;
}

.sidebar-collapsed .sidebar-link:hover {
  transform: none;
}

.sidebar-account {
  display: flex;
  position: relative;
  align-items: center;
  gap: 8px;
  margin: 0 12px 14px;
  min-height: 44px;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #fbfcfd;
  padding: 6px 8px;
  color: #475569;
}

.sidebar-account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-account-main {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-account-name,
.sidebar-account-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-name {
  color: #111827;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.sidebar-account-meta {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

.sidebar-account-action {
  text-decoration: none;
}

.sidebar-account-action:hover {
  color: var(--brand);
}

.sidebar-account-logout {
  min-width: auto;
  min-height: 28px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  padding: 0 6px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-account-logout:hover {
  background: var(--brand-soft);
  color: var(--brand);
  transform: none;
}

.credit-panel {
  display: grid;
  gap: 8px;
  margin: 10px 12px;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #fbfcfd;
  padding: 10px;
  color: #475569;
}

.credit-panel-title {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.credit-panel-loading,
.credit-panel-empty {
  color: #94a3b8;
  font-size: 11px;
}

.credit-balance-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 4px;
  border-radius: 12px;
  background: #fff7ed;
  padding: 8px;
}

.credit-balance-card span,
.credit-balance-card small {
  color: #9a3412;
  font-size: 10px;
  font-weight: 700;
}

.credit-balance-card strong {
  color: #c2410c;
  font-size: 22px;
  line-height: 1;
}

.credit-rules {
  display: grid;
  gap: 2px;
  font-size: 10px;
  line-height: 1.35;
}

.credit-rules div,
.credit-transaction-title {
  color: #111827;
  font-size: 11px;
  font-weight: 750;
}

.credit-rules p {
  margin: 0;
}

.credit-assistant-rule {
  border-top: 1px solid #eef2f7;
  padding-top: 7px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.credit-recharge-button {
  width: 100%;
  min-height: 32px;
  border-radius: 11px;
  padding: 0 10px;
  font-size: 12px;
}

.credit-package-list {
  display: grid;
  gap: 6px;
}

.credit-package-card {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  border-color: #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 7px 8px;
  color: #111827;
  box-shadow: none;
  text-align: left;
}

.credit-package-card:hover {
  border-color: #fecaca;
  background: #fff7f7;
  transform: none;
}

.credit-package-card strong,
.credit-package-card small {
  display: block;
}

.credit-package-card strong {
  font-size: 11px;
}

.credit-package-card small {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.credit-package-badge {
  border-radius: 999px;
  background: #fff1f2;
  color: var(--brand);
  padding: 2px 5px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.credit-transaction-list {
  display: grid;
  gap: 5px;
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
}

.credit-transaction-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: baseline;
  font-size: 10px;
}

.credit-transaction-item span {
  overflow: hidden;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-transaction-item strong {
  font-size: 10px;
}

.credit-transaction-item .positive {
  color: #15803d;
}

.credit-transaction-item .negative {
  color: #dc2626;
}

.credit-mini-panel {
  display: grid;
  box-sizing: border-box;
  height: 131px;
  gap: 6px;
  margin: auto 12px 8px;
  border: 1px solid #edf1f6;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 12px;
  color: #475569;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.credit-mini-title {
  width: 53px;
  min-height: 22px;
  margin: 1px 54px -3px 0;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.credit-mini-row {
  display: flex;
  box-sizing: border-box;
  width: 115px;
  min-height: 21px;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 0 16px;
  padding-top: 4px;
}

.credit-mini-row span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.credit-mini-row strong {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.credit-mini-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e8edf3;
}

.credit-mini-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6 0%, #3b82f6 100%);
}

.credit-mini-percent {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.credit-mini-link {
  display: inline-flex;
  box-sizing: border-box;
  width: 125px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin: 6px 0 2px 13px;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--brand);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.credit-mini-link:hover {
  background: #ffe4e6;
  transform: translateY(-1px);
}

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

.legal-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.legal-topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.legal-topnav .btn-secondary {
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.96);
}

.legal-topnav .btn {
  min-height: 52px;
  padding: 0 26px;
}

.legal-card {
  display: grid;
  gap: 24px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

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

.legal-card p {
  color: #475569;
  font-size: 15px;
  line-height: 1.85;
}

.legal-card h2 {
  color: var(--text-main);
}

.legal-eyebrow {
  color: var(--brand) !important;
  font-size: 12px !important;
  font-weight: 800;
  line-height: 1.2 !important;
}

.legal-lead {
  max-width: 760px;
  color: #334155 !important;
  font-size: 17px !important;
  line-height: 1.8 !important;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.pricing-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  align-content: center;
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #fbfcfd;
  padding: 16px;
}

.pricing-card strong {
  color: var(--text-main);
  font-size: 18px;
}

.pricing-card span {
  color: var(--brand);
  font-size: 22px;
  font-weight: 850;
}

.legal-rule-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.legal-rule-list div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #fbfcfd;
  padding: 14px 16px;
}

.legal-rule-list dt {
  color: var(--text-main);
  font-weight: 800;
}

.legal-rule-list dd {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  margin-top: 18px;
  color: #8a96a3;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.legal-footer a,
.home-footer a {
  color: inherit;
}

.sidebar-collapsed .credit-mini-panel {
  display: none;
}

.credits-page {
  background: #f6f8fb;
}

.credits-shell,
.credit-page .app-shell {
  max-width: 1180px;
}

.credits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid #e9eef5;
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
}

.credits-header-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.credits-header h1 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 26px;
  line-height: 1.15;
}

.credits-header-actions {
  flex: none;
}

.credit-contact-admin {
  min-height: 34px;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--brand);
  padding: 0 14px;
  box-shadow: none;
  font-size: 13px;
}

.credits-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.credits-overview-card {
  display: grid;
  gap: 5px;
  min-height: 98px;
  align-content: center;
  border: 1px solid #e9eef5;
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.credits-overview-card.primary {
  border-color: #e9eef5;
  background: #fff;
}

.credits-overview-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.credits-overview-card strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 23px;
  line-height: 1.15;
}

.credits-overview-card.primary strong {
  color: var(--brand);
  font-size: 32px;
}

.credits-overview-card.text-card strong {
  font-size: 15px;
  line-height: 1.35;
}

.credits-overview-card small {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
}

.credits-progress-section {
  display: grid;
  margin-bottom: 12px;
}

.credits-progress-card,
.credit-packages-section,
.credit-transactions-section,
.credit-rule-card {
  display: grid;
  min-width: 0;
  border: 1px solid #e9eef5;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.credits-progress-card {
  gap: 12px;
}

.credits-progress-card > h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.25;
}

.credits-progress-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.credits-progress-item {
  display: grid;
  gap: 8px;
}

.credits-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.credits-progress-head h2,
.credits-section-heading h2,
.credit-rule-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.25;
}

.credits-progress-head > span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.credits-progress-head strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.credits-progress-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e8edf3;
}

.credits-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6 0%, #3b82f6 100%);
}

.credits-progress-fill.assistant {
  background: linear-gradient(90deg, #818cf8 0%, #22c55e 100%);
}

.credits-progress-item p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.credit-packages-section,
.credit-transactions-section {
  gap: 12px;
  margin-bottom: 12px;
}

.credits-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.credits-section-heading p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.credit-package-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.credit-plan-card {
  display: flex;
  min-width: 0;
  min-height: 248px;
  flex-direction: column;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  color: #0f172a;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.credit-plan-card.highlight {
  border-color: rgba(233, 65, 79, 0.32);
  background: linear-gradient(180deg, #fff7f8 0%, #ffffff 72%);
}

.credit-package-topline {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.credit-package-topline > strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.25;
}

.credit-package-credits {
  margin-top: 20px;
  color: #0f172a;
  font-size: 32px;
  font-weight: 850;
  line-height: 1.05;
}

.credit-package-credits span {
  color: #64748b;
  font-size: 14px;
  font-weight: 750;
}

.credit-package-price {
  margin-top: 10px;
  color: #0f172a;
  font-size: 25px;
  font-weight: 860;
  line-height: 1.1;
}

.credit-plan-card p {
  flex: 1;
  margin-top: 16px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.credit-package-muted {
  color: #cbd5e1;
}

.credit-plan-card .credit-package-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.credit-package-badge.recommended {
  background: #fff1f2;
  color: var(--brand);
}

.credit-package-badge.best {
  background: #fff7ed;
  color: #c2410c;
}

.credit-package-action {
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(233, 65, 79, 0.18);
}

.credit-package-action:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.payment-choice-dialog,
.wechat-pay-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 20px;
}

.payment-choice-card {
  position: relative;
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 26px;
}

.payment-choice-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
}

.payment-choice-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
}

.payment-choice-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}

.payment-choice-summary span {
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.payment-choice-summary strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}

.payment-choice-card p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

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

.payment-channel-button {
  min-height: 44px;
  box-shadow: none;
}

.payment-channel-button.alipay {
  border-color: #1677ff;
  background: #1677ff;
}

.payment-channel-button.alipay:hover {
  border-color: #0958d9;
  background: #0958d9;
}

.payment-channel-button.wechat {
  border-color: #16a34a;
  background: #16a34a;
}

.payment-channel-button.wechat:hover {
  border-color: #15803d;
  background: #15803d;
}

.payment-choice-close,
.wechat-pay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  padding: 0;
  font-size: 20px;
  box-shadow: none;
}

.wechat-pay-card {
  position: relative;
  width: min(360px, 100%);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 28px;
  text-align: center;
}

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

.wechat-pay-qr {
  width: 220px;
  height: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.wechat-pay-card p {
  margin: 16px 0 6px;
  color: #0f172a;
  font-weight: 800;
}

.wechat-pay-status.success {
  color: #16a34a;
}

.wechat-pay-status.error {
  color: #dc2626;
}

.wechat-pay-card small {
  color: #64748b;
}

.wechat-pay-mobile-hint,
.payment-wechat-browser-note {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(181, 71, 8, 0.18);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 10px 12px;
  text-align: left;
}

.wechat-pay-mobile-hint p,
.payment-wechat-browser-note {
  margin: 0;
  color: var(--warning-text);
  font-size: 13px;
  font-weight: 560;
}

.wechat-pay-mobile-hint button {
  width: 100%;
  margin-top: 2px;
}

.wechat-pay-browser-note {
  display: block;
  margin-top: 10px;
  color: var(--warning-text);
}

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

.credit-rules-section {
  margin-bottom: 12px;
}

.credit-rule-card {
  gap: 0;
}

.credit-rule-column {
  display: grid;
  gap: 8px;
  border-left: 1px solid #edf1f6;
  padding-left: 14px;
}

.credit-rule-column:first-child {
  border-left: 0;
  padding-left: 0;
}

.credit-rule-column h3 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
}

.credit-rule-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.credit-rule-list li {
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.credit-transaction-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e9eef5;
  border-radius: 16px;
}

.credit-transaction-row {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 1.8fr 0.8fr 0.65fr;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #e9eef5;
  padding: 9px 12px;
  color: #475569;
  font-size: 12px;
}

.credit-transaction-row:first-child {
  border-top: 0;
}

.credit-transaction-row.header {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.credit-transaction-row strong.positive {
  color: #15803d;
}

.credit-transaction-row strong.negative {
  color: #dc2626;
}

.credit-empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  color: #64748b;
  text-align: center;
}

.credit-empty-state strong {
  color: #0f172a;
  font-size: 15px;
}

.credit-empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .credits-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .credits-overview-grid,
  .credit-rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credits-progress-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .credit-transaction-row {
    grid-template-columns: 1fr 1fr;
  }

  .credit-transaction-row.header {
    display: none;
  }
}

@media (max-width: 760px) {
  .credit-package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .credits-header {
    padding: 14px;
  }

  .credits-header h1 {
    font-size: 24px;
  }

  .credits-overview-grid,
  .credits-progress-stack,
  .credit-rules-grid {
    grid-template-columns: 1fr;
  }

  .credit-package-grid {
    grid-template-columns: 1fr;
  }

  .credit-plan-card {
    min-height: 0;
  }

  .payment-choice-actions {
    grid-template-columns: 1fr;
  }

  .credits-overview-card {
    min-height: 92px;
  }
}

.sidebar-collapsed .credit-panel {
  display: none;
}

.sidebar-collapsed .sidebar-account {
  justify-content: center;
  width: 44px;
  min-height: 44px;
  margin-right: 0;
  margin-left: 0;
  padding: 0;
}

.sidebar-collapsed .sidebar-account-main,
.sidebar-collapsed .sidebar-account-logout {
  display: none;
}

.sidebar-collapsed .sidebar-collapse-button {
  position: absolute;
  inset: 0;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.sidebar-collapsed .sidebar-collapse-icon {
  width: 34px;
  height: 34px;
}

.sidebar-collapsed .sidebar-logo-wrap:hover .sidebar-logo {
  opacity: 0;
}

.sidebar-collapsed .sidebar-logo-wrap:hover .sidebar-collapse-button {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-collapsed .sidebar-logo-wrap:hover .sidebar-collapse-button:hover {
  transform: none;
}

.sidebar-mobile-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 95;
  display: none;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-color: rgba(226, 232, 240, 0.95);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.sidebar-mobile-toggle:hover {
  border-color: rgba(124, 58, 237, 0.22);
  background: #f8f5ff;
  transform: none;
}

.sidebar-toggle-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.36);
}

.sidebar-backdrop[hidden] {
  display: none;
}

@media (min-width: 769px) {
  .page-with-sidebar [data-back-button] {
    display: none;
  }
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.admin-login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: min(100vw - 32px, 520px);
  margin: 0 auto;
  padding: 32px 0;
}

.panel,
.card,
.form-panel,
.preview-panel,
.admin-login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 232, 236, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.admin-login-page {
  min-height: 100vh;
}

.admin-login-card {
  display: grid;
  width: 100%;
  padding: 30px;
  gap: 20px;
  border-radius: var(--radius-xl);
}

.admin-login-header {
  display: grid;
  gap: 8px;
}

.admin-login-card h1 {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.08;
  font-weight: 780;
}

.admin-login-fields {
  display: grid;
  gap: 10px;
}

.admin-login-card label {
  gap: 3px;
  margin-bottom: 0;
}

.admin-login-card input {
  min-height: 48px;
  font-size: 15px;
}

.admin-login-card .field-error {
  min-height: 18px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.verification-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.verification-code-row .secondary {
  min-height: 48px;
  white-space: nowrap;
}

.auth-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
  margin: -2px 0 -12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-consent input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.auth-consent a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-consent a:hover {
  text-decoration: underline;
}

.auth-consent-error {
  margin-top: -8px;
}

.admin-login-card button[type="submit"] {
  width: fit-content;
  min-width: 148px;
  min-height: 46px;
  padding: 0 24px;
}

.admin-login-card button[type="submit"]:disabled {
  color: #9ca3af;
  background: #eef2f7;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.9;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 700;
}

.signup-bonus-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(8px);
}

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

.signup-bonus-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid rgba(230, 232, 236, 0.9);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  text-align: center;
}

.signup-bonus-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), #fb7185);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(233, 65, 79, 0.24);
  font-size: 28px;
  font-weight: 850;
}

.signup-bonus-eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
}

.signup-bonus-card h2 {
  color: var(--text-main);
  font-size: 24px;
  font-weight: 850;
}

.signup-bonus-card p:not(.signup-bonus-eyebrow) {
  color: var(--text-muted);
  line-height: 1.7;
}

.signup-bonus-card button {
  width: 100%;
  margin-top: 6px;
}

.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.onboarding-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(230, 232, 236, 0.95);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.onboarding-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  color: var(--text-muted);
  padding: 0;
  box-shadow: none;
  font-size: 20px;
}

.onboarding-header {
  display: grid;
  gap: 8px;
  padding: 28px 64px 18px 28px;
}

.onboarding-header h2 {
  color: var(--text-main);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
}

.onboarding-header p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.onboarding-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 28px 18px;
}

.onboarding-tabs button {
  min-height: 38px;
  border-color: var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: #475569;
  box-shadow: none;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 760;
}

.onboarding-tabs button.active {
  border-color: rgba(233, 65, 79, 0.28);
  background: var(--brand-soft);
  color: var(--brand);
}

.onboarding-body {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  padding: 22px 28px;
}

.onboarding-body h3 {
  margin-bottom: 16px;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 850;
}

.onboarding-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.onboarding-card-grid article,
.onboarding-copy-block,
.onboarding-step-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.onboarding-card-grid article {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: start;
  padding: 16px;
}

.onboarding-card-grid strong,
.onboarding-step-list strong {
  color: var(--text-main);
  font-size: 15px;
}

.onboarding-card-grid p,
.onboarding-step-list p,
.onboarding-copy-block p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.onboarding-step-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-step-list li {
  display: flex;
  gap: 12px;
  padding: 14px;
}

.onboarding-step-list span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
}

.onboarding-copy-block {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.onboarding-copy-block strong {
  color: var(--brand);
}

.onboarding-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-token-list span {
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: #08716d;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 760;
}

.onboarding-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-action-list li {
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: #374151;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 28px;
  background: #ffffff;
}

.onboarding-footer-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.onboarding-footer-main span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 760;
}

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

.home-shell {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  flex-direction: column;
  margin: 0 auto;
  padding: 24px 0;
}

.home-topline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  margin-bottom: 12px;
}

.home-account-actions {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.home-credit-link {
  text-decoration: none;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  backdrop-filter: blur(12px);
}

.home-brand {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.home-tagline {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  color: var(--text-muted);
  background: #ffffff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.status-ok {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #047857;
}

.status-error {
  border-color: rgba(233, 65, 79, 0.32);
  background: rgba(233, 65, 79, 0.1);
  color: var(--brand);
}

.status-offline,
.status-checking {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #4b5563;
}

.home-hero {
  display: grid;
  flex: 1;
  align-items: center;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  padding: 72px 0;
}

.home-hero-copy h1 {
  max-width: 860px;
  color: var(--text-main);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
}

.home-hero-copy p {
  max-width: 640px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.8;
}

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

.home-hero-actions button {
  min-height: 44px;
  padding: 0 24px;
}

.home-workbench {
  border: 1px solid rgba(214, 218, 225, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.home-workbench-inner {
  border: 1px solid #f0f1f4;
  border-radius: 22px;
  background: var(--surface-subtle);
  padding: 20px;
}

.home-workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.home-workbench-title {
  font-size: 14px;
  font-weight: 760;
}

.home-workbench-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.home-ready-pill {
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: #08716d;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.home-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 12px 16px;
  color: #374151;
  font-size: 14px;
  font-weight: 650;
}

.home-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: #f1f3f5;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
  flex: 0 0 auto;
}

.home-steps li:first-child span {
  background: var(--brand-soft);
  color: var(--brand);
}

.home-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  scroll-margin-top: 32px;
}

.home-tool-card {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  border: 1px solid rgba(214, 218, 225, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  padding: 24px;
  color: inherit;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-tool-card:hover {
  border-color: rgba(233, 65, 79, 0.32);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.home-tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border: 1px solid rgba(233, 65, 79, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(233, 65, 79, 0.035);
  padding: 8px;
}

.home-tool-icon img {
  display: block;
  width: 55px;
  height: 55px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.home-tool-icon .home-tool-icon-ai {
  width: 35px;
  height: 35px;
}

.home-tool-card h2 {
  color: var(--text-main);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.home-tool-card p {
  flex: 1;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-tool-card > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 24px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
}

.home-tool-card b {
  transition: transform 0.2s ease;
}

.home-tool-card:hover b {
  transform: translateX(4px);
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 40px;
  color: #8a96a3;
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}

.home-footer nav {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 100%;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 8px;
}

.home-footer a {
  font-weight: 650;
  text-decoration: none;
}

.home-footer a:hover {
  color: var(--brand);
}

.home-account-menu {
  position: relative;
}

.home-account-popover {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  width: min(260px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.home-account-name {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 850;
}

.home-account-email {
  overflow-wrap: anywhere;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.home-account-popover button {
  margin-top: 14px;
  color: #dc2626;
}

.release-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.35);
  padding: 24px 16px;
  backdrop-filter: blur(8px);
}

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

.release-modal-card {
  width: min(780px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.release-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.release-modal-version {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.release-modal-head h2 {
  margin-top: 8px;
  color: var(--text-main);
  font-size: 24px;
  font-weight: 850;
}

.release-modal-date {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 650;
}

.release-close {
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
}

.release-modal ul {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.release-modal li {
  display: flex;
  gap: 12px;
  border: 1px solid #f0f1f4;
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  padding: 12px 16px;
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
}

.release-modal li span {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: var(--radius-full);
  background: var(--brand);
  flex: 0 0 auto;
}

.release-modal li b {
  font-weight: 650;
}

.release-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.sub-card,
.inner-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.card,
.tool-card,
.history-item,
.history-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover,
.tool-card:hover,
.history-item:hover,
.history-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.1);
}

.topbar,
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.topbar-copy {
  display: grid;
  gap: 8px;
}

.page-desc {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.topbar-actions,
.admin-actions,
.button-row,
.action-row,
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  justify-content: flex-start;
  margin-top: 22px;
}

.actions.single-action {
  justify-content: flex-start;
}

.copywriting-title-action {
  column-gap: 0;
  gap: 0;
  margin-top: -8px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.back-link {
  color: inherit;
  text-decoration: none;
}

.back-link:hover {
  color: var(--brand);
}

.status-pill,
.badge,
.admin-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-muted);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok,
.badge-success,
.admin-status.status-success {
  border-color: rgba(2, 122, 72, 0.16);
  background: var(--success-bg);
  color: var(--success-text);
}

.status-pill.error,
.badge-error,
.admin-status.status-error {
  border-color: rgba(180, 35, 24, 0.16);
  background: var(--error-bg);
  color: var(--error-text);
}

.badge-warning,
.admin-status.status-warning {
  border-color: rgba(181, 71, 8, 0.16);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.admin-status.status-muted {
  border-color: rgba(148, 163, 184, 0.24);
  background: #f1f5f9;
  color: #64748b;
}

.recharge-counting-text,
.recharge-counting-button {
  color: var(--success-text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.recharge-counting-button {
  min-height: 30px;
  border: 1px solid rgba(2, 122, 72, 0.2);
  border-radius: var(--radius-full);
  background: var(--success-bg);
  padding: 5px 12px;
  cursor: pointer;
}

.recharge-counting-button:hover {
  border-color: rgba(2, 122, 72, 0.38);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.recharge-counting-text.recharge-counting-excluded,
.recharge-counting-button.recharge-counting-excluded {
  color: var(--warning-text);
}

.recharge-counting-button.recharge-counting-excluded {
  border-color: rgba(181, 71, 8, 0.2);
  background: var(--warning-bg);
}

.recharge-counting-button.recharge-counting-excluded:hover {
  border-color: rgba(181, 71, 8, 0.38);
}

.workspace,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(480px, 0.58fr);
  gap: 24px;
  align-items: start;
}

.workspace.single {
  grid-template-columns: minmax(0, 860px);
}

.workspace.copywriting-workspace,
.copywriting-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  align-items: stretch;
}

.creator,
.preview,
.history,
.admin-table-panel,
.copywriting-panel {
  padding: 22px;
}

.preview {
  position: sticky;
  top: 24px;
  border-radius: var(--radius-xl);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.required-note {
  margin: -6px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.required-mark {
  color: var(--brand);
  font-weight: 800;
}

.grid,
.form-grid {
  display: grid;
  gap: 14px;
}

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

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

.form-section {
  padding: 0;
  margin-bottom: 26px;
}

.form-section + .form-section {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.form-section-title {
  font-size: 15px;
  font-weight: 720;
  color: var(--text-main);
  margin-bottom: 4px;
}

.form-section-desc {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.form-field,
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  color: #374151;
  font-size: 13px;
  font-weight: 650;
}

.form-field.full {
  grid-column: 1 / -1;
}

.label-text {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

input,
textarea,
select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 470;
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input,
select {
  min-height: 42px;
}

select.custom-select-native {
  position: fixed;
  inset: auto auto 0 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.custom-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.custom-select[hidden] {
  display: none;
}

.custom-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: #334155;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.custom-select-button span:first-child {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.custom-select-button:hover,
.custom-select-button:focus,
.custom-select-button[aria-expanded="true"] {
  color: #334155;
  background: #f1f3f6;
  border-color: rgba(226, 232, 240, 0.9);
  outline: none;
}

[data-can-generate-image="true"] .creator .custom-select-button {
  border-color: #f4b6b6;
}

[data-can-generate-image="true"] .creator .custom-select-button:hover,
[data-can-generate-image="true"] .creator .custom-select-button:focus,
[data-can-generate-image="true"] .creator .custom-select-button[aria-expanded="true"] {
  border-color: #ef9a9a;
}

.custom-select-menu {
  position: fixed;
  z-index: 300;
  display: grid;
  min-width: var(--dropdown-trigger-width, 100%);
  width: max-content;
  max-width: min(var(--dropdown-max-width, 260px), calc(100vw - 28px));
  max-height: min(360px, calc(100vh - 28px));
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #dce2eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.16);
  animation: menu-pop 0.16s ease-out both;
  overscroll-behavior: contain;
}

.custom-select-menu--compact {
  --dropdown-max-width: 180px;
}

.custom-select-menu--normal {
  --dropdown-max-width: 260px;
}

.custom-select-menu--wide {
  --dropdown-max-width: 360px;
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 40px;
  gap: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  color: #252934;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  transform: none;
}

.custom-select-menu button > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.custom-select-menu button strong {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}

.custom-select-menu button small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  white-space: nowrap;
}

.custom-select-menu button:hover,
.custom-select-menu button.is-selected {
  color: #ef3b4f;
  background: rgba(244, 63, 94, 0.08);
  transform: none;
}

.custom-select-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-light);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(233, 65, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(233, 65, 79, 0.08);
}

input.field-invalid,
select.field-invalid,
textarea.field-invalid {
  border-color: rgba(180, 35, 24, 0.78);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.field-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.inline-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.step-heading {
  margin-top: 0;
}

.inline-other {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-other[hidden] {
  display: none;
}

.other-back-button {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.other-back-button::before,
.other-back-button::after {
  position: absolute;
  content: "";
}

.other-back-button::before {
  left: 14px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg);
}

.other-back-button::after {
  left: 14px;
  top: 20px;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.title-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 8px;
  margin: 8px 0 14px;
}

.title-chip {
  border-color: rgba(15, 143, 138, 0.22);
  background: var(--accent-soft);
  color: #08716d;
  min-height: 32px;
  max-width: 100%;
  box-shadow: none;
  white-space: normal;
  text-align: left;
}

.title-chip:hover {
  border-color: rgba(15, 143, 138, 0.34);
  background: #dff1ef;
  color: #08716d;
}

.progress-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  margin: 0 0 22px;
  padding: 16px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-row strong {
  color: var(--brand);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: #eef0f3;
  margin: 12px 0 14px;
}

.progress-bar,
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e9414f, #ff7a85);
  transition: width 0.3s ease;
}

.progress-steps,
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}

.progress-steps li,
.step-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-light);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.progress-steps li::before,
.step-dot {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7dce3;
}

.progress-steps li.active,
.step-item.is-active {
  border-color: rgba(233, 65, 79, 0.24);
  background: var(--brand-soft);
  color: var(--brand);
}

.progress-steps li.active::before,
.step-item.is-active .step-dot {
  background: var(--brand);
}

.progress-steps li.done,
.step-item.is-complete {
  border-color: rgba(15, 143, 138, 0.2);
  background: var(--accent-soft);
  color: #08716d;
}

.progress-steps li.done::before,
.step-item.is-complete .step-dot {
  background: var(--accent);
}

.progress-panel.error .progress-row strong,
.progress-panel.error #progressLabel {
  color: var(--error-text);
}

.poster-stage,
.preview-canvas {
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
    linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
  background-color: #ffffff;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.poster-stage.has-logo-editor {
  display: block;
  min-height: auto;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
}

.poster-stage > img,
.preview-image,
.poster-preview img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.16);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  width: min(360px, 82%);
  min-height: 360px;
  border: 1px dashed #c9ced6;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-light);
  padding: 28px;
  text-align: center;
  font-weight: 700;
}

.empty-state span {
  display: grid;
  gap: 8px;
}

.empty-state span::before {
  content: "海报预览将在这里显示";
  color: var(--text-main);
  font-size: 16px;
  font-weight: 720;
}

.empty-state span::after {
  content: "填写左侧信息后，可以生成标题、正文和视觉风格，最后生成完整海报。";
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
}

.meta {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.logo-editor {
  display: grid;
  gap: 14px;
}

.logo-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.logo-toolbar label {
  margin: 0;
}

.logo-editor-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.16);
  touch-action: none;
}

.poster-stage .poster-base-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.poster-stage .poster-logo-layer {
  position: absolute;
  z-index: 2;
  width: 20%;
  height: auto;
  border: 1.5px dashed rgba(233, 65, 79, 0.75);
  border-radius: 10px;
  background: transparent;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.poster-stage .poster-logo-layer:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(233, 65, 79, 0.1);
}

.poster-stage .poster-logo-layer:active {
  cursor: grabbing;
}

.poster-edit-controls {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.poster-edit-controls .inline-actions {
  margin-top: 0;
}

.poster-editor-workspace {
  --poster-picker-width: 320px;
  --poster-ai-width: 380px;
  --poster-preview-min-width: 360px;
  display: grid;
  grid-template-columns: var(--poster-picker-width) 14px minmax(var(--poster-preview-min-width), 1fr) 14px var(--poster-ai-width);
  gap: 0;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.poster-editor-page {
  height: 100vh;
  overflow: hidden;
}

.poster-editor-page .app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  width: calc(100% - var(--sidebar-width, 200px) - 32px);
  max-width: none;
  margin-right: 16px;
  padding-top: 22px;
  padding-bottom: 16px;
  overflow: hidden;
}

.poster-editor-page .topbar {
  align-items: center;
  margin-bottom: 10px;
}

.poster-editor-page .eyebrow,
.poster-editor-page .page-desc,
.poster-editor-page .topbar-actions {
  display: none;
}

.poster-editor-page .topbar-main {
  align-items: center;
}

.poster-editor-page h1 {
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.1;
}

.poster-editor-workspace > .panel,
.poster-editor-workspace > .poster-ai-sidebar {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.poster-picker-panel,
.poster-editor-preview {
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.poster-picker-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.poster-picker-panel > .form-section:last-child {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.poster-layout-resizer {
  position: relative;
  z-index: 8;
  align-self: stretch;
  min-height: 0;
  cursor: col-resize;
  touch-action: none;
  border-left: 1px solid var(--border);
  border-right: 0;
  background: transparent;
}

.poster-layout-resizer span {
  display: none;
}

.poster-layout-resizer:hover span,
.poster-layout-resizer:focus-visible span,
.is-resizing-panels .poster-layout-resizer span {
  display: none;
}

.poster-layout-resizer:hover,
.poster-layout-resizer:focus-visible,
.is-resizing-panels .poster-layout-resizer {
  border-left-color: rgba(233, 65, 79, 0.34);
}

.is-resizing-panels {
  cursor: col-resize;
  user-select: none;
}

.poster-editor-workspace.is-ai-hidden {
  grid-template-columns: var(--poster-picker-width) 14px minmax(var(--poster-preview-min-width), 1fr) 0 0;
}

.poster-editor-workspace.is-ai-hidden .poster-ai-resizer {
  display: none;
}

.poster-editor-workspace.is-ai-collapse-preview .poster-ai-sidebar {
  position: relative;
  background: #ffffff;
}

.poster-editor-workspace.is-ai-collapse-preview .poster-ai-sidebar-inner {
  opacity: 0.08;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.poster-editor-workspace.is-ai-collapse-preview .poster-ai-sidebar::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  color: #2b3038;
  content: "›\A隐藏";
  white-space: pre;
  text-align: center;
  font-size: 30px;
  font-weight: 760;
  line-height: 1.9;
  pointer-events: none;
}

.poster-editor-workspace.is-ai-collapse-preview .poster-ai-resizer span {
  border-color: rgba(233, 65, 79, 0.36);
  box-shadow: 0 0 0 4px rgba(233, 65, 79, 0.08);
}

.poster-editor-preview {
  position: static;
  height: 100%;
  max-height: none;
  overflow: auto;
}

.poster-editor-preview .progress-panel {
  margin-top: 16px;
  margin-bottom: 0;
}

.panel-heading-actions .poster-zoom-button {
  white-space: nowrap;
}

.poster-source-select-wrap {
  position: relative;
  z-index: 120;
  display: block;
  width: 70%;
  min-width: 156px;
}

.poster-source-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: #334155;
  box-shadow: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.poster-source-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.poster-source-select:hover,
.poster-source-select:focus,
.poster-source-select[aria-expanded="true"] {
  background: #f1f3f6;
  color: #334155;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: none;
  outline: none;
}

.poster-source-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 300;
  display: grid;
  min-width: var(--dropdown-trigger-width, 100%);
  width: max(100%, var(--dropdown-trigger-width, 100%));
  max-width: min(280px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid #dce2eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.16);
  animation: menu-pop 0.16s ease-out both;
  transform-origin: top left;
}

.poster-source-menu[hidden] {
  display: none;
}

.poster-source-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 40px;
  gap: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  color: #252934;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  transform: none;
}

.poster-source-menu button > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.poster-source-menu button strong {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}

.poster-source-menu button small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  white-space: nowrap;
}

.poster-source-menu button:hover,
.poster-source-menu button.is-selected {
  color: #ef3b4f;
  background: rgba(244, 63, 94, 0.08);
  transform: none;
}

.poster-source-menu button.is-selected small {
  color: rgba(233, 65, 79, 0.64);
}

@keyframes menu-pop {
  from {
    opacity: 0.5;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.poster-editor-history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.poster-editor-history-item {
  position: relative;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 86px 12px 12px;
  overflow: hidden;
}

.poster-editor-history-item .history-thumb {
  width: 86px;
  height: 86px;
}

.poster-editor-history-item > span:not(.status-pill) {
  align-self: center;
  min-width: 0;
}

.poster-editor-history-item .history-title {
  max-width: 100%;
}

.poster-editor-history-item .history-sub {
  max-width: 100%;
}

.poster-editor-history-item .status-pill {
  position: absolute;
  top: 50%;
  right: 12px;
  max-width: 68px;
  min-height: 34px;
  padding: 0 10px;
  transform: translateY(-50%);
}

.poster-editor-history-item.active {
  border-color: rgba(233, 65, 79, 0.36);
  background: var(--brand-soft);
}

.poster-adjust-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.poster-adjust-panel label {
  margin: 0;
  color: var(--text-main);
  font-weight: 700;
}

.poster-adjust-panel textarea {
  min-height: 132px;
  resize: vertical;
}

.poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0.86);
  backdrop-filter: blur(10px);
}

.poster-lightbox[hidden] {
  display: none;
}

.poster-lightbox-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.poster-lightbox-frame img {
  display: block;
  max-width: min(100%, 980px);
  max-height: 94vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.poster-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1001;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: none;
  font-size: 28px;
  line-height: 1;
}

.poster-lightbox-close:hover,
.poster-lightbox-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: none;
}

.poster-lightbox-open {
  overflow: hidden;
}

.history {
  margin-top: 24px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item,
.history-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: none;
  text-align: left;
}

.history-item > span:not(.status-pill),
.history-card > span:not(.status-pill) {
  min-width: 0;
  overflow: hidden;
}

.history-item:hover,
.history-card:hover {
  border-color: rgba(233, 65, 79, 0.22);
  background: #fffefe;
}

.history-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  background: #f3f4f6;
  object-fit: cover;
}

.history-title {
  display: block;
  margin: 0 0 6px;
  overflow: hidden;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-sub {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .status-pill,
.history-card .status-pill {
  justify-self: end;
  max-width: 96px;
}

.copy-output textarea {
  min-height: 430px;
}

.copywriting-panel,
.workspace.copywriting-workspace > .panel {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.result-box {
  position: relative;
  background: #f9fafb;
  border: 1px solid #edf0f2;
  border-radius: 14px;
  padding: 16px;
  color: var(--text-main);
  line-height: 1.7;
}

.admin-summary,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-card span,
.metric-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.metric-card strong,
.metric-value {
  color: var(--text-main);
  font-size: 28px;
  line-height: 1;
  font-weight: 760;
}

.metric-note {
  color: var(--text-light);
  font-size: 12px;
}

.table-wrap,
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table,
.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

thead th,
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #fafafa;
}

.admin-table td {
  color: var(--text-main);
}

.admin-table td:nth-child(7),
.admin-table td:nth-child(9) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-empty {
  color: var(--text-muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 14px;
  background: #111827;
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.36s ease, transform 0.36s ease;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

.toast.toast-success {
  background: #027a48;
}

.toast.toast-error {
  background: #b42318;
}

.admin-shell {
  max-width: 1480px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.admin-tab {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.admin-tab:hover,
.admin-tab.is-active {
  border-color: rgba(233, 65, 79, 0.22);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: block;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-grid > * {
  min-width: 0;
}

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

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

.usage-grid {
  margin-bottom: 18px;
}

.usage-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.usage-filter-panel select,
.usage-filter-panel .custom-select,
.usage-filter-panel input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  padding: 0 12px;
}

.usage-filter-panel .custom-select,
.admin-filter-bar .custom-select,
.admin-settings-form .custom-select {
  border: 0;
  background: transparent;
  padding: 0;
}

.usage-filter-panel button {
  grid-column: 1 / -1;
}

.usage-chart {
  display: grid;
  gap: 12px;
}

.usage-account-list {
  display: grid;
  gap: 12px;
}

.usage-account-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px;
}

.usage-account-row div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.usage-account-row strong {
  color: var(--text-main);
  font-size: 13px;
}

.usage-account-row span,
.usage-account-row small {
  color: var(--text-muted);
  font-size: 12px;
}

.usage-bar-row {
  display: grid;
  gap: 8px;
}

.usage-bar-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.usage-bar-meta strong {
  color: var(--text-main);
  font-size: 13px;
}

.usage-bar-meta span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.usage-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: #f1f3f5;
}

.usage-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e9414f, #f59e0b);
}

.usage-table td:nth-child(11) {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-admin-summary {
  margin-bottom: 18px;
}

.admin-section-note {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.credit-admin-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.42fr) minmax(130px, 0.42fr) auto;
}

.credit-ledger-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.5fr) repeat(2, minmax(130px, 0.45fr)) auto;
}

.credit-ledger-panel {
  margin-top: 18px;
}

.credit-account-table {
  min-width: 980px;
}

.credit-account-table th:last-child,
.credit-account-table td:last-child {
  width: 180px;
}

.admin-row-actions.credit-account-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: nowrap;
  width: max-content;
}

.credit-account-actions .compact {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.credit-ledger-table {
  min-width: 1120px;
}

.credit-positive {
  color: var(--success-text);
}

.credit-negative {
  color: var(--brand);
}

.credit-admin-dialog-form {
  display: grid;
  gap: 14px;
}

.credit-admin-dialog-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.credit-admin-dialog-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font: inherit;
}

.credit-dialog-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px 14px;
}

.credit-dialog-summary span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.credit-dialog-summary strong {
  color: var(--text-main);
  font-size: 18px;
}

.credit-package-picker {
  display: grid;
  gap: 8px;
}

.credit-package-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 10px 12px;
}

.credit-package-option:has(input:checked) {
  border-color: rgba(233, 65, 79, 0.34);
  background: var(--brand-soft);
}

.credit-package-option input {
  width: 16px;
  min-height: 16px;
}

.credit-package-option span {
  display: grid;
  gap: 2px;
}

.credit-package-option strong {
  color: var(--text-main);
}

.credit-package-option small {
  color: var(--text-muted);
}

.credit-cycle-toggle {
  grid-template-columns: auto 1fr;
}

.credit-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(140px, 0.6fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-filter-bar input,
.admin-filter-bar select,
.admin-filter-bar .custom-select,
.admin-settings-form input,
.admin-settings-form select,
.admin-settings-form .custom-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  padding: 0 12px;
}

.admin-filter-bar .custom-select,
.admin-settings-form .custom-select {
  border: 0;
  background: transparent;
  padding: 0;
}

.admin-table-wide {
  min-width: 1040px;
}

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

.admin-table th:last-child,
.admin-table td:last-child {
  width: 180px;
}

.admin-inline-select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 0 8px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--text-muted);
}

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

.admin-list-item,
.admin-empty-block {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px;
}

.admin-list-item span,
.admin-empty-block,
.muted {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-list-item span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recent-error-item {
  gap: 8px;
}

.recent-error-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.recent-error-heading strong {
  min-width: 0;
}

.recent-error-heading time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.compact-link {
  min-height: 34px;
  border-radius: var(--radius-full);
  padding: 0 12px;
  font-size: 13px;
}

.admin-settings-form {
  display: grid;
  gap: 14px;
}

.admin-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.admin-field-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.api-key-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.api-key-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px;
}

.api-key-item > div:first-child {
  display: grid;
  gap: 4px;
}

.api-key-item strong {
  color: var(--text-main);
  font-size: 14px;
}

.api-key-item span {
  color: var(--text-muted);
  font-size: 12px;
}

.api-key-item .admin-row-actions {
  grid-column: 1 / -1;
}

.danger-soft {
  color: var(--error-text);
}

.model-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.model-select-row button {
  min-height: 40px;
  white-space: nowrap;
}

.admin-form-status {
  min-height: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.admin-form-status.status-success {
  color: var(--success-text);
}

.admin-form-status.status-error {
  color: var(--error-text);
}

.admin-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text-main);
}

.admin-toggle input {
  width: 18px;
  min-height: 18px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.material-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.material-upload-form input[type="file"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 8px 10px;
  color: var(--text-muted);
}

.material-item {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 10px;
  text-decoration: none;
}

.material-item a {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.material-item img {
  width: 100%;
  height: 92px;
  object-fit: contain;
}

.material-item span {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.material-item button {
  width: 100%;
}

.admin-dialog {
  width: min(840px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.admin-dialog::backdrop {
  background: rgba(17, 24, 39, 0.38);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-body {
  display: grid;
  gap: 14px;
  max-height: 640px;
  overflow: auto;
}

.dialog-image {
  width: min(320px, 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.detail-list {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--text-muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

.detail-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  padding: 10px;
  font: inherit;
}

@media (max-width: 1100px) {
  .admin-summary,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid.two,
  .admin-filter-bar,
  .usage-filter-panel,
  .material-upload-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .poster-editor-page {
    height: auto;
    overflow: auto;
  }

  .poster-editor-page .app-shell {
    display: block;
    height: auto;
    overflow: visible;
    padding-top: 32px;
    padding-bottom: 56px;
  }

  .workspace,
  .workspace-grid,
  .workspace.copywriting-workspace,
  .copywriting-grid,
  .poster-editor-workspace {
    grid-template-columns: 1fr;
  }

  .poster-editor-workspace {
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .poster-layout-resizer {
    display: none;
  }

  .poster-editor-workspace > .panel {
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
  }

  .poster-picker-panel {
    display: block;
    overflow: visible;
  }

  .poster-picker-panel > .form-section:last-child {
    display: block;
  }

  .preview,
  .poster-editor-preview {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .home-shell {
    width: min(100% - 24px, 640px);
    padding: 16px 0 24px;
  }

  .home-topline {
    align-items: flex-start;
  }

  .home-account-popover {
    position: fixed;
    top: 92px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    z-index: 80;
    border-radius: var(--radius-md);
  }

  .home-header {
    align-items: flex-start;
    border-radius: var(--radius-xl);
  }

  .home-tagline {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0;
  }

  .home-hero-copy h1 {
    font-size: 40px;
  }

  .home-hero-copy p {
    font-size: 16px;
  }

  .home-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .home-tools {
    grid-template-columns: 1fr;
  }

  .home-tool-card {
    min-height: 0;
  }

  .release-modal {
    align-items: flex-start;
    padding: 16px 12px;
  }

  .release-modal-card {
    border-radius: 20px;
    padding: 20px;
  }

  .release-modal-head h2 {
    font-size: 22px;
  }

  .onboarding-modal {
    align-items: stretch;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .onboarding-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .onboarding-header {
    padding: 22px 54px 14px 18px;
  }

  .onboarding-header h2 {
    font-size: 22px;
  }

  .onboarding-header p {
    font-size: 14px;
  }

  .onboarding-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0 18px 14px;
  }

  .onboarding-tabs button {
    flex: 0 0 auto;
  }

  .onboarding-body {
    padding: 18px;
  }

  .onboarding-card-grid,
  .onboarding-action-list {
    grid-template-columns: 1fr;
  }

  .onboarding-card-grid article {
    min-height: 0;
  }

  .onboarding-footer {
    align-items: stretch;
    padding: 14px 18px;
  }

  .onboarding-footer-main {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .app-sidebar,
  .sidebar-mobile-toggle,
  .sidebar-backdrop {
    display: none;
  }

  .page-with-sidebar.sidebar-collapsed {
    --sidebar-width: 240px;
  }

  .page-with-sidebar .app-shell {
    width: calc(100% - 32px);
    margin-right: auto;
    margin-left: auto;
    padding: 20px 0 40px;
  }

  .app-sidebar {
    width: min(82vw, var(--sidebar-width, 260px));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .sidebar-collapsed .app-sidebar {
    align-items: stretch;
    padding: 0;
  }

  .sidebar-collapsed .sidebar-header {
    justify-content: flex-start;
    padding: 14px 12px 10px;
  }

  .sidebar-collapsed .sidebar-brand {
    flex: 1 1 auto;
    justify-content: flex-start;
    padding-right: 50px;
  }

  .sidebar-collapsed .sidebar-logo-wrap {
    width: 34px;
    height: 34px;
  }

  .sidebar-collapsed .sidebar-logo {
    width: 34px;
    height: 34px;
  }

  .sidebar-collapsed .sidebar-brand-text,
  .sidebar-collapsed .sidebar-link-text {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    opacity: 1;
    white-space: nowrap;
  }

  .sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
    gap: 8px;
    padding: 0 14px;
  }

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

  .sidebar-mobile-toggle {
    display: none;
  }

  .app-shell {
    width: calc(100% - 32px);
    padding: 20px 0 40px;
  }

  .topbar,
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  h1,
  .page-title {
    font-size: 26px;
    letter-spacing: 0;
  }

  .workspace,
  .workspace-grid {
    gap: 18px;
  }

  .panel,
  .card,
  .form-panel,
  .preview-panel {
    border-radius: 16px;
  }

  .creator,
  .preview,
  .history,
  .admin-table-panel {
    padding: 18px;
  }

  .grid.two,
  .grid.three,
  .form-grid,
  .form-grid.two,
  .form-grid.three,
  .logo-toolbar,
  .inline-other {
    grid-template-columns: 1fr;
  }

  .button-row,
  .action-row,
  .actions,
  .topbar-actions,
  .inline-controls,
  .admin-actions,
  .admin-pagination {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .model-select-row {
    grid-template-columns: 1fr;
  }

  .usage-bar-meta {
    display: grid;
    gap: 4px;
  }

  .usage-account-row div:first-child {
    display: grid;
    gap: 4px;
  }

  .usage-bar-meta span {
    white-space: normal;
  }

  .button-row .btn,
  .button-row button,
  .action-row .btn,
  .action-row button,
  .actions button,
  .inline-controls button,
  .admin-actions button,
  .admin-pagination button,
  .download-link {
    width: 100%;
  }

  .preview {
    min-height: 420px;
  }

  .poster-stage,
  .preview-canvas {
    min-height: 360px;
    padding: 18px;
  }

  .empty-state {
    min-height: 280px;
    width: 100%;
  }

  .progress-steps {
    padding-bottom: 4px;
  }

  .history-item,
  .history-card {
    grid-template-columns: 72px 1fr;
  }

  .history-thumb {
    width: 72px;
    height: 72px;
  }

  .history-item .status-pill,
  .history-card .status-pill {
    grid-column: 1 / -1;
  }

  .copy-output textarea {
    min-height: 320px;
  }

  .admin-login-shell {
    width: calc(100% - 32px);
    padding: 24px 0;
  }

  .admin-login-card {
    padding: 24px;
  }

  .verification-code-row {
    grid-template-columns: 1fr;
  }

  .admin-login-card button[type="submit"] {
    width: 100%;
  }

  .legal-topnav {
    justify-content: stretch;
  }

  .legal-topnav a {
    flex: 1 1 120px;
  }

  .legal-card {
    border-radius: 18px;
  }

  .pricing-grid,
  .legal-rule-list div {
    grid-template-columns: 1fr;
  }
}

.wechat-browser-tip {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 90;
  display: none;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: rgba(255, 250, 235, 0.98);
  border-bottom: 1px solid rgba(181, 71, 8, 0.2);
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
}

.wechat-browser-tip-bar {
  width: min(100%, 720px);
  min-height: 42px;
  margin: 0 auto;
  border-color: rgba(181, 71, 8, 0.18);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--warning-text);
  box-shadow: none;
  gap: 8px;
}

.wechat-browser-tip-bar span {
  color: #7a4a06;
  font-size: 13px;
  font-weight: 560;
}

.wechat-browser-dialog,
.credit-insufficient-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.5);
}

.wechat-browser-card,
.credit-insufficient-card {
  position: relative;
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.wechat-browser-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 760;
}

.wechat-browser-card h2,
.credit-insufficient-card h2 {
  font-size: 22px;
}

.wechat-browser-card p,
.credit-insufficient-card p,
.credit-insufficient-meta {
  color: var(--text-muted);
}

.wechat-browser-card small {
  color: var(--text-light);
}

.wechat-browser-close,
.credit-insufficient-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  color: var(--text-muted);
  padding: 0;
  box-shadow: none;
}

.wechat-browser-actions,
.credit-insufficient-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-top-credit-entry {
  display: none;
}

@media (max-width: 768px) {
  .wechat-browser-tip {
    display: block;
  }

  .mobile-top-credit-entry {
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }

  .wechat-browser-actions,
  .credit-insufficient-actions {
    grid-template-columns: 1fr;
  }

  .wechat-browser-card,
  .credit-insufficient-card {
    align-self: start;
    margin-top: 56px;
    border-radius: var(--radius-md);
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .admin-summary,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
