/* ============================================================
   AI广告渲染智能体 · 深色专业工具界面
   配色：底 #0f0f1a / 卡片 #1a1a2e / 输入框 #2a2a3e
        边框 #4a4a6a / 金色 #e6b422 / 主按钮渐变 #667eea→#764ba2
   ============================================================ */

/* ---------- 1. 基础重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --input: #2a2a3e;
  --border: #4a4a6a;
  --gold: #e6b422;
  --primary-1: #667eea;
  --primary-2: #764ba2;
  --text: #e8e8f0;
  --text-sub: #9a9ab0;
  --text-dim: #6a6a80;
  --danger: #ff4d4f;
  --success: #27ae60;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- 2. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
  border: 1px solid rgba(230, 180, 34, 0.35);
  border-radius: 10px;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-sub);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quota-pill {
  font-size: 12px;
  color: var(--text-sub);
  background: rgba(230, 180, 34, 0.08);
  border: 1px solid rgba(230, 180, 34, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.quota-pill b {
  color: var(--gold);
  font-size: 14px;
}

.btn-login {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s ease;
}

.btn-login:hover {
  border-color: var(--primary-1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.login-icon {
  font-size: 14px;
}

.btn-install {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  background: linear-gradient(135deg, #f5d98b, #e0b450);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-install:hover {
  box-shadow: 0 0 0 3px rgba(224, 180, 80, 0.25);
  transform: translateY(-1px);
}

/* ---------- 3. 工作区双栏布局 ---------- */
.workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.panel-left {
  width: 40%;
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-right {
  width: 60%;
  flex: 0 0 calc(60% - 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 86px;
}

/* ---------- 4. 通用卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-inline {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.step-num {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  border-radius: 50%;
  flex-shrink: 0;
}

.optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

/* ---------- 5. 上传区 ---------- */
.upload-zone {
  position: relative;
  height: 190px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(42, 42, 62, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary-1);
  background: rgba(102, 126, 234, 0.08);
}

.upload-placeholder {
  text-align: center;
  padding: 16px;
  pointer-events: none;
}

.upload-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: var(--gold);
  border: 1.5px solid rgba(230, 180, 34, 0.4);
  border-radius: 50%;
  margin-bottom: 8px;
}

.upload-title {
  font-size: 14px;
  font-weight: 600;
}

.upload-tip {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-sub);
}

.upload-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background:
    repeating-conic-gradient(#222236 0% 25%, #1a1a2e 0% 50%) 0 0 / 18px 18px;
}

.upload-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 26, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-sub);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(230, 180, 34, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.upload-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.upload-status.success { color: var(--success); }
.upload-status.error { color: var(--danger); }

/* ---------- 6. 模板网格 ---------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tpl-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: rgba(42, 42, 62, 0.4);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tpl-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-1);
}

.tpl-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.18);
}

.tpl-card.active::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #1a1a2e;
  background: var(--gold);
  border-radius: 50%;
  font-weight: 700;
}

.tpl-thumb {
  width: 100%;
  height: 64px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tpl-name {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

.tpl-card.active .tpl-name {
  color: var(--gold);
}

/* ---------- 7. 表单元素 ---------- */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-half {
  flex: 1;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%),
    linear-gradient(135deg, var(--text-sub) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.char-count {
  margin-top: 4px;
  text-align: right;
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- 8. 颜色预设 ---------- */
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-dot:hover {
  transform: scale(1.12);
}

.color-dot.active {
  box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.35);
  border-color: var(--gold);
}

.color-custom {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}

.color-custom span {
  font-size: 13px;
  pointer-events: none;
}

.color-custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-custom.active {
  border-color: var(--gold);
}

/* ---------- 9. 画幅选择条 ---------- */
.ratio-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ratio-label {
  font-size: 13px;
  color: var(--text-sub);
}

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

.ratio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--text-sub);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.18s ease;
}

.ratio-btn:hover {
  border-color: var(--primary-1);
  color: var(--text);
}

.ratio-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  border-color: transparent;
}

.ratio-icon {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.r11 { width: 12px; height: 12px; }
.r916 { width: 8px; height: 13px; }
.r169 { width: 14px; height: 8px; }
.r34 { width: 10px; height: 13px; }

/* ---------- 10. 预览画布 ---------- */
.canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0;
}

.canvas-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 62vh;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #0a0a2e, #1a0a3e);
}

.canvas-stage.ratio-11 { aspect-ratio: 1 / 1; max-width: 440px; }
.canvas-stage.ratio-916 { aspect-ratio: 9 / 16; }
.canvas-stage.ratio-169 { aspect-ratio: 16 / 9; max-width: 640px; width: 100%; }
.canvas-stage.ratio-34 { aspect-ratio: 3 / 4; max-width: 420px; }

.stage-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a2e, #1a0a3e);
}

.stage-product {
  position: absolute;
	left: 50%;
	top: 50%;
  transform: translate(-50%, -42%);
  max-width: 78%;
  max-height: 66%;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
}

.stage-text {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 10%;
  text-align: center;
  pointer-events: none;
}

.stage-text.pos-top { top: 7%; }
.stage-text.pos-middle { top: 50%; transform: translateY(-50%); }
.stage-text.pos-bottom { bottom: 7%; }

.stage-main {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.stage-sub {
  font-size: 13px;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.stage-logo {
  position: absolute;
  z-index: 4;
  width: 15%;
  object-fit: contain;
}

.stage-logo.lp-top-left { top: 4%; left: 4%; }
.stage-logo.lp-top-right { top: 4%; right: 4%; }
.stage-logo.lp-bottom-left { bottom: 4%; left: 4%; }
.stage-logo.lp-bottom-right { bottom: 4%; right: 4%; }
.stage-logo.lp-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.85;
}

.stage-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  padding: 20px;
  z-index: 1;
}

/* 成品结果 */
.result-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.result-stage img {
  width: auto;
  max-width: 100%;
  max-height: 62vh;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.result-tip {
  font-size: 12.5px;
  color: var(--gold);
}

/* ---------- 11. Logo 卡片 ---------- */
.logo-card {
  padding: 14px 18px;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mini-upload {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.mini-upload:hover {
  border-color: var(--primary-1);
}

.mini-upload img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mini-upload-text {
  font-size: 12px;
  color: var(--text-sub);
}

.logo-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo-pos-group {
  display: flex;
  gap: 8px;
}

/* ---- 通用胶囊按钮组（产品摆放 / 画面风格） ---- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text-sub);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--text);
}

.chip.active {
  color: #1a1a2e;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}

.logo-pos {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--input);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.15s ease;
}

.logo-pos::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--text-dim);
}

.logo-pos[data-pos="top-left"]::after { top: 4px; left: 4px; }
.logo-pos[data-pos="top-right"]::after { top: 4px; right: 4px; }
.logo-pos[data-pos="bottom-left"]::after { bottom: 4px; left: 4px; }
.logo-pos[data-pos="bottom-right"]::after { bottom: 4px; right: 4px; }
.logo-pos[data-pos="center"]::after {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.logo-pos.active {
  border-color: var(--gold);
  background: rgba(230, 180, 34, 0.12);
}

.logo-pos.active::after {
  background: var(--gold);
}

.logo-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-size-row label {
  font-size: 12.5px;
  color: var(--text-sub);
}

.size-val {
  font-size: 12px;
  color: var(--gold);
  min-width: 38px;
  text-align: right;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--input);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  border: 2px solid #fff;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-1);
  border: 2px solid #fff;
  cursor: pointer;
}

/* ---------- 12. 操作按钮 ---------- */
.action-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-generate {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.btn-generate:active {
  transform: translateY(0);
}

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

.btn-spark {
  color: var(--gold);
}

.download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-download {
  flex: 1;
  min-width: 150px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}

.btn-download:hover:not(:disabled) {
  border-color: var(--success);
  color: var(--success);
}

.btn-hd:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-back {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--text-sub);
}

/* ---------- 13. 弹窗通用 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 12, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  width: 100%;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-sub);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: var(--input);
  color: var(--text);
}

/* ---------- 14. 生成进度弹窗 ---------- */
.modal-progress {
  max-width: 420px;
}

.progress-steps {
  list-style: none;
  margin: 20px 0 18px;
}

.p-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(74, 74, 106, 0.4);
}

.p-step:last-child {
  border-bottom: none;
}

.p-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 14px;
  border-radius: 50%;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
}

.p-label {
  flex: 1;
  font-size: 14px;
}

.p-state {
  font-size: 12px;
  color: var(--text-dim);
}

.p-step.active .p-icon {
  color: var(--gold);
  border-color: var(--gold);
}

.p-step.active .p-state {
  color: var(--gold);
}

.p-step.done .p-icon {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.p-step.done .p-state {
  color: var(--success);
}

.p-step.active .p-icon .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.progress-bar {
  height: 6px;
  background: var(--input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-1), var(--gold));
  transition: width 0.4s ease;
}

.progress-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-sub);
}

/* ---------- 15. 支付弹窗 ---------- */
.modal-pay {
  max-width: 640px;
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 22px;
}

.plan-card {
  position: relative;
  padding: 14px 10px;
  text-align: center;
  background: var(--input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.plan-card:hover {
  border-color: var(--primary-1);
  transform: translateY(-2px);
}

.plan-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.18);
}

.plan-hot {
  border-color: rgba(230, 180, 34, 0.55);
}

.hot-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #1a1a2e;
  background: var(--gold);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 700;
}

.plan-name {
  font-size: 13.5px;
  font-weight: 600;
}

.plan-price {
  margin: 8px 0 6px;
  color: var(--gold);
}

.plan-price b {
  font-size: 24px;
}

.plan-price span {
  font-size: 11px;
  color: var(--text-sub);
}

.plan-desc {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

.pay-qr-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.qr-box {
  width: 168px;
  height: 168px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-placeholder {
  color: #8a8a9a;
  font-size: 12.5px;
  text-align: center;
  line-height: 1.8;
  padding: 10px;
}

.qr-tip {
  font-size: 12.5px;
  color: var(--text-sub);
  max-width: 200px;
}

.qr-tip.paid {
  color: var(--success);
  font-weight: 600;
}

/* ---------- 16. 登录弹窗 ---------- */
.modal-login {
  max-width: 380px;
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-row input {
  flex: 1;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.code-row input:focus {
  border-color: var(--primary-1);
}

.btn-sms {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 12.5px;
  color: var(--gold);
  background: rgba(230, 180, 34, 0.1);
  border: 1px solid rgba(230, 180, 34, 0.4);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.btn-sms:disabled {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--input);
  cursor: not-allowed;
}

.btn-confirm-login {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
}

.btn-confirm-login:hover {
  opacity: 0.9;
}

/* ---------- 17. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  min-width: 200px;
  max-width: 80vw;
  padding: 12px 22px;
  font-size: 13.5px;
  text-align: center;
  color: #fff;
  background: rgba(26, 26, 46, 0.96);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--primary-1); }

/* ---------- 18. 响应式：<768px 上下布局 ---------- */
@media (max-width: 768px) {
  .header-inner {
    padding: 10px 16px;
  }

  .brand-text p {
    display: none;
  }

  .quota-pill {
    display: none;
  }

  .workspace {
    flex-direction: column;
    padding: 16px 14px 40px;
    gap: 16px;
  }

  .panel-left,
  .panel-right {
    width: 100%;
    flex: none;
    position: static;
  }

  .panel-right {
    order: -1;
  }

  .canvas-stage {
    max-height: 70vh;
  }

  .canvas-stage.ratio-169 {
    max-width: 100%;
  }

  .plan-list {
    grid-template-columns: 1fr;
  }

  .pay-qr-area {
    flex-direction: column;
    text-align: center;
  }

  .download-row {
    flex-direction: column;
  }

  .btn-download {
    width: 100%;
  }

  .modal {
    padding: 22px 18px;
  }
}

@media (max-width: 420px) {
  .brand-text h1 {
    font-size: 15px;
  }

  .template-grid {
    gap: 8px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
