:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e2e8f0;
  --soft: #f1f5fb;
  --green: #3f5fc8;
  --green-dark: #2f4aa0;
  --cyan: #5974c9;
  --coral: #dc6562;
  --gold: #b7791f;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
  color: var(--ink);
  box-shadow: 10px 0 28px rgba(15, 23, 42, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(63, 95, 200, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, #5d7ce2, #3f5fc8);
  color: #ffffff;
  box-shadow:
    0 12px 26px rgba(63, 95, 200, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-mark::before {
  position: absolute;
  inset: -30% auto auto -30%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  content: "";
}

.brand-mark svg {
  position: relative;
  z-index: 1;
  width: 23px;
  height: 23px;
  stroke-width: 2.4;
}

.brand-orbit {
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 22px;
  height: 8px;
  border-bottom: 2px solid rgba(236, 242, 255, 0.78);
  border-radius: 50%;
  transform: rotate(-18deg);
  opacity: 0.9;
}

.brand strong,
.brand span {
  display: block;
}

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

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

.nav-item,
.ghost-button,
.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: #475569;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: #eef3ff;
  color: var(--green-dark);
}

.nav-item svg,
.ghost-button svg,
.primary-button svg,
.secondary-button svg,
.icon-button svg,
.notice svg,
.account-chip svg,
.mode-card svg,
.upload-zone svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.side-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.side-panel p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.panel-kicker,
.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.side-panel .panel-kicker {
  color: var(--green-dark);
}

.qr-large {
  display: grid;
  position: relative;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  place-items: center;
  border: 12px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #ccd5d8;
  overflow: hidden;
}

.login-mini {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #d5def5;
  border-radius: 8px;
  color: var(--green-dark);
  background: #eef3ff;
}

.login-mini svg {
  width: 24px;
  height: 24px;
}

.auth-visual {
  display: grid;
  gap: 12px;
  align-content: center;
}

.auth-icon {
  width: 76px;
  height: 76px;
}

.auth-icon svg {
  width: 34px;
  height: 34px;
}

.qr-large img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-large img[hidden] {
  display: none;
}

.qr-large span {
  max-width: 160px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.qr-large.qr-loading::after {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 68px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  content: "";
  animation: qr-loading 1s ease-in-out infinite;
}

.qr-large.qr-error {
  border-color: #fee2e2;
  background: #fff7f7;
  box-shadow: inset 0 0 0 1px #fecaca;
}

.qr-large.qr-error span {
  color: #b91c1c;
}

.qr-status {
  max-width: 280px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-flow-note {
  padding: 12px;
  border: 1px solid #dbe5f8;
  border-radius: 8px;
  background: #f8fbff;
}

.login-flow-note strong {
  display: block;
  margin-bottom: 4px;
  color: #334155;
  font-size: 13px;
}

.login-flow-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes qr-loading {
  0%,
  100% {
    transform: translateX(-50%) scaleX(0.45);
    opacity: 0.42;
  }

  50% {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.08;
}

h2 {
  font-size: 22px;
  line-height: 1.25;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.account-chip span,
.account-chip strong {
  display: block;
  white-space: nowrap;
}

.account-chip span {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #dbe5f8;
  border-radius: 8px;
  background: #f7f9ff;
  color: #334155;
}

.notice p {
  margin: 0;
  line-height: 1.55;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 18px;
}

.tool-panel,
.result-panel,
.compliance-panel,
.price-card,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.tool-panel,
.result-panel,
.compliance-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-heading {
  align-items: center;
  margin-top: 10px;
}

.mode-badge {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #d5def5;
  border-radius: 999px;
  color: var(--green-dark);
  background: #f4f7ff;
  font-size: 12px;
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mode-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px 10px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.mode-card:hover,
.mode-card.active {
  border-color: rgba(63, 95, 200, 0.36);
  background: #f7f9ff;
  box-shadow: 0 12px 28px rgba(63, 95, 200, 0.09);
}

.mode-card svg {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  color: var(--green);
}

.mode-card strong {
  align-self: end;
  font-size: 16px;
}

.mode-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workflow-tabs {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.workflow-tabs.active {
  display: grid;
}

.workflow-tab.mode-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 56px;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 14px;
}

.workflow-tab.mode-card svg {
  grid-row: span 1;
  width: 20px;
  height: 20px;
  margin-top: 0;
}

.workflow-tab.mode-card strong {
  align-self: center;
  font-size: 15px;
}

.upload-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  gap: 10px;
  padding: 24px;
  border: 1.5px dashed #c8d6f4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(63, 95, 200, 0.06), transparent 42%),
    #ffffff;
  text-align: center;
}

body.aigc-workflow .workflow-tabs {
  display: none;
}

body.ppt-workflow .mode-grid,
body.ppt-workflow .option-grid {
  display: none;
}

body.ppt-workflow .upload-zone {
  min-height: 260px;
  border-color: rgba(28, 153, 140, 0.38);
  background:
    linear-gradient(135deg, rgba(28, 153, 140, 0.08), transparent 46%),
    #ffffff;
}

body.ppt-workflow .upload-zone svg {
  color: #1c998c;
}

body.ppt-workflow .download-ready-panel:not(.is-complete) ~ .result-actions .download-format,
body.ppt-workflow .download-ready-panel:not(.is-complete) ~ .result-actions #downloadBtn {
  display: none;
}

.upload-zone.dragover {
  border-color: var(--green);
  background: #f2f6ff;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-zone svg {
  width: 42px;
  height: 42px;
  color: var(--green);
}

.upload-zone strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.upload-zone span {
  color: var(--muted);
  line-height: 1.5;
}

.upload-guidance {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dbe5f8;
  border-radius: 8px;
  background: #f8fbff;
}

.upload-guidance strong {
  color: #334155;
  font-size: 14px;
}

.upload-guidance p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.option-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px);
  gap: 12px;
  margin: 16px 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.check-row span {
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

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

.field textarea {
  min-height: 280px;
  resize: vertical;
  line-height: 1.6;
}

.manual-field {
  margin-top: 14px;
}

.manual-field textarea {
  min-height: 150px;
}

.template-field {
  display: none;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d5def5;
  border-radius: 8px;
  background: #f8faff;
}

.template-field.active {
  display: grid;
}

.template-field textarea {
  min-height: 96px;
}

.template-upload-zone {
  position: relative;
  display: grid;
  min-height: 118px;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed #c8d6f4;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.template-upload-zone.dragover {
  border-color: var(--green);
  background: #f2f6ff;
  box-shadow: 0 10px 22px rgba(63, 95, 200, 0.08);
}

.template-upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.template-upload-zone svg {
  width: 30px;
  height: 30px;
  color: var(--green);
}

.template-upload-zone strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.template-upload-zone span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-field small {
  color: var(--muted);
  line-height: 1.55;
}

.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cost-row span,
.cost-row strong {
  display: block;
}

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

.cost-row strong {
  font-size: 22px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(63, 95, 200, 0.18);
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--green-dark);
  border: 1px solid #d5def5;
  background: #f7f9ff;
}

.secondary-button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

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

.side-panel .ghost-button {
  width: 100%;
  color: var(--green-dark);
  border-color: #d5def5;
  background: #ffffff;
}

.icon-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.icon-button:hover {
  color: var(--green-dark);
  border-color: #d5def5;
}

#resultText {
  width: 100%;
  min-height: 368px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #253238;
  background: #fbfcfc;
  line-height: 1.7;
  resize: vertical;
}

.detect-metrics {
  display: none;
  gap: 12px;
  margin-bottom: 14px;
}

.detect-metrics.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-card.primary {
  grid-column: 1 / -1;
  min-height: 128px;
  border-color: rgba(63, 95, 200, 0.28);
  background: #f7f9ff;
}

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

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

.metric-card.primary strong {
  color: var(--green-dark);
  font-size: 52px;
}

.metric-card.danger strong {
  color: var(--coral);
}

.metric-card.warn strong {
  color: var(--gold);
}

.metric-card.low strong {
  color: var(--cyan);
}

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

#resultText.compact-hidden {
  display: none;
}

.result-progress {
  display: none;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #d5def5;
  border-radius: 8px;
  background: #f7f9ff;
}

.result-progress.active {
  display: block;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.progress-header span {
  color: #475569;
  font-size: 14px;
}

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

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5d7ce2, #3f5fc8);
  box-shadow: 0 0 16px rgba(63, 95, 200, 0.24);
  transition: width 0.28s ease;
}

.download-ready-panel {
  display: none;
  min-height: 368px;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(93, 124, 226, 0.12), transparent 30%),
    #ffffff;
  text-align: center;
}

.download-ready-panel.active {
  display: grid;
}

.ready-visual {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(135deg, #eef3ff, #ffffff);
  box-shadow:
    inset 0 0 0 1px #d5def5,
    0 18px 42px rgba(63, 95, 200, 0.12);
}

.ready-visual::before,
.ready-visual span {
  position: absolute;
  border-radius: 999px;
  content: "";
}

.ready-visual::before {
  inset: -12px;
  border: 1px solid rgba(63, 95, 200, 0.14);
}

.ready-visual span {
  right: 14px;
  top: 14px;
  width: 12px;
  height: 12px;
  background: #3f5fc8;
  box-shadow: -48px 42px 0 rgba(63, 95, 200, 0.18);
}

.ready-visual svg {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  color: var(--green);
  stroke-width: 1.9;
}

.download-ready-panel.is-complete .ready-visual {
  animation: ready-pop 0.36s ease both;
}

.download-ready-panel.is-error .ready-visual svg {
  color: var(--coral);
}

.download-ready-panel.is-error .ready-visual span {
  background: var(--coral);
  box-shadow: -48px 42px 0 rgba(220, 101, 98, 0.14);
}

.download-ready-panel > strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.download-ready-panel p {
  max-width: 360px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.65;
}

.result-panel.reduce-mode #copyResult,
.result-panel.format-mode #copyResult {
  display: none;
}

.result-panel.reduce-mode .result-actions,
.result-panel.format-mode .result-actions {
  justify-content: center;
}

.result-panel.reduce-mode #downloadBtn:not(:disabled),
.result-panel.format-mode #downloadBtn:not(:disabled) {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 12px 28px rgba(63, 95, 200, 0.18);
}

@keyframes ready-pop {
  0% {
    opacity: 0.4;
    transform: scale(0.92);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.download-format {
  width: 104px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

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

.daily-free-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid rgba(63, 95, 200, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(63, 95, 200, 0.09), transparent 54%),
    #ffffff;
  box-shadow: var(--shadow);
}

.daily-free-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.daily-free-card strong {
  display: block;
  margin-top: 4px;
  color: #1f3f99;
  font-size: 46px;
  line-height: 1;
}

.daily-free-card p {
  margin: 0;
  color: #4b5563;
  font-weight: 700;
  line-height: 1.6;
}

#myInviteCode {
  font-size: 34px;
  word-break: break-all;
}

#copyInviteCode {
  margin-top: 14px;
}

.redeem-card {
  align-items: center;
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
}

.redeem-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  background: #ffffff;
}

.redeem-row button {
  white-space: nowrap;
}

.price-card {
  display: grid;
  min-height: 258px;
  gap: 12px;
  align-content: start;
  padding: 20px;
}

.price-card.featured {
  border-color: rgba(63, 95, 200, 0.28);
  background:
    linear-gradient(140deg, rgba(63, 95, 200, 0.08), transparent 45%),
    #fff;
}

.price-card span {
  color: var(--muted);
  font-weight: 800;
}

.price-card strong {
  font-size: 30px;
}

.price-card p {
  min-height: 52px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}

.payment-actions .primary-button,
.payment-actions .secondary-button {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.payment-modal {
  width: min(430px, 100%);
  padding: 24px;
}

.payment-dialog {
  display: grid;
  gap: 16px;
  text-align: center;
}

.payment-dialog-head {
  display: grid;
  gap: 6px;
}

.payment-dialog-head h2,
.payment-dialog-head p {
  margin: 0;
}

.payment-dialog-head p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.payment-qr-shell {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 16px;
  border: 1px solid #d5def5;
  border-radius: 8px;
  background: #f8faff;
}

.payment-qr-shell strong {
  font-size: 34px;
  line-height: 1;
}

.payment-qr-shell img {
  width: min(280px, 72vw);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}

.payment-qr-shell span {
  color: #374151;
  font-weight: 800;
}

.payment-order-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: left;
}

.payment-order-box span {
  overflow-wrap: anywhere;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

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

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.history-item strong {
  overflow-wrap: anywhere;
}

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

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.prompt-field textarea {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.compliance-panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 25, 29, 0.58);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  position: relative;
  width: min(760px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.25);
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
}

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

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

.sms-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: stretch;
}

.sms-code-row .secondary-button {
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: 8px;
  color: #fff;
  background: #172126;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .side-panel {
    display: none;
  }

  .workspace-grid,
  .mode-grid,
  .prompt-layout,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .daily-free-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar,
  .main {
    padding: 18px;
  }

  .topbar,
  .cost-row,
  .page-heading,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list,
  .option-grid,
    .detect-metrics.active,
    .pricing-grid,
    .modal-grid,
    .auth-actions,
    .sms-code-row,
    .payment-actions {
    grid-template-columns: 1fr;
  }

  .metric-card.primary {
    grid-column: auto;
  }

  .metric-card.primary strong {
    font-size: 42px;
  }

  .nav-item {
    justify-content: center;
  }

  .account-chip,
  .download-format,
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .workspace-grid {
    gap: 14px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}
