/* ==========================================================
   智卷助手 · 移动端设计系统
   ========================================================== */
:root {
  --bg: #f3f7fd;
  --surface: #ffffff;
  --surface-2: #f5f8ff;
  --ink: #0f1c33;
  --sub: #55647d;
  --muted: #8c9ab2;
  --line: #e7eef9;
  --brand: #1d6bf3;
  --brand-deep: #0b4ed6;
  --brand-2: #38bdf8;
  --brand-soft: #e9f2ff;
  --ok: #10b981;
  --ok-soft: #e8f9f2;
  --warn: #f59e0b;
  --warn-soft: #fff6e5;
  --danger: #ef4444;
  --danger-soft: #feefee;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 8px 24px rgba(20, 62, 135, .06);
  --shadow-lg: 0 22px 60px rgba(12, 44, 100, .16);
  --grad: linear-gradient(135deg, #1d6bf3 0%, #38bdf8 100%);
  --grad-deep: linear-gradient(135deg, #0b3fa8 0%, #1d6bf3 52%, #35b4ff 100%);
  --grad-warm: linear-gradient(135deg, #fb923c 0%, #f43f5e 100%);
  --nav-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: #eaf1fb; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 12% -10%, #dbeafe 0%, #edf4ff 38%, #f7faff 72%, #f2f7fd 100%);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: 15px; }
::selection { background: rgba(29, 107, 243, .16); }

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(22, 30, 60, .03), 0 30px 80px rgba(22, 30, 60, .08);
}
@media (min-width: 560px) {
  html, body { background: radial-gradient(1200px 600px at 20% 0%, #dbeafe 0%, #edf4ff 45%, #f2f9ff 100%); }
  .app { margin: 24px auto; min-height: calc(100dvh - 48px); border-radius: 34px; }
  .tabbar { border-radius: 0 0 34px 34px; }
}
@media (min-width: 560px) and (display-mode: browser) {
  .app { overflow: hidden; }
}

/* ---------- 通用布局 ---------- */
.page { padding: 0 16px 110px; }
.page.tight { padding-bottom: calc(30px + var(--nav-h) + env(safe-area-inset-bottom)); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.sub { color: var(--sub); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; }
.mt18 { margin-top: 18px; } .mt24 { margin-top: 24px; }
.mb10 { margin-bottom: 10px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hide { display: none !important; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(247, 250, 255, .84);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}
.topbar.on-white { background: rgba(255, 255, 255, .84); }
.topbar .title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .subtitle { font-size: 11.5px; color: var(--muted); }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; border: none;
  background: rgba(255,255,255,.82); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(20, 62, 135, .05);
}
.iconbtn:active { transform: scale(.95); }
.iconbtn.plain { background: transparent; box-shadow: none; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: 0 0 auto;
  box-shadow: 0 6px 14px rgba(29,107,243,.26);
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 22px; }

/* ---------- 会员卡 ---------- */
.hero { padding: 4px 16px 0; }
.hello { padding: 6px 2px 16px; }
.hello h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.4px; }
.hello p { margin: 0; color: var(--sub); font-size: 13px; }
.hello .row { align-items: flex-start; }

.member-card {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 20px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255,255,255,.20), transparent 36%),
    linear-gradient(135deg, #0b3fa8 0%, #1d6bf3 52%, #35b4ff 100%);
  color: #fff;
  box-shadow: 0 18px 38px rgba(13, 74, 191, .30);
}
.member-card::before, .member-card::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.12); pointer-events: none;
}
.member-card::before { width: 190px; height: 190px; right: -60px; top: -90px; }
.member-card::after { width: 130px; height: 130px; right: 40px; bottom: -90px; background: rgba(255,255,255,.07); }
.member-card .mc-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.member-card .brandline { display: flex; align-items: center; gap: 7px; font-size: 12.5px; opacity: .9; letter-spacing: .5px; }
.member-card .pill {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; backdrop-filter: blur(8px);
}
.member-card h2 { font-size: 24px; margin: 14px 0 2px; letter-spacing: -.3px; position: relative; z-index: 1; }
.member-card .expire { font-size: 12px; opacity: .78; position: relative; z-index: 1; }
.member-card .mc-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 16px; position: relative; z-index: 1; }
.member-card .days { font-size: 12px; opacity: .9; flex: 1; margin-right: 18px; }
.member-card .days strong { font-size: 22px; font-weight: 700; margin-right: 3px; }
.member-card .link { font-size: 11.5px; background: rgba(255,255,255,.18); border-radius: 999px; padding: 6px 11px; }
.progress { height: 5px; background: rgba(255,255,255,.22); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: #fff; border-radius: 999px; }

/* ---------- 统计 / 快捷 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 0; }
.stat {
  background: #fff; border: 1px solid #e7eef9; border-radius: 16px; padding: 11px 6px;
  text-align: center; box-shadow: 0 4px 14px rgba(20, 62, 135, .04);
}
.stat b { display: block; font-size: 17px; letter-spacing: -.3px; color: #15315f; }
.stat span { font-size: 10.5px; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.section-head h3 { margin: 0; font-size: 17px; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; }
.section-head h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 3px;
  background: var(--grad); display: inline-block; flex: 0 0 auto;
}
.section-head .more { font-size: 12px; color: var(--brand); display: inline-flex; align-items: center; gap: 2px; }
.section-head .desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- 模式卡片 ---------- */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-form { display: block; margin: 0; }
.mode-form.wide-form { grid-column: span 2; }
.mode-form .mode-card { width: 100%; text-align: left; font-family: inherit; color: inherit; font-size: inherit; }
.mode-grid > .mode-form.wide-form .mode-card { display: flex; align-items: center; gap: 13px; }
.mode-grid > .mode-form.wide-form .mode-card .ic { margin: 0; }
.mode-grid > .mode-form.wide-form .mode-card p { min-height: 0; }
.mode-card {
  position: relative; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 18px; padding: 14px;
  box-shadow: 0 5px 16px rgba(20, 62, 135, .05); border: 1px solid #e8effa;
  display: block; transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.mode-card h4, .mode-card p { position: relative; z-index: 1; }
.mode-card:active { transform: scale(.975); box-shadow: 0 3px 10px rgba(20, 62, 135, .06); }
.mode-card .ic {
  width: 43px; height: 43px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 11px; position: relative; z-index: 1;
}
.mode-card h4 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.mode-card p { margin: 3px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; min-height: 30px; }
.mode-card .arrow { position: absolute; right: 12px; bottom: 12px; color: #bccce4; }
.mode-card.wide { grid-column: span 2; display: flex; align-items: center; gap: 13px; }
.mode-card.wide .ic { margin: 0; }
.mode-card.wide p { min-height: 0; }
.mode-card.wide .arrow { position: static; margin-left: auto; }

.t-indigo { background: #e9f2ff; color: #1d6bf3; }
.t-violet { background: #e8f4ff; color: #0877c9; }
.t-rose { background: #e9f8ff; color: #0e7490; }
.t-cyan { background: #e6f8ff; color: #0891b2; }
.t-amber { background: #eef4ff; color: #2563eb; }
.t-green { background: #e8f7f8; color: #0f766e; }
.t-blue { background: #e8f1ff; color: #1e40af; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 48px; padding: 0 20px; border-radius: 15px; border: none;
  font-size: 15px; font-weight: 600; letter-spacing: .2px;
  background: var(--surface); color: var(--ink); transition: transform .15s ease, opacity .15s;
}
.btn:active { transform: scale(.975); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(29,107,243,.26); }
.btn.dark { background: #102a52; color: #fff; }
.btn.ghost { background: #f4f8ff; color: var(--sub); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.line { background: transparent; border: 1px solid var(--line); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn.xs { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 10px; box-shadow: none; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid #e8effa;
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tight { padding: 14px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .hint { font-size: 11.5px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field > label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #243a5e; }
.field .req { color: var(--danger); margin-left: 3px; }
.field .tip { font-weight: 400; color: var(--muted); font-size: 11px; }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid transparent; background: #f4f8ff;
  border-radius: 14px; padding: 13px 14px; color: var(--ink); outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
  -webkit-appearance: none; appearance: none; font-size: 16px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(29,107,243,.55); background: #fff; box-shadow: 0 0 0 4px rgba(29,107,243,.09);
}
.textarea { min-height: 116px; resize: vertical; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: #a7b4ca; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a1b3' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 46px; }
.pwd-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }

/* 分段控件 */
.segmented { display: flex; background: var(--surface-2); border-radius: 13px; padding: 4px; gap: 3px; }
.segmented label { flex: 1; position: relative; text-align: center; font-size: 12.5px; padding: 9px 6px; border-radius: 10px; color: var(--sub); font-weight: 500; transition: all .18s; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: #fff; }
.segmented label:has(input:checked) { background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(29,107,243,.25); font-weight: 600; }

/* 胶囊选择 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 999px; background: var(--surface-2);
  border: 1.5px solid transparent; font-size: 12.5px; color: var(--sub); cursor: pointer;
  transition: all .18s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--brand-soft); border-color: rgba(91,91,214,.5); color: var(--brand); font-weight: 600; }
.chip.solid:has(input:checked) { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(29,107,243,.22); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }
.chip.on { background: var(--brand-soft); border-color: rgba(91,91,214,.5); color: var(--brand); font-weight: 600; }

/* 卡片选择（模板/比例） */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice {
  position: relative; border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 12px 9px; cursor: pointer; transition: all .18s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .name { font-size: 13.5px; font-weight: 700; }
.choice .desc { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.choice .ratio-icon { width: 30px; height: 38px; border: 1.6px solid #c3c9d8; border-radius: 4px; margin-bottom: 8px; }
.choice[data-ratio="9:16"] .ratio-icon { width: 22px; height: 39px; }
.choice[data-ratio="1:1"] .ratio-icon { width: 32px; height: 32px; }
.choice[data-ratio="4:3"] .ratio-icon { width: 40px; height: 30px; }
.choice[data-ratio="16:9"] .ratio-icon { width: 44px; height: 25px; }
.choice[data-ratio="a4"] .ratio-icon { width: 28px; height: 40px; }
.choice[data-ratio="a4l"] .ratio-icon { width: 40px; height: 28px; }
.choice[data-ratio="a3"] .ratio-icon { width: 30px; height: 42px; }
.choice[data-ratio="a3l"] .ratio-icon { width: 42px; height: 30px; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 6px 16px rgba(29,107,243,.1); }
.choice:has(input:checked) .ratio-icon { border-color: var(--brand); }

/* 模板横向选择 */
.tpl-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.tpl-scroll::-webkit-scrollbar { display: none; }
.tpl-card {
  flex: 0 0 84px; scroll-snap-align: start; cursor: pointer; position: relative;
}
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-thumb {
  height: 108px; border-radius: 12px; padding: 9px; border: 2px solid transparent;
  background: #fff; box-shadow: 0 4px 12px rgba(24,32,72,.06); overflow: hidden; position: relative;
}
.tpl-thumb .band { height: 5px; border-radius: 3px; width: 60%; margin-bottom: 6px; }
.tpl-thumb .ln { height: 3px; border-radius: 2px; margin-bottom: 4px; opacity: .55; }
.tpl-thumb .ln.w80 { width: 80%; } .tpl-thumb .ln.w60 { width: 60%; } .tpl-thumb .ln.w90 { width: 90%; }
.tpl-thumb .box { height: 22px; border-radius: 4px; margin: 5px 0; opacity: .5; }
.tpl-thumb.tpl-none { display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg,#f8fbff,#eef6ff); border: 1.5px dashed #cfe0f7; }
.tpl-thumb.tpl-none span { font-size: 11px; color: #8ba1bd; text-align: center; line-height: 1.55; }
.tpl-card:has(input:checked) .tpl-thumb.tpl-none { border: 2px solid var(--brand); background: var(--brand-soft); }
.tpl-card:has(input:checked) .tpl-thumb.tpl-none span { color: var(--brand); font-weight: 600; }
.tpl-card .tname { font-size: 11px; text-align: center; margin-top: 6px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-card:has(input:checked) .tpl-thumb { border-color: var(--brand); box-shadow: 0 8px 18px rgba(29,107,243,.18); }
.tpl-card:has(input:checked) .tname { color: var(--brand); font-weight: 600; }
.tpl-scene {
  position: absolute; left: 5px; bottom: 5px; z-index: 3; max-width: calc(100% - 10px);
  background: rgba(29,107,243,.92); color: #fff; font-size: 9px; line-height: 1.4;
  padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.tpl-block .tpl-scene { left: 6px; bottom: 6px; font-size: 9.5px; background: rgba(29,107,243,.9); }
.tpl-subject {
  position: absolute; left: 5px; top: 5px; z-index: 3;
  background: rgba(15,28,51,.72); color: #fff; font-size: 9px; line-height: 1.4;
  padding: 2px 5px; border-radius: 5px; pointer-events: none;
}

/* 上传区 */
.dropzone {
  border: 1.6px dashed #c6dbf7; border-radius: 16px; background: rgba(245,250,255,.8);
  padding: 22px 16px; text-align: center; cursor: pointer; transition: all .18s; position: relative;
}
.dropzone:active { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .up-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.dropzone .t1 { font-size: 13.5px; font-weight: 600; }
.dropzone .t2 { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ref-dropzone { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ref-template-preview { display: none; width: 100%; flex-direction: column; align-items: center; gap: 7px; }
.ref-template-preview.show { display: flex; }
.ref-template-preview img { max-width: 100%; max-height: 170px; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: 0 3px 10px rgba(24,32,72,.08); }
.ref-template-name { font-size: 11px; color: #5b7aa0; }
.ref-template-preview.show + #ref-upload-placeholder { display: none; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.file-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.file-item .fi-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
.file-item .fi-ic img { width: 100%; height: 100%; object-fit: cover; }
.file-item .fi-name { font-size: 12.5px; font-weight: 600; }
.file-item .fi-meta { font-size: 10.5px; color: var(--muted); }
.file-item .del { color: var(--muted); background: none; border: 0; padding: 4px; }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--warn-soft); color: #9a5b06; border-radius: 13px;
  padding: 11px 13px; font-size: 12px; line-height: 1.55;
}
.notice.info { background: var(--brand-soft); color: #174ea6; }
.notice.ok { background: var(--ok-soft); color: #087443; }
.notice.danger { background: var(--danger-soft); color: #b42318; }
.notice .ico { flex: 0 0 auto; margin-top: 1px; }

/* ---------- 步骤条 ---------- */
.wizard-steps {
  display: flex; align-items: center; padding: 4px 2px 14px; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }
.wstep { display: flex; align-items: center; flex: 0 0 auto; }
.wstep .num {
  width: 25px; height: 25px; border-radius: 50%; background: #e3e6ef; color: #8d95a8;
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
  flex: 0 0 auto; transition: all .2s;
}
.wstep .lbl { font-size: 11px; color: var(--muted); margin-left: 5px; white-space: nowrap; }
.wstep .line { width: 14px; height: 1.5px; background: #e0e3ec; margin: 0 7px; border-radius: 2px; }
.wstep.done .num { background: var(--ok-soft); color: var(--ok); }
.wstep.active .num { background: var(--grad); color: #fff; box-shadow: 0 5px 12px rgba(29,107,243,.3); }
.wstep.active .lbl { color: var(--brand); font-weight: 600; }
.wstep.done .lbl { color: var(--sub); }

/* ---------- 任务内容 ---------- */
.chapter-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px; font-size: 10.5px; color: var(--sub);
}
.page-card { background: var(--surface); border-radius: 16px; border: 1px solid var(--line); padding: 14px; margin-bottom: 10px; }
.page-card .pc-head { display: flex; align-items: flex-start; gap: 10px; }
.page-card .idx { width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.page-card h4 { margin: 2px 0 0; font-size: 14px; flex: 1; }
.page-card .preview { font-size: 12px; color: var(--sub); line-height: 1.7; margin-top: 9px; white-space: pre-wrap; max-height: 76px; overflow: hidden; position: relative; }
.page-card .preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(transparent, #fff); }
.page-card .pc-actions { display: flex; gap: 8px; margin-top: 10px; }
.page-card .pc-actions .btn { flex: 1; }

.prompt-preview { background: var(--surface-2); border-radius: 13px; padding: 12px; font-size: 12px; color: var(--sub); line-height: 1.65; max-height: 120px; overflow: auto; white-space: pre-wrap; }

/* ---------- 生图结果 ---------- */
.progress-panel {
  background: linear-gradient(135deg, #e9f2ff, #f2f9ff);
  border: 1px solid #dceaff; border-radius: 18px; padding: 16px;
}
.progress-panel .pp-top { display: flex; align-items: center; gap: 10px; }
.progress-panel .pp-top .ic { width: 36px; height: 36px; border-radius: 11px; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(29,107,243,.14); }
.progress-panel .bar { height: 7px; background: rgba(255,255,255,.9); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-panel .bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s ease; }
.progress-panel .warn { font-size: 11px; color: #3b6fb8; margin-top: 9px; }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.img-grid.single { grid-template-columns: minmax(0, 66%); justify-content: center; }
.img-cell { position: relative; border-radius: 14px; overflow: hidden; background: #e9ecf5; aspect-ratio: 3 / 4; cursor: pointer; }
.img-cell.ratio-916 { aspect-ratio: 9 / 16; } .img-cell.ratio-11 { aspect-ratio: 1 / 1; }
.img-cell.ratio-43 { aspect-ratio: 4 / 3; } .img-cell.ratio-169 { aspect-ratio: 16 / 9; }
.img-cell.ratio-a4 { aspect-ratio: 1 / 1.414; }
.img-cell.ratio-a4l { aspect-ratio: 1.414 / 1; }
.img-cell.ratio-a3 { aspect-ratio: 1 / 1.414; }
.img-cell.ratio-a3l { aspect-ratio: 1.414 / 1; }
.img-cell img { width: 100%; height: 100%; object-fit: contain; background: #fff; transition: transform .3s; }
.img-cell:active img { transform: scale(1.02); }
.img-cell .ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #a2aabd; font-size: 11px; background: linear-gradient(110deg, #eef0f7 30%, #f7f8fc 50%, #eef0f7 70%); background-size: 200% 100%; animation: shine 1.4s infinite linear; }
@keyframes shine { to { background-position: -200% 0; } }
.img-cell .idx-tag { position: absolute; left: 8px; top: 8px; background: rgba(17,24,39,.55); color: #fff; font-size: 10px; padding: 3px 7px; border-radius: 7px; backdrop-filter: blur(6px); }
.img-cell .badge-done { position: absolute; right: 8px; bottom: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(18,183,106,.92); color: #fff; display: flex; align-items: center; justify-content: center; }

.result-toolbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.result-toolbar::-webkit-scrollbar { display: none; }
.result-toolbar .btn { flex: 0 0 auto; }

/* ---------- 记录 ---------- */
.record { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.record .thumb { width: 68px; height: 88px; border-radius: 10px; background: #f2f7ff; overflow: hidden; flex: 0 0 auto; position: relative; }
.record .thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.record .thumb .empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9cc3f5; }
.record .info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.record h4 { margin: 0 0 4px; font-size: 14px; line-height: 1.35; }
.record .meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.record .mini-tag { background: var(--surface-2); border-radius: 5px; padding: 2px 5px; color: var(--sub); }
.record .cnt { font-size: 11px; color: var(--sub); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--sub); }
.badge.ok { background: var(--ok-soft); color: #087443; }
.badge.run { background: var(--brand-soft); color: var(--brand); }
.badge.warn { background: var(--warn-soft); color: #9a5b06; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row a { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--sub); font-size: 12px; border: 1px solid var(--line); }
.filter-row a.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(29,107,243,.22); }
.filter-clear {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  background: #fff; color: var(--sub); font-size: 12px;
  border: 1px solid var(--line); font-family: inherit; line-height: 1.55;
  cursor: pointer; appearance: none; -webkit-appearance: none;
}
.filter-clear:active { background: var(--surface-2); }

/* ---------- 个人中心 ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 6px 2px 20px; }
.profile-head h2 { margin: 0; font-size: 20px; }
.profile-head .phone { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.member-tag { display: inline-flex; align-items: center; gap: 4px; background: #e9f2ff; color: #0b4ed6; border: 1px solid #d7e8ff; border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 600; }

.menu-group { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid #e8effa; box-shadow: var(--shadow); margin-bottom: 14px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--surface-2); }
.menu-item .mi-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.menu-item .mi-label { flex: 1; font-size: 14px; font-weight: 500; }
.menu-item .mi-desc { font-size: 10.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }
.menu-item .mi-right { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.menu-group .group-title { font-size: 11px; color: var(--muted); padding: 12px 16px 4px; }

.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.me-stats div { text-align: center; border-right: 1px solid var(--line); }
.me-stats div:last-child { border: 0; }
.me-stats b { display: block; font-size: 18px; }
.me-stats span { font-size: 10.5px; color: var(--muted); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  display: flex; align-items: center; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid #e8effa;
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9aa9bf; font-size: 10px; flex: 1; padding: 6px 0 4px; transition: color .2s; }
.tabbar a .ico { transition: transform .2s; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a.on .ico { transform: translateY(-1px); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }

/* ---------- 任务页底栏 ---------- */
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 55;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.92) 26%, #fff 55%);
  display: flex; gap: 10px;
}
.actionbar .btn { flex: 1; }
.actionbar .btn.ghost { flex: 0 0 auto; padding: 0 16px; }
.job-page { padding-bottom: 100px; }
.job-head { padding: 2px 0 6px; }
.job-head h1 { font-size: 21px; margin: 0; letter-spacing: -.4px; }
.job-head .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.job-head .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #cfd4e0; }

/* ---------- 底部弹层 ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(9, 24, 45, .44); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(2px); }
.backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 102%);
  width: 100%; max-width: 480px; max-height: 88dvh; z-index: 90;
  background: #fff; border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  transition: transform .32s cubic-bezier(.32,.72,0,1); overflow-y: auto;
  box-shadow: 0 -20px 60px rgba(20,26,41,.18);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 38px; height: 4px; border-radius: 999px; background: #e2e5ee; margin: 6px auto 12px; }
.sheet h3 { margin: 4px 0 14px; font-size: 17px; }
.sheet .sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .sheet-actions .btn { flex: 1; }

/* 图片查看器 */
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(10,12,20,.94); display: none; flex-direction: column; }
.viewer.show { display: flex; }
.viewer .vtop { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #fff; }
.viewer .vbody { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px 8px; overflow: hidden; }
.viewer .vbody img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.viewer .vbar { display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.viewer .vbar .btn { flex: 1; height: 42px; font-size: 13px; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(10px); }
.viewer .vbar.many { flex-wrap: wrap; }
.viewer .vbar.many .btn { flex: 1 1 calc(50% - 4px); font-size: 12px; }
.viewer .vbar .btn.primary { background: var(--grad); }

/* ---------- 提示词库 / 课本 / 模板 ---------- */
.cat-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a { flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; font-size: 12px; color: var(--sub); background: #fff; border: 1px solid var(--line); }
.cat-tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 5px 12px rgba(29,107,243,.22); }
.prompt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 14px; margin-bottom: 10px; }
.prompt-card .pc-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.prompt-card .pc-body { font-size: 12px; color: var(--sub); line-height: 1.65; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-card .pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.prompt-card .pc-foot .btns { display: flex; gap: 6px; }
.src-tag { font-size: 9.5px; padding: 2px 6px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); }
.src-tag.mine { background: var(--ok-soft); color: #087443; }

.book-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.book-card .bk-top { display: flex; gap: 11px; align-items: flex-start; }
.book-cover { width: 44px; height: 58px; border-radius: 7px; background: linear-gradient(150deg, #1d6bf3, #38bdf8); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(29,107,243,.25); }
.book-card h4 { margin: 0; font-size: 14px; line-height: 1.4; }
.book-card .bk-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.book-units { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 9px; font-size: 13px; font-weight: 700; color: var(--ink); }
.book-cover.has-img { padding: 0; overflow: hidden; background: #fff; box-shadow: 0 4px 10px rgba(23,58,115,.12); }
.book-cover.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-units .lesson .muted { flex: 0 0 auto; }
.sys-book-list { display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow-y: auto; padding: 2px; }
.sys-book { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.sys-book:has(input:checked) { border-color: var(--brand); box-shadow: 0 4px 12px rgba(29,107,243,.12); }
.sys-book input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); flex: 0 0 auto; }
.sys-book.disabled { opacity: .6; cursor: default; }
.sys-book .book-cover { width: 38px; height: 50px; font-size: 14px; }
.sys-book .badge { flex: 0 0 auto; }
.unit { padding: 7px 0; }
.unit .unit-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.unit .lesson { font-size: 11px; color: var(--sub); padding: 3px 0 0 14px; display: flex; justify-content: space-between; gap: 8px; }
.unit .lesson .del { color: #c3c9d7; font-size: 10px; }
.add-inline { display: flex; gap: 6px; margin-top: 6px; }
.add-inline .input { height: 36px; padding: 8px 10px; font-size: 12px; border-radius: 9px; }
.add-inline .btn { flex: 0 0 auto; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tpl-block { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 9px; min-width: 0; }
.tpl-block .cover { height: 128px; border-radius: 10px; background: #f2f7ff; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.tpl-block .cover[data-view-tpl] { cursor: zoom-in; }
.tpl-block .cover .zoom-tag {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  background: rgba(15, 28, 51, .55); color: #fff; font-size: 9px;
  padding: 3px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 3px;
  pointer-events: none; backdrop-filter: blur(4px);
}
.tpl-block .cover img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tpl-block .mini-paper { width: 76%; height: 86%; border-radius: 4px; box-shadow: 0 4px 12px rgba(24,32,72,.12); padding: 9px 8px; position: relative; }
.tpl-block h4 { font-size: 12.5px; margin: 8px 2px 0; display: flex; align-items: center; gap: 5px; min-width: 0; }
.tpl-block .tmeta { font-size: 10px; color: var(--muted); margin: 2px 2px 4px; min-width: 0; }
.tpl-block .tacts { display: flex; gap: 5px; margin-top: 6px; min-width: 0; }
.tpl-block .tacts form { min-width: 0; }
.tpl-block .tacts .btn { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; }
.paper-pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.paper-page { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; cursor: pointer; min-width: 0; }
.paper-page input { position: absolute; left: 7px; top: 7px; width: 16px; height: 16px; accent-color: var(--brand); z-index: 2; }
.paper-page img { width: 100%; height: 96px; object-fit: cover; object-position: top; border-radius: 6px; background: #f7faff; cursor: zoom-in; }
.paper-page span { font-size: 10px; color: var(--sub); }
.paper-page:has(input:checked) { border-color: var(--brand); box-shadow: 0 4px 12px rgba(29,107,243,.14); }
.pc-origin { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.pc-origin a { display: block; line-height: 0; }
.pc-origin img { width: 52px; height: 70px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #f2f8ff; }
.login-hero {
  position: relative; padding: 58px 26px 74px; color: #fff;
  background: linear-gradient(150deg, #0b3fa8 0%, #1d6bf3 55%, #38bdf8 115%);
  border-radius: 0 0 34px 34px;
}
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.login-hero::before { width: 220px; height: 220px; right: -80px; top: -100px; }
.login-hero::after { width: 150px; height: 150px; left: -70px; bottom: -60px; background: rgba(255,255,255,.06); }
.logo-mark { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.25); margin-bottom: 18px; position: relative; z-index: 1; }
.login-hero h1 { font-size: 30px; margin: 0; letter-spacing: 1px; position: relative; z-index: 1; }
.login-hero p { margin: 8px 0 0; opacity: .82; font-size: 13px; position: relative; z-index: 1; letter-spacing: .4px; }
.login-hero .feat { display: flex; gap: 16px; margin-top: 22px; font-size: 11px; opacity: .85; position: relative; z-index: 1; }
.login-hero .feat span { display: inline-flex; align-items: center; gap: 4px; }
.login-card { position: relative; z-index: 2; margin: -46px 18px 0; background: #fff; border-radius: 24px; padding: 22px 20px 20px; box-shadow: 0 20px 50px rgba(12, 44, 100, .14); border: 1px solid rgba(232,239,250,.9); }
.login-tabs { display: flex; gap: 22px; margin-bottom: 20px; }
.login-tabs button { background: none; border: 0; padding: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--muted); position: relative; }
.login-tabs button.on { color: var(--ink); }
.login-tabs button.on::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 3px; border-radius: 3px; background: var(--grad); }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin: 24px 0 30px; }
.login-help { display: flex; align-items: center; justify-content: space-between; margin-top: -6px; margin-bottom: 16px; font-size: 11.5px; }
.login-help a { color: var(--brand); }
.checkline { display: flex; align-items: flex-start; gap: 7px; font-size: 11px; color: var(--sub); margin: 14px 0 16px; line-height: 1.5; }
.checkline input { width: 15px; height: 15px; accent-color: var(--brand); margin-top: 2px; }
.demo-tip { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 11px; color: var(--sub); display: flex; gap: 8px; align-items: flex-start; }

/* ---------- 登录错误 ---------- */
.form-error { background: var(--danger-soft); color: #b42318; border-radius: 11px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .ball { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 24px; background: #fff; display: flex; align-items: center; justify-content: center; color: #c6ccda; box-shadow: var(--shadow); }
.empty-state h4 { margin: 0 0 5px; color: var(--sub); font-size: 14px; }
.empty-state p { margin: 0 0 16px; font-size: 11.5px; }

/* ---------- Toast ---------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translate(-50%, -16px); z-index: 200; max-width: 340px; width: max-content; background: rgba(20,26,41,.92); color: #fff; font-size: 12.5px; padding: 11px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .28s; box-shadow: 0 12px 30px rgba(0,0,0,.2); display: flex; align-items: center; gap: 8px; line-height: 1.5; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 通用图标色 ---------- */
.ico { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.t-ic-indigo { background: #e9f2ff; color: #1d6bf3; }
.t-ic-violet { background: #e8f4ff; color: #0877c9; }
.t-ic-rose { background: #e9f8ff; color: #0e7490; }
.t-ic-cyan { background: #e8f9fc; color: #0891b2; }
.t-ic-amber { background: #eef4ff; color: #2563eb; }
.t-ic-green { background: #e8f7f8; color: #0f766e; }
.t-ic-blue { background: #eaf3ff; color: #2563eb; }

/* ---------- 媒体查询 ---------- */
@media (max-width: 360px) {
  .mode-grid { gap: 8px; }
  .mode-card { padding: 12px; }
  .mode-card h4 { font-size: 13.5px; }
  .choice-grid { gap: 7px; }
  .choice { padding: 10px 7px; }
}

/* 生成中禁止交互遮罩 */
body.generating .actionbar .btn.primary { opacity: .5; pointer-events: none; }

/* ---------- 法律条款 ---------- */
.legal-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 85% 5%, rgba(255,255,255,.18), transparent 36%),
    linear-gradient(135deg, #0b3fa8 0%, #1d6bf3 55%, #38bdf8 120%);
  color: #fff; border-radius: 22px; padding: 22px 20px 20px;
  box-shadow: 0 16px 34px rgba(13, 74, 191, .24);
}
.legal-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.24);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; backdrop-filter: blur(8px);
}
.legal-hero h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.legal-hero p { margin: 7px 0 0; font-size: 12.5px; line-height: 1.7; opacity: .86; }
.legal-meta { margin-top: 12px; font-size: 10.5px; opacity: .72; letter-spacing: .3px; }
.legal-card {
  background: #fff; border: 1px solid #e8effa; border-radius: 18px;
  padding: 18px; margin-top: 13px; box-shadow: 0 5px 18px rgba(20, 62, 135, .04);
}
.legal-card h2 {
  margin: 0 0 10px; font-size: 14.5px; letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px; color: #102a52;
}
.legal-card h2::before {
  content: ""; width: 3px; height: 14px; border-radius: 3px;
  background: var(--grad); display: inline-block; flex: 0 0 auto;
}
.legal-card p { margin: 0 0 9px; font-size: 12.5px; line-height: 1.95; color: #4f5f78; }
.legal-card p:last-child { margin-bottom: 0; }
.legal-card b { color: #1e3a66; }
.legal-links { font-size: 12px; }
.legal-links a { color: var(--brand); font-weight: 600; }
.legal-foot { text-align: center; font-size: 10.5px; color: var(--muted); line-height: 1.7; padding: 20px 14px 8px; }

/* ---------- 全屏加载 ---------- */
.loading-mask {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: rgba(9, 26, 50, .36);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  padding: 24px;
}
.loading-mask.show { display: flex; }
.loading-card {
  width: 100%; max-width: 320px; background: #fff; border-radius: 22px;
  padding: 28px 24px 24px; text-align: center;
  box-shadow: 0 30px 70px rgba(18, 22, 42, .25);
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 16px;
  border: 3px solid #e8eaf5; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
.loading-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.loading-sub { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

