/* ============================================================
   Sola 全站 UI 设计规范样式层（v1.0 · 2026-11-05）
   ============================================================
   本文件是全站唯一视觉规范，配合 site.css（导航/页脚/首页骨架）使用。
   新页面一律：site.css → ui.css → 页内特例 <style>；tupian.css / webui.css 退役不再引用。

   【页面模板】
   · 工具页（加水印/压缩/提词器/去字幕）：ui-head → tool-nav → page-main > workbench（左画布右控制）→ actions
   · 提交页（转文章/提取脚本）：ui-head → tool-nav → page-main > card 表单 → 结果卡
   · 列表页（套餐/充值/账户）：ui-head → page-main > 卡片列表（pkg-grid / balance-row / order-row）

   【铁律】
   · 全站容器统一 1080px；表单窄列变体 640px；列表宽列 860px
   · 页头一律左对齐蓝条 h1 22px（营销首页 hero 除外）
   · 控件高度统一 38px（主 CTA 42px）；圆角：控件 8px、按钮 12px、卡片 14px、胶囊 999px
   · 8px 间距网格：4/8/12/16/24/32
   · 品牌蓝只用于主按钮/焦点环/选中态/tab 激活；不做渐变、不做发光、不加装饰性插画
   · JS 挂钩（ID / [hidden] 显隐 / .panel / .row.upload-row / .text-list 结构）永远不改名
   ============================================================ */

/* ===== 设计 token ===== */
:root {
  /* 色彩 */
  --bg: #ffffff;
  --bg-soft: #f5f5f7;        /* 区块浅底 */
  --bg-group: #f7f8fa;       /* 工作区底 */
  --panel: #ffffff;
  --border: #e8eaed;
  --border-soft: #f2f2f4;
  --border-strong: #d2d2d7;
  --text: #1d1d1f;
  --text-sub: #6e6e73;
  --text-hint: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-active: #0060c0;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-line: #bfdbfe;
  --ok: #34c759;
  --err: #ff3b30;
  --warn: #f59e0b;

  /* 尺寸刻度 */
  --h-input: 38px;           /* 输入/下拉/次级按钮统一高度 */
  --h-cta: 42px;             /* 主 CTA 高度 */
  --radius-sm: 6px;
  --radius: 8px;             /* 控件 */
  --radius-btn: 12px;        /* 按钮 */
  --radius-card: 14px;       /* 卡片 */
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-cta: 0 4px 12px rgba(0, 113, 227, .22);

  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* ===== 全局（body flex column 环境下的容器规矩：
   flex 交叉轴 auto margin 会放弃 stretch 收缩成 fit-content，居中容器必须显式 width:100%） ===== */
[hidden] { display: none !important; }  /* flex 容器里 display 会盖掉 hidden 属性，JS 显隐全靠它 */
body { font-family: var(--font-body); font-size: 14px; line-height: 1.6; color: var(--text); }

.ui-main, .page-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}
main.ui-narrow { max-width: 640px; }   /* 表单窄列（充值/账户/协议） */
main.ui-wide  { max-width: 860px; }   /* 列表宽列（套餐） */

/* ===== 页头（全站统一：左对齐 + 蓝条 h1） ===== */
.page-head, .app-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px 0;
  text-align: left;
}
.page-head h1, .app-header h1 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 6px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-head h1::before, .app-header h1::before {
  content: ''; display: inline-block; width: 6px; height: 20px;
  background: var(--accent); border-radius: 3px; flex: 0 0 auto;
}
.page-head p, .app-header .sub {
  color: var(--text-sub); font-size: 13.5px; line-height: 1.7;
  margin: 0; padding-left: 16px; max-width: 640px;
}

/* ===== 工具切换胶囊 tab（居中） ===== */
.tool-nav {
  display: flex; justify-content: center; gap: 4px;
  margin: 18px auto 0; padding: 4px;
  width: fit-content; max-width: 100%;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow-x: auto; scrollbar-width: none;
}
.tool-nav::-webkit-scrollbar { display: none; }
.tool-nav a {
  display: inline-block; padding: 7px 22px;
  border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--text-sub); text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.tool-nav a:hover { color: var(--text); }
.tool-nav a.current { background: var(--accent); color: #fff; font-weight: 600; }

/* ===== 卡片 ===== */
.card, .ctrl-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card h2, .ctrl-card h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin: 0 0 12px;
}
.card h2::before, .ctrl-card h2::before {
  content: ''; width: 4px; height: 14px;
  background: var(--accent); border-radius: 2px; flex: 0 0 auto;
}
.sec-title {
  font-size: 13px; font-weight: 600; margin: 20px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.sec-title::before { content: ''; width: 4px; height: 14px; background: var(--accent); border-radius: 2px; }

/* ===== 按钮（统一高度与圆角） ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--h-input);
  padding: 8px 20px;
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { background: var(--border); border-color: var(--border); color: var(--text-hint); cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: var(--panel); color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--border-strong); color: var(--text); }
.btn-lg { min-height: var(--h-cta); padding: 10px 28px; font-size: 14.5px; }
.btn-block { width: 100%; }

/* ===== 表单（块状 field：webui 系；行内 field 在工具页上下文另定义） ===== */
.field { margin-bottom: 14px; }
.field > label, .field > span:first-child {
  display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px;
}
.field input[type=text], .field input[type=number], .field input[type=email],
.field input[type=password], .field input[type=tel], .field select, .field textarea {
  width: 100%; min-height: var(--h-input);
  font-size: 14px; padding: 8px 12px; font-family: inherit;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-hint); }
.field select { cursor: pointer; }

/* 工具页行内 field（.workbench/.toolbar 上下文内） */
.toolbar .field, .workbench .field, .ctrl-card .field {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-sub); width: 100%; margin: 0;
}
.toolbar .field > span:first-child, .workbench .field > span:first-child, .ctrl-card .field > span:first-child {
  display: inline; margin: 0; flex: 0 0 auto;
}
.toolbar .field input[type=text], .workbench .field input[type=text], .ctrl-card .field input[type=text] {
  min-width: 0;
}
.toolbar .field input[type=range], .workbench .field input[type=range], .ctrl-card .field input[type=range] {
  flex: 1 1 auto; width: auto; min-width: 80px;
}

/* ===== 通用输入件（高度/滑条/颜色/复选全站统一） ===== */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 4px;
  background: var(--border); border-radius: var(--radius-pill);
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px;
  background: #fff; border: 2px solid var(--accent); border-radius: 50%;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type=range]::-moz-range-thumb {
  width: 17px; height: 17px; background: #fff;
  border: 2px solid var(--accent); border-radius: 50%; cursor: pointer;
}
input[type=range]:disabled::-webkit-slider-thumb { border-color: var(--text-hint); background: var(--bg-soft); }
input[type=range]:disabled::-moz-range-thumb { border-color: var(--text-hint); background: var(--bg-soft); }
input[type=color] {
  width: 40px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch { border: none; border-radius: 4px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== 上传靶（工具页上传区） ===== */
.row.upload-row {
  margin: 18px 0 16px;
  padding: 18px 24px;
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-group);
  border: 1.5px dashed var(--accent-line);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.row.upload-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.row.upload-row .btn-upload {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  padding: 10px 22px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow-cta);
  pointer-events: none; /* 点击整行已触发，label 内元素穿透防双弹 */
}
.row.upload-row:hover .btn-upload { background: var(--accent-hover); }
.row.upload-row .btn-upload::before { content: '↑'; font-weight: 700; font-size: 15px; }
.row.upload-row .hint { font-size: 13px; color: var(--text-sub); }
.row.upload-row .hint strong { color: var(--text); font-weight: 600; }

/* ===== 工具页工作台（双栏：左画布右控制） ===== */
.workbench { display: flex; gap: 16px; align-items: flex-start; }
.canvas-col { flex: 1 1 auto; min-width: 0; }
.ctrl-col { flex: 0 0 320px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 880px) {
  .workbench { flex-direction: column-reverse; }
  .ctrl-col { flex: 1 1 auto; width: 100%; }
}
.canvas-stage {
  margin: 0; padding: 16px;
  background: var(--bg-group);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  display: flex; justify-content: center; align-items: center;
}
.canvas-wrap {
  position: relative;
  width: fit-content; height: fit-content;
  max-width: 100%; min-width: 240px; min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: repeating-conic-gradient(#f0f1f3 0% 25%, #fafafb 0% 50%) 0 0 / 16px 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.canvas-wrap canvas { display: block; max-width: 100%; max-height: 68vh; }
.canvas-col .canvas-wrap:only-child { min-width: 100%; }  /* 单画布撑满列（双画布对比页不适用） */
.canvas-wrap .caption {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(255,255,255,.95); color: var(--text);
  padding: 3px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.size-summary { font-size: 13px; color: var(--text-sub); flex: 1; font-variant-numeric: tabular-nums; }
.canvas-wrap .placeholder {
  position: absolute; z-index: 1;
  color: var(--text-sub); font-size: 13px;
  text-align: center; padding: 0 24px;
  pointer-events: none;
}
.toolbar { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.toolbar-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 文字列表（加水印自由文字） */
.text-list {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
  max-height: 132px; overflow-y: auto; font-size: 13px;
}
.text-list-empty { padding: 14px; color: var(--text-hint); font-size: 12px; text-align: center; }
.text-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border-soft);
}
.text-list-item:last-child { border-bottom: none; }
.text-list-item:hover { background: var(--bg-soft); }
.text-list-item.is-anchor { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.text-list-item-label { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 操作行（导出/提交行） ===== */
.row.actions { margin: 16px 0 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row.actions .status, .status { font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.status.error { color: var(--err); }
.status.ok { color: var(--ok); }
.status.loading { color: var(--accent); }
.hint { color: var(--text-sub); font-size: 12.5px; line-height: 1.7; }
.hint strong { color: var(--text); font-weight: 600; }

/* ===== 提示条（提交页消息） ===== */
.msg { font-size: 13.5px; line-height: 1.6; border-radius: var(--radius); padding: 11px 14px; margin-bottom: 14px; display: none; }
.msg.show { display: block; }
.msg-err { color: var(--err); background: rgba(255, 59, 48, 0.08); }
.msg-ok { color: #1d7a35; background: rgba(52, 199, 89, 0.12); }
.msg-info { color: var(--text-sub); background: var(--bg-soft); }

/* ===== 套餐卡（pricing/recharge） ===== */
.pkg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .pkg-grid { grid-template-columns: 1fr; } }
.pkg {
  position: relative; border: 1.5px solid var(--border-soft); border-radius: var(--radius-card);
  padding: 18px 16px; cursor: pointer; background: var(--panel);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pkg:hover { border-color: var(--border-strong); }
.pkg.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pkg .name { font-size: 15px; font-weight: 600; }
.pkg .price { font-size: 21px; font-weight: 600; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.pkg .price small { font-size: 12px; font-weight: 400; color: var(--text-hint); }
.pkg .desc { font-size: 12px; color: var(--text-sub); line-height: 1.6; }
.pkg .tag {
  position: absolute; top: 12px; right: 12px; font-size: 11px;
  color: #d9a13c; background: rgba(217, 161, 60, 0.15);
  padding: 2px 9px; border-radius: var(--radius-pill);
}

/* ===== 余额条 / 订单行 / 状态徽章 ===== */
.balance-row { display: flex; gap: 10px; flex-wrap: wrap; }
.balance-item {
  flex: 1; min-width: 140px;
  background: var(--bg-soft); border-radius: var(--radius-card); padding: 14px 16px;
}
.balance-item .num { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.balance-item .lbl { font-size: 12px; color: var(--text-hint); margin-top: 3px; }
.order-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.order-row:last-child { border-bottom: none; }
.order-row .oid { font-family: ui-monospace, Consolas, monospace; color: var(--text-sub); }
.status-pill { display: inline-block; font-size: 12px; padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 500; }
.st-pending { color: #b25e09; background: rgba(245, 158, 11, 0.13); }
.st-paid { color: #1d7a35; background: rgba(52, 199, 89, 0.13); }
.badge-free { color: #1d7a35; background: rgba(52, 199, 89, 0.12); }
.badge-pro { color: #d9a13c; background: rgba(217, 161, 60, 0.15); }
.badge-soon { color: #8e8e93; background: rgba(142, 142, 147, 0.14); }

/* ===== 二维码支付块 ===== */
.qr-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.qr-tab {
  font-size: 13px; padding: 7px 18px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); font-family: inherit;
  transition: all .15s ease;
}
.qr-tab:hover { border-color: var(--border-strong); }
.qr-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.qr-box {
  width: 220px; height: 220px; margin: 0 auto;
  border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); font-size: 13px; color: var(--text-hint);
  text-align: center; line-height: 1.7; padding: 12px;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.pay-amount { font-size: 30px; font-weight: 600; text-align: center; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.pay-amount small { font-size: 13px; font-weight: 400; color: var(--text-hint); }
.pay-orderid { text-align: center; font-size: 12px; color: var(--text-hint); letter-spacing: .5px; margin-bottom: 16px; user-select: all; }
.pay-note { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; margin-top: 14px; }

/* ===== 处理进度（提交页：步骤条 + 进度线） ===== */
.steps { list-style: none; margin: 0 0 14px; padding: 0; }
.steps li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13.5px; color: var(--text-hint);
}
.steps li .dot {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 12px;
  background: var(--bg-soft); color: var(--text-hint);
  border: 1px solid var(--border);
}
.steps li.doing { color: var(--text); }
.steps li.doing .dot { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.steps li.done { color: var(--text-sub); }
.steps li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress-line {
  height: 6px; border-radius: var(--radius-pill);
  background: var(--bg-soft); overflow: hidden;
}
.progress-line i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: var(--radius-pill);
  transition: width .4s ease;
}

/* ===== 配额行（今日免费/余额小卡） ===== */
.quota-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.quota-item {
  flex: 1; min-width: 130px;
  background: var(--bg-soft); border-radius: var(--radius-card); padding: 12px 14px;
}
.quota-item .num { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-item .lbl { font-size: 12px; color: var(--text-hint); margin-top: 2px; }

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(29, 29, 31, .95); color: #fff;
  padding: 12px 24px; border-radius: var(--radius-pill);
  font-size: 13px; box-shadow: var(--shadow-md);
  z-index: 999; max-width: 80vw;
}

/* ===== 响应式（全站统一断点） ===== */
@media (max-width: 720px) {
  .page-head, .app-header { padding: 20px 16px 0; }
  .page-head h1, .app-header h1 { font-size: 19px; }
  .page-head h1::before, .app-header h1::before { width: 5px; height: 17px; }
  .page-head p, .app-header .sub { padding-left: 13px; font-size: 12.5px; }
  .ui-main, .page-main { padding: 14px 14px 60px; }
  .row.upload-row { flex-direction: column; text-align: center; padding: 16px; gap: 10px; }
  .row.actions .btn-primary.btn-lg, .row.actions .btn-lg { width: 100%; }
  .canvas-wrap { min-height: 180px; }
}

/* ===== 可访问性 ===== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
