/* ============================================================
   绿幕数字人 · 工作台
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f5f8f5;
  --surface: #ffffff;
  --surface-sub: #f7faf7;
  --ink: #0f1c15;
  --ink-2: #33443a;
  --muted: #728177;
  --muted-2: #8d9a92;
  --line: #e3eae4;
  --line-strong: #d2ded5;
  --brand: #0b7a4b;
  --brand-strong: #075f3a;
  --brand-bright: #12a065;
  --brand-soft: #eaf6ef;
  --brand-softer: #f2faf5;
  --mint: #c9f0d8;
  --danger: #b42318;
  --shadow-card: 0 1px 2px rgba(15, 28, 21, .04), 0 24px 60px -40px rgba(15, 28, 21, .35);
  --shadow-pop: 0 1px 2px rgba(15, 28, 21, .06), 0 20px 40px -24px rgba(15, 28, 21, .3);
  --ring: 0 0 0 3px rgba(11, 122, 75, .12);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 50% -280px, rgba(18, 160, 101, .14), transparent 72%),
    linear-gradient(180deg, #f7faf7 0%, var(--bg) 36%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--mint); }

[hidden] { display: none !important; }

img { max-width: 100%; }

button { font: inherit; color: inherit; }

a { color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 120;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 14px; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
.btn .icon { width: 15px; height: 15px; }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none !important; filter: none !important; box-shadow: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #0d8a55 0%, #0a7047 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -10px rgba(9, 105, 66, .75);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 22px -10px rgba(9, 105, 66, .65);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(.98); }

.btn-secondary {
  color: var(--ink-2);
  background: #fff;
  border-color: var(--line-strong);
}
.btn-secondary:hover:not(:disabled) { background: #fbfdfb; border-color: #b9cec0; }

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

.btn-sm { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.btn-sm .icon { width: 13px; height: 13px; }
.btn-lg { height: 48px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- 顶部导航 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 250, 247, .82);
  border-bottom: 1px solid rgba(15, 28, 21, .07);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.topbar-inner {
  max-width: 1240px;
  height: 68px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 10px;
  flex: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 8px 16px -10px rgba(11, 122, 75, .8);
  transition: transform .2s ease;
}
.brand:hover .brand-mark { transform: translateY(-1px) rotate(-2deg); }
.brand-mark svg { display: block; width: 100%; height: 100%; border-radius: 9px; }
.brand-text {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--ink);
}
.brand-chip {
  margin-left: 1px;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.3;
}

/* 右上角「任务中心」入口：单页里唯一的功能入口 */
.task-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 28, 21, .04);
  transition: border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.task-entry:hover {
  border-color: #b9cec0;
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -12px rgba(11, 122, 75, .55);
}
.task-entry.is-active {
  border-color: rgba(11, 122, 75, .32);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.task-entry > .icon { width: 15px; height: 15px; color: var(--brand); }

.task-entry-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.account { position: relative; }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 9px 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.account-btn:hover { background: #fff; border-color: var(--line); }
.account-avatar .icon { width: 14px; height: 14px; }
.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 700;
  flex: none;
}
.account-name { font-size: 12.5px; color: var(--ink-2); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .icon { width: 13px; height: 13px; color: var(--muted); transition: transform .18s ease; }
.account-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  animation: popIn .16s ease;
}
.account-menu-head { padding: 7px 9px 8px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.account-menu-head strong { display: block; font-size: 12.5px; font-weight: 600; }
.account-menu-head span { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10.5px; }
.account-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover { background: #f1f6f2; }

/* ---------- 生成页 ---------- */

main { flex: 1 0 auto; }

.view {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  padding: 58px 0 38px;
  text-align: center;
}

.hero h1 {
  max-width: 860px;
  margin: 0 auto 14px;
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 680;
  line-height: 1.18;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.marker {
  color: var(--brand-strong);
  background-image: linear-gradient(180deg, transparent 63%, rgba(24, 176, 111, .22) 63%, rgba(24, 176, 111, .22) 92%, transparent 92%);
  padding: 0 .04em;
}

/* ---------- 工作台 ---------- */

.studio {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.studio-body {
  display: grid;
  grid-template-columns: 500px minmax(0, 1fr);
  gap: 34px;
  padding: 24px 26px 26px;
}

/* 画布高度跟随右侧表单，左右底边对齐 */
.canvas-col { min-width: 0; display: flex; }

.canvas {
  position: relative;
  flex: 1;
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #f3f9f4 52%, #e9f3ec 100%);
  box-shadow: inset 0 1px 0 #fff;
  overflow: hidden;
}
.canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(11, 122, 75, .14) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .45;
  -webkit-mask-image: radial-gradient(78% 68% at 50% 42%, #000 0%, transparent 100%);
  mask-image: radial-gradient(78% 68% at 50% 42%, #000 0%, transparent 100%);
  pointer-events: none;
}
.canvas.is-empty {
  border-style: dashed;
  border-color: #c6d9cc;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.canvas.is-empty:hover,
.canvas.is-dragging {
  border-color: var(--brand);
  background: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #f1faf4 52%, #e6f4ea 100%);
}
.canvas:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(11, 122, 75, .16); }

.canvas-content { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; }

.canvas-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(38px) saturate(1.08);
  opacity: .22;
  transform: scale(1.14);
  pointer-events: none;
}

.canvas-photo-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-photo-box {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.canvas-photo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #eef4ef;
  cursor: zoom-in;
}
.canvas-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.canvas-photo:focus-visible { outline: none; }
.canvas-photo:focus-visible img { outline: 2px solid rgba(11, 122, 75, .55); outline-offset: -2px; }

.canvas-photo-box .canvas-tools { opacity: 0; transition: opacity .18s ease; }
.canvas-photo-box.is-ready .canvas-tools { opacity: 1; }

.canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
}
.canvas-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 14px 30px -20px rgba(11, 122, 75, .6);
}
.canvas-icon .icon { width: 25px; height: 25px; }
.canvas-empty strong { font-size: 14px; font-weight: 600; }
.canvas-hint { color: var(--muted); font-size: 11.5px; }

.canvas-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.canvas-tool {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-2);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .25);
}
.canvas-tool:hover { color: var(--brand); border-color: var(--line-strong); transform: scale(1.05); }
.canvas-tool:active { transform: scale(.94); }
.canvas-tool.is-danger:hover {
  color: #c0392b;
  border-color: rgba(192, 57, 43, .35);
  background: #fff;
}
.canvas-tool:focus-visible { outline: 2px solid rgba(11, 122, 75, .4); outline-offset: 2px; }
.canvas-tool:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.canvas-tool .icon { width: 14px; height: 14px; }

.canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: rgba(246, 251, 247, .62);
  color: var(--brand-strong);
  font-size: 12px;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.canvas-overlay small { color: var(--muted); font-size: 11px; }
.canvas-overlay-text {
  padding: 8px 15px;
  border: 1px solid rgba(11, 122, 75, .12);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 24px -16px rgba(4, 70, 40, .55);
}
.canvas-overlay.is-error {
  pointer-events: none;
  padding: 22px;
  text-align: center;
  background: rgba(255, 250, 248, .88);
  color: #9a3b2c;
}
.canvas-overlay.is-error .btn { pointer-events: auto; }
.canvas-error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.canvas-error-text {
  max-width: 240px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.6;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(11, 122, 75, .18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}



/* ---------- 表单 ---------- */

.form-col { display: flex; flex-direction: column; min-width: 0; }

.field { margin-bottom: 16px; }
.field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input::placeholder { color: #9aa69f; }
.input:hover { border-color: #cddbd2; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.duration {
  position: relative;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.duration:hover { border-color: #c6d9cc; background: #fcfdfc; }
.duration .d-label { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.duration .d-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.duration.is-selected {
  border-color: var(--brand);
  background: var(--brand-softer);
  box-shadow: 0 0 0 3px rgba(11, 122, 75, .1);
}
.duration.is-selected .d-label { color: var(--brand-strong); }
.d-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .16s ease, transform .16s ease;
}
.d-check .icon { width: 8px; height: 8px; }
.duration.is-selected .d-check { opacity: 1; transform: scale(1); }

.duration-custom .d-meta { color: var(--muted); }

.duration-custom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfb;
}
.duration-custom-bar[hidden] { display: none; }
.dc-label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.minute-field { display: inline-flex; align-items: center; gap: 5px; }
.minute-input {
  width: 62px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.minute-input::-webkit-outer-spin-button,
.minute-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.minute-input { appearance: textfield; -moz-appearance: textfield; }
.minute-input:hover { border-color: #cddbd2; }
.minute-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.minute-unit { color: var(--muted); font-size: 12px; }
.dc-meta { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }

.presenter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.presenter {
  position: relative;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.presenter:hover { border-color: #c6d9cc; background: #fcfdfc; }
.presenter .p-label { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.presenter .p-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.presenter.is-selected {
  border-color: var(--brand);
  background: var(--brand-softer);
  box-shadow: 0 0 0 3px rgba(11, 122, 75, .1);
}
.presenter.is-selected .p-label { color: var(--brand-strong); }
.presenter.is-selected::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

#createBtn { margin-top: 2px; }

.fineprint { margin: 10px 0 0; color: var(--muted-2); font-size: 10.5px; text-align: center; line-height: 1.6; }

/* ---------- 状态 ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.running { border-color: #d6e7ff; background: #eff6ff; color: #175cd3; }
.status.queued { border-color: #f5e7bc; background: #fffaeb; color: #9a6700; }
.status.succeeded { border-color: #c7f0d8; background: #ecfdf3; color: #067647; }
.status.failed { border-color: #fbd5d1; background: #fef3f2; color: #b42318; }
.status.canceled { border-color: #e4e7e7; background: #f5f7f7; color: #667085; }
.status.running i { animation: pulse 1.8s ease infinite; }

/* ---------- 任务中心（右上角抽屉） ---------- */

.task-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #f3f6f3; }
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.tab span {
  min-width: 15px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(15, 28, 21, .06);
  color: var(--muted-2);
  font-size: 9.5px;
  text-align: center;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 28, 21, .08); }
.tab.is-active span { background: var(--brand-soft); color: var(--brand-strong); }

.refresh-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }
.refresh-note .icon { width: 12px; height: 12px; }

.job-list { padding: 2px 18px 6px; }

.job-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
}
.job-more[hidden] { display: none; }
.job-more .icon { width: 12px; height: 12px; color: var(--muted-2); }
.job-more.is-end { color: var(--muted-2); }

.job-card { padding: 17px 2px; border-bottom: 1px solid var(--line); }
.job-card:last-child { border-bottom: 0; }
.job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.job-title-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.job-title-wrap h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-side { display: flex; align-items: center; gap: 10px; flex: none; }
.job-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.job-side .btn { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; }
.job-side .btn .icon { width: 13px; height: 13px; }

.job-media { display: flex; gap: 10px; margin-top: 12px; }
.job-media-item {
  width: 66px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.job-media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef3ef;
  transition: border-color .16s ease;
}
.job-media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.job-media-item:hover .job-media-thumb { border-color: var(--brand); }
.job-media-item:focus-visible .job-media-thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
.job-media-item.is-video .job-media-thumb {
  border-color: var(--brand);
  background: linear-gradient(135deg, #14a46a, #0b7a4b);
  color: #fff;
}
.job-media-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.job-media-play {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(7, 19, 13, .55);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.job-media-play .icon {
  width: 10px;
  height: 10px;
  margin-left: 1px;
  color: #fff;
}
.job-media-label {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.job-media-item:hover .job-media-label { color: var(--brand-strong); }
.job-media-download {
  flex: none;
  align-self: flex-start;
  height: 30px;
  margin-top: 18px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
}
.job-media-download .icon { width: 13px; height: 13px; }

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}
.job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-meta .icon { width: 11px; height: 11px; color: var(--muted-2); }
.job-meta b { color: var(--ink-2); font-weight: 600; }

.job-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.bar { flex: 1; height: 6px; border-radius: 4px; background: #eef2ef; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #12a065, #0b7a4b); transition: width .6s ease; }
.job-card.is-failed .bar i { background: #f04438; }
.job-pct { width: 34px; color: var(--muted); font-size: 10.5px; text-align: right; font-variant-numeric: tabular-nums; }

.job-error {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #fbd5d1;
  border-radius: 9px;
  background: #fef3f2;
  color: #b42318;
  font-size: 11px;
  line-height: 1.6;
}
.job-error .icon { width: 13px; height: 13px; margin-top: 1px; flex: none; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 56px 24px;
  text-align: center;
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.empty-icon .icon { width: 23px; height: 23px; }
.empty-state strong { font-size: 13.5px; font-weight: 600; }
.empty-state p { max-width: 320px; margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.empty-state .btn { margin-top: 10px; }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 48px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 任务中心抽屉 ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 23, 16, .38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}

.drawer-panel {
  position: absolute;
  outline: none;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -40px 0 90px -50px rgba(8, 30, 20, .55);
  animation: drawerIn .26s cubic-bezier(.22, .61, .36, 1);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head-main { flex: 1; min-width: 0; }

.drawer-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -.025em;
}
.drawer-count {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid #d6e7ff;
  border-radius: 999px;
  background: #eff6ff;
  color: #175cd3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.drawer-close {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.drawer-close:hover { background: #f2f5f2; border-color: var(--line-strong); color: var(--ink); }
.drawer-close .icon { width: 14px; height: 14px; }

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 22px 26px;
}

.drawer-body .task-panel { border-radius: 14px; }
.drawer-body .task-toolbar { padding: 11px 12px; }
.drawer-body .job-list { padding: 0 14px 4px; }
.drawer-body .job-more { padding: 12px 14px; }
.drawer-body .job-card { padding: 15px 0; }
.drawer-body .job-head { flex-direction: column; gap: 8px; }
.drawer-body .job-side { width: 100%; justify-content: space-between; }

.drawer-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .36);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.footer-brand svg { width: 22px; height: 22px; border-radius: 6px; }
.footer-note { color: var(--muted-2); }

/* 版权 + 备案号是同一档「主体信息」，包成一组摆在左端；协议入口留在右端。
   不分组的话 space-between 会把三样东西摊成「左 / 中 / 右」，中间那一样像排版掉了队。 */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
}
.footer-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
/* 备案号必须能点：链到工信部政务服务平台。与协议入口同档（muted、不带下划线），
   只靠 hover 变色 —— 页脚不该出现比版权行更抢眼的元素。 */
.footer-icp,
.footer-links a {
  color: var(--muted-2);
  text-decoration: none;
}
.footer-icp:hover,
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* ---------- 模态 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 23, 16, .44);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 40px 80px -30px rgba(8, 30, 20, .45);
  animation: modalIn .22s ease;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2f5f2;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: #e8eee9; color: var(--ink); }
.modal-close .icon { width: 14px; height: 14px; }
.modal-mark { display: block; width: 40px; height: 40px; margin-bottom: 14px; }
.modal-mark svg { width: 40px; height: 40px; border-radius: 11px; display: block; }
.modal-card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 10px;
  background: #f2f6f3;
}
.auth-tabs button {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.auth-tabs button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 28, 21, .08); }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.auth-code-row { display: flex; gap: 8px; margin-bottom: 10px; }
.auth-code-row .input { flex: 1; min-width: 0; }
.auth-code-btn { height: 42px; flex: none; padding: 0 12px; font-size: 11.5px; }
.auth-hint {
  margin: 0 0 10px;
  padding: 7px 9px;
  border: 1px solid #d7ecdf;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 10.5px;
  line-height: 1.55;
}
.auth-hint code { font-weight: 700; letter-spacing: .09em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-error { min-height: 17px; margin: 2px 0 8px; color: var(--danger); font-size: 11px; line-height: 1.5; }
.auth-submit { height: 44px; }
.auth-note { margin: 9px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; text-align: center; }

/* ---------- 图片放大预览 ---------- */

.preview {
  --preview-w: min(720px, 94vw);
  --preview-h: min(86vh, 900px);
  position: fixed;
  inset: 0;
  z-index: 105;
  display: grid;
  place-items: center;
  padding: 24px;
}
.preview[hidden] { display: none; }
.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 15, 11, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.preview-card {
  position: relative;
  z-index: 1;
  width: var(--preview-w);
  height: var(--preview-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: #0d1712;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .85);
  animation: modalIn .2s ease;
}
.preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 18px;
  color: #dcebe2;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.preview-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: auto;
  font-size: 12.5px;
  font-weight: 600;
}
.preview-hint {
  color: rgba(220, 235, 226, .5);
  font-size: 10.5px;
  white-space: nowrap;
}
.preview-close {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .05);
  color: #e6f2ea;
  cursor: pointer;
  transition: background .16s ease;
}
.preview-close:hover { background: rgba(255, 255, 255, .16); }
.preview-close .icon { width: 14px; height: 14px; }
.preview-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background: radial-gradient(70% 60% at 50% 45%, rgba(20, 164, 106, .14), transparent 72%);
}
.preview-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(var(--preview-h) - 88px);
  border-radius: 6px;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  transition: transform .18s ease;
  will-change: transform;
}
.preview.is-zoomed .preview-stage img { cursor: grab; transition: none; }
.preview.is-panning .preview-stage img { cursor: grabbing; }
.preview-stage img[hidden] { display: none; }
.preview-stage video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(var(--preview-h) - 88px);
  border-radius: 6px;
  background: #000;
}
.preview-stage video[hidden] { display: none; }
.preview.is-video .preview-stage { padding: 12px; background: #000; }

/* ---------- 悬浮提示（替代原生 title） ---------- */

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 115;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #10231a;
  color: #f2fbf6;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px) scale(.97);
  transform-origin: var(--tip-origin, 50% 0%);
  box-shadow: 0 12px 26px -16px rgba(6, 30, 19, .65), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: opacity .13s ease, transform .16s cubic-bezier(.2, .8, .3, 1);
}
.tip[hidden] { display: none; }
.tip.is-in { opacity: 1; transform: none; }
.tip::after {
  content: '';
  position: absolute;
  left: var(--tip-arrow, 50%);
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 1px;
  background: #10231a;
  transform: rotate(45deg);
}
.tip.is-above::after { bottom: -3px; }
.tip.is-below::after { top: -3px; }

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(440px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 10px;
  background: #10231a;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .45);
  animation: toastIn .24s ease;
}
.toast.is-leaving { animation: toastOut .2s ease forwards; }
.toast .icon { width: 14px; height: 14px; color: #5fe3a5; flex: none; }
.toast.is-error .icon { color: #ff9b8f; }

/* ---------- 动画 ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawerIn { from { opacity: .4; transform: translateX(36px); } to { opacity: 1; transform: none; } }


/* ---------- 积分账户 / 充值 ---------- */

.wallet-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #cfe3d7;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.wallet-entry:hover { background: #e2f3e9; border-color: #b5d4c1; box-shadow: 0 2px 8px -4px rgba(15, 28, 21, .25); }
.wallet-entry.is-active { background: #dff3e8; border-color: #a9d3b9; }
a.task-entry { text-decoration: none; }

.wallet-card {
  max-width: 760px;
  max-height: min(88vh, 820px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
}
.wallet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 62px 16px 28px;
}
.wallet-head h2 { margin: 0 0 4px; font-size: 20px; }
.wallet-rate { margin: 0; color: var(--muted); font-size: 11px; }
.wallet-balance-box { text-align: right; flex: none; }
.wallet-balance-box span { display: block; color: var(--muted-2); font-size: 10px; }
.wallet-balance-box strong {
  display: block;
  margin-top: 2px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.wallet-tabs {
  display: flex;
  gap: 26px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.wallet-tabs button {
  position: relative;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.wallet-tabs button:hover { color: var(--ink); }
.wallet-tabs button.is-active { color: var(--ink); font-weight: 600; }
.wallet-tabs button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.wallet-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fff1e6;
  color: #a45a00;
  font-size: 9px;
  font-weight: 700;
  vertical-align: 1px;
}
.wallet-card.is-pay .wallet-tabs, #walletModal.is-pay .wallet-tabs { display: none; }
.wallet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 26px; }

.recharge-copy p { margin: 0 0 15px; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.recharge-copy b { color: var(--ink-2); }

.credit-packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.credit-pack {
  position: relative;
  min-width: 0;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.credit-pack:hover { border-color: #bcd4c3; transform: translateY(-1px); box-shadow: 0 8px 18px -14px rgba(15, 28, 21, .45); }
.credit-pack.is-selected {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f8fdfa 0%, #f0faf4 100%);
  box-shadow: 0 0 0 3px rgba(11, 122, 75, .08);
}
.pack-credits { display: flex; align-items: baseline; gap: 4px; }
.pack-credits strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pack-credits em { font-style: normal; color: var(--muted); font-size: 10px; }
.pack-price {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pack-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: none;
  place-items: center;
}
.pack-check .icon { width: 10px; height: 10px; }
.credit-pack.is-selected .pack-check { display: grid; }
.credit-pack.is-custom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 36px 10px 14px;
}
.credit-pack.is-custom .pack-credits { flex: 1; }
.credit-pack.is-custom .pack-credits strong { font-size: 13px; letter-spacing: 0; }
.credit-pack.is-custom .pack-credits em { font-size: 10px; }
.credit-pack.is-custom .pack-price { margin: 0; }

.custom-credit-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-sub);
}
.custom-credit-field label { color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.custom-credit-input { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; }
.custom-credit-input input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.custom-credit-input input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.custom-credit-input span { flex: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.custom-credit-hint { color: var(--muted-2); font-size: 10px; }

.recharge-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.recharge-channel.is-off { background: #fafbfa; }
.channel-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: #1677ff;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.recharge-channel.is-off .channel-logo { background: #c8d2cb; }
.channel-body { flex: 1; min-width: 0; }
.channel-body strong { display: block; font-size: 12px; }
.channel-body span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.channel-state {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 600;
}
.recharge-channel.is-off .channel-state { background: #f0f2f0; color: var(--muted); }

.recharge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid #dfeee4;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbf8 0%, #f2f9f4 100%);
}
.recharge-total span { display: block; color: var(--muted); font-size: 10px; }
.recharge-total strong { display: block; margin-top: 1px; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recharge-summary .btn { min-width: 132px; height: 42px; }
.recharge-error { min-height: 16px; margin: 7px 2px 0; color: var(--muted-2); font-size: 11px; line-height: 1.5; }
.recharge-error.is-error { color: var(--danger); }
.recharge-note { margin: 4px 2px 0; color: var(--muted-2); font-size: 10px; line-height: 1.65; }

.wallet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.wallet-toolbar-note { color: var(--muted-2); font-size: 10px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.filter-chip {
  height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.filter-chip:hover { background: #f2f6f3; color: var(--ink); }
.filter-chip.is-active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.wallet-count { flex: none; color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.bill-list, .ledger-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bill-row, .ledger-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.bill-row:last-child, .ledger-row:last-child { border-bottom: 0; }
.bill-main, .ledger-main { flex: 1; min-width: 0; }
.bill-title { display: flex; align-items: center; gap: 8px; }
.bill-title strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-status { padding: 2px 7px; border-radius: 999px; font-size: 9.5px; line-height: 1.5; }
.bill-status.pending { background: #fff4e5; color: #9a5b00; }
.bill-status.paid { background: var(--brand-soft); color: var(--brand-strong); }
.bill-status.manual { background: #eef2f8; color: #3b5b86; }
.bill-status.expired, .bill-status.canceled { background: #f1f3f1; color: var(--muted); }
.bill-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; color: var(--muted); font-size: 10px; }
.bill-amount { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-no { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.bill-side { flex: none; }
.bill-paid { color: var(--muted-2); font-size: 9.5px; white-space: nowrap; }

.ledger-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 124px;
  gap: 12px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfb;
  color: var(--muted-2);
  font-size: 9.5px;
}
.ledger-head span:nth-child(2),
.ledger-head span:nth-child(3) { text-align: right; }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 124px; }
.ledger-record { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ledger-kind {
  flex: none;
  width: 62px;
  padding: 3px 6px;
  border-radius: 7px;
  text-align: center;
  font-size: 9.5px;
  font-weight: 600;
}
.ledger-kind.recharge { background: var(--brand-soft); color: var(--brand-strong); }
.ledger-kind.consume { background: #eef2f8; color: #3b5b86; }
.ledger-kind.refund { background: #fff4e5; color: #9a5b00; }
.ledger-kind.adjust { background: #f1f3f1; color: var(--muted); }
.ledger-main { flex: 1; min-width: 0; }
.ledger-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.ledger-main span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9.5px; }
.ledger-delta-col { min-width: 0; text-align: right; }
.ledger-delta { display: block; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ledger-delta.is-in { color: var(--brand-strong); }
.ledger-delta.is-out { color: var(--ink-2); }
.ledger-money { display: block; margin-top: 1px; color: var(--muted-2); font-size: 9.5px; }
.ledger-balance-col { min-width: 0; padding-left: 14px; border-left: 1px solid #f0f4f1; text-align: right; }
.ledger-balance-col strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ledger-balance-col span { display: block; margin-top: 1px; color: var(--muted-2); font-size: 9.5px; }
.ledger-kind-inline { display: none; font-style: normal; }

.wallet-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 46px 0; color: var(--muted); font-size: 11.5px; }
.wallet-empty { padding: 38px 16px; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; color: var(--muted); }
.wallet-empty .icon { width: 26px; height: 26px; color: var(--muted-2); }
.wallet-empty strong { display: block; margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.wallet-empty p { max-width: 300px; margin: 5px auto 10px; font-size: 11px; line-height: 1.65; }

.pay-pane { max-width: 430px; margin: 0 auto; }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-back { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.pay-back:hover { color: var(--ink); }
.pay-status { padding: 3px 8px; border-radius: 999px; background: #fff4e5; color: #9a5b00; font-size: 10px; font-weight: 600; }
.pay-status.is-ok { background: var(--brand-soft); color: var(--brand-strong); }
.pay-status.is-expired { background: #f1f3f1; color: var(--muted); }
.pay-summary { margin: 14px 0 16px; text-align: center; }
.pay-summary span { display: block; color: var(--muted); font-size: 10.5px; }
.pay-summary strong { display: block; margin-top: 2px; font-size: 34px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pay-summary em { font-style: normal; color: var(--muted); font-size: 10.5px; }
.pay-qr {
  width: 300px;
  height: 356px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.pay-qr iframe { display: block; width: 100%; height: 100%; border: 0; }
.pay-hint { margin: 9px 0 10px; color: var(--muted); font-size: 10.5px; text-align: center; }
.pay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pay-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 15px; color: var(--muted-2); font-size: 9.5px; }
.pay-foot b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pay-order-no code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.pay-error { min-height: 15px; margin: 7px 0 0; color: var(--danger); font-size: 10.5px; text-align: center; }
.pay-result { padding: 22px 14px; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.pay-result .icon { width: 34px; height: 34px; color: var(--brand); }
.pay-result.is-expired .icon { color: var(--muted-2); }
.pay-result strong { display: block; margin-top: 7px; font-size: 15px; }
.pay-result p { margin: 5px 0 12px; color: var(--muted); font-size: 10.5px; }
.pay-mock { padding: 18px 16px; border: 1px dashed #e3bc74; border-radius: 14px; background: #fffaf0; text-align: center; }
.pay-mock-badge { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #fff0d6; color: #98600a; font-size: 9px; font-weight: 700; }
.pay-mock strong { display: block; margin-top: 7px; font-size: 14px; }
.pay-mock p { margin: 5px 0 12px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }


/* ---------- 积分账户独立页 ---------- */

.recharge-page {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 28px 80px;
  flex: 1 0 auto;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11.5px;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color .16s ease;
}
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb-sep { color: var(--muted-2); }
.breadcrumb strong { color: var(--ink-2); font-weight: 600; }
.recharge-page-head { margin-bottom: 14px; }
.recharge-page-title h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.03em;
}
.recharge-page-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.balance-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 17px 22px 16px;
  border: 1px solid #d9eade;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fcf9 0%, #edf8f1 100%);
}
.balance-overview-main { min-width: 0; }
.balance-label { display: block; color: var(--muted); font-size: 10.5px; }
#balanceValue {
  display: block;
  margin-top: 1px;
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}
.balance-recharge-btn { flex: none; min-width: 118px; height: 44px; }

.recharge-tabs { padding: 0; margin-bottom: 18px; background: transparent; }
.recharge-panel {
  min-height: 320px;
  padding: 24px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.recharge-modal-card {
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 820px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
}
.recharge-modal-head {
  flex: none;
  padding: 22px 58px 14px 26px;
  border-bottom: 1px solid var(--line);
}
.recharge-modal-head h2 { margin: 0 0 4px; font-size: 20px; }
.recharge-modal-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.recharge-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 26px 26px; }
.recharge-modal-body .pay-pane { max-width: 430px; margin: 0 auto; }

.page-gate { max-width: 560px; margin: 72px auto 0; padding: 0 24px; }
.page-gate-card {
  padding: 40px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.page-gate-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.page-gate-icon .icon { width: 22px; height: 22px; }
.page-gate-card h2 { margin: 0 0 6px; font-size: 20px; }
.page-gate-card p { margin: 0 auto 18px; max-width: 320px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-gate-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .recharge-page { padding: 20px 16px 50px; }
  .recharge-page-title h1 { font-size: 24px; }
  .balance-overview { flex-wrap: wrap; gap: 12px; padding: 15px 16px; }
  #balanceValue { font-size: 32px; }
  .balance-recharge-btn { height: 40px; min-width: 96px; }
  .recharge-panel { padding: 16px; border-radius: 16px; }
  .recharge-tabs { padding: 0; gap: 18px; }
  .recharge-modal-card { max-width: 100%; max-height: 92vh; border-radius: 16px; }
  .recharge-modal-head { padding: 18px 50px 12px 18px; }
  .recharge-modal-body { padding: 16px 18px 22px; }
  .page-gate { margin-top: 36px; padding: 0 16px; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1200px) {
  .studio-body { grid-template-columns: 420px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 1080px) {
  .studio-body { grid-template-columns: 380px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 1020px) {
  .studio-body { grid-template-columns: 1fr; gap: 24px; }
  .canvas { min-height: 420px; }
}

@media (max-width: 900px) {
  .topbar-inner {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 8px 20px;
  }
  .topbar-actions { gap: 8px; }
  .hero { padding: 42px 0 30px; }
  .studio-body { grid-template-columns: 1fr; gap: 24px; }
  .canvas { min-height: 400px; }
}

@media (max-width: 640px) {
  .view { padding: 0 16px; }
  .topbar-inner { padding: 8px 16px; }
  .footer-inner { padding: 20px 16px; align-items: flex-start; gap: 12px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-legal { width: 100%; align-items: flex-start; }
  .brand-text { font-size: 16px; }
  .brand-chip { display: none; }
  .account-name, .account-btn > .icon { display: none; }
  .account-btn { padding: 0 4px; }
  .hero { padding: 34px 0 26px; }
  .hero h1 { font-size: 27px; letter-spacing: -.02em; }
  .studio { border-radius: 18px; }
  .studio-body { padding: 18px; }
  .canvas { min-height: 360px; }
  .duration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-custom-bar { flex-wrap: wrap; row-gap: 5px; }
  .job-head { flex-direction: column; gap: 6px; }
  .job-side { width: 100%; justify-content: flex-end; }
  .task-toolbar { flex-direction: column; align-items: flex-start; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; justify-content: center; }
  .refresh-note { display: none; }
  .job-list { padding: 2px 14px 6px; }
  .task-entry { padding: 0 9px; gap: 5px; }
  .drawer-panel { border-left: 0; }
  .drawer-head { padding: 18px 16px 13px; }
  .drawer-head h2 { font-size: 18px; }
  .drawer-body { padding: 14px 16px 22px; }
  .drawer-body .job-list { padding: 0 12px 2px; }
  .job-more { padding: 12px; gap: 5px; }
  .modal-card { padding: 22px; }
  .wallet-entry { padding: 0 11px; }
  .wallet-card { max-height: 92vh; border-radius: 16px; }
  .wallet-head { padding: 20px 50px 12px 18px; gap: 10px; }
  .wallet-head h2 { font-size: 18px; }
  .wallet-balance-box strong { font-size: 20px; }
  .wallet-tabs { gap: 18px; padding: 0 18px; }
  .wallet-body { padding: 16px 18px 22px; }
  .credit-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credit-pack.is-custom { grid-column: 1 / -1; }
  .recharge-summary { padding: 11px 13px; }
  .recharge-summary .btn { min-width: 112px; }
  .bill-row, .ledger-row { padding: 11px 12px; gap: 9px; }
  .bill-no { max-width: 130px; }
  .ledger-kind { display: none; }
  .ledger-kind-inline { display: inline; }
  .ledger-head { grid-template-columns: minmax(0, 1fr) 72px 84px; gap: 6px; padding: 8px 12px; font-size: 9px; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) 72px 84px; gap: 6px; }
  .ledger-record { gap: 8px; }
  .ledger-balance-col { padding-left: 8px; }
  .ledger-delta, .ledger-balance-col strong { font-size: 12px; }
  .filter-chips { gap: 1px; }
  .filter-chip { padding: 0 8px; }
  .wallet-toolbar { align-items: flex-start; flex-direction: column; gap: 6px; }
  .wallet-count { padding-left: 2px; }
  .pay-qr { width: 100%; max-width: 300px; height: 330px; }
  .preview { --preview-h: min(92vh, 820px); padding: 10px; }
  .preview-card { width: 100%; border-radius: 14px; }
  .preview-head { padding: 8px 8px 8px 14px; }
  .preview-hint { display: none; }
  .preview-stage { padding: 10px; }
  .canvas-tools { top: 7px; right: 7px; gap: 5px; }
  .canvas-tool { width: 26px; height: 26px; }
  .canvas-tool .icon { width: 12px; height: 12px; }
  .footer { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
