/* ========== 设计变量 ========== */
:root {
  --bg: #f5f5f9;
  --card: #ffffff;
  --border: #e9e8f0;
  --border-2: #dcdae7;
  --text: #14131c;
  --muted: #6d6b7b;
  --muted-2: #97949f;
  --accent: #6152f5;
  --accent-2: #8b5cf6;
  --accent-soft: #eeecff;
  --ok: #0d9b73;
  --ok-soft: #e7f7f1;
  --warn: #b0741a;
  --warn-soft: #fdf5e7;
  --danger: #d0392f;
  --danger-soft: #fdeceb;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 19, 28, .04);
  --shadow-md: 0 14px 30px -18px rgba(20, 19, 28, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -8%, #ece9ff 0%, rgba(236, 233, 255, 0) 62%),
    radial-gradient(900px 480px at 92% -14%, #e6f0ff 0%, rgba(230, 240, 255, 0) 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

/* ========== 顶栏 ========== */
header {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.nav {
  max-width: 1440px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
}

/* 窄屏下这些字必须单行，否则会被压成竖排 */
.brand, .nav a.item, .balance, .uname { white-space: nowrap; }
.uname { font-size: 13px; color: var(--muted); }

.brand {
  display: flex; align-items: center;
  font-weight: 650; font-size: 15px; letter-spacing: .2px;
  color: var(--text); margin-right: 6px;
}
.brand::before {
  content: "";
  width: 26px; height: 26px; margin-right: 9px;
  border-radius: 8px;
  background: linear-gradient(140deg, #7a6bff, #b06bff 60%, #6152f5);
  box-shadow: 0 4px 12px -4px rgba(97, 82, 245, .7);
}
.brand span { color: var(--accent); }

.nav a.item {
  color: var(--muted); font-size: 13.5px; padding: 6px 2px;
  border-bottom: 2px solid transparent; transition: color .15s;
}
.nav a.item:hover { color: var(--text); }
.nav a.item.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.spacer { flex: 1; }

.balance {
  background: linear-gradient(135deg, #f0eeff, #eaf3ff);
  color: #4c3fd6;
  border: 1px solid #e0dcff;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

main { max-width: 1440px; margin: 0 auto; padding: 24px 28px 72px; }

h1 { font-size: 21px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15.5px; font-weight: 650; margin: 0 0 14px; letter-spacing: -.01em; }

.sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 900px) {
  .grid.two { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
}

label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .3px;
}

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; min-height: 120px; line-height: 1.65; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(97, 82, 245, .12);
}

button, .btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

button:hover { border-color: var(--border-2); }

.btn-primary {
  background: linear-gradient(135deg, #6f5fff, #8b5cf6);
  border: none;
  color: #fff;
  font-weight: 600;
  width: 100%;
  padding: 13px;
  border-radius: 11px;
  box-shadow: 0 10px 22px -12px rgba(97, 82, 245, .9);
  letter-spacing: .2px;
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 12px 26px -12px rgba(97, 82, 245, 1); }
.btn-primary:disabled {
  background: #e4e2ec; color: #a8a5b6; box-shadow: none; cursor: not-allowed;
}

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  transition: all .14s;
}
.chip:hover { border-color: #c9c4ee; }
.chip small { display: block; color: var(--muted-2); font-size: 11px; }
.chip.on {
  border-color: var(--accent); background: var(--accent-soft); color: #4b3ce0;
  font-weight: 600;
}
.chip.on small { color: #6f61f0; }

.tag {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f0f6;
  color: var(--muted);
  white-space: nowrap;
}
.tag.success { background: var(--ok-soft); color: var(--ok); }
.tag.failed { background: var(--danger-soft); color: var(--danger); }
.tag.running { background: var(--warn-soft); color: var(--warn); }
.tag.queued, .tag.submitting { background: #eef1fb; color: #4a5670; }

.empty {
  text-align: center; color: var(--muted-2);
  font-size: 13px; padding: 44px 0;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted-2); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }

.flash {
  background: var(--warn-soft);
  border: 1px solid #f2dfbe;
  color: var(--warn);
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ========== 登录 / 注册 ==========
   左品牌、右表单。左侧只负责建立信任，所有可操作元素都在右侧，
   这样手机上滚到哪都只面对一个表单，不会误点进说明文字里。 */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  max-width: 1040px;
  margin: 6px auto 0;
  min-height: min(620px, calc(100vh - 76px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 34px 70px -46px rgba(20, 19, 28, .55);
}

/* 认证页没有顶栏，main 的内边距单独收，并让卡片在视口里垂直居中 */
main.main-auth {
  padding: 28px 24px 40px;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 68px);
}
main.main-auth .auth { width: 100%; }

.auth-side {
  position: relative;
  padding: 46px 42px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    radial-gradient(620px 340px at 88% 6%, rgba(139, 92, 246, .40), transparent 62%),
    radial-gradient(520px 340px at 4% 96%, rgba(56, 132, 255, .26), transparent 62%),
    linear-gradient(158deg, #1b1733 0%, #251d48 58%, #191530 100%);
}
/* 极淡的网格，纯色大片会显闷，加纹理又不抢内容 */
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 26% 18%, #000 0%, transparent 76%);
  mask-image: radial-gradient(circle at 26% 18%, #000 0%, transparent 76%);
}

.auth-side-in { position: relative; z-index: 1; width: 100%; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .4px;
}
.auth-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c6bff, #a78bfa);
  box-shadow: 0 8px 18px -8px rgba(124, 107, 255, .95);
}

.auth-side h2 {
  font-size: 27px;
  line-height: 1.36;
  font-weight: 650;
  letter-spacing: -.02em;
  color: #fff;
  margin: 26px 0 12px;
}
.auth-lead {
  margin: 0 0 26px;
  max-width: 30em;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .68);
}

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.auth-points li { position: relative; padding-left: 17px; }
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b7bff;
  box-shadow: 0 0 0 3px rgba(139, 123, 255, .18);
}
.auth-points b { display: block; font-size: 13.5px; font-weight: 600; }
.auth-points em {
  font-style: normal;
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .55);
}
.auth-side-foot {
  margin-top: 34px;
  font-size: 12px;
  letter-spacing: .7px;
  color: rgba(255, 255, 255, .34);
}

.auth-panel {
  padding: 44px 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-panel h1 { font-size: 22px; margin-bottom: 5px; }
.auth-panel .sub { margin-bottom: 20px; }

.auth-tabs {
  align-self: flex-start;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 26px;
  background: #f1f0f7;
  border-radius: 11px;
}
.auth-tabs a {
  padding: 7px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .16s, color .16s;
}
.auth-tabs a.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 19, 28, .12);
}

.auth-err {
  margin-bottom: 16px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid #f7cfcc;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

/* 密码显隐按钮压在输入框里，不能挤到文字 */
.pw { position: relative; display: block; }
.pw input { padding-right: 60px; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pw-eye:hover { background: var(--accent-soft); }

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 20px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.auth-remember input { width: 15px; height: 15px; accent-color: var(--accent); }

.auth-submit { padding: 12px; font-size: 14.5px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.auth-tip {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-2);
  margin: 10px 0 0;
}

@media (max-width: 860px) {
  /* 手机上不留品牌大图，但保留一条窄的品牌条：
     整块藏掉会让人不知道自己在哪个站，留着又太占屏。 */
  .auth {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    margin-top: 0;
    border-radius: 16px;
  }
  .auth-side { display: block; padding: 20px 20px 18px; }
  .auth-side h2, .auth-points, .auth-side-foot { display: none; }
  .auth-lead { margin: 9px 0 0; font-size: 12.5px; }
  .auth-panel { padding: 22px 20px 26px; }
  .auth-tabs { align-self: stretch; justify-content: center; margin-bottom: 20px; }
  .auth-tabs a { flex: 1; text-align: center; }
}

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--muted-2); }

/* ========== Hero ========== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(128deg, #16112c 0%, #241a4d 46%, #14304a 100%);
  color: #fff;
  padding: 32px 34px 30px;
  box-shadow: 0 28px 56px -34px rgba(30, 16, 90, .75);
  margin-bottom: 18px;
}
.hero::before {
  content: "";
  position: absolute; width: 560px; height: 560px; right: -140px; top: -300px;
  background: radial-gradient(circle, rgba(139, 92, 246, .55) 0%, rgba(139, 92, 246, 0) 66%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 22% 10%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 22% 10%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-in {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: rgba(255, 255, 255, .58); margin-bottom: 12px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .18);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, .05); }
}

.hero h1 {
  font-size: 32px; line-height: 1.18; font-weight: 700;
  letter-spacing: -.025em; margin: 0 0 8px; color: #fff;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #d6c9ff, #9ee6ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin: 0 0 20px; font-size: 13px; color: rgba(255, 255, 255, .62);
  max-width: 520px; line-height: 1.65;
}

.hero-types {
  display: inline-flex; gap: 3px; padding: 4px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.hero-types button {
  border: none; background: none; color: rgba(255, 255, 255, .72);
  font-size: 13px; padding: 8px 18px; border-radius: 9px;
  transition: all .16s;
}
.hero-types button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.hero-types button.on {
  background: #fff; color: #191627; font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .5);
}

.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(72px, auto));
  gap: 8px 26px; align-items: end;
}
.hs { display: flex; flex-direction: column; gap: 2px; }
.hs b {
  font-size: 26px; font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.hs span { font-size: 11.5px; color: rgba(255, 255, 255, .5); letter-spacing: .3px; }
.hs.hl b { background: linear-gradient(100deg, #c4b5fd, #93c5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 同步条 */
.syncbar {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin: 0 2px 16px;
}
.syncbar .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none;
}
.syncbar.warn { color: var(--warn); }
.syncbar.warn .dot { background: #e0a02a; }
.syncbar button {
  margin-left: 2px; font-size: 12px; color: var(--accent);
  background: none; border: none; padding: 0; cursor: pointer;
}
.syncbar button:hover { text-decoration: underline; text-underline-offset: 3px; }
.syncbar button:disabled { color: var(--muted-2); cursor: default; text-decoration: none; }

/* 账号级告警 */
.alertbar {
  font-size: 12.5px; line-height: 1.5; color: #93261c;
  background: var(--danger-soft); border: 1px solid #f6cfcb; border-left: 3px solid var(--danger);
  border-radius: 10px; padding: 9px 13px; margin: 0 0 16px;
}

/* ========== 工作台两栏 ========== */
.studio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 1100px) {
  .studio { grid-template-columns: minmax(0, 1fr) 358px; align-items: start; }
}

/* 筛选条 */
.toolbar {
  position: sticky; top: 72px; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px -22px rgba(20, 19, 28, .5);
}
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.frow + .frow { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

.flabel {
  font-size: 11.5px; color: var(--muted-2); letter-spacing: .6px;
  min-width: 30px; flex: none;
}

.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: all .14s;
}
.fchip i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--fc, #999);
  display: block; flex: none;
}
.fchip span {
  font-size: 11px; color: var(--muted-2);
  background: #f3f2f8; border-radius: 999px; padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.fchip:hover { border-color: #c9c4ee; color: var(--text); }
.fchip.on {
  border-color: transparent; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #6f5fff, #8b5cf6);
  box-shadow: 0 6px 14px -8px rgba(97, 82, 245, .9);
}
.fchip.on i { background: #fff; }
.fchip.on span { background: rgba(255, 255, 255, .22); color: #fff; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button {
  border: none; border-radius: 0; padding: 6px 12px; font-size: 12.5px;
  background: none; color: var(--muted); cursor: pointer; transition: all .14s;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: #f7f6fb; color: var(--text); }
.seg button.on { background: var(--accent-soft); color: #4b3ce0; font-weight: 600; }

.search {
  margin-left: auto; padding: 7px 13px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 9px; width: 190px;
  background: #fff; color: var(--text);
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97, 82, 245, .1); }

/* ========== 系列分组 ========== */
/* 视频 / 图片的大分区标题，让「全部」视图也有版块感 */
.kind-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 4px 2px 16px;
}
.kind-head.gap { margin-top: 34px; }
.kind-head b { font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; }
.kind-head span { font-size: 11.5px; color: var(--muted-2); }
.kind-head::after {
  content: ""; flex: 1; height: 1px; margin-left: 4px;
  background: linear-gradient(90deg, var(--border), rgba(233, 232, 240, 0));
}

.fam { margin-bottom: 26px; }

.fam-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 4px; margin-bottom: 12px;
}
.fam-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.fam-t { min-width: 0; }
.fam-t h3 {
  margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.fam-brand {
  font-size: 11px; font-weight: 500; color: var(--muted-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; background: #fff;
}
.fam-t p { margin: 2px 0 0; font-size: 12px; color: var(--muted-2); }

.fam-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 1px; }
.fam-count { font-size: 11.5px; color: var(--muted-2); }
.fam-from { font-size: 11.5px; color: var(--muted-2); }
.fam-from b { font-size: 15px; color: var(--text); font-weight: 650; margin-right: 2px; }

.model-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 12px;
}

.mcard {
  position: relative;
  display: flex; flex-direction: column; gap: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px 15px 13px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
/* 顶部家族色条：分组在视觉上的落地 */
.mcard::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--fc, #ccc); opacity: .85;
}
.mcard:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
}
.mcard.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(97, 82, 245, .12), var(--shadow-md);
}
.mcard.off { background: #fbfbfd; cursor: not-allowed; }
.mcard.off::before { opacity: .25; }
.mcard.off:hover { transform: none; box-shadow: none; border-color: var(--border); }
.mcard.off .mc-name { color: var(--muted); }
/* 本站实测连续失败造成的停售，和上游异常停售要能一眼分开 */
.mcard.localbroken { border-left: 3px solid var(--danger); }

.mc-top { display: flex; align-items: center; gap: 6px; }

.chan {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: #f2f1f7; color: #6b6880; letter-spacing: .3px;
  border: 1px solid transparent; white-space: nowrap;
}
.chan.official { background: #e9f2ff; color: #2c62b8; border-color: #d6e5fb; }
.chan.deal { background: #fff2e2; color: #a4621a; border-color: #f8e2c6; }
.chan.xn { background: #f0edff; color: #5b47c9; border-color: #e2dcfb; }

.hp {
  margin-left: auto; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.hp.ok { background: var(--ok-soft); color: var(--ok); border-color: #cfeee3; }
.hp.busy { background: var(--warn-soft); color: var(--warn); border-color: #f2e0bf; }
.hp.new { background: #f2f1f7; color: #6b6880; border-color: #e7e5f0; }
.hp.down { background: var(--danger-soft); color: var(--danger); border-color: #f6d2ce; }

.mc-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-name i {
  font-style: normal; font-size: 10.5px; color: #bdb9c8; font-weight: 400;
  margin-left: 5px; letter-spacing: .3px;
}

.mc-meta {
  font-size: 11.5px; color: var(--muted-2); line-height: 1.55;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 分辨率单独一行小胶囊：塞进 meta 会把说明挤成三行，卡片高度全乱 */
.mc-res { display: flex; gap: 4px; flex-wrap: wrap; }
.mc-res span {
  font-size: 10.5px; padding: 1px 6px; border-radius: 5px;
  background: #f6f5fb; color: #7b7890; border: 1px solid #eeecf7;
  font-variant-numeric: tabular-nums;
}
/* 能力胶囊统一同一色系：分辨率用灰、能力用淡紫，只有两色才不花 */
.mc-res span.rp, .mc-res span.cap { background: #f0eeff; color: #5b47c9; border-color: #e1dcfb; }

/* 停售原因 / 拥堵提示 / 本站实测，统一成一条紧凑说明，别把卡片撑高 */
.mc-note {
  font-size: 11px; line-height: 1.45; border-radius: 6px; padding: 4px 7px;
  color: #8a6420; background: #fdf7ec;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-note.bad { color: #a3584f; background: #fdf3f1; }
.mc-note.ok { color: var(--ok); background: #f0faf6; }
.mc-note.warn { color: #8a6420; background: #fdf7ec; }

.mc-price {
  margin-top: auto; padding-top: 9px;
  display: flex; align-items: baseline; gap: 5px;
}
.mc-price b {
  font-size: 21px; font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.mc-price span { font-size: 11.5px; color: var(--muted-2); }
.mc-price .na { font-size: 12.5px; color: var(--muted-2); }

/* ========== 右侧创作面板 ========== */
.config-pane { position: sticky; top: 72px; }
@media (max-width: 1099px) { .config-pane { position: static; } }

.pane {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 18px 40px -30px rgba(20, 19, 28, .5);
}

.pane-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.pane-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background: #f2f1f7; color: var(--muted-2);
}
.pane-title { min-width: 0; }

.picked-name { font-size: 14px; font-weight: 650; line-height: 1.4; margin-bottom: 2px; }
.picked-sub { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

.field-row { margin-bottom: 14px; }
.field-row > label {
  display: block; font-size: 11.5px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .2px;
}
.field-row > label span { color: var(--muted-2); }

.uploader {
  border: 1px dashed var(--border-2); border-radius: 10px; padding: 15px;
  text-align: center; font-size: 12px; color: var(--muted-2); cursor: pointer;
  transition: all .15s; background: #fcfcfe;
}
.uploader:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.up-ico { font-size: 14px; margin-right: 3px; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb {
  position: relative; width: 56px; height: 56px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; padding: 0;
  border-radius: 50%; border: none; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
}

/* 充值档位：2×2 网格 */
.chips.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips.tiers .chip { width: 100%; }

.quote-box {
  display: flex; align-items: baseline; justify-content: space-between;
  background: linear-gradient(135deg, #f2efff, #eef5ff);
  border: 1px solid #e6e1ff;
  border-radius: 11px; padding: 12px 15px; margin: 16px 0 14px;
}
.quote-box .n {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em;
  color: #4c3fd6; font-variant-numeric: tabular-nums;
}
.quote-box .s { font-size: 12px; color: var(--muted); }
.quote-box .qv { display: inline-flex; align-items: baseline; gap: 4px; }

.hint { font-size: 11.5px; color: var(--muted-2); margin-top: 10px; line-height: 1.6; text-align: center; }

/* 比例下拉：长得像 chip，行为是 select */
.chip-sel {
  appearance: none; border: 1px dashed var(--border-2); background: #fff;
  color: var(--muted); font-size: 12px; padding: 6px 10px; border-radius: 9px;
  cursor: pointer; font-family: inherit;
}
.chip-sel.on { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
#ratioChips select.chip-sel { flex: 0 0 auto; width: auto; max-width: 140px; }

/* 时长滑块 */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider-wrap input[type=range] { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.slider-val { font-size: 12.5px; color: var(--muted-2); white-space: nowrap; min-width: 50px; text-align: right; }
.slider-val b { color: var(--text); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }

#fDur { max-width: 160px; }

/* ========== 生成记录 ========== */
.sec-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 34px 0 14px;
}
.sec-head h2 { margin: 0; }
.sec-sub { font-size: 11.5px; color: var(--muted-2); }

.empty-state {
  background: #fff;
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  padding: 46px 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.es-ico {
  width: 44px; height: 44px; border-radius: 13px; margin-bottom: 6px;
  background: linear-gradient(135deg, #f0edff, #eaf3ff);
  color: var(--accent); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 3px;
}
.empty-state b { font-size: 13.5px; font-weight: 600; }
.empty-state span { font-size: 12px; color: var(--muted-2); }

.job {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px 17px;
  margin-bottom: 11px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .16s;
}
.job:hover { box-shadow: var(--shadow-md); }

.job-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.job-head .id { color: var(--muted-2); font-size: 12px; }
.job-prompt {
  color: var(--muted); font-size: 13px; line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* 竖屏视频在宽容器里会自动撑到上千像素高，必须限高，否则一条记录占满整屏 */
.job [data-role="body"] video,
.job [data-role="body"] img {
  max-width: 100%; max-height: 420px; width: auto;
  border-radius: 10px; display: block; background: #000;
}
.job [data-role="body"] img { background: transparent; }

.result-img {
  max-width: 100%; max-height: 420px; border-radius: 10px;
  border: 1px solid var(--border); display: block;
}

@media (max-width: 720px) {
  main { padding: 16px 14px 60px; }
  header { padding: 0 14px; }
  .nav { gap: 14px; height: 56px; }
  .uname { display: none; }
  .hero { padding: 24px 20px; border-radius: 18px; }
  .hero h1 { font-size: 25px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px 22px; width: 100%; }
  .toolbar { position: static; }
  .fam-right { display: none; }
  .search { width: 100%; margin-left: 0; }
}

/* ========== 卡密 / 兑换 ========== */
.flashes { margin-bottom: 18px; }
.flash.ok {
  background: var(--ok-soft); border-color: #c6e9dd; color: var(--ok);
}
.flash.err {
  background: var(--danger-soft); border-color: #f6cfcc; color: var(--danger);
}

/* 兑换是账户页的主路径，给它一点「这里能立刻办事」的重量 */
.redeem-panel {
  border-color: #ddd6ff;
  background: linear-gradient(180deg, #fbfaff 0%, #fff 58%);
}
.rp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rp-head h2 { margin: 0; }
.rp-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: #5a48e0; font-weight: 500;
}
.redeem-form { display: flex; gap: 10px; }
.redeem-form input {
  flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase;
}
.redeem-form .btn-primary {
  width: auto; flex: 0 0 auto; padding: 0 24px; white-space: nowrap;
  font-size: 14px; border-radius: 10px;
}
.rp-note { margin: 12px 0 0; font-size: 12px; color: var(--muted-2); line-height: 1.65; }
.rp-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; background: #f3f1fb; color: #5743c9;
  padding: 1px 5px; border-radius: 5px;
}

/* 分步小标题：把「先付款、再兑换」两步写死，避免用户买完不知道往哪走 */
.rp-step {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 10px; font-size: 12.5px; font-weight: 600; color: #4a4570;
}
.rp-step:first-of-type { margin-top: 4px; }
.rp-step b {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
}

/* 面额格子：整块可点，直接开新窗口去第三方商品页 */
.buy-grid {
  display: grid; gap: 10px;
  /* 有几个可买的面额就铺几格：只上架了 10 元时不会留三个空洞 */
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.buy-tile {
  display: grid; gap: 1px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid #e3dff8; background: #fff;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.buy-tile b { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.buy-tile span { font-size: 11.5px; color: var(--muted-2); }
.buy-tile i {
  font-style: normal; font-size: 11.5px; color: var(--accent);
  margin-top: 4px; font-weight: 500;
}
a.buy-tile:hover {
  border-color: #b9aef4; box-shadow: 0 6px 18px -10px rgba(97, 82, 245, .55);
  transform: translateY(-1px);
}
.buy-tile.off {
  background: #fafafa; border-color: #eee; color: #a8a4bb; cursor: not-allowed;
}
.buy-tile.off i { color: #b8b4c7; }

/* 从 /redeem 进来时给整张卡一个短暂高亮，让人一眼看到兑换框在哪 */
.focus-flash { animation: focusPulse 1.4s ease-out 1; }
@keyframes focusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(97, 82, 245, .38); }
  70%  { box-shadow: 0 0 0 10px rgba(97, 82, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(97, 82, 245, 0); }
}

.manual-panel { margin-top: 16px; }
.manual-panel summary {
  cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.manual-panel summary::-webkit-details-marker { display: none; }
.manual-panel summary::before {
  content: "+"; font-weight: 400; font-size: 15px; color: var(--muted-2);
}
.manual-panel[open] summary::before { content: "−"; }
.manual-panel[open] summary { margin-bottom: 16px; }

.btn-ghost {
  padding: 9px 18px; border-radius: 10px; border: 1px solid var(--border-2);
  background: #fff; color: var(--text); font-size: 13.5px;
}
.btn-ghost:hover { border-color: #c9c4ee; color: var(--accent); }

/* 后台发码 */
.code-form { display: grid; gap: 14px; }
.fld { display: block; }
.fld > span {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .3px;
}
.chips.quick .chip {
  font-size: 12.5px; padding: 5px 12px; background: #fbfaff;
}
.chips.quick .chip:hover { border-color: var(--accent); color: var(--accent); }
.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 2px;
}
.form-foot .btn-primary { width: auto; padding: 10px 26px; }
.calc { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.howto {
  margin: 0; padding-left: 19px;
  font-size: 13px; color: var(--muted); line-height: 1.95;
}
.howto li { margin-bottom: 2px; }

tr.on td { background: #faf9ff; }
.ops { white-space: nowrap; }
.ops .btn-sm, .ops button { margin-right: 4px; }
.btn-sm.danger { color: var(--danger); border-color: #f3cdca; }
.btn-sm.danger:hover { background: var(--danger-soft); border-color: #eeb9b4; }

.listhead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.listhead h2 { margin: 0; }
.listtools { display: flex; gap: 8px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
code.code {
  font-size: 13px; letter-spacing: .6px; color: #3b3560;
  background: #f6f5fc; padding: 2px 7px; border-radius: 6px;
}

/* 账户页左栏只有 420px，四列表格会把「余额」压成竖排两个字。
   表头和前三列强制不换行，只让说明列自由折行。 */
.ledger th, .ledger td:nth-child(-n+3) { white-space: nowrap; }
.ledger td { font-variant-numeric: tabular-nums; }

.adjust-form { display: flex; gap: 10px; }
.adjust-form input { flex: 1; min-width: 0; }
.adjust-form input[name=delta] { flex: 0 0 130px; text-align: center; }
.adjust-form .btn-ghost { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 720px) {
  .adjust-form { flex-direction: column; }
  .adjust-form input[name=delta] { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  .redeem-form { flex-direction: column; }
  .redeem-form .btn-primary { padding: 12px; width: 100%; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn-primary { width: 100%; }
  .ops .btn-sm, .ops button { margin-bottom: 4px; }

  /* 管理员比普通用户多两项导航，430px 下「积分 + 退出」会被挤出屏幕。
     品牌只剩方块 logo，间距收紧，这样六项也能单行放下。 */
  .brand { font-size: 0; margin-right: 0; }
  .nav { gap: 12px; }
  .nav .item { font-size: 13px; }
  .balance { font-size: 12.5px; }
  .empty { padding: 28px 0; }
}
