/* web/styles/components.css —— 组件与布局，全部引用 tokens.css 变量 */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-bottom-color: var(--glass-border-bottom);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease-out, background var(--dur) ease-out;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-primary { background: var(--btn-primary-bg); color: #fff; font-weight: 700; box-shadow: var(--btn-primary-shadow); }
.btn-primary:active { background: var(--blue-pressed); opacity: 0.88; }
.btn-secondary { background: var(--fill-secondary); color: var(--text); }
.btn-secondary:active { background: var(--fill-secondary-pressed); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }

/* ---------- 胶囊 / 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: var(--chip-bg); color: var(--chip-text);
}
.chip-free { background: rgba(52, 199, 89, 0.14); color: #136F2D; }
@media (prefers-color-scheme: dark) { .chip-free { color: #4ADE80; } }
.chip-cost { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  border-bottom: 1px solid var(--group-divider);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; height: 56px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-strong); }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.brand h1 { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.brand small { font-size: 12px; color: var(--text-sub); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.top-nav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--fill-secondary); color: var(--text);
  font-size: 13px; font-weight: 600;
  transition: background var(--dur) ease-out, transform var(--dur) var(--ease);
}
.top-nav-btn:hover { background: var(--fill-secondary-pressed); }
.top-nav-btn:active { transform: scale(0.96); }
.wallet-pill {
  display: none; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: #0051A8; font-size: 13px; font-weight: 700;
  transition: background var(--dur) ease-out, transform var(--dur) var(--ease);
}
@media (prefers-color-scheme: dark) { .wallet-pill { color: #60A5FA; } }
.wallet-pill:hover { background: color-mix(in srgb, var(--blue) 22%, transparent); }
.wallet-pill:active { transform: scale(0.96); }
.wallet-pill.show { display: inline-flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--fill-secondary); display: none; align-items: center; justify-content: center; }
.avatar.show { display: inline-flex; }

/* ---------- 工作台三栏 ---------- */
.workbench {
  max-width: 1440px; margin: 0 auto; padding: 16px 20px 8px;
  display: grid; grid-template-columns: 248px minmax(0, 1fr) 340px; gap: 16px;
  min-height: calc(100vh - 56px - 24px);
}

/* 左：工具列表 (Inset Grouped Table) */
.tool-rail { display: flex; flex-direction: column; gap: 12px; align-self: start; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding-bottom: 8px; scrollbar-width: thin; }
.group-label { font-size: 12px; color: var(--text-sub); font-weight: 600; padding: 0 12px 4px; letter-spacing: 0.01em; }
.inset-group {
  background: var(--group-bg);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-radius: var(--radius-group);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  overflow: hidden;
}
.cell {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; text-align: left;
  transition: background var(--dur) ease-out;
}
.cell:hover { background: var(--cell-pressed); }
.cell:active { background: var(--cell-pressed); }
.cell::after { content: ''; position: absolute; left: 50px; right: 0; bottom: 0; height: 1px; background: var(--group-divider); }
.cell:last-child::after { display: none; }
.cell.active { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.cell.active .cell-title { color: #0051A8; }
@media (prefers-color-scheme: dark) { .cell.active .cell-title { color: var(--blue); } }
.icon-badge {
  width: 28px; height: 28px; border-radius: var(--radius-icon); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
}
.icon-badge svg { width: 16px; height: 16px; }
.cell-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 中：画布 */
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.stage-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); }
.stage-sub { font-size: 13px; color: var(--text-sub); }
.canvas-card { position: relative; flex: 1; min-height: 520px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }

.empty-stage { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 8px 0; }
.dropzone {
  width: min(520px, 100%); min-height: auto; padding: 16px 20px;
  border: 1.5px dashed color-mix(in srgb, var(--blue) 45%, transparent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--blue) 4%, transparent);
  transition: background var(--dur) ease-out, border-color var(--dur) ease-out;
}
.dropzone:hover, .dropzone.dragover, .canvas-card.dragover .dropzone { background: color-mix(in srgb, var(--blue) 10%, transparent); border-color: var(--blue); }
.dropzone-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; background: var(--btn-primary-bg); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--btn-primary-shadow); }
.dropzone-copy { flex: 1; min-width: 0; }
.dropzone h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.dropzone p { font-size: 12px; margin-top: 2px; color: var(--text-sub); }
.dropzone .btn { flex-shrink: 0; }
.sample { width: min(500px, 100%); text-align: center; }
.sample .compare { aspect-ratio: 1 / 1; }
.sample-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }

.preview-img { max-width: 100%; max-height: 640px; object-fit: contain; border-radius: 10px; }

/* 前后对比滑块 (design.md: Interactive Comparison Slider) */
.compare { position: relative; width: 100%; max-width: 900px; border-radius: 12px; overflow: hidden; user-select: none; --pos: 50%; background: #000; }
.compare img { width: 100%; height: auto; max-height: 640px; object-fit: contain; }
.compare .compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .compare-before img { height: 100%; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,0.35); pointer-events: none; }
.compare-handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: rgba(255,255,255,0.92); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare-tag { position: absolute; top: 10px; font-size: 11px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 10px; background: rgba(0,0,0,0.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.25); }
.compare-tag.l { left: 10px; } .compare-tag.r { right: 10px; }

/* 处理中骨架 (design.md: shimmer) */
.processing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: color-mix(in srgb, var(--canvas) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.shimmer-bar { width: 220px; height: 6px; border-radius: 3px; background: var(--fill-secondary); overflow: hidden; }
.shimmer-bar span { display: block; height: 100%; width: 0; background: var(--btn-primary-bg); border-radius: 3px; transition: width 400ms var(--ease); }
.processing p { font-size: 14px; font-weight: 600; }

.stage-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* 右：参数面板 */
.panel { align-self: start; position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; }
.panel-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel-desc { font-size: 13px; color: var(--text-sub); line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text-strong); display: flex; justify-content: space-between; }
.field-label span { font-weight: 500; color: var(--text-sub); }
.textarea {
  width: 100%; min-height: 96px; resize: vertical;
  border-radius: 12px; border: 1px solid var(--group-divider);
  background: var(--fill-secondary); padding: 10px 12px; font-size: 14px; line-height: 1.5;
  outline: none; transition: border-color var(--dur) ease-out;
}
.textarea:focus { border-color: var(--blue); }
.input { min-height: 40px; border-radius: 10px; border: 1px solid var(--group-divider); background: var(--fill-secondary); padding: 0 12px; font-size: 14px; outline: none; }
.input:focus { border-color: var(--blue); }

/* 分段控件 (.apple-segmented-group) */
.segmented { display: flex; padding: 2px; border-radius: 9px; background: rgba(120,120,128,0.12); }
.segmented button { flex: 1; min-height: 30px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text); transition: background var(--dur) ease-out; }
.segmented button.active { background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04); }
@media (prefers-color-scheme: dark) { .segmented { background: rgba(120,120,128,0.24); } .segmented button.active { background: #636366; color: #fff; } }

/* 选项胶囊网格 (.spec-chip) */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--fill-secondary); font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) ease-out;
}
.option:active { transform: scale(0.96); }
.option.active { background: color-mix(in srgb, var(--blue) 14%, transparent); color: #0051A8; border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.option-more { color: #0051A8; background: transparent; }
@media (prefers-color-scheme: dark) { .option.active, .option-more { color: var(--blue); } }
.swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--glass-border); }
.swatch.active { box-shadow: 0 0 0 2px var(--blue); }

.range { width: 100%; accent-color: var(--blue); }

.cost-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-sub); }
.cost-row strong { color: var(--text-strong); font-size: 15px; }

.notice { font-size: 12px; line-height: 1.6; color: var(--text-sub); padding: 10px 12px; border-radius: 10px; background: var(--fill-secondary); }
.notice.warn { background: rgba(255, 149, 0, 0.12); color: #B25E00; }
.notice.cost-alert { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
@media (prefers-color-scheme: dark) { .notice.warn { color: #FFB340; } }

.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat { padding: 10px; border-radius: 10px; background: var(--fill-secondary); text-align: center; }
.stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.stat small { font-size: 11px; color: var(--text-sub); }

/* ---------- 下方介绍区 ---------- */
.section { max-width: 1440px; margin: 0 auto; padding: 32px 20px 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.section-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-strong); }
.section-head p { font-size: 12px; color: var(--text-sub); font-weight: 500; }

/* Bento 磁贴：首页同款图片底 + 顶部可读性暗场 */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bento-card {
  display: block; color: var(--text-on-image); text-decoration: none;
  position: relative; height: 180px; border-radius: 14px; overflow: hidden; text-align: left;
  border: 1px solid rgba(255,255,255,0.8); border-top-color: #fff;
  box-shadow: 0 3px 10px -2px rgba(0,0,0,0.05);
  transition: transform var(--dur) var(--ease);
  background: #000;
}
.bento-card:active { transform: scale(0.975); }
.bento-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bento-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 52%; z-index: 1; background: linear-gradient(to bottom, rgba(7,9,13,0.72) 0%, rgba(7,9,13,0.48) 32%, rgba(7,9,13,0.22) 62%, rgba(7,9,13,0.06) 82%, rgba(7,9,13,0) 100%); }
.bento-text { position: relative; z-index: 2; padding: 10px 12px; color: var(--text-on-image); }
.bento-text b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.bento-text small { display: block; font-size: 11px; opacity: 0.85; margin-top: 2px; }
.bento-card .chip { position: absolute; z-index: 2; right: 10px; bottom: 10px; background: rgba(0,0,0,0.6); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.25); }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.value { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.value h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; color: var(--text-strong); line-height: 1.45; }
.value p { font-size: 13px; color: var(--text-sub); line-height: 1.65; }

.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.faq-item { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.faq-item h3 { font-size: 15px; font-weight: 700; color: var(--text-strong); line-height: 1.45; }
.faq-item p { font-size: 13px; color: var(--text-sub); line-height: 1.65; }

/* ---------- 页脚 ---------- */
.footer { max-width: 1440px; margin: 32px auto 0; padding: 20px 20px 36px; border-top: 1px solid var(--group-divider); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--text-sub); }
.footer strong { color: var(--text); font-size: 13px; }
.footer-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; line-height: 1.6; }
.beian-link { color: var(--text-sub); text-decoration: none; transition: color 140ms ease; }
.beian-link:hover { color: var(--blue); text-decoration: underline; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links button { color: var(--text-sub); font-size: 12px; }
.footer-links button:hover { color: var(--blue); }

/* ---------- 弹层 ---------- */
.sheet-mask { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.38); display: none; align-items: center; justify-content: center; padding: 20px; }
.sheet-mask.show { display: flex; animation: fade 160ms ease-out; }
.sheet { width: min(520px, 100%); max-height: 86vh; overflow: auto; padding: 20px; animation: rise 220ms var(--ease); }
.sheet.sheet-wide { width: min(680px, 100%); }
.sheet h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; color: var(--text-strong); }
.sheet-body { font-size: 14px; line-height: 1.75; color: var(--text); }
.sheet-body p + p { margin-top: 10px; }
.sheet-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 处理记录 / 我的作品弹窗 ---------- */
.modal-tabs { margin-bottom: 14px; }
.history-empty { text-align: center; padding: 36px 16px; color: var(--text-sub); font-size: 13px; }
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 2px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--fill-secondary);
  border: 1px solid var(--group-divider);
}
.history-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.history-thumb {
  width: 52px; height: 52px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-meta { min-width: 0; flex: 1; }
.history-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-title-row b { font-size: 14px; color: var(--text-strong); }
.history-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.history-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.status-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.status-ok { background: rgba(52, 199, 89, 0.16); color: #136F2D; }
.status-run { background: rgba(0, 122, 255, 0.15); color: #0051A8; }
.status-fail { background: rgba(255, 59, 48, 0.14); color: #B81D13; }
@media (prefers-color-scheme: dark) {
  .status-ok { color: #4ADE80; }
  .status-run { color: #60A5FA; }
  .status-fail { color: #F87171; }
}

.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 2px; }
.work-card {
  border-radius: 12px; overflow: hidden; background: var(--fill-secondary);
  border: 1px solid var(--group-divider); display: flex; flex-direction: column;
}
.work-thumb { aspect-ratio: 1 / 1; width: 100%; background: rgba(0,0,0,0.08); position: relative; overflow: hidden; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.work-info-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.work-info-top b { color: var(--text-strong); font-weight: 700; }
.work-info-top span { color: var(--text-sub); font-size: 11px; }
.work-btns { display: flex; gap: 6px; }
.work-btns .btn-sm { flex: 1; padding: 0 8px; min-height: 28px; font-size: 12px; }

/* ---------- 处理点充值与账单中心 ---------- */
.recharge-summary {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: var(--fill-secondary);
  margin-bottom: 14px;
}
.recharge-balance { display: flex; align-items: baseline; gap: 6px; }
.recharge-balance strong { font-size: 24px; font-weight: 800; color: var(--text-strong); }
.recharge-balance span { font-size: 12px; color: var(--text-sub); }
.recharge-rule { font-size: 12px; color: var(--text-sub); }
.link-btn { font-size: 12px; font-weight: 600; color: #0051A8; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .link-btn { color: #60A5FA; } }

.recharge-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.pkg-card {
  position: relative; padding: 12px 8px 10px; border-radius: 12px;
  background: var(--fill-secondary); border: 1.5px solid transparent;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
  transition: border-color var(--dur) ease-out, background var(--dur) ease-out, transform var(--dur) var(--ease);
}
.pkg-card:hover { background: var(--fill-secondary-pressed); }
.pkg-card:active { transform: scale(0.97); }
.pkg-card.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}
.pkg-tag {
  position: absolute; top: -8px; right: 6px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: var(--btn-primary-bg); color: #fff;
}
.pkg-points { font-size: 16px; font-weight: 800; color: var(--text-strong); margin-top: 2px; }
.pkg-sub { font-size: 11px; color: var(--text-sub); line-height: 1.3; }
.pkg-price { font-size: 15px; font-weight: 800; color: #0051A8; margin-top: 4px; }
@media (prefers-color-scheme: dark) { .pkg-price { color: #60A5FA; } }

.pay-channel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pay-channel-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--fill-secondary); border: 1.5px solid transparent;
  font-size: 13px; font-weight: 700; color: var(--text-strong);
}
.pay-channel-btn.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: #0051A8;
}
@media (prefers-color-scheme: dark) { .pay-channel-btn.active { color: #60A5FA; } }
.pay-channel-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

.pay-checkout {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border-radius: 12px; background: var(--fill-secondary); border: 1px solid var(--group-divider);
}
.qr-box {
  width: 148px; height: 148px; border-radius: 12px; background: #fff; padding: 8px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.alipay-badge-box {
  width: 112px; height: 112px; border-radius: 12px;
  background: linear-gradient(180deg, #1677FF 0%, #0958D9 100%);
  color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.22);
  font-size: 11px; font-weight: 700;
}
.pay-copy { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.pay-copy h4 { font-size: 15px; font-weight: 800; color: var(--text-strong); }
.pay-copy p { font-size: 12px; color: var(--text-sub); line-height: 1.55; margin: 0 !important; }
.pay-copy-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pay-copy-actions a.btn { text-decoration: none; }

.ledger-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--group-divider); }
.ledger-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: var(--fill-secondary); }
.ledger-row span { color: var(--text-sub); }
.ledger-row b.plus { color: #136F2D; }
.ledger-row b.minus { color: var(--text-strong); }
@media (prefers-color-scheme: dark) { .ledger-row b.plus { color: #4ADE80; } }

.toast { position: fixed; left: 50%; bottom: 32px; z-index: 120; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 12px; background: rgba(28,28,30,0.88); color: #fff; font-size: 14px; font-weight: 600; transition: opacity 180ms ease, transform 180ms var(--ease); max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .workbench { grid-template-columns: 220px minmax(0, 1fr); }
  .panel { grid-column: 1 / -1; position: static; }
  .bento { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 0 14px; }
  .brand small { display: none; }
  .workbench { grid-template-columns: 1fr; padding: 12px 14px; }
  .tool-rail { position: static; max-height: none; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .tool-rail .group-label { display: none; }
  .tool-rail .inset-group { display: contents; }
  .tool-rail .cell { flex-shrink: 0; width: auto; border-radius: var(--radius-pill); background: var(--group-bg); padding: 6px 12px 6px 6px; }
  .tool-rail .cell::after { display: none; }
  .tool-rail .cell.active { background: color-mix(in srgb, var(--blue) 16%, var(--group-bg)); }
  .canvas-card { min-height: 360px; }
  .dropzone { flex-wrap: wrap; min-height: auto; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card { height: 135px; }
  .values { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .recharge-grid { grid-template-columns: repeat(2, 1fr); }
  .pay-checkout { flex-direction: column; text-align: center; }
  .pay-copy-actions { justify-content: center; }
  .history-item { flex-direction: column; align-items: flex-start; }
  .history-actions { width: 100%; justify-content: flex-end; }
  .section { padding: 24px 14px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:active, .option:active, .bento-card:active { transform: none; }
}
