/* ============================================================================
   电商AI作图平台 · 客户端样式

   设计取向：这是一个干活用的工具，不是展示页面。所以：
     · 信息密度优先——一屏能看到类型、张数、价钱，不用滚动
     · 状态永远可见——余额、能不能生成、任务跑到哪一步，都在视线里
     · 不用深色主题——客户在里面看商品图，深色背景会让图片偏色判断失误
         （这是电商做图的真实需求，不是审美选择）

   所有颜色走 CSS 变量，将来要换主色只改 :root 一处。
   ========================================================================== */

:root {
  /* 主色：偏蓝紫，工具感强，和图片里的暖色商品不抢 */
  --brand:        #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft:   #eef2ff;
  --brand-line:   #c7d2fe;

  /* 语义色 */
  --ok:      #059669;
  --ok-soft: #ecfdf5;
  --ok-line: #a7f3d0;
  --warn:    #b45309;
  --warn-soft:#fffbeb;
  --err:     #dc2626;
  --err-soft:#fef2f2;
  --err-line:#fecaca;

  /* 中性阶 */
  --ink:     #0f172a;
  --ink-2:   #334155;
  --muted:   #64748b;
  --muted-2: #94a3b8;
  --line:    #e2e8f0;
  --line-2:  #f1f5f9;
  --bg:      #f6f7fb;
  --panel:   #ffffff;

  --radius:   12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-2: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-3: 0 18px 48px rgba(15, 23, 42, .18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

.muted   { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.strong  { font-weight: 650; }
.mono    { font-family: var(--mono); }
.nowrap  { white-space: nowrap; }
.grow    { flex: 1; }
.center  { text-align: center; }

/* ============================================================ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  font-weight: 550;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.btn:hover:not(:disabled) { border-color: var(--muted-2); background: #fbfcfe; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-1);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); border-color: var(--brand-strong); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); border-color: transparent; }

.btn-danger { color: var(--err); border-color: #fecaca; background: var(--err-soft); }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-warn { color: #92400e; border-color: #fcd34d; background: #fef3c7; font-weight: 600; }
.btn-warn:hover:not(:disabled) { background: #fde68a; }
.btn-warn:disabled { opacity: .6; cursor: default; }

.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  width: 30px; height: 30px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* ============================================================ 表单 */
.field { display: block; margin-bottom: 14px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field-label em { font-style: normal; font-weight: 400; }

/* 产品名称行：标签 + AI帮填按钮 同一行 */
.field-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 6px;
}
.ai-fill-btn {
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s;
}
.ai-fill-btn:hover:not(:disabled) { background: #e3e9ff; border-color: var(--brand); }
.ai-fill-btn:active:not(:disabled) { transform: translateY(1px); }
.ai-fill-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============================================================ 高级参数（折叠） */
.adv-wrap { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 12px; }
.adv-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.adv-arrow {
  display: inline-block; color: var(--muted-2);
  transition: transform .18s ease;
  font-size: 10px;
}
.adv-toggle.open .adv-arrow { transform: rotate(90deg); }
.adv-panel { padding: 12px 0 2px; display: flex; flex-direction: column; gap: 14px; }

.slider-group { display: flex; flex-direction: column; gap: 6px; }
.slider-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.slider-label .mode-button { margin-left: auto; }

input[type=range].slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; padding: 0;
  border: 0; border-radius: 99px; background: var(--line);
  cursor: pointer;
}
input[type=range].slider:disabled { opacity: .5; cursor: not-allowed; }
input[type=range].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: var(--shadow-1); cursor: pointer;
}
input[type=range].slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff; cursor: pointer;
}

.mode-button {
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); border-radius: 7px;
  padding: 3px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mode-button:hover { border-color: var(--muted-2); background: #fbfcfe; }

input[type=text], input[type=password], input[type=tel],
input[type=email], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
select { cursor: pointer; appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted-2) 50%),
  linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* ============================================================ 提示条 */
.alert {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin: 0 0 12px;
  font-size: 13px;
  border: 1px solid transparent;
}
.alert-err  { background: var(--err-soft);  color: #991b1b; border-color: #fecaca; }
.alert-ok   { background: var(--ok-soft);   color: #065f46; border-color: #a7f3d0; }
.alert-warn { background: var(--warn-soft); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--brand-soft);color: var(--brand-strong); border-color: var(--brand-line); }

/* 登录失败时的兜底提示：紧跟在错误条下面的淡一行，
   不能比错误本身更抢眼 —— 它是补充路径，不是主角。 */
.auth-hint {
  margin: -6px 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-hint a { color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.auth-hint a:hover { text-decoration: underline; }

/* 登录/注册按钮下方的「忘记密码？/返回登录」行：必须和按钮留出明显间距，
   不能复用 .auth-hint 的 -6px（那是给紧贴错误条用的）。 */
#authAlt { margin: 14px 0 12px; text-align: right; }

/* 图形验证码：输入框与图片并排。
   图片给固定宽度、不随窗口缩放 —— 缩放会让字符变形，
   客户本来就不好认，再变形等于把人挡在门外。 */
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; letter-spacing: 3px; text-transform: uppercase; }
.captcha-img {
  width: 132px; height: 44px; flex: 0 0 auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #f7f9fc; cursor: pointer; user-select: none;
}
.captcha-img:hover { border-color: var(--brand-line); }
/* 还没取到图时（或者取失败）不要显示成一个破图图标 */
.captcha-img:not([src]) { opacity: .4; }

/* 密码框：右侧挂一个「显示/隐藏」小眼睛；注册页与重置页各多一个确认框。
   为什么要有眼睛：客户打错一个字自己看不出来，而平台当前还没有可靠的
   自助找回通道（找回邮件还没通），能当场核对比事后找回便宜得多。 */
.pwd-wrap { display: block; position: relative; }
.pwd-wrap input { padding-right: 44px; }   /* 给右侧图标让位，别压到文字 */
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; padding: 0; border-radius: 7px;
  color: var(--muted-2); cursor: pointer;
  transition: color .15s, background .15s;
}
.pwd-eye:hover { color: var(--ink-2); background: var(--line-2); }
.pwd-eye .ico { width: 20px; height: 20px; display: block; }
/* 已切到明文时：图标划一道斜杠并转成品牌色，一眼能看出当前是"看得见"的状态 */
.pwd-eye.is-on { color: var(--brand); }
.pwd-eye.is-on::after {
  content: ''; position: absolute; width: 20px; height: 2px;
  background: currentColor; border-radius: 2px; transform: rotate(-45deg);
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok    { background: var(--ok-soft);   color: var(--ok); }

/* 抽屉里的「重试失败张」提示区 */
.retry-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
}
.retry-head { display: flex; align-items: center; gap: 8px; }
.pill-err   { background: var(--err-soft);  color: var(--err); }
.pill-warn  { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: var(--line-2);    color: var(--muted); }
.pill-brand { background: var(--brand-soft);color: var(--brand-strong); }

/* ============================================================ 登录页 */
.auth-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 12% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(900px 420px at 100% 0%, #fae8ff 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-2);
}
.auth-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 22px; }
.auth-logo, .logo {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-1);
}
.auth-brand h1 { font-size: 18px; }
.auth-foot { margin-top: 16px; text-align: center; line-height: 1.7; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--line-2);
  border-radius: 10px;
  margin-bottom: 18px;
}
.tab {
  flex: 1; padding: 8px; border: 0; border-radius: 7px;
  background: transparent; cursor: pointer;
  font-weight: 600; color: var(--muted);
}
.tab.is-on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.tabs-sm { margin-bottom: 16px; }

/* ============================================================ 框架 */
.app { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-left strong { font-size: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
}
.chip:hover { border-color: var(--muted-2); }
.chip b { font-weight: 700; color: var(--brand-strong); }
.chip-label { color: var(--muted); font-size: 12px; }
.caret { color: var(--muted-2); font-size: 10px; }

.user-menu { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 168px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: 5px;
  z-index: 60;
}
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 11px; border: 0; border-radius: 7px;
  background: transparent; cursor: pointer; font-size: 13.5px;
}
.menu button:hover { background: var(--line-2); }
.menu button.danger { color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 8px; }

.mainnav {
  display: flex; align-items: center; gap: 2px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  position: sticky; top: 56px; z-index: 30;
}
.nav-item {
  padding: 12px 14px;
  border: 0; background: transparent; cursor: pointer;
  font-weight: 550; color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-on { color: var(--brand-strong); border-bottom-color: var(--brand); }
.nav-locked { color: var(--muted-2); }
.nav-locked::after { content: '·未开放'; font-size: 11px; margin-left: 4px; }
.nav-sep { flex: 0 0 1px; width: 1px; height: 18px; background: var(--line); margin: 0 10px; }

.view { padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ============================================================ 卡片 / 面板 */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
}
.panel-body { padding: 16px; }
.panel-foot {
  padding: 13px 16px;
  border-top: 1px solid var(--line-2);
  background: #fcfdff;
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
.grid-2-wide { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 18px; align-items: start; }
@media (max-width: 1080px) { .grid-2, .grid-2-wide { grid-template-columns: minmax(0,1fr); } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 10px; }
.divider { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }

/* ============================================================ 上传区 */
.drop {
  border: 1.5px dashed var(--brand-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9ff 100%);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop-icon { font-size: 24px; margin-bottom: 6px; }
.drop b { display: block; color: var(--brand-strong); }
.drop .muted { margin-top: 3px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; margin-top: 12px; }
.thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line-2);
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item .x {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(15,23,42,.6); color: #fff;
  cursor: pointer; font-size: 11px; line-height: 1;
  display: grid; place-items: center;
}
.thumb-item .x:hover { background: var(--err); }

/* ============================================================ 类型选择 */
.type-group + .type-group { margin-top: 16px; }
.type-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 9px;
}
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }

.type-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .13s, box-shadow .13s, background .13s;
}
.type-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-1); }
.type-card.is-on { border-color: var(--brand); background: #fbfbff; box-shadow: 0 0 0 3px var(--brand-soft); }
.type-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.type-name { font-weight: 620; font-size: 13.5px; }
.type-desc {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 36px;
}
.type-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.type-tag { font-size: 11px; color: var(--muted); background: var(--line-2); padding: 1px 6px; border-radius: 4px; }
.check {
  width: 18px; height: 18px; flex: none;
  border-radius: 5px; border: 1.5px solid var(--line);
  display: grid; place-items: center;
  color: transparent; font-size: 11px; font-weight: 800;
}
.type-card.is-on .check { background: var(--brand); border-color: var(--brand); color: #fff; }

.qty {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  width: fit-content;
  background: var(--panel);
}
.qty button {
  width: 26px; height: 26px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-2); font-weight: 700; line-height: 1;
}
.qty button:hover:not(:disabled) { background: var(--line-2); }
.qty button:disabled { color: var(--muted-2); cursor: not-allowed; }
.qty b { min-width: 26px; text-align: center; font-size: 13px; }

/* 卡片底部的「这一类图的画面补充」。只在勾选后出现，
   用虚线上边框跟上面的张数控件分区 —— 两者是不同性质的东西：
   上面是「出几张」，这里是「这一类要什么画面」。 */
.type-note {
  margin-top: 2px; padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.type-note-input {
  padding: 6px 9px; font-size: 12px;
  background: var(--panel);
  cursor: text;
}

/* ============================================================ 报价条 */
.quote { display: flex; flex-direction: column; gap: 9px; }
.quote-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.quote-line .k { color: var(--muted); }
.quote-line .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.quote-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.quote-total .v { font-size: 22px; font-weight: 750; color: var(--brand-strong); font-variant-numeric: tabular-nums; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-opt {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.seg-opt:hover { border-color: var(--muted-2); }
.seg-opt.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.seg-opt small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }

/* ============================================================ 画面比例（胶囊） */
/* 对齐原版 aqun 的比例选择：一排圆角胶囊，选中的那个高亮。 */
.ratio-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.ratio-pill {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ratio-pill:hover { border-color: var(--muted-2); }
.ratio-pill.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}
.ratio-note { margin-top: 8px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { width: auto; margin: 0; accent-color: var(--brand); width: 15px; height: 15px; }

/* ============================================================ 任务 */
.task-card {
  display: flex; gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .13s, box-shadow .13s;
}
.task-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-1); }
.task-thumbs { display: flex; gap: 5px; flex: none; }
.task-thumbs img {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 7px; border: 1px solid var(--line); background: var(--line-2);
}
.task-thumbs .ph {
  width: 52px; height: 52px; border-radius: 7px;
  background: var(--line-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted-2); font-size: 16px;
}
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.task-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title .no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); }

.progress { height: 5px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .35s ease; }

/* ---- 按类型的进度（任务详情里「白底图 1/1 张」那一行行）----
   一条类型一行、左侧一个计数胶囊，比一排横向小标签更耐读：
   类型名长短差很多（「白底图」vs「细节工艺特写图」），竖排不会互相挤。 */
.type-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.type-progress-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; }
.type-progress-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 3px 9px; border-radius: 99px;
  background: var(--line-2); color: var(--ink-2);
  border: 1px solid transparent;
}
.type-progress-chip b { font-weight: 620; }
.type-progress-chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.type-progress-chip.is-run { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.type-progress-chip.is-run .n { color: var(--brand); }
.type-progress-chip.is-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.type-progress-chip.is-ok .n { color: var(--ok); }
.type-progress-chip.is-fail { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.type-progress-chip.is-fail .n { color: var(--err); }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.img-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  display: flex; flex-direction: column;
}
.img-cell .ph-img {
  aspect-ratio: 1; background: var(--line-2);
  display: grid; place-items: center; color: var(--muted-2);
  position: relative;
}
.img-cell .ph-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.img-cell .ph-img .spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--brand-line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.img-cell .badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(15,23,42,.62); color: #fff;
}
.img-cell .info { padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.img-cell .info .name { font-size: 13px; font-weight: 600; }
.img-cell .actions { display: flex; gap: 6px; }
.img-cell .actions .btn { flex: 1; padding: 5px 6px; font-size: 12px; }

/* ============================================================ 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fcfdff; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pos { color: var(--ok); }
.table .neg { color: var(--err); }

/* ============================================================ 模态框 */
/* 为什么要有它：以前「修改密码」用的是浏览器原生 prompt()，
   在嵌入式浏览器（WebView / IDE 内置浏览器）里直接抛 "prompt() is not supported"，
   客户看到的只是"点了没反应"。而且原生 prompt 收密码没法做二次确认、也没有掩码反馈。 */
.modal-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(15, 23, 42, .42);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 18px 4px; }
.modal-body .field { margin-bottom: 14px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 4px 18px 18px;
}
.modal-foot .btn { min-width: 96px; }

/* ============================================================ 抽屉 */
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 384px; max-width: 92vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  z-index: 80;
  display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.drawer-head-actions { display: flex; align-items: center; gap: 6px; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

.timeline { display: flex; flex-direction: column; gap: 9px; }
.tl-item { display: flex; gap: 9px; font-size: 13px; }
.tl-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 7px; }
.tl-dot.ok { background: var(--ok); } .tl-dot.err { background: var(--err); }
.tl-dot.run { background: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.tl-text { color: var(--ink-2); }
.tl-text small { display: block; color: var(--muted); font-size: 11.5px; }

/* ============================================================ 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 13, 24, .9);
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto;
  padding: 40px 20px 0;
}
.lightbox img { max-width: min(1200px, 94vw); max-height: 78vh; object-fit: contain; border-radius: 8px; }
.lb-close {
  position: absolute; top: 16px; right: 20px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  cursor: pointer; font-size: 15px;
}
.lb-close:hover { background: rgba(255,255,255,.26); }
.lb-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 4px 22px; color: #fff;
}
.lb-bar .muted { color: rgba(255,255,255,.62); }

/* ============================================================ Toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 200; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow-3);
  animation: rise .2s ease;
  max-width: 76vw;
}
.toast.err { background: var(--err); }
.toast.ok  { background: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================ 空态 / 骨架 */
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 30px; margin-bottom: 8px; opacity: .55; }

.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, #e9eef5 37%, var(--line-2) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============================================================ 图片裂变 */
/* 缩略图左上角的序号。
   裂变的硬规则是「每张结果只参考自己那一张原图」，也就是原图的**顺序**
   就是结果与原图的一一对应关系。序号不显眼地标出来，客户拖错顺序时
   从界面上看不出来，等出图才发现「第 3 张变的是第 1 张的图」。 */
.thumb-no {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 6px; background: rgba(15,23,42,.66); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* 裂变的「变化方向」胶囊：比类型卡片轻，一行能放好几个，
   因为客户通常是「勾两三个方向」而不是「读一堆说明」。 */
.fs-dir-note { margin: 10px 0 0; }
/* 预计生成张数那一行要压过其它明细 —— 它是客户核对「花多少钱」的第一眼。 */
.fs-plan-line .v { color: var(--brand-strong); font-weight: 700; }

/* ============================================================ 邀请好友 */
/* 邀请码卡片：整页最该被看到的东西。
   放大字号 + 拉开字距，是因为邀请码要**被读出来、被抄下来**
   （客户在群里发码、在电话里念码），不是给人一眼扫过的正文。 */
.ref-code-card {
  padding: 16px 18px;
  border: 1.5px dashed var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-soft);
}
.ref-code-label { color: var(--muted); font-size: 12px; }
.ref-code {
  margin: 4px 0 2px;
  font-family: var(--mono);
  font-size: 32px; font-weight: 750; line-height: 1.2;
  letter-spacing: .16em;
  color: var(--brand-strong);
  word-break: break-all;
}
/* 链接独占一行且允许换行：它是拿来「整条复制」的。
   一旦被省略号截掉，客户就没法核对复制到的到底是不是完整地址。 */
.ref-url {
  margin-top: 10px; font-size: 12px; color: var(--muted);
  word-break: break-all; line-height: 1.5;
}

/* 说「消耗」的那一句。它是整页唯一的计费口径说明 ——
   给足行高和上下留白，别让客户从两行小字里去找。 */
.ref-rule { margin: 14px 0 4px; line-height: 1.75; }
.ref-rule b { color: var(--brand-strong); }

.ref-kpis {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ref-kpi {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.ref-kpi .k { color: var(--muted); font-size: 12px; }
.ref-kpi .v {
  margin-top: 2px; font-size: 20px; font-weight: 750;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.ref-kpi-hint { color: var(--muted-2); font-size: 11px; line-height: 1.4; }

/* 三条边界说明。列成列表而不是糊成一段：
   这三条客户会反复回来查（「朋友退款了我会不会被追回」「返利会过期吗」），
   排成列表才找得到。 */
.ref-notes {
  margin: 14px 0 0; padding-left: 20px;
  color: var(--muted); font-size: 12px; line-height: 1.8;
}
.ref-notes b { color: var(--ink-2); }

/* 窄屏把四个数排成两行：否则每格只剩 60 来像素，数字会折行。 */
@media (max-width: 1080px) {
  .ref-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-code { font-size: 26px; }
}

/* ============================================================ 扫码支付弹窗 */
/* 【为什么二维码要给定尺寸而不是让它自适应】
   二维码是「靠边扫描」的图形，图越小、手机越难对上焦。
   这里锁死 220×220 并且用 image-rendering: pixelated 关掉浏览器的
   平滑缩放 —— 平滑会让黑白边界发灰，扫码识别率明显下降。 */
.pay-qr {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 4px 0 6px;
}
.pay-qr-img {
  width: 220px; height: 220px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
/* 服务器没装二维码库时的退化形态：给一个能直接点开的付款链接 */
.pay-qr-link {
  width: 100%; padding: 14px;
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  text-align: center;
}
.pay-amount {
  font-size: 26px; font-weight: 750; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.pay-amount small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pay-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
/* 倒计时数字等宽：否则 1 变成 0 的瞬间整行会抖一下 */
.pay-countdown { font-variant-numeric: tabular-nums; }
.pay-steps {
  margin: 12px 0 0; padding: 12px 14px 12px 32px;
  background: var(--line-2); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 12.5px; line-height: 1.9;
}
.pay-steps b { color: var(--ink-2); }
/* 到账后的成功态：整块变绿 + 打勾，客户不用再盯着余额变动猜 */
.pay-done {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 0 10px; text-align: center;
}
.pay-done .ok-mark {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
}
.pay-order-no {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  word-break: break-all; text-align: center;
}
