:root {
  --ink: #24302f;
  --muted: #65716e;
  --line: #ddd8cc;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --mint: #116a5c;
  --mint-dark: #0b4e45;
  --coral: #b9483f;
  --coral-dark: #933227;
  --gold: #c9822f;
  --blue: #4e5f9e;
  --soft: #f4efe4;
  --page-bg: #f2eadf;
  --page-gradient: linear-gradient(180deg, #fbfaf6 0%, #f2eadf 72%, #f2eadf 100%);
  --title-band: #f1eadc;
  --control-bg: #f0eee7;
  --input-disabled-bg: #f7f4ec;
  --notice-bg: #fff2e1;
  --notice-border: #e7c399;
  --active-soft: #e8f3ef;
  --active-border: #a7cec1;
  --shadow: 0 18px 50px rgba(49, 43, 32, 0.10);
}

body[data-theme="lake"] {
  --ink: #1f302e;
  --muted: #65736f;
  --line: #d3ddd9;
  --paper: #f5faf8;
  --mint: #0f6f61;
  --mint-dark: #075146;
  --coral: #d06b3b;
  --coral-dark: #a84722;
  --gold: #b88736;
  --blue: #3f6b78;
  --soft: #eef6f2;
  --page-bg: #eaf2ee;
  --page-gradient: linear-gradient(180deg, #fbfdfb 0%, #eaf2ee 72%, #eaf2ee 100%);
  --title-band: #e7f0eb;
  --control-bg: #e9f0ec;
  --input-disabled-bg: #eef4f1;
  --notice-bg: #fff2e8;
  --notice-border: #e8c0a8;
  --active-soft: #e1f1eb;
  --active-border: #9bcbbd;
  --shadow: 0 18px 48px rgba(27, 61, 55, 0.09);
}

body[data-theme="berry"] {
  --ink: #302725;
  --muted: #746864;
  --line: #e2d6d2;
  --paper: #fffaf8;
  --mint: #9f3f4a;
  --mint-dark: #7f2d39;
  --coral: #c75b31;
  --coral-dark: #9c3f20;
  --gold: #bf7e37;
  --blue: #6a5a88;
  --soft: #f8ece9;
  --page-bg: #f5ebe7;
  --page-gradient: linear-gradient(180deg, #fffdfb 0%, #f5ebe7 72%, #f5ebe7 100%);
  --title-band: #f5e7e2;
  --control-bg: #f1e8e4;
  --input-disabled-bg: #f7efec;
  --notice-bg: #fff1df;
  --notice-border: #edc39e;
  --active-soft: #fae8e8;
  --active-border: #dfb1b4;
  --shadow: 0 18px 48px rgba(86, 47, 41, 0.10);
}

body[data-theme="ink"] {
  --ink: #25282b;
  --muted: #6d7378;
  --line: #d9dde0;
  --paper: #f7f8f8;
  --mint: #374151;
  --mint-dark: #1f2937;
  --coral: #aa4a42;
  --coral-dark: #87362f;
  --gold: #9a7a42;
  --blue: #4b5563;
  --soft: #eef0f1;
  --page-bg: #eceff1;
  --page-gradient: linear-gradient(180deg, #fbfbfa 0%, #eceff1 72%, #eceff1 100%);
  --title-band: #eceff1;
  --control-bg: #edf0f1;
  --input-disabled-bg: #f1f2f2;
  --notice-bg: #f5f1ea;
  --notice-border: #ddd2bd;
  --active-soft: #eef0f2;
  --active-border: #c9ced3;
  --shadow: 0 18px 48px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: var(--page-gradient);
}

.redeem-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.stage-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(245, 230, 222, 0.92));
}

.stage-card {
  width: min(760px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.stage-card h1 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 38px);
}

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

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

.stage-grid button {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid #eaded2;
  border-radius: 16px;
  background: #fffdfa;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.stage-grid button:hover {
  transform: translateY(-2px);
  border-color: var(--active-border);
  box-shadow: 0 14px 34px rgba(49, 43, 32, 0.12);
}

.stage-grid strong {
  font-size: 20px;
}

.stage-grid span,
.trial-badge {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stage-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.startup-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.startup-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.startup-card .button-spinner {
  border-color: rgba(23, 105, 93, 0.22);
  border-top-color: var(--mint);
}

.redeem-card {
  width: min(560px, 100%);
  padding: clamp(26px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.redeem-brand {
  color: var(--mint-dark);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.redeem-brand span,
.topbar h1 small {
  margin-left: 6px;
  color: var(--coral);
  font-size: 12px;
}

.redeem-card h1 {
  margin: 18px 0 8px;
  font-size: clamp(28px, 6vw, 40px);
}

.redeem-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.redeem-form {
  margin-top: 26px;
}

.redeem-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.redeem-input-row input {
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.redeem-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--coral-dark);
  font-size: 13px;
}

.redeem-message.is-success {
  color: var(--mint-dark);
}

.test-codes {
  margin-top: 24px;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}

.test-codes summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.test-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.test-code-grid button {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}

.test-code-grid button:hover {
  border-color: var(--active-border);
  background: var(--active-soft);
}

.test-code-grid code {
  color: var(--muted);
  font-size: 11px;
}

.redeem-card .prototype-note {
  margin-top: 18px;
  font-size: 12px;
}

.redeem-contact {
  width: 100%;
  margin-top: 14px;
  justify-content: center;
}

.access-status {
  display: grid;
  gap: 2px;
  padding: 7px 12px;
  border: 1px solid var(--active-border);
  border-radius: 9px;
  background: var(--active-soft);
}

.access-status strong {
  color: var(--mint-dark);
  font-size: 13px;
}

.access-status span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 640px) {
  .redeem-input-row {
    grid-template-columns: 1fr;
  }

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

  .access-status {
    width: 100%;
  }
}

.topbar {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 56px) 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  font-size: clamp(26px, 3vw, 40px);
}

h2 {
  font-size: 18px;
}

.privacy-note,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mint-dark);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 48px) 42px;
}

.site-footer {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 48px) 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.footer-actions,
.footer-access {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}

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

.footer-access span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.footer-contact {
  min-height: 36px;
  padding: 0 14px;
}

.footer-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}

.theme-dot {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px var(--line);
}

.theme-dot.is-active {
  box-shadow: 0 0 0 2px var(--mint-dark);
}

.theme-dot-warm {
  background: linear-gradient(135deg, #116a5c 0 50%, #b9483f 50% 100%);
}

.theme-dot-lake {
  background: linear-gradient(135deg, #0f6f61 0 50%, #d06b3b 50% 100%);
}

.theme-dot-berry {
  background: linear-gradient(135deg, #9f3f4a 0 50%, #c75b31 50% 100%);
}

.theme-dot-ink {
  background: linear-gradient(135deg, #374151 0 50%, #aa4a42 50% 100%);
}

.mode-band {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mode-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.product-button {
  flex: 0 0 auto;
  color: #fff;
  background: var(--coral);
}

.official-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px 0 12px;
  border: 1px solid rgba(196, 146, 56, 0.56);
  border-radius: 999px;
  color: #6f4514;
  background: linear-gradient(180deg, #fff9ea 0%, #fff1ce 100%);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(122, 75, 18, 0.12);
}

.official-button:hover {
  transform: translateY(-1px);
  border-color: rgba(196, 146, 56, 0.82);
  background: #fff4d8;
  box-shadow: 0 12px 24px rgba(122, 75, 18, 0.18);
}

.official-vip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff8e8;
  background: #7a4b12;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

.trial-title-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--coral);
  background: rgba(185, 72, 63, 0.09);
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.header-link {
  color: var(--muted);
  background: transparent;
}

.header-link:hover {
  color: var(--mint-dark);
}

.name-mode {
  margin-bottom: 0;
}

.name-mode p {
  margin: 0;
  color: rgba(36, 48, 47, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.segmented.compact.mode-tabs {
  width: 100%;
  margin-top: 0;
  padding: 0 0 0 2px;
  gap: 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e5ded0;
  border-radius: 0;
}

.segmented.mode-tabs button {
  position: relative;
  min-height: 42px;
  justify-content: center;
  color: #68756f;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: none;
}

.segmented.mode-tabs button:hover {
  color: var(--mint-dark);
  background: rgba(255, 255, 255, 0.48);
}

.segmented.mode-tabs button.active {
  color: var(--mint-dark);
  background: #fffdfa;
  border-color: #e5ded0;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.9) inset;
}

.segmented.mode-tabs button.active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--mint);
}

.product-button:hover {
  background: var(--coral-dark);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  width: min(520px, 100%);
  margin-top: 12px;
  background: var(--control-bg);
  border: 1px solid #d8d0c1;
  border-radius: 8px;
}

.segmented button {
  color: #344054;
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
}

.segmented button.active {
  color: #fff;
  background: var(--mint);
  border-color: var(--mint-dark);
}

.workflow {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.progress-rail {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 18px 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -18px 4px;
  padding: 12px 18px;
  background: var(--title-band);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.progress-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.demo-link {
  min-height: 30px;
  padding: 0 8px;
  color: var(--coral);
}

.progress-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(50, 41, 34, 0.48);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.progress-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #8f7b68;
  background: #f4e5d5;
}

.progress-step.active {
  color: var(--mint-dark);
}

.progress-step.active span {
  color: #fff;
  background: var(--mint);
}

.progress-step.active::after {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 2px;
  color: #fff;
  background: #d58a34;
  font-size: 12px;
  font-weight: 900;
}

.progress-line {
  height: 2px;
  background: #ead8c4;
}

.step-panel,
.preview-band {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.step-panel {
  padding: 0 18px 18px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -18px 14px;
  padding: 12px 18px;
  background: var(--title-band);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.step-title span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 12px;
  text-align: center;
  border: 1.5px dashed #9bb7ab;
  border-radius: 8px;
  background: #f8fbf7;
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-zone svg {
  color: var(--mint);
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
}

.upload-zone.has-file {
  border-style: solid;
  background: #fffdfa;
  min-height: 74px;
  padding: 10px;
}

.upload-zone.has-file > svg,
.upload-zone.has-file .upload-prompt {
  display: none;
}

.upload-file-status {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-file-status strong {
  color: var(--ink);
  font-weight: 500;
}

.upload-clear {
  min-height: 26px;
  margin-top: 7px;
  padding: 0 8px;
  color: #77716a;
  background: transparent;
  border: 1px solid #e1d8cb;
  font-size: 12px;
  font-weight: 400;
}

.upload-clear:hover {
  color: #b42318;
  background: #fff7f6;
  border-color: #efc7c4;
}

.upload-zone small {
  color: var(--muted);
  line-height: 1.6;
}

.inline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#generateAll,
#exportWord,
#copyAll,
.add-card-action {
  min-height: 46px;
}

#exportWord.is-loading {
  cursor: wait;
  opacity: 0.9;
}

.button-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.18);
}

button svg {
  width: 18px;
  height: 18px;
}

.primary {
  background: var(--mint);
  color: #fff;
}

.primary:hover {
  background: var(--mint-dark);
}

.secondary {
  color: #fff;
  background: var(--coral);
}

.secondary:hover {
  background: var(--coral-dark);
}

.utility {
  color: #fff;
  background: #4e5f9e;
}

.utility:hover {
  background: #39477b;
}

.secondary.soft {
  color: var(--blue);
  background: #fff2e8;
  border: 1px solid #ecc4a8;
}

.ghost {
  color: var(--ink);
  background: #fff8ed;
  border: 1px solid #e3c79d;
}

.ghost-lite {
  color: #69736f;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.link-button {
  min-height: 32px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.link-button:hover {
  color: var(--mint-dark);
}

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

.mini-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid #e5ded0;
  background: transparent;
}

.mini-tabs button {
  min-height: 36px;
  color: #69736f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
}

.mini-tabs button.active {
  color: var(--mint-dark);
  background: transparent;
  border-bottom-color: var(--mint);
  box-shadow: none;
}

.full {
  width: 100%;
  margin-top: 12px;
}

.no-top {
  margin-top: 0;
}

.import-subpanel {
  padding: 14px;
  border: 1px solid #d8d0c1;
  border-radius: 0 0 8px 8px;
  background: var(--soft);
  height: 322px;
  overflow: visible;
}

.import-step {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e5ded0;
}

.import-step.upload-step {
  grid-template-columns: 1fr;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.import-step-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.import-step-copy strong {
  color: var(--coral);
}

.import-step-copy span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--mint);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.import-step .primary {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #8fc0b1;
}

.import-step .primary:hover {
  background: #e8f3ef;
}

.upload-toolbar {
  justify-content: flex-end;
  margin: 0 0 10px;
}

.safe-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.safe-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--mint);
  margin-top: 1px;
}

.textarea-label,
label {
  color: #8f9693;
  font-size: 13px;
  font-weight: 400;
}

.required {
  color: #c43d2b;
}

.hidden {
  display: none !important;
}

.generic-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8d0c1;
  border-radius: 0 0 8px 8px;
  background: var(--soft);
  height: 322px;
  align-content: start;
}

.generic-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.step-panel.is-disabled {
  opacity: 1;
}

.step-panel.is-disabled h2,
.step-panel.is-disabled .export-box,
.step-panel.is-disabled .export-box strong {
  color: rgba(36, 48, 47, 0.42);
}

.step-panel.is-disabled .export-box {
  background: #f4f2ed;
  border-color: #ddd8cc;
}

.step-panel.is-disabled .step-title span {
  background: #98a2b3;
}

.step-panel.is-disabled .form-grid,
.step-panel.is-disabled #generateAll {
  pointer-events: none;
  opacity: 0.48;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
}

input:disabled,
textarea:disabled,
select:disabled {
  color: #98a2a0;
  background: #f2f1ed;
  border-color: #dedbd3;
  -webkit-text-fill-color: #98a2a0;
}

select option:disabled {
  color: #aaa49a;
  cursor: not-allowed;
}

.static-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-disabled-bg);
  color: rgba(36, 48, 47, 0.78);
  font-size: 14px;
  padding: 9px 10px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

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

.template-picker {
  position: relative;
  margin-bottom: 14px;
}

.field-title {
  margin-bottom: 8px;
  color: #8f9693;
  font-size: 13px;
  font-weight: 400;
}

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

.export-template-picker.is-collapsed .template-grid {
  overflow: visible;
}

.export-template-picker.is-collapsed .template-card:nth-of-type(n+13) {
  display: none;
}

.export-template-picker:not(.is-collapsed) .template-grid {
  position: static;
  overflow: visible;
}

.export-template-picker:not(.is-collapsed) .template-more {
  margin-top: 10px;
}

.template-more {
  width: 100%;
  margin-top: 10px;
  color: var(--mint-dark);
  background: var(--active-soft);
  border: 1px solid var(--active-border);
}

.template-card {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid #e6dfd3;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.template-card img,
.template-placeholder {
  width: 100%;
  aspect-ratio: 10 / 6.2;
  border-radius: 6px;
  border: 1px solid #eadfce;
  object-fit: cover;
  background: #f3efe6;
}

.template-zoom {
  position: absolute;
  right: calc(100% + 14px);
  top: 0;
  z-index: 120;
  width: min(380px, 44vw);
  padding: 8px;
  border: 1px solid #d8d0c1;
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 18px 60px rgba(49, 43, 32, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.template-zoom img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.template-card:hover .template-zoom {
  opacity: 1;
  transform: translateY(0);
}

.template-placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #9a8f82;
  font-size: 12px;
  text-align: center;
}

.template-card span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.template-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.template-card.is-selected {
  border-color: var(--coral);
  background: #fffdfa;
  box-shadow: 0 0 0 2px rgba(185, 72, 63, 0.14);
}

.template-card.is-selected::after {
  content: "已选";
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.student-type-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--mint) 9%, transparent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.switch-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  padding: 28px 0 0;
}

.switch-row input {
  width: 18px;
  height: 18px;
}

.export-box {
  min-height: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #faf8f2;
  border: 1px solid #e1d9c7;
  color: #3f4652;
  line-height: 1.5;
  font-size: 13px;
}

.export-box strong {
  color: var(--coral);
  font-size: 20px;
}

.preview-band {
  margin-top: 18px;
  overflow: hidden;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--title-band);
}

.preview-head h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.preview-head h2 small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.preview-head h2 small strong {
  color: var(--coral);
  font-size: 14px;
}

.preview-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.preview-head p strong {
  color: var(--coral);
  font-size: 18px;
}

#listStatsText .type-stat {
  margin-left: 10px;
}

#listStatsText .type-stat strong {
  font-size: 15px;
}

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

.custom-optimize-toggle {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.custom-optimize-toggle.active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.custom-optimize-toggle:not([disabled]):hover {
  color: #fff;
  background: var(--coral-dark);
  border-color: var(--coral-dark);
}

.custom-optimize-toggle[disabled] {
  color: #fff;
  background: #d8aaa2;
  border-color: #d8aaa2;
  opacity: 0.7;
  cursor: not-allowed;
}

.danger {
  color: rgba(180, 35, 24, 0.52);
}

.latest-import {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.latest-import strong {
  color: var(--coral);
}

.danger-icon {
  color: #9ca3a0;
  background: transparent;
  border-color: #e4e0d8;
  margin-top: 8px;
}

.danger-icon:hover,
.danger.ghost-lite:hover {
  color: #b42318;
  background: #fff7f6;
  border-color: #efc7c4;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 24, 31, 0.36);
}

.modal-box {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 24, 31, 0.22);
}

.modal-box h2 {
  margin-bottom: 10px;
}

.modal-box p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
}

.usage-guide-box {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 14px;
}

.usage-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.usage-guide-box h2 {
  margin: 0 36px 16px 0;
  color: var(--ink);
  font-size: 22px;
}

.usage-guide-section-title {
  margin: 18px 0 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.usage-step-list {
  display: grid;
  gap: 16px;
}

.usage-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 42%);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa;
}

.usage-step-copy h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
}

.usage-step-copy p,
.usage-ai-note p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
}

.usage-step img {
  width: 100%;
  border: 1px solid #eaded2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(49, 43, 32, 0.08);
}

.usage-ai-note {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(23, 105, 93, 0.16);
  border-radius: 14px;
  background: rgba(23, 105, 93, 0.06);
}

.usage-ai-note h3 {
  margin: 0 0 8px;
  color: var(--mint-dark);
  font-size: 17px;
}

.usage-guide-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-image {
  display: block;
  width: min(320px, 100%);
  max-height: 420px;
  object-fit: contain;
  margin: 16px auto 0;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.upgrade-box {
  position: relative;
  width: min(520px, 100%);
}

.upgrade-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.upgrade-code-input {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}

.upgrade-code-input.is-error,
#redeemCode.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(190, 61, 61, 0.12);
}

.upgrade-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.trial-limit-hint {
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

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

.manual-copy-text {
  min-height: 220px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.toast-message {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 1300;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  color: #fff;
  background: rgba(36, 48, 47, 0.92);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(20, 24, 31, 0.22);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, 0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast-message.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
}

.export-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 24, 31, 0.56);
  backdrop-filter: blur(3px);
}

.export-progress-box {
  width: min(420px, 100%);
  padding: 30px 26px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 24, 31, 0.28);
  text-align: center;
}

.export-progress-box h2 {
  margin: 14px 0 8px;
}

.export-progress-box p {
  min-height: 24px;
  margin: 0;
  color: #475467;
}

.export-progress-box small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.export-spinner {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 4px solid #e3eee9;
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: button-spin 0.8s linear infinite;
}

.export-progress-track {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeec;
}

.export-progress-track span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), #62b7a8);
  transition: width 0.2s ease;
}

.export-progress-track span.is-indeterminate {
  width: 35%;
  animation: export-progress-slide 1.2s ease-in-out infinite;
}

@keyframes export-progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(300%);
  }
}

body.is-exporting {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

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

.preview-band.is-custom-optimizing table {
  min-width: 1180px;
}

.preview-band:not(.is-custom-optimizing) th:nth-child(3),
.preview-band:not(.is-custom-optimizing) th:nth-child(4),
.preview-band:not(.is-custom-optimizing) th:nth-child(5),
.preview-band:not(.is-custom-optimizing) th:nth-child(6),
.preview-band:not(.is-custom-optimizing) td.custom-column {
  display: none;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #475467;
  font-size: 13px;
  background: #fbfcfb;
}

.operation-column,
.operation-cell {
  position: sticky;
  right: 0;
  z-index: 8;
  min-width: 126px;
  width: 126px;
  background: #fffdfa;
  box-shadow: -8px 0 14px rgba(49, 43, 32, 0.06);
}

.operation-column {
  z-index: 12;
  background: #fbfcfb;
}

.sortable-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-icon {
  width: 24px;
  min-height: 24px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.sort-icon.active,
.sort-icon:hover {
  color: var(--mint-dark);
  background: #e8f3ef;
  border-color: #b9d9cf;
}

.sort-icon svg {
  width: 14px;
  height: 14px;
}

.name-cell {
  width: 86px;
}

.name-cell input {
  width: 72px;
  min-width: 72px;
}

.student-type-column {
  width: 132px;
  min-width: 132px;
}

.index-cell {
  width: 58px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.trait-single {
  position: relative;
  width: 184px;
  min-width: 184px;
}

.trait-single.is-picker-open {
  z-index: 35;
}

tr:has(.trait-single.is-picker-open) {
  position: relative;
  z-index: 30;
}

.trait-single input,
.name-cell input {
  margin-bottom: 8px;
}

.student-comment {
  min-width: 360px;
}

.preview-band:not(.is-custom-optimizing) .student-comment {
  min-width: 460px;
}

.quick-tags {
  position: absolute;
  left: -12px;
  right: auto;
  top: 54px;
  z-index: 40;
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  width: 330px;
  max-height: 250px;
  overflow: auto;
  padding: 12px 12px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(36, 48, 47, 0.16);
}

.trait-single.is-picker-open .quick-tags {
  display: flex;
}

.tag-picker-tip {
  width: 100%;
  margin-bottom: 2px;
  padding-right: 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.quick-tags .tag-picker-close {
  position: absolute;
  top: 7px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  color: var(--muted);
  background: #fff;
  border: 1px solid #eadfd5;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.quick-tags .tag-picker-close:hover {
  color: var(--danger);
  border-color: #efc7c7;
  background: #fff7f7;
}

.tag-input {
  cursor: pointer;
  background: #fffdfa;
}

.quick-tags button {
  min-height: 26px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 1px solid #e5dccf;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
}

.quick-tags button.is-active {
  color: var(--mint-dark);
  background: var(--active-soft);
  border-color: var(--active-border);
  font-weight: 700;
}

.quick-tags button:disabled:not(.is-active) {
  opacity: 0.38;
  cursor: not-allowed;
}

tr.is-removing {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 44px;
  min-height: 44px;
  padding: 0;
  color: #fff;
  background: var(--mint-dark);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(36, 48, 47, 0.22);
}

.icon-btn {
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: #f1f6f4;
  color: var(--mint-dark);
  border: 1px solid #c9ddd5;
}

.text-icon-btn {
  min-height: 34px;
  padding: 0 10px;
  color: var(--mint-dark);
  background: #f1f6f4;
  border: 1px solid #c9ddd5;
  font-size: 12px;
  white-space: nowrap;
}

.text-icon-btn svg {
  width: 15px;
  height: 15px;
}

.ai-optimize {
  display: none;
  margin-top: 8px;
  color: #fff;
  background: var(--coral);
  border-color: transparent;
  min-height: 38px;
}

.ai-optimize:hover {
  background: var(--coral-dark);
}

.preview-band.is-custom-optimizing .ai-optimize {
  display: inline-flex;
}

.text-icon-btn.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.empty-row td {
  height: 140px;
  text-align: center;
  color: var(--muted);
  vertical-align: middle;
}

@media (max-width: 1080px) {
  .workflow {
    grid-template-columns: 1fr;
  }

  .progress-rail {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .progress-line {
    display: none;
  }

  .export-box {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .progress-rail {
    display: none;
  }

  .topbar,
  .preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .upload-toolbar,
  .preview-actions,
  .inline-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .stage-card {
    padding: 22px;
  }

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

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

  .export-template-picker.is-collapsed .template-grid {
    overflow: visible;
  }

  .export-template-picker.is-collapsed .template-card:nth-of-type(n+7) {
    display: none;
  }

  .export-template-picker:not(.is-collapsed) .template-card:nth-of-type(n+7) {
    display: grid;
  }

  .template-zoom {
    right: auto;
    left: 0;
    top: calc(100% + 8px);
    width: min(320px, 80vw);
  }

  .usage-guide-box {
    width: calc(100vw - 24px);
    padding: 18px;
  }

  .usage-step {
    grid-template-columns: 1fr;
  }

  .usage-step img {
    max-height: 220px;
    object-fit: contain;
  }

  .upload-toolbar,
  .preview-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Temporarily hidden; markup and JS stay in place for later reuse. */
.progress-rail {
  display: none;
}
