:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f5f9;
  font-synthesis: none;
  --brand: #ff6b2c;
  --brand-deep: #e94e16;
  --brand-soft: #fff1e9;
  --ink: #172033;
  --muted: #7b8497;
  --line: #e7eaf0;
  --surface: #ffffff;
  --sidebar: #101827;
  --sidebar-soft: #182236;
  --green: #16a46f;
  --red: #e34850;
  --yellow: #e5a21a;
  --blue: #3a71e8;
  --shadow: 0 12px 34px rgba(22, 31, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink);
}

.boot-screen .brand-mark,
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  background: linear-gradient(145deg, #ff8b38, #ee4418);
  box-shadow: 0 9px 22px rgba(238, 68, 24, 0.28);
}

.boot-screen strong,
.boot-screen span {
  display: block;
}

.boot-screen strong {
  font-size: 18px;
}

.boot-screen span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(450px, 0.9fr);
  background: #fff;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 8vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 123, 53, 0.3), transparent 30%),
    radial-gradient(circle at 82% 75%, rgba(66, 103, 214, 0.24), transparent 32%),
    linear-gradient(145deg, #0c1320 0%, #17233b 58%, #111927 100%);
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.hero-brand,
.hero-copy,
.hero-points {
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

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

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

.hero-brand span {
  margin-top: 2px;
  color: #9eabc1;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.hero-copy {
  max-width: 650px;
}

.hero-kicker {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #ffc2a4;
  background: rgba(255, 107, 44, 0.09);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(42px, 4.6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy h1 span {
  color: #ff7d3d;
}

.hero-copy p {
  max-width: 580px;
  margin: 0;
  color: #aeb8ca;
  font-size: 17px;
  line-height: 1.8;
}

.hero-points {
  display: flex;
  gap: 28px;
}

.hero-point {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c5ccda;
  font-size: 13px;
}

.hero-point i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(255, 107, 44, 0.12);
}

.auth-panel {
  padding: 68px clamp(48px, 7vw, 110px);
  display: flex;
  align-items: center;
  background: #fff;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.auth-box h2 {
  margin: 0;
  font-size: 31px;
}

.auth-subtitle {
  margin: 10px 0 30px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 25px;
  border-radius: 12px;
  background: #f2f4f7;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: #6e7788;
  background: transparent;
}

.auth-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(26, 33, 50, 0.08);
  font-weight: 650;
}

.field {
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  padding: 12px 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #ff8c5b;
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.11);
}

.field-hint {
  margin-top: 7px;
  color: #98a0af;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #394154;
  background: #fff;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.btn-primary {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(135deg, #ff7b38, #f0541e);
  box-shadow: 0 8px 18px rgba(239, 79, 24, 0.19);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px rgba(239, 79, 24, 0.28);
}

.btn-outline {
  border-color: #dfe3eb;
}

.btn-danger {
  color: var(--red);
  border-color: #ffdadd;
  background: #fff7f7;
}

.btn-block {
  width: 100%;
  min-height: 46px;
}

.btn-small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.auth-footnote {
  margin-top: 22px;
  color: #98a0af;
  text-align: center;
  font-size: 12px;
}

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

.sidebar {
  position: fixed;
  z-index: 5;
  inset: 0 auto 0 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  color: #e7ebf3;
  background: var(--sidebar);
}

.sidebar-brand {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand .brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  font-size: 20px;
}

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

.sidebar-brand strong {
  font-size: 14px;
}

.sidebar-brand span {
  margin-top: 3px;
  color: #8390a7;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.nav-area {
  flex: 1;
  padding: 17px 12px;
  overflow-y: auto;
}

.nav-label {
  padding: 12px 11px 7px;
  color: #68768e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: #99a5b9;
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  transform: none;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 107, 44, 0.22), rgba(255, 107, 44, 0.08));
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #aeb8c9;
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
}

.nav-item.active .nav-icon {
  color: #fff;
  background: var(--brand);
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #5e6e8c, #35415a);
  font-weight: 800;
}

.user-chip strong,
.user-chip span {
  display: block;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  margin-top: 3px;
  color: #78869d;
  font-size: 10px;
}

.logout-btn {
  margin-left: auto;
  border: 0;
  color: #7f8ca1;
  background: transparent;
  font-size: 17px;
}

.main-column {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.page-title h1 {
  margin: 0;
  font-size: 20px;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-pill {
  padding: 8px 12px;
  border: 1px solid #cdeede;
  border-radius: 999px;
  color: #127c57;
  background: #effbf5;
  font-size: 12px;
  font-weight: 650;
}

.content {
  padding: 26px 30px 38px;
}

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

.stat-card,
.panel,
.module-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(31, 42, 66, 0.035);
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 20px;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -28px;
  top: -28px;
  border-radius: 50%;
  background: var(--stat-soft, #f3f6fb);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--stat-color, var(--blue));
  background: var(--stat-soft, #eef3ff);
}

.stat-value {
  margin-top: 17px;
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.stat-note {
  margin-top: 5px;
  color: #9aa2b2;
  font-size: 11px;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-width: 0;
}

.panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 18px;
}

.panel-body.flush {
  padding: 0;
}

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

.module-card {
  min-height: 150px;
  padding: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.module-card .module-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--module-color, var(--brand));
  background: var(--module-soft, var(--brand-soft));
  font-size: 18px;
}

.module-card h3 {
  margin: 15px 0 7px;
  font-size: 15px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.material-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
  color: #263247;
}

.material-section-title span {
  color: var(--muted);
  font-size: 11px;
}

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

.material-folder-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid #e7eaf0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(26, 39, 66, 0.04);
}

.material-folder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.material-folder-head h3 {
  margin: 0;
  font-size: 15px;
}

.material-folder-head p {
  max-width: 240px;
  margin: 5px 0 0;
  overflow: hidden;
  color: #9aa2b2;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-health {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #b77a13;
  background: #fff6de;
  font-size: 9px;
  font-weight: 700;
}

.material-health.enough {
  color: #0c885c;
  background: #eaf8f1;
}

.material-count {
  margin: 17px 0 10px;
  color: #5c6678;
  font-size: 11px;
}

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

.material-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 13;
  border-radius: 7px;
  background: linear-gradient(155deg, #eff3fa, #e1e7f1);
}

.material-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.material-preview.placeholder::after {
  content: "";
  position: absolute;
  inset: 16% 22%;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.48);
}

.material-folder-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.material-folder-actions .btn {
  flex: 1;
}

.workflow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 18px;
  border: 1px solid #e5e9f1;
  border-radius: 14px;
  background: #fff;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9aa2b2;
  font-size: 12px;
}

.workflow-step span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8b94a5;
  background: #edf0f5;
  font-size: 11px;
}

.workflow-step.done,
.workflow-step.active {
  color: #263247;
}

.workflow-step.done span {
  color: #fff;
  background: var(--green);
}

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

.workflow-arrow {
  color: #c5cbd5;
  font-size: 22px;
}

.theme-heading {
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 700;
}

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

.theme-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid #dce2ed;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.theme-card:hover {
  transform: none;
  border-color: #b8c8ed;
}

.theme-card.selected {
  border-color: #3d74ff;
  box-shadow: 0 0 0 2px rgba(61, 116, 255, 0.1);
}

.theme-visual {
  position: relative;
  width: 64px;
  height: 45px;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--theme-tone), #192233);
}

.theme-visual::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  top: 18px;
  left: 11px;
  background: #397dff;
}

.theme-visual i {
  position: absolute;
  width: 29px;
  height: 11px;
  right: 10px;
  bottom: 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.76);
}

.theme-copy strong,
.theme-copy small {
  display: block;
}

.theme-copy strong {
  font-size: 13px;
}

.theme-copy strong em {
  margin-left: 5px;
  color: #497efa;
  font-size: 9px;
  font-style: normal;
}

.theme-copy small {
  margin-top: 4px;
  color: #8a94a6;
  font-size: 10px;
  line-height: 1.5;
}

.theme-radio {
  width: 16px;
  height: 16px;
  border: 2px solid #c9d8ef;
  border-radius: 50%;
}

.theme-card.selected .theme-radio {
  border: 5px solid #3979ff;
}

.copy-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 14px 0 10px;
  border-top: 1px solid #edf0f5;
}

.copy-result-head strong,
.copy-result-head span {
  display: block;
}

.copy-result-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.copy-draft-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 480px;
  overflow: auto;
}

.copy-draft-card {
  padding: 13px;
  border: 1px solid #e6eaf1;
  border-radius: 11px;
  background: #fbfcfe;
}

.copy-draft-card.muted {
  opacity: 0.52;
}

.draft-length {
  margin-top: 5px;
  color: #15936b;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.draft-length.short,
.job-error-detail {
  color: #d34c3f;
}

.job-error-detail {
  max-width: 460px;
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #fff1ee;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}

.copy-check {
  display: block;
  margin-bottom: 8px;
  color: #697487;
  font-size: 10px;
}

.copy-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.copy-mode-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px 34px 13px 14px;
  border: 1px solid #dfe5ef;
  border-radius: 11px;
  color: #263249;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.copy-mode-card strong { font-size: 13px; }
.copy-mode-card span { color: var(--muted); font-size: 11px; }
.copy-mode-card i {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #bdd0ec;
  border-radius: 50%;
  transform: translateY(-50%);
}

.copy-mode-card.selected {
  border-color: #ff7139;
  background: #fff8f4;
  box-shadow: 0 0 0 2px rgba(255, 100, 43, 0.1);
}

.copy-mode-card.selected i {
  border: 4px solid #ff642b;
}

.draft-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 2px 6px;
  color: #263249;
  font-size: 12px;
  font-weight: 800;
}

.draft-field-label span {
  color: #8490a4;
  font-size: 10px;
  font-weight: 500;
}

.draft-field-label.script-label { margin-top: 12px; }

.draft-title,
.draft-script {
  width: 100%;
  border: 1px solid #dfe3eb;
  border-radius: 8px;
  padding: 9px;
  color: var(--ink);
  background: #fff;
}

.draft-title {
  font-weight: 700;
}

.draft-script {
  resize: vertical;
  line-height: 1.65;
}

.segmented-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.segmented-choice button {
  padding: 9px 8px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  color: #657085;
  background: #fff;
  cursor: pointer;
}

.segmented-choice button.selected {
  border-color: #ff7139;
  color: #d94d1d;
  background: #fff4ee;
  font-weight: 750;
}

.draft-topics {
  margin-top: 7px;
  color: #6681b8;
  font-size: 10px;
}

.copy-empty {
  margin-top: 18px;
  padding: 26px;
  border: 1px dashed #d7deea;
  border-radius: 12px;
  color: var(--muted);
  background: #fafbfd;
  text-align: center;
}

.copy-empty strong,
.copy-empty span {
  display: block;
}

.copy-empty strong {
  color: #354055;
}

.copy-empty span {
  margin-top: 6px;
  font-size: 11px;
}

.voice-engine-card,
.service-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ffe1cf;
  border-radius: 10px;
  background: #fff8f4;
}

.voice-engine-card.ready {
  border-color: #cdeede;
  background: #f2fbf7;
}

.voice-engine-card strong,
.voice-engine-card span {
  display: block;
}

.voice-engine-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.visual-style-editor {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(220px, 1.28fr);
  gap: 14px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #e3e8f1;
  border-radius: 12px;
  background: #f8fafd;
}

.style-preview-wrap {
  min-width: 0;
}

.style-preview {
  position: relative;
  width: 100%;
  max-height: 390px;
  overflow: hidden;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(12, 22, 41, 0.08), rgba(8, 15, 29, 0.5)),
    radial-gradient(circle at 67% 27%, #e8ae75 0 7%, transparent 8%),
    linear-gradient(145deg, #8fb3c9, #526c76 45%, #26333b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  user-select: none;
}

.style-preview::after {
  content: "画面预览";
  position: absolute;
  right: 8px;
  top: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.26);
  font-size: 8px;
}

.style-preview::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 5% 7%;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 7px;
  pointer-events: none;
}

.style-preview-text {
  position: absolute;
  z-index: 2;
  width: max-content;
  max-width: 86%;
  padding: 3px 5px;
  color: #fff;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
  cursor: move;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.style-preview-text.subtitle {
  padding: 4px 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: -2px -2px 0 rgba(0, 0, 0, 0.92), 2px -2px 0 rgba(0, 0, 0, 0.92), -2px 2px 0 rgba(0, 0, 0, 0.92), 2px 2px 0 rgba(0, 0, 0, 0.92), 0 3px 7px rgba(0, 0, 0, 0.7);
}

.style-preview-text.effect-outline {
  text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
}

.style-preview-text.effect-shadow {
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.82);
}

.style-preview-text.effect-box {
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.52);
}

.style-preview-text.template-cream-pop {
  padding: 4px 9px;
  font-weight: 950;
  letter-spacing: 1px;
  text-shadow: -2px -2px 0 #ff4f85, 2px -2px 0 #ff4f85, -2px 2px 0 #ff4f85, 2px 2px 0 #ff4f85, 0 5px 0 #6737bb, 0 8px 14px rgba(15, 16, 40, 0.55);
}

.style-preview-text.template-variety-impact {
  padding: 5px 10px;
  font-weight: 950;
  font-style: italic;
  letter-spacing: 1.4px;
  transform: translate(-50%, -50%) rotate(-2deg);
  text-shadow: -2px -2px 0 #12151c, 2px -2px 0 #12151c, -2px 2px 0 #12151c, 2px 2px 0 #12151c, 5px 5px 0 #ff6a2c;
}

.style-preview-text.template-china-red {
  padding: 5px 10px;
  font-weight: 950;
  letter-spacing: 2px;
  text-shadow: -2px -2px 0 #8c1717, 2px -2px 0 #8c1717, -2px 2px 0 #8c1717, 2px 2px 0 #8c1717, 0 5px 0 #3c0d0d;
}

.style-preview-text.template-fresh-store {
  padding: 6px 12px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(0, 145, 132, 0.78);
  box-shadow: 0 6px 16px rgba(0, 72, 68, 0.28);
  text-shadow: none;
}

.style-preview-text.template-minimal-brand {
  padding: 6px 13px;
  border-radius: 3px;
  background: rgba(9, 14, 24, 0.68);
  letter-spacing: 2px;
  text-shadow: none;
}

.style-preview-text.subtitle.template-douyin-clean {
  text-shadow: -2px -2px 0 #111, 2px -2px 0 #111, -2px 2px 0 #111, 2px 2px 0 #111, 0 4px 8px rgba(0, 0, 0, 0.7);
}

.style-preview-text.subtitle.template-highlight-yellow {
  text-shadow: -2px -2px 0 #2a1c00, 2px -2px 0 #2a1c00, -2px 2px 0 #2a1c00, 2px 2px 0 #2a1c00, 0 4px 0 #ff7a00;
}

.style-preview-text.subtitle.template-white-plate {
  padding: 5px 11px;
  border-radius: 5px;
  background: rgba(8, 13, 22, 0.68);
  text-shadow: none;
}

.style-preview-text.subtitle.template-fresh-green {
  text-shadow: -2px -2px 0 #067466, 2px -2px 0 #067466, -2px 2px 0 #067466, 2px 2px 0 #067466, 0 4px 9px rgba(0, 45, 38, 0.65);
}

.style-preview-text.subtitle.template-pink-pop {
  text-shadow: -2px -2px 0 #eb3c8f, 2px -2px 0 #eb3c8f, -2px 2px 0 #eb3c8f, 2px 2px 0 #eb3c8f, 0 4px 0 #6b2459;
}

.style-preview-controls {
  min-width: 0;
}

.service-status-row {
  justify-content: flex-start;
  border-color: #e5eaf2;
  background: #fafbfd;
}

.service-status-row > div {
  flex: 1;
}

.service-status-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.service-status-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #3869cf;
  background: #eaf1ff;
  font-weight: 800;
}

.service-status-icon.voice {
  color: #0f8a5e;
  background: #eaf8f1;
}

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

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8b43, #ef4f1c);
}

.license-card {
  padding: 4px 0;
}

.license-card strong {
  display: block;
  margin: 12px 0 7px;
  font-size: 26px;
}

.license-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar input,
.toolbar select {
  min-height: 38px;
  border: 1px solid #dfe3eb;
  border-radius: 9px;
  padding: 8px 11px;
  outline: none;
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid .field {
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #7a8394;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 650;
}

tbody tr:hover {
  background: #fffaf7;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}

.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.tag-green {
  color: #0b8a5d;
  background: #eaf8f1;
}

.tag-red {
  color: #d83b43;
  background: #fff0f1;
}

.tag-yellow {
  color: #ad7600;
  background: #fff7df;
}

.tag-gray {
  color: #758096;
  background: #f0f2f5;
}

.actions {
  display: flex;
  gap: 6px;
}

.code-text {
  color: #21314d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.empty-state {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.placeholder-workspace {
  min-height: 470px;
  display: grid;
  place-items: center;
  border: 1px dashed #d9dee7;
  border-radius: 14px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 107, 44, 0.08), transparent 32%),
    #fff;
  text-align: center;
}

.placeholder-workspace .big-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 20px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 28px;
}

.placeholder-workspace h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
}

.placeholder-workspace p {
  max-width: 470px;
  margin: 0 auto 18px;
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 16, 28, 0.54);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(520px, 100%);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(8, 14, 27, 0.28);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 20px;
}

.output-confirm-backdrop {
  z-index: 220;
  overflow: auto;
}

.output-confirm-modal {
  width: min(980px, 96vw);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.output-confirm-modal .modal-head > div {
  display: grid;
  gap: 4px;
}

.output-confirm-modal .modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-x {
  border: 0;
  color: #7b8493;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.output-confirm-body {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(380px, 1.28fr);
  gap: 22px;
  padding: 20px;
  background: #f6f8fb;
}

.output-confirm-preview-column {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
}

.output-style-preview {
  width: min(100%, 300px);
  min-height: 390px;
}

.output-preview-tip {
  max-width: 320px;
  color: #7e899c;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.output-confirm-controls {
  padding: 18px;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  background: #fff;
}

.confirm-section-title {
  margin: 2px 0 10px;
  color: #172238;
  font-size: 13px;
  font-weight: 800;
}

.confirm-section-title:not(:first-child) {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid #edf0f5;
}

.confirm-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.output-summary {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  color: #5c687c;
  background: #f4f6fa;
  font-size: 11px;
  line-height: 1.65;
}

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

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.temporary-password {
  padding: 15px;
  border: 1px dashed #ffb28f;
  border-radius: 10px;
  color: #b53e12;
  background: #fff7f2;
  font-family: Consolas, monospace;
  font-size: 18px;
  font-weight: 750;
  text-align: center;
  user-select: all;
}

#toast-root {
  position: fixed;
  z-index: 100;
  right: 24px;
  top: 24px;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 420px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  color: #263047;
  background: #fff;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}

.toast.error {
  border-left-color: var(--red);
}

.generation-progress-overlay {
  position: fixed;
  z-index: 250;
  right: 22px;
  bottom: 22px;
  width: min(430px, calc(100vw - 30px));
  pointer-events: none;
}

.generation-progress-card {
  width: 100%;
  padding: 19px;
  border: 1px solid #ffd7c5;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(12, 24, 42, 0.24);
  pointer-events: auto;
}

.generation-progress-spinner {
  float: left;
  width: 30px;
  height: 30px;
  margin: 0 12px 8px 0;
  border: 4px solid #ffe2d3;
  border-top-color: #ff642b;
  border-radius: 50%;
  animation: generation-spin 0.8s linear infinite;
}

.generation-progress-spinner.finished {
  border-color: #21a475;
  animation: none;
}

.generation-progress-overlay.failed .generation-progress-spinner.finished {
  border-color: #e25248;
}

.generation-progress-copy {
  display: grid;
  gap: 7px;
}

.generation-progress-copy strong {
  color: #162238;
  font-size: 16px;
}

.generation-progress-copy span {
  min-height: 34px;
  color: #727d90;
  font-size: 12px;
  line-height: 1.55;
}

.generation-progress-bar {
  clear: both;
  height: 12px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f2f6;
}

.generation-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8d47, #f14e20);
  transition: width 0.25s ease;
}

.generation-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: #788396;
  font-size: 12px;
  font-weight: 700;
}

.generation-progress-close {
  width: 100%;
  margin-top: 20px;
}

.generation-progress-close[hidden] {
  display: none !important;
}

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

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

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

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

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

  .visual-style-editor {
    grid-template-columns: minmax(160px, 0.55fr) minmax(260px, 1.45fr);
  }
}

@media (max-width: 760px) {
  .copy-mode-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .output-confirm-body {
    grid-template-columns: 1fr;
  }

  .output-style-preview {
    min-height: 360px;
  }
}
