/* =========================================================
   AI 创作与 API 平台 — 复刻版样式
   ========================================================= */
:root {
  --blue: #315efb;
  --blue-hover: #244ce0;
  --pale: #eef3ff;
  --border: #e2e8f0;
  --muted: #64748b;
  --coral: #f06a5d;
  --ink: #0b1530;
  --page-bg: #f7f9fc;
  --radius-card: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page-bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon.sm { width: 16px; height: 16px; }
.icon.xs { width: 14px; height: 14px; }
.icon.lg { width: 22px; height: 22px; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }

.eyebrow {
  color: var(--blue);
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------------- buttons ---------------- */
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  font-weight: 650;
  text-decoration: none;
}
.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(49, 94, 251, .16);
}
.primary-button:hover { background: var(--blue-hover); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.secondary-button {
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--border);
}
.secondary-button:hover { background: #f8fafc; border-color: #b8c5dd; }
.secondary-button:disabled { opacity: .55; cursor: not-allowed; }
.icon-button .icon { width: 18px; height: 18px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #475569;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.icon-button:hover { background: #f8fafc; border-color: #c9d4e6; }
.text-button {
  width: 100%;
  padding: 16px;
  color: var(--blue);
  background: none;
  border: 0;
}
.text-button:hover { color: var(--blue-hover); }
.bottom-nav { display: none; }

/* =========================================================
   登录 / 注册
   ========================================================= */
.auth-shell {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  min-height: 100vh;
  background: #fff;
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px 8vw;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 18%, #6787ff 0, rgba(0, 0, 0, 0) 35%),
    linear-gradient(145deg, #0f1b43, #15296a 57%, #253c98);
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  color: #fff;
  background: #fff;
  border-radius: 11px;
  box-shadow: 0 7px 18px rgba(49, 94, 251, .18);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-mark.large { width: 56px; height: 56px; border-radius: 18px; }
.brand-mark.large .icon { width: 24px; height: 24px; }
.auth-copy { position: relative; z-index: 1; max-width: 580px; margin: auto 0; }
.auth-copy .eyebrow { display: inline; color: #bfcdff; }
.auth-copy h1 {
  margin: 18px 0 22px;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.auth-copy p { margin: 18px 0; color: #d8e0ff; font-size: 18px; line-height: 1.8; }
.auth-orbit { position: absolute; border: 1px solid rgba(255, 255, 255, .13); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; bottom: -180px; right: -170px; }
.orbit-two { width: 300px; height: 300px; bottom: -70px; right: -40px; }
.auth-panel {
  display: flex;
  padding: 48px;
  background: var(--page-bg);
}
.auth-card {
  width: min(430px, 100%);
  margin: auto;
  padding: 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(11, 21, 48, .07);
}
.auth-card .eyebrow { display: inline; }
.auth-card h2 { margin: 10px 0; font-size: 30px; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.auth-card label {
  display: block;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 650;
}
.auth-card input {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .09); }
.auth-submit { width: 100%; margin-top: 12px; }
.form-notice {
  padding: 12px 14px;
  color: #9a3412;
  background: #fff7ed;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.form-notice.error { color: #b91c1c; background: #fef2f2; }
.auth-code-row { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; }
.auth-code-row input { flex: 1; min-width: 0; margin-top: 0; }
.auth-code-button {
  flex: none;
  height: 48px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.auth-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.auth-links { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.auth-links .text-button { width: auto; padding: 2px 0; font-size: 13px; }
.auth-links-sep { width: 3px; height: 3px; background: #cbd5e1; border-radius: 50%; }
.auth-switch { margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch .text-button { display: inline; width: auto; padding: 0; margin-left: 4px; font-size: 13px; font-weight: 650; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 30px; font-weight: 700; }

/* =========================================================
   应用外壳
   ========================================================= */
.app-shell { min-height: 100vh; padding-top: 72px; padding-left: 208px; transition: padding .2s; }
.app-shell.compact { padding-left: 76px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 208px;
  padding: 18px 14px;
  background: #fff;
  border-right: 1px solid var(--border);
  transition: width .2s;
}
.compact .sidebar { width: 76px; }
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}
.sidebar nav { display: flex; flex-direction: column; gap: 5px; margin-top: 30px; }
.sidebar nav button,
.collapse {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  overflow: hidden;
  color: #64748b;
  background: none;
  border: 0;
  border-radius: 10px;
  font-weight: 550;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.sidebar nav button:hover,
.sidebar nav button.active { color: var(--blue); background: var(--pale); }
.sidebar nav button.active { font-weight: 700; }
.sidebar nav button { position: relative; }
.sidebar nav button .icon { width: 19px; height: 19px; }
.nav-dot {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff;
  pointer-events: none;
}
.collapse { margin-top: auto; }
.collapse .icon { width: 18px; height: 18px; transition: transform .2s; }
.compact .collapse .icon { transform: rotate(180deg); }
.compact .sidebar span { display: none; }
.compact .brand { justify-content: center; }

.topbar {
  position: fixed;
  top: 0;
  left: 208px;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: left .2s;
}
.compact .topbar { left: 76px; }
.topbar-context-group { display: flex; align-items: center; gap: 28px; min-width: 0; flex: 1; }
.top-context { display: flex; flex-direction: column; gap: 3px; font-weight: 700; white-space: nowrap; }
.top-context small { color: var(--muted); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.points-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  color: var(--blue);
  background: #f4f7ff;
  border: 1px solid #dbe4ff;
  border-radius: 12px;
  font-weight: 750;
}
.points-pill .icon { width: 16px; height: 16px; }
.points-pill small { font-weight: 500; }
.points-pill.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: #172554;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.announcement-shortcut {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #526178;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.announcement-shortcut:hover { color: var(--blue); border-color: #bdcaff; background: #f8faff; }
.announcement-shortcut .icon { width: 18px; height: 18px; }
.announcement-shortcut .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: var(--blue);
  background: #eef3ff;
  border: 2px solid #fff;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

/* 公告滚动条 */
.announcement-ticker {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 44px;
  margin-right: 18px;
  padding: 0;
  overflow: hidden;
  color: #334155;
  background: #f8faff;
  border: 1px solid #dbe4ff;
  border-radius: 11px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.announcement-ticker:hover { background: #f1f5ff; border-color: #b8c7ff; }
.announcement-ticker-window {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.announcement-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: announcement-ticker-ltr var(--ticker-duration, 28s) linear infinite;
}
.announcement-ticker:hover .announcement-ticker-track { animation-play-state: paused; }
.announcement-ticker-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max(680px, 50vw);
  height: 42px;
  padding: 0 32px;
  font-size: 13px;
  white-space: nowrap;
}
.announcement-ticker-copy .icon { width: 16px; height: 16px; color: var(--blue); }
.announcement-ticker-copy strong { flex: none; color: var(--blue); font-size: 12px; }
.announcement-ticker-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes announcement-ticker-ltr {
  0% { transform: translate(-33.3333%); }
  100% { transform: translate(0); }
}

/* 内容区 */
.content { max-width: 1800px; margin: 0 auto; padding: 30px 32px 48px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading h1 { margin: 7px 0; font-size: 30px; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading .heading-actions { display: flex; gap: 10px; flex: none; }
.page-heading .secondary-button .icon { width: 17px; height: 17px; }

/* =========================================================
   创作工作台
   ========================================================= */
.creation-shell { height: 100dvh; min-height: 0; overflow: hidden; }
.creation-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: none;
  height: calc(100dvh - 72px);
  padding: 16px 20px 20px;
  overflow: hidden;
}
.channel-health {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(11, 21, 48, .03);
}
.channel-health-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.channel-health-head > div { flex: 1; min-width: 0; }
.channel-health-head strong { display: block; font-size: 13px; }
.channel-health-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-health-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.channel-health-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px 11px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(11, 21, 48, .03);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.channel-health-card:hover { border-color: #c7d2fe; }
.channel-health-card.is-active {
  background: #eef4ff;
  border-color: #93b4ff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .12), 0 6px 18px rgba(37, 99, 235, .08);
}
.channel-health-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.channel-health-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-health-trophy {
  display: inline-flex;
  flex: none;
  color: #c7a24a;
}
.channel-health-trophy .icon { width: 15px; height: 15px; }
.channel-health-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.channel-health-metrics > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.channel-health-metrics small { color: var(--muted); font-size: 10px; }
.channel-health-metrics strong {
  font-size: 14px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.channel-health-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  height: 12px;
}
.channel-health-bars i {
  display: block;
  min-width: 0;
  border-radius: 3px;
  background: #e2e8f0;
}
.channel-health-bars i.good { background: #22c55e; }
.channel-health-bars i.warn { background: #f59e0b; }
.channel-health-bars i.bad { background: #ef4444; }
.channel-health-bars i.empty { background: #e2e8f0; }
.channel-health-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  flex: none;
}
.channel-health-refresh:hover { color: var(--blue); border-color: #c7d2fe; }
.channel-health-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.creation-workspace {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(290px, .92fr) minmax(420px, 1.65fr);
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(11, 21, 48, .03);
}
.creation-workspace > section { min-width: 0; height: 100%; min-height: 0; }
.creation-models,
.creation-parameters,
.creation-prompt {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 20px;
  border-right: 1px solid var(--border);
}
.creation-models {
  overflow: hidden;
  background: #fbfcfe;
  border-radius: 18px 0 0 18px;
}
.creation-parameters,
.creation-prompt {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.creation-prompt {
  border-right: 0;
  border-radius: 0 18px 18px 0;
}

.creation-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid #edf1f6;
}
.creation-section-heading > span {
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  color: var(--blue);
  background: #eef2ff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}
.creation-section-heading > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.creation-section-heading > .channel-health-refresh { margin-left: auto; align-self: center; }
.creation-section-heading strong { color: #1e293b; font-size: 14px; }
.creation-section-heading small { color: #94a3b8; font-size: 10px; line-height: 1.45; }

.model-rail-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.model-rail-list > button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-height: 108px;
  padding: 12px;
  overflow: visible;
  color: #334155;
  text-align: left;
  background: #fff;
  border: 1px solid #e7ecf4;
  border-radius: 12px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.model-rail-list > button:hover { background: #f8faff; border-color: #cfd8e8; }
.model-rail-list > button.active {
  background: #f2f5ff;
  border-color: #8fa8ff;
  box-shadow: 0 5px 18px rgba(49, 94, 251, .086);
}
.model-rail-list strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.model-rail-list .model-check { color: var(--blue); display: grid; place-items: center; }
.model-rail-list .model-pinned { color: #f59e0b; display: grid; place-items: center; }
.model-rail-list .model-pinned .icon { width: 14px; height: 14px; }
.model-rail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; }
.model-rail-heading > strong { color: #172554; min-width: 0; font-size: 12px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.model-rail-heading .model-pinned { flex: none; margin-top: 1px; width: 14px; height: 14px; }
.model-health { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: #64748b; pointer-events: none; }
.model-health-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.model-health-metrics > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model-health-metrics small { display: block; color: #7c8aa0; font-size: 9px; line-height: 1.2; white-space: nowrap; }
.model-health-metrics b { color: #334155; font-size: 11px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.model-health-metrics b.great { color: #08775b; }
.model-health-metrics b.good { color: #157a6e; }
.model-health-metrics b.watch { color: #9a5b00; }
.model-health-metrics b.poor { color: #c2413a; }
.model-health-metrics b.empty { color: #7c8aa0; }
.model-health-bars { display: grid; grid-template-columns: repeat(24, minmax(2px, 1fr)); align-items: stretch; gap: 2px; width: 100%; height: 13px; }
.model-health-bars i { display: block; min-width: 2px; background: #dbe2ec; border-bottom: 2px solid #aeb8c7; border-radius: 2px; }
.model-health-bars i.great { background: #19b98b; border-color: #08775b; }
.model-health-bars i.good { background: #38b8b0; border-color: #157a6e; }
.model-health-bars i.watch { background: #f5b83d; border-color: #b56a08; }
.model-health-bars i.poor { background: #ef6a62; border-color: #b93832; }

/* 参数表单 */
.field-label {
  display: block;
  margin-bottom: 9px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.field { position: relative; display: block; }
.field > span,
.reference-head > span { display: block; margin-bottom: 9px; color: #334155; font-size: 13px; font-weight: 700; }
.field textarea {
  width: 100%;
  color: #000;
  min-height: 150px;
  padding: 14px;
  line-height: 1.65;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  resize: vertical;
}
.field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .07); }
.field > small { position: absolute; right: 11px; bottom: 10px; color: #94a3b8; font-size: 11px; }
.creation-prompt .field.grow { display: flex; flex: 1; flex-direction: column; }
.creation-prompt .field.grow textarea { flex: 1; min-height: 210px; }
.creation-prompt .cost-line { margin-top: auto; }

.reference-box { padding: 14px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; }
.reference-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.reference-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reference-thumb,
.reference-add {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.reference-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reference-thumb > .reference-delete-button {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #be123c;
  cursor: pointer;
  background: rgba(255, 255, 255, .93);
  border: 0;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .13);
}
.reference-thumb > .reference-delete-button:hover { color: #9f1239; background: #fff1f2; }
.reference-thumb > .reference-delete-button:focus-visible { outline: 3px solid #fda4af; outline-offset: 2px; }
.reference-thumb figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 28px 9px 8px;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, .85));
}
.reference-thumb figcaption strong { font-size: 12px; }
.reference-thumb figcaption span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.reference-add { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: var(--blue); cursor: pointer; border-style: dashed; border-color: #aebfff; }
.reference-add:hover { background: var(--pale); border-color: var(--blue); }
.reference-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.reference-add:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.reference-add .icon { width: 22px; height: 22px; }
.reference-add strong { max-width: 90%; font-size: 12px; line-height: 1.35; text-align: center; }
.reference-add small { color: var(--muted); font-size: 10px; }
.reference-image-grid.is-empty .reference-add {
  grid-column: 1 / -1;
  gap: 8px;
  width: 100%;
  min-height: 132px;
  padding: 18px 14px;
  aspect-ratio: auto;
}
.reference-image-grid.is-empty .reference-add .icon { width: 28px; height: 28px; }
.reference-image-grid.is-empty .reference-add strong { max-width: none; font-size: 13px; }
.reference-audios { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.reference-audios-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.reference-audios-head span { font-size: 13px; font-weight: 650; }
.reference-audios-head small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.reference-audio-list { display: grid; gap: 8px; }
.reference-audios .audio-add { width: 100%; min-height: 64px; padding: 10px; background: #fff; border: 1px dashed #aebfff; border-radius: 12px; position: relative; }
.reference-audios .audio-add strong { font-size: 12px; }
.reference-audio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.audio-role { flex: none; padding: 3px 9px; color: var(--blue); background: var(--pale); border-radius: 999px; font-size: 11px; font-weight: 700; }
.reference-audio-item audio { flex: 1; min-width: 0; height: 36px; }
.audio-meta { display: flex; flex-direction: column; gap: 1px; max-width: 150px; min-width: 0; }
.audio-meta strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.audio-meta small { color: var(--muted); font-size: 11px; }
.audio-remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #64748b;
  background: #f1f5f9;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.audio-remove:hover { color: #b91c1c; background: #fee2e2; }
.audio-remove .icon { width: 14px; height: 14px; }
.reference-thumb[draggable="true"] { cursor: grab; transition: opacity .14s, box-shadow .14s, transform .14s; }
.reference-thumb[draggable="true"]:active { cursor: grabbing; }
.reference-thumb.is-dragging { opacity: .48; transform: scale(.97); }
.reference-thumb.is-drop-target { box-shadow: 0 0 0 3px rgba(49, 94, 251, .44); }

.reference-prompt-field { z-index: 4; }
.reference-prompt-editor {
  position: relative;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.reference-prompt-editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .07); }
.reference-prompt-content {
  min-height: 480px;
  padding: 64px 14px 14px;
  color: #0f172a;
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: inherit;
  outline: 0;
  cursor: text;
}
.reference-prompt-content:empty:before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; }
.prompt-expand-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 104px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--blue);
  background: #f7f9ff;
  border: 1px solid #c7d4ff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(49, 94, 251, .07);
  font-size: 12px;
  font-weight: 750;
}
.prompt-expand-trigger:hover { background: var(--pale); border-color: #829dff; }
.prompt-expand-trigger:focus-visible { outline: 3px solid rgba(49, 94, 251, .21); outline-offset: 2px; }
.reference-prompt-help { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.reference-prompt-help code { padding: 2px 5px; color: var(--blue); background: var(--pale); border-radius: 5px; }
.prompt-mention {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin: 0 2px;
  padding: 2px 7px 2px 3px;
  color: var(--blue);
  background: #eef3ff;
  border: 1px solid #c7d4ff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
  user-select: none;
  cursor: default;
}
.prompt-mention img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; }
.prompt-mention-label { display: inline-block; }
.prompt-mention-popover {
  position: absolute;
  z-index: 30;
  width: min(320px, calc(100% - 16px));
  max-height: 290px;
  padding: 6px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dbe4ff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}
.prompt-mention-popover[hidden] { display: none; }
.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  color: #1e293b;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.mention-option:hover,
.mention-option.active { background: #eef3ff; }
.mention-thumb { flex: none; width: 38px; height: 38px; object-fit: cover; background: #eef2f7; border-radius: 8px; }
.mention-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.mention-copy strong { color: var(--blue); font-size: 12px; }
.mention-copy small { overflow: hidden; color: #64748b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mention-kind { flex: none; padding: 3px 7px; color: #475569; background: #f1f5f9; border-radius: 6px; font-size: 10px; font-weight: 700; }
.mention-empty { display: flex; align-items: center; gap: 8px; padding: 14px 12px; color: #64748b; font-size: 12px; line-height: 1.5; }
.mention-empty .icon { flex: none; width: 16px; height: 16px; }
.billing-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #64748b;
  background: #f7f9ff;
  border: 1px solid #dbe4ff;
  border-radius: 9px;
  font-size: 12px;
}
.billing-breakdown strong { color: #173bba; font-variant-numeric: tabular-nums; }
.billing-breakdown small { margin-left: auto; color: #526178; }
.billing-price { display: inline-flex; align-items: baseline; gap: 7px; }
.price-original { color: #94a3b8; font-weight: 600; text-decoration: line-through; }
.billing-price .price-original { font-size: 11px; }
.choice-field { position: relative; }
.choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.choice-trigger:hover { border-color: #c3cee0; }
.choice-trigger > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-trigger strong { color: #1e293b; font-size: 13px; }
.choice-trigger small { color: #94a3b8; font-size: 10px; }
.choice-trigger .icon { width: 17px; height: 17px; color: #000; }
.choice-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 35;
  max-height: 260px;
  padding: 7px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}
.choice-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: #334155;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 8px;
}
.choice-menu button:hover,
.choice-menu button.active { color: var(--blue); background: #eef2ff; font-weight: 700; }

.prompt-box { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 480px; }
.prompt-box textarea {
  flex: 1;
  width: 100%;
  min-height: 480px;
  padding: 32px 14px 30px;
  line-height: 1.65;
  resize: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.prompt-box textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .07); }
.video-prompt-box textarea { padding-top: 60px; }
.prompt-box textarea::placeholder { color: #94a3b8; }
.char-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #94a3b8;
  font-size: 10px;
  pointer-events: none;
}
.prompt-hint { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.prompt-hint code {
  padding: 1px 5px;
  color: var(--blue);
  background: var(--pale);
  border-radius: 5px;
  font-size: 11px;
}
.expand-prompt {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  color: var(--blue);
  background: #f5f8ff;
  border: 1px solid #dbe4ff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}
.expand-prompt:hover { background: #eef3ff; }
.prompt-toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pricing-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #475569;
  background: #f5f7ff;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
}
.pricing-note strong { color: var(--ink); font-size: 12px; }
.pricing-note small { color: var(--muted); font-size: 10px; }
.cost-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px dashed var(--border);
}
.cost-line span { color: var(--muted); font-size: 13px; }
.cost-line strong { color: var(--coral); font-size: 20px; }
.cost-line small { margin-left: auto; color: var(--muted); }
.generate { width: 100%; height: 48px; }
.generate .icon { width: 18px; height: 18px; }

/* 结果面板 */
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 22px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.panel-title > span { display: flex; align-items: center; gap: 8px; }
.panel-title .icon { width: 17px; height: 17px; }
.panel-title .panel-sub { color: #94a3b8; font-size: 10px; font-weight: 500; }
.empty-result {
  width: min(340px, 70%);
  margin: auto;
  color: var(--muted);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  color: var(--blue);
  background: var(--pale);
  border-radius: 18px;
}
.empty-icon .icon { width: 28px; height: 28px; }
.empty-result h3 { margin: 16px 0; color: #334155; font-size: 16px; }
.empty-result p { margin: 13px 0; font-size: 13px; line-height: 1.7; }

.generation-queue {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  flex: 1;
  gap: 14px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.generation-task {
  padding: 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
}
.generation-task.queued { border-color: #bdcaff; }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.task-head strong { font-size: 12px; }
.task-status { padding: 4px 8px; border-radius: 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.task-status.queued { color: #9a5b00; background: #fffbeb; }
.task-status.running { color: var(--blue); background: #eef3ff; }
.task-status.success { color: #047857; background: #ecfdf5; }
.task-status.failed { color: #b91c1c; background: #fef2f2; }
.task-status.expired { color: #475569; background: #f1f5f9; }
.task-prompt { color: var(--muted); font-size: 11px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-preview {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 10px;
  aspect-ratio: 16 / 10;
}
.task-preview img { width: 100%; height: 100%; object-fit: cover; }
.task-preview .shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #eef2f7 20%, #f8fafc 40%, #eef2f7 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.task-preview .task-progress {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--blue);
}
.task-preview.task-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #64748b;
  background: #f1f5f9;
}
.task-preview.task-expired .task-progress { position: static; color: #64748b; font-size: 11px; font-weight: 600; }
.task-preview.task-expired .icon { fill: none; }
.task-expired-note { display: flex; flex: 1 1 100%; align-items: center; justify-content: center; gap: 4px; color: #64748b; font-size: 10.5px; }
.task-expired-note .icon { width: 14px; height: 14px; }
.task-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: #94a3b8; font-size: 10px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.task-actions button,
.task-actions a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 6px;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 10.5px;
  white-space: nowrap;
}
.task-actions button:hover,
.task-actions a:hover { background: #eef2ff; border-color: #c7d2fe; }
.task-actions .danger { color: #b91c1c; }
.task-image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 6px; margin-top: 10px; }
.task-image-grid figure { position: relative; margin: 0; overflow: hidden; border-radius: 9px; aspect-ratio: 1; background: #eef2f7; }
.task-image-grid img { width: 100%; height: 100%; object-fit: cover; }
.task-image-grid .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, #eef2f7 20%, #f8fafc 40%, #eef2f7 60%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* =========================================================
   通用页面元素
   ========================================================= */
.page-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-title h2 { margin: 6px 0 5px; font-size: 21px; letter-spacing: -.02em; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 380px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
}
.empty-card h3 { margin: 1em 0; }
.empty-card p { margin: 1em 0; }
.works-empty-icon { width: 32px; height: 32px; }

.segments { display: flex; flex-wrap: wrap; gap: 7px; }
.segments button {
  min-width: 54px;
  height: 36px;
  padding: 0 11px;
  color: #475569;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
}
.segments button.active { color: var(--blue); background: var(--pale); border-color: #aebfff; font-weight: 700; }

/* =========================================================
   我的作品
   ========================================================= */
.works-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
}
.works-filters { display: flex; align-items: center; gap: 10px; }
.works-bar .segments button { font-size: 0; }
.works-bar .segments button::after { content: "全部"; font-size: 13px; }
.works-bar .segments button:nth-child(2)::after { content: "视频"; }
.success-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  color: #526178;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.success-filter .icon { width: 15px; height: 15px; }
.success-filter.active { color: #047857; background: #ecfdf5; border-color: #86d4b2; font-weight: 700; }
.select-all-works {
  height: 36px;
  padding: 0 11px;
  color: #475569;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.works-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  color: #334155;
  background: #f5f8ff;
  border: 1px solid #dbe4ff;
  border-radius: 11px;
  font-size: 12px;
}
.works-bulk .spacer { flex: 1; }
.works-bulk button {
  height: 32px;
  padding: 0 11px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 12px;
}
.works-bulk button.danger { color: #b91c1c; border-color: #fecaca; }
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.work-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: box-shadow .18s, transform .18s;
}
.work-card:hover { box-shadow: 0 13px 30px rgba(11, 21, 48, .08); transform: translateY(-1px); }
.work-preview { position: relative; aspect-ratio: 1.2; background: #eef2f8; }
.work-preview img { width: 100%; height: 100%; object-fit: cover; }
.work-preview .play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.work-preview .play-badge span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: rgba(11, 21, 48, .55);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  backdrop-filter: blur(3px);
}
.work-preview .play-badge .icon { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  color: #92400e;
  background: #fffbeb;
  border-radius: 7px;
  font-size: 11px;
}
.status.success { color: #047857; background: #ecfdf5; }
.status.failed { color: #b91c1c; background: #fef2f2; }
.status.expired { color: #475569; background: #f1f5f9; }
.work-check {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fff;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(11, 21, 48, .18);
  border-radius: 7px;
  opacity: 0;
  transition: opacity .15s;
}
.work-card:hover .work-check,
.work-check.checked { opacity: 1; }
.work-check.checked { background: var(--blue); border-color: var(--blue); }
.work-check .icon { width: 13px; height: 13px; }
.work-info { padding: 14px; }
.work-info p {
  display: -webkit-box;
  height: 40px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.work-info small { display: block; margin-top: 7px; color: #94a3b8; font-size: 10px; }
.work-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}
.work-card:hover .work-actions { opacity: 1; }
.work-actions button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #334155;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.work-actions button:hover { color: var(--blue); border-color: #bdcaff; }
.work-actions button.danger:hover { color: #b91c1c; border-color: #fecaca; }

/* =========================================================
   平台公告
   ========================================================= */
.announcement-feed { display: grid; gap: 16px; max-width: 980px; }
.announcement-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.announcement-card > div { padding: 22px; }
.announcement-card span { color: #94a3b8; font-size: 11px; }
.announcement-card h2 { display: flex; align-items: center; gap: 8px; margin: 7px 0 10px; font-size: 20px; }
.announcement-card p { margin: 0; color: #475569; line-height: 1.8; white-space: pre-wrap; }
.announcement-card.unread { border-color: #b8c7ff; box-shadow: 0 8px 24px rgba(49, 94, 251, .05); }
.unread-label { padding: 3px 7px; color: #b91c1c; background: #fee2e2; border-radius: 99px; font-size: 10px; }
.announcement-read-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-height: 44px;
  margin-top: 17px;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
}
.announcement-read-control input { position: absolute; opacity: 0; }
.announcement-read-control > span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: transparent;
  border: 1px solid #aebfff;
  border-radius: 6px;
}
.announcement-read-control input:checked + span { color: #fff; background: var(--blue); border-color: var(--blue); }
.announcement-read-control input:focus-visible + span { outline: 3px solid rgba(49, 94, 251, .19); outline-offset: 2px; }
.announcement-read-control input:disabled ~ strong { color: #64748b; }
.announcement-read-control:has(input:disabled) { cursor: default; }

/* =========================================================
   充值与账户
   ========================================================= */
.metric-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 150px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.metric > span { color: var(--muted); }
.metric strong { margin-top: 15px; font-size: 40px; letter-spacing: -.04em; line-height: normal; }
.metric small { color: var(--muted); }
.hero-metric {
  color: #fff;
  background: linear-gradient(135deg, #172554, #315efb);
  border-color: #e2e8f0;
}
.hero-metric > span { color: #cbd7ff; }
.hero-metric small { color: #cbd7ff; padding-right: 124px; }
.hero-metric .secondary-button { position: absolute; right: 20px; bottom: 20px; }
.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 18px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.settings-card .profile { display: flex; align-items: center; gap: 15px; }
.settings-card h3 { margin: 0 0 5px; }
.settings-card p { margin: 0; color: var(--muted); }
.large-avatar {
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  color: #fff;
  background: #172554;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}
.account-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  color: #047857;
  background: #ecfdf5;
  border-radius: 9px;
  font-size: 13px;
  white-space: nowrap;
}
.account-status .icon { width: 15px; height: 15px; align-self: flex-start; }
.account-activity-card {
  margin-top: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.account-activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}
.account-activity-head .eyebrow { margin-top: 4px; }
.account-activity-head h2 { margin: 7px 0 5px; font-size: 21px; }
.account-activity-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.account-activity-head .secondary-button { flex: none; }
.activity-filters { display: flex; gap: 7px; padding: 0 24px 16px; overflow: auto; scrollbar-width: thin; }
.activity-filters button {
  min-height: 38px;
  padding: 0 13px;
  color: #526178;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}
.activity-filters button:hover,
.activity-filters button.active { color: var(--blue); background: var(--pale); border-color: #bdcaff; }
.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.activity-empty .icon { width: 24px; height: 24px; }
.activity-empty strong { color: #334155; font-size: 16px; }
.activity-empty span { font-size: 12px; }
.activity-retention-note {
  margin: 0;
  padding: 12px 24px;
  color: #7b8798;
  background: #fbfcfe;
  border-top: 1px solid #edf1f6;
  font-size: 11px;
  line-height: 1.5;
}
.activity-table { border-top: 1px solid var(--border); }
.activity-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.15fr) minmax(230px, 1.55fr) 92px minmax(105px, .7fr);
  align-items: center;
  gap: 18px;
  padding: 15px 24px;
  font-size: 13px;
  border-bottom: 1px solid #edf1f6;
}
.activity-row:last-child { border-bottom: 0; }
.activity-header { min-height: 44px; padding-top: 11px; padding-bottom: 11px; color: #64748b; background: #f8fafc; font-size: 11px; font-weight: 700; }
.activity-row strong { display: block; color: #1e293b; line-height: 1.45; font-weight: 600; }
.activity-row small { display: block; margin-top: 4px; color: #8492a7; font-size: 11px; line-height: 1.4; }
.activity-row time { color: #64748b; font-size: 11px; font-variant-numeric: tabular-nums; }
.activity-row .amount { color: var(--coral); font-weight: 700; text-align: right; }
.activity-row .amount.positive { color: #047857; }
.activity-footer { padding: 14px 24px; color: #94a3b8; font-size: 11px; border-top: 1px solid #edf1f6; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.contact-card .empty-icon { flex: none; width: 56px; height: 56px; margin: 0; border-radius: 18px; }
.contact-card h3 { margin: 0 0 5px; }
.contact-card p { margin: 0; color: var(--muted); }

/* =========================================================
   API 对接
   ========================================================= */
.api-doc-download-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f7f9ff, #fff);
  border: 1px solid #c7d4ff;
  border-radius: 14px;
}
.api-doc-download-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.api-doc-download-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--blue);
  background: #e9efff;
  border-radius: 11px;
}
.api-doc-download-icon .icon { width: 21px; height: 21px; }
.api-doc-download-card strong { color: #1e293b; font-size: 14px; }
.api-doc-download-card span { color: #64748b; font-size: 12px; line-height: 1.5; }
.api-doc-download-card > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.api-doc-download-card > button:hover:not(:disabled) { background: #244de1; }
.api-doc-download-card > button:disabled { cursor: wait; opacity: .72; }
.api-doc-download-card > button .icon { width: 17px; height: 17px; }
.developer-key-panel {
  margin-top: 0;
  margin-bottom: 20px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 17px;
}
.developer-key-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.developer-key-heading h2 { margin: 6px 0 4px; font-size: 24px; }
.developer-key-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: normal; }
.developer-key-heading > span { padding: 7px 10px; color: var(--blue); background: var(--pale); border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.key-create { display: flex; align-items: flex-end; gap: 10px; margin: 20px 0; }
.key-create label { flex: 1; max-width: 430px; font-size: 12px; font-weight: 700; }
.key-create input {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 7px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #000;
  font-size: 12px;
  outline: none;
}
.key-create input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .07); }
.key-create .primary-button { height: 44px; }
.key-create .primary-button .icon { width: 17px; height: 17px; }
.key-list { border-top: 1px solid var(--border); }
.key-list article {
  display: grid;
  grid-template-columns: 38px minmax(190px, 1fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid #edf1f6;
}
.key-list article > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.key-symbol { display: grid; place-items: center; width: 36px; height: 36px; color: #526178; background: #f3f6fb; border-radius: 10px; }
.key-symbol .icon { width: 18px; height: 18px; }
.key-list strong { display: block; font-size: 13px; }
.key-list code { color: #64748b; font-size: 12px; }
.key-time { display: flex; flex-direction: column; gap: 4px; color: #64748b; font-size: 11px; }
.key-time small { color: #94a3b8; }
.configured { padding: 6px 9px; color: #047857; background: #ecfdf5; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.revoke-key { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; color: #be123c; background: #fff1f2; border: 0; border-radius: 8px; }
.revoke-key .icon { width: 15px; height: 15px; }
.empty-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100px;
  color: var(--muted);
  font-size: 13px;
}
.empty-key .icon { width: 24px; height: 24px; }
.new-key-result { margin: 14px 0; padding: 14px; background: #f0fdf4; border: 1px solid #a7e1bd; border-radius: 12px; }
.new-key-result > div:first-child { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; color: #047857; }
.new-key-result > div:first-child .icon { width: 18px; height: 18px; }
.new-key-result span { display: flex; flex-direction: column; gap: 2px; }
.new-key-result small { color: #43815d; }
.new-key-result .code-line { background: #fff; }
.code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding-left: 13px;
  overflow: hidden;
  background: #f5f7fb;
  border-radius: 10px;
}
.code-line code { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.code-line button { width: 46px; height: 100%; color: var(--blue); background: 0 0; border: 0; }
.code-line button .icon { width: 16px; height: 16px; margin: auto; }

.api-docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 650px;
  margin-top: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 17px;
}
.api-doc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 14px;
  background: #fbfcfe;
  border-right: 1px solid var(--border);
}
.api-doc-nav strong { padding: 5px 10px 13px; color: var(--ink); font-size: 16px; }
.api-doc-nav button {
  height: 39px;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
}
.api-doc-nav button:hover { color: var(--blue); background: #f6f8fd; }
.api-doc-nav button.active { color: var(--blue); background: var(--pale); font-weight: 700; }
.api-doc-body { min-width: 0; padding: 28px 34px; }
.api-base-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 26px;
  padding: 14px 16px;
  color: #fff;
  background: #0b1530;
  border-radius: 12px;
}
.api-base-banner > div { display: flex; flex: 0 1 auto; flex-direction: column; gap: 5px; min-width: 0; }
.api-base-banner span { color: #9fb2d6; font-size: 10px; }
.api-base-banner code { color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.api-base-banner button, .code-example button {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 10px;
  color: #dce7ff;
  background: #ffffff16;
  border: 0;
  border-radius: 8px;
}
.api-base-banner button { font-size: 16px; }
.api-base-banner button .icon { width: 16px; height: 16px; }
.api-base-banner button:hover, .code-example button:hover { background: rgba(255, 255, 255, .14); }
.api-section { display: none; padding-top: 4px; scroll-margin-top: 90px; }
.api-section.active { display: block; }
.api-section > .eyebrow { line-height: 17px; }
.api-section h2 { margin: 7px 0 12px; font-size: 28px; }
.api-section h3 { margin: 25px 0 10px; font-size: 15px; }
.api-section > p { margin: 14px 0; color: #53627a; font-size: 14px; line-height: 1.8; }
.api-section > ul, .api-section > ol { margin: 14px 0; padding-left: 20px; color: #53627a; font-size: 14px; line-height: 1.8; }
.api-section code { overflow-wrap: anywhere; }
.docs-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  color: #047857;
  background: #f0fdf4;
  border: 1px solid #a7e1bd;
  border-radius: 11px;
}
.docs-success > .icon { flex: none; width: 18px; height: 18px; }
.docs-success p { margin: 4px 0 0; color: #357a54; font-size: 12px; line-height: 1.55; }
.docs-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 0 0;
  padding: 13px;
  color: #8a5a12;
  background: #fff9ed;
  border: 1px solid #f4dfb4;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}
.docs-warning > .icon { flex: none; width: 18px; height: 18px; }
.inline-code {
  padding: 13px;
  color: var(--ink);
  background: #f4f6fa;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}
.code-example { margin-top: 26px; overflow: hidden; background: #0b1530; border-radius: 12px; }
.code-example > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  color: #b9c8e5;
  border-bottom: 1px solid #ffffff18;
  font-size: 12px;
}
.code-example > div strong { font-size: 12px; font-weight: 700; }
.code-example button { font-size: 12px; }
.code-example button .icon { width: 15px; height: 15px; }
.code-example pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #d8e5ff;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.75;
}
.endpoint {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 15px 0;
  padding: 12px 14px;
  background: #f6f8fb;
  border-radius: 10px;
}
.endpoint b { padding: 5px 7px; color: #08733b; background: #dff7e8; border-radius: 6px; font-size: 11px; }
.endpoint code { font-size: 13px; }
.endpoint span { margin-left: auto; color: var(--muted); font-size: 11px; }
.param-table {
  display: grid;
  grid-template-columns: 170px 170px 1fr;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.param-table > * { margin: 0; padding: 11px 13px; border-bottom: 1px solid #edf1f6; font-size: 12px; }
.param-table b { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.param-table span { color: var(--blue); }
.param-table p { color: #64748b; }
.status-docs, .error-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.status-docs > *, .error-grid > * { margin: 0; padding: 12px 14px; border-bottom: 1px solid #edf1f6; font-size: 13px; }
.status-docs span { display: flex; align-items: center; gap: 8px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.status-docs i { width: 8px; height: 8px; background: #94a3b8; border-radius: 50%; }
.status-docs i.running { background: #315efb; }
.status-docs i.done { background: #16a34a; }
.status-docs i.failed { background: #dc2626; }
.error-grid b { color: #b45309; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.error-shapes { display: grid; gap: 8px; margin: 16px 0; }
.error-shapes code {
  display: block;
  padding: 12px 14px;
  color: #475569;
  background: #f6f8fb;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.docs-model-table { margin-top: 20px; overflow: auto; border: 1px solid var(--border); border-radius: 11px; }
.docs-model-table table { width: 100%; min-width: 700px; border-collapse: collapse; }
.docs-model-table th, .docs-model-table td { padding: 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf1f6; font-size: 12px; }
.docs-model-table th { color: #64748b; background: #f8fafc; }
.model-capability-list { display: flex; flex-direction: column; gap: 4px; min-width: 210px; color: #526178; }
.model-capability-list span { line-height: 1.45; }
.response-example {
  margin: 10px 0 20px;
  padding: 16px;
  overflow: auto;
  color: #d8e5ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #0b1530;
  border-radius: 11px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
}

/* =========================================================
   弹窗 / 提示
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 21, 48, .42);
  backdrop-filter: blur(3px);
  animation: fade-in .16s ease-out;
}
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(11, 21, 48, .24);
  animation: modal-in .2s ease-out;
}
.modal.wide { width: min(760px, 100%); }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #64748b;
  background: #f8fafc;
  border: 0;
  border-radius: 9px;
}
.modal-close:hover { color: #0f172a; background: #eef2f7; }
.modal h2 { margin: 8px 42px 6px 0; font-size: 22px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal .modal-media { width: 100%; max-height: 420px; margin-top: 18px; object-fit: contain; background: #eef2f8; border-radius: 13px; }
.modal .modal-details { display: grid; grid-template-columns: 76px 1fr; gap: 10px 14px; margin-top: 18px; color: #334155; font-size: 13px; line-height: 1.6; }
.modal .modal-details dt { color: var(--muted); }
.modal .modal-details dd { margin: 0; overflow-wrap: anywhere; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .danger-button { color: #b91c1c; background: #fff; border-color: #fecaca; }
.modal .danger-button:hover { background: #fef2f2; border-color: #fca5a5; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.toast-root {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 120;
  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: 90vw;
  padding: 11px 16px;
  color: #fff;
  background: rgba(11, 21, 48, .93);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(11, 21, 48, .25);
  font-size: 13px;
  animation: toast-in .2s ease-out;
}
.toast .icon { color: #7ee2b8; }
.toast.error .icon { color: #fca5a5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================
   真实 API 连接 / 任务状态
   ========================================================= */
.developer-key-heading > span.connected { color: #047857; background: #ecfdf5; }
.developer-key-heading > span.error { color: #b91c1c; background: #fef2f2; }
.api-connection-panel .key-create { flex-wrap: wrap; }
.api-connection-panel .key-create label { min-width: 260px; }
.api-connection-panel .key-create .secondary-button { height: 44px; }
.key-create .danger-button { color: #b91c1c; background: #fff; border-color: #fecaca; }
.key-create .danger-button:hover { background: #fef2f2; border-color: #fca5a5; }
.api-key-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: -4px 0 14px;
  padding: 11px 13px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}
.api-key-status.ok { color: #047857; background: #f0fdf4; border-color: #bbf7d0; }
.api-key-status.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.api-key-status > span { display: inline-flex; align-items: center; gap: 6px; }
.api-key-mask { color: #334155; }
.api-key-mask code { font-size: 12px; }
.api-key-status .icon { width: 15px; height: 15px; }
.api-key-error { font-weight: 600; }
.api-key-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.api-key-help a { color: var(--blue); font-weight: 600; }

.model-brief { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: #7c8aa0; font-size: 10px; line-height: 1.35; }
.model-brief .model-price { color: var(--blue); font-size: 11px; font-weight: 700; }
.model-price-discount { display: inline-flex; flex-direction: column; gap: 1px; align-items: flex-start; line-height: 1.25; }
.model-price-original { color: #94a3b8; font-size: 10px; font-weight: 600; text-decoration: line-through; }
.model-price-current { color: var(--blue); font-size: 12px; font-weight: 800; }
.model-rail-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 220px;
  padding: 22px 16px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfe;
  border: 1px dashed #d7dfec;
  border-radius: 12px;
}
.model-rail-empty .icon { width: 26px; height: 26px; color: #94a3b8; }
.model-rail-empty strong { color: #334155; font-size: 13px; }
.model-rail-empty span { max-width: 260px; font-size: 11px; line-height: 1.6; }
.model-rail-empty.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.model-rail-empty .primary-button,
.model-rail-empty .secondary-button { margin-top: 4px; min-height: 34px; padding: 0 12px; font-size: 11px; }

.reference-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 9px;
}

.choice-field.is-disabled { opacity: .55; }

.task-status.cancelled { color: #64748b; background: #f1f5f9; }
.task-error {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 9px 0 0;
  padding: 8px 9px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.task-error .icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.task-preview video { width: 100%; height: 100%; object-fit: cover; }

.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: #fff;
  background: linear-gradient(135deg, #315efb, #6d5efc);
  cursor: pointer;
}
.media-placeholder .icon { width: 26px; height: 26px; fill: currentColor; }
.media-placeholder small { font-size: 10px; opacity: .86; }
.media-placeholder.media-error { color: #94a3b8; background: #f8fafc; }
.media-error { display: flex; align-items: center; gap: 6px; padding: 10px; color: #b91c1c; font-size: 10.5px; line-height: 1.5; text-align: left; }
.media-error .icon { flex: none; width: 14px; height: 14px; fill: none; }
.work-preview .media-placeholder { background: linear-gradient(135deg, #1d4ed8, #6d28d9); }
.work-preview .media-placeholder.work-pending { cursor: default; background: linear-gradient(135deg, #64748b, #475569); }
.work-preview .media-placeholder.work-pending.failed { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.work-preview .media-placeholder.work-expired { cursor: default; background: linear-gradient(135deg, #64748b, #334155); }
.work-preview .media-placeholder.work-expired .icon { fill: none; }
.work-actions button:disabled { opacity: .5; cursor: not-allowed; }
.work-actions button:disabled:hover { color: #334155; border-color: var(--border); }
.modal-media .media-placeholder.work-pending { min-height: 180px; cursor: default; border-radius: 13px; }
.modal-media .media-placeholder.work-pending.failed { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.modal-media .media-placeholder.work-expired { min-height: 180px; cursor: default; border-radius: 13px; background: linear-gradient(135deg, #64748b, #334155); }
.modal-media .media-placeholder.work-expired .icon { fill: none; }
.modal-media video { width: 100%; max-height: 420px; margin-top: 18px; background: #eef2f8; border-radius: 13px; }

.docs-model-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 14px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d7dfec;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}
.docs-model-empty.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.docs-model-empty .icon { flex: none; width: 16px; height: 16px; }

/* =========================================================
   响应式
   ========================================================= */
@media (width <= 1450px) {
  .creation-models, .creation-parameters, .creation-prompt { padding: 17px; }
}
@media (width <= 1320px) {
  .creation-shell { height: auto; min-height: 100vh; overflow: visible; }
  .creation-content { height: auto; min-height: calc(100dvh - 72px); overflow: visible; }
  .creation-workspace {
    grid-template-columns: 220px 1fr 1.25fr;
    height: auto;
    min-height: calc(100dvh - 108px);
  }
  .creation-workspace > section { height: auto; }
  .creation-models, .creation-parameters, .creation-prompt { overflow: visible; }
  .model-rail-list { flex: none; max-height: 620px; }
}
@media (width <= 1250px) {
  .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (width <= 1100px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric.hero-metric { grid-column: 1 / -1; }
}
@media (width <= 900px) {
  .app-shell, .app-shell.compact { padding-left: 76px; }
  .sidebar, .compact .sidebar { width: 76px; transform: none; box-shadow: none; }
  .sidebar span { display: none !important; }
  .topbar, .compact .topbar { left: 76px; }
  .topbar-context-group { gap: 12px; }
  .announcement-ticker { margin-right: 10px; }
  .mobile-menu { display: none; }
  .creation-workspace { grid-template-columns: 1fr; }
  .channel-health { padding: 10px 12px; }
  .channel-health-head { min-width: 0; }
  .channel-health-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .channel-health-card { flex: 0 0 260px; scroll-snap-align: start; }
  .creation-models, .creation-parameters, .creation-prompt { border-right: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
  .creation-models { border-radius: 18px 18px 0 0; }
  .creation-prompt { border-bottom: 0; border-radius: 0 0 18px 18px; }
  .model-rail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-docs-layout { grid-template-columns: 165px minmax(0, 1fr); }
  .api-doc-body { padding: 24px; }
  .key-time { display: none; }
  .key-list article { grid-template-columns: 38px 1fr auto auto; }
}
@media (width <= 640px) {
  .auth-shell { display: block; }
  .auth-brand { display: none; }
  .auth-panel { padding: 22px; min-height: 100vh; }
  .auth-card { padding: 28px 22px; }
  .mobile-brand { display: flex; }
  .model-health-bars { gap: 3px; height: 15px; }
  .model-health-metrics small { font-size: 10px; }
  .model-health-metrics b { font-size: 12px; }
  .app-shell, .app-shell.compact { padding: 60px 0 70px; }
  .sidebar { display: none; }
  .topbar, .compact .topbar { height: 60px; padding: 0 14px; left: 0; }
  .top-context small, .top-actions .icon-button, .top-actions .avatar, .mobile-menu { display: none; }
  .topbar-context-group { flex: 1; justify-content: space-between; overflow: visible; }
  .top-actions { gap: 6px; }
  .points-pill { height: 36px; }
  .points-pill small { display: none; }
  .announcement-shortcut { width: 36px; height: 36px; }
  .bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; height: 66px; background: rgba(255,255,255,.93); border-top: 1px solid var(--border); backdrop-filter: blur(14px); }
  .bottom-nav button { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; color: #94a3b8; background: none; border: 0; font-size: 10px; white-space: nowrap; }
  .bottom-nav button.active { color: var(--blue); }
  .bottom-nav .nav-dot { top: 8px; right: calc(50% - 17px); box-shadow: 0 0 0 2px #fff; }
  .bottom-nav button .icon { width: 20px; height: 20px; }
  .content { padding: 20px 14px 30px; }
  .creation-content { height: auto; padding: 14px 14px 30px; }
  .creation-models, .creation-parameters, .creation-prompt { padding: 16px; }
  .model-rail-list { grid-template-columns: 1fr; max-height: 46vh; overflow-y: auto; }
  .topbar.creation .announcement-shortcut { display: none; }
  .announcement-ticker { height: 38px; margin-right: 8px; }
  .announcement-ticker-copy { width: max(320px, 78vw); height: 36px; padding: 0 14px; font-size: 12px; }
  .announcement-ticker-copy strong { display: none; }
  .points-pill { max-width: 105px; padding: 0 10px; }
  .points-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .works-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 130px; padding: 18px; }
  .metric strong { font-size: 32px; }
  .hero-metric small { padding-right: 0; }
  .hero-metric .secondary-button { position: static; margin-top: 14px; }
  .account-status { display: none; }
  .account-activity-head { flex-wrap: wrap; padding: 20px 16px; }
  .account-activity-head .secondary-button { width: 100%; }
  .activity-filters { padding: 0 16px 14px; }
  .activity-filters button { min-height: 44px; }
  .activity-retention-note { padding: 12px 16px; }
  .announcement-card > div { padding: 17px; }
  .announcement-read-control { width: 100%; }
  .activity-row { grid-template-columns: 1fr 1fr; }
  .activity-header { display: none; }
  .api-docs-layout { display: block; }
  .api-doc-nav { flex-direction: row; padding: 10px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .api-doc-nav strong { display: none; }
  .api-doc-nav button { padding: 0 12px; white-space: nowrap; }
  .api-doc-body { padding: 20px 16px; }
  .api-doc-download-card { grid-template-columns: 42px minmax(0, 1fr); }
  .api-doc-download-card > button { grid-column: 1 / -1; width: 100%; }
  .developer-key-panel { padding: 18px; }
  .key-create { flex-direction: column; align-items: stretch; }
  .key-create label { max-width: none; }
  .key-list article { grid-template-columns: 38px 1fr auto; }
  .key-list .configured { display: none; }
  .param-table { grid-template-columns: 1fr 1fr; }
  .param-table p { grid-column: 1 / -1; }
  .status-docs, .error-grid { grid-template-columns: 120px 1fr; }
  .works-bar { align-items: flex-start; gap: 10px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 13px; line-height: 1.55; }
  .page-heading .heading-actions { display: none; }
}
@media (width <= 700px) {
  .works-filters { flex-flow: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .announcement-ticker-track { width: 100%; animation: none; transform: none; }
  .announcement-ticker-copy { width: 100%; min-width: 0; }
  .announcement-ticker-copy:not(:first-child) { display: none; }
  .spin { animation: none; }
}

/* =========================================================
   启动页 / 账户 / 管理后台
   ========================================================= */
.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 32%, rgba(49, 94, 251, .1), transparent 42%),
    var(--page-bg);
}
.boot-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  color: #fff;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(49, 94, 251, .2);
}
.boot-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.boot-mark .icon { width: 26px; height: 26px; }
.boot-splash strong { font-size: 18px; letter-spacing: -.01em; }
.boot-splash > span { color: var(--muted); font-size: 12px; }
.boot-bar { width: 180px; height: 4px; margin-top: 4px; overflow: hidden; background: #e2e8f0; border-radius: 99px; }
.boot-bar i { display: block; width: 42%; height: 100%; background: var(--blue); border-radius: 99px; animation: boot-slide 1.15s ease-in-out infinite; }
@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

.form-notice.success { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.auth-disabled-note {
  margin: 8px 0 0;
  padding: 10px 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
}
.auth-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.auth-footnote { margin: 0; color: #94a3b8; font-size: 11px; text-align: center; }
.auth-footer .support-inline { justify-content: center; margin-top: 8px; padding: 0; background: none; border: 0; }
.auth-footer .support-inline-label { font-size: 11px; }
.auth-footer .support-inline button { padding: 2px 8px; font-size: 11px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.role-badge.admin { color: #7c3aed; background: #f3e8ff; }
.role-badge.user { color: #475569; background: #eef2f7; }

.account-profile-card { flex-wrap: wrap; gap: 16px; }
.account-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.account-profile-actions .secondary-button { min-height: 38px; padding: 0 13px; font-size: 13px; }
.account-metrics .metric strong { font-variant-numeric: tabular-nums; }
.ledger-balance { flex: none; color: var(--muted); font-size: 12px; }
.ledger-balance strong { margin-left: 6px; color: var(--blue); font-size: 20px; font-variant-numeric: tabular-nums; }
.ledger-table { overflow-x: auto; border-top: 1px solid var(--border); }
.ledger-row {
  display: grid;
  grid-template-columns: 132px 92px minmax(180px, 1fr) 160px 88px 88px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 24px;
  border-bottom: 1px solid #edf1f6;
  font-size: 12px;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-header { min-height: 42px; color: #64748b; background: #f8fafc; font-size: 11px; font-weight: 700; }
.ledger-row time { color: #64748b; font-variant-numeric: tabular-nums; }
.ledger-row strong { color: #1e293b; font-weight: 600; line-height: 1.45; }
.ledger-row code { color: #475569; font-size: 11px; word-break: break-all; }
.ledger-type { display: inline-flex; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ledger-type.out { color: #b42318; background: #fef3f2; }
.ledger-type.in { color: #047857; background: #ecfdf5; }
.ledger-balance-cell { color: #334155; text-align: right; font-variant-numeric: tabular-nums; }
.ledger-row .amount { color: var(--coral); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ledger-row .amount.positive { color: #047857; }

.modal-list { margin: 14px 0; padding-left: 20px; color: #475569; font-size: 13px; line-height: 1.75; }
.modal-form { display: grid; gap: 14px; margin-top: 16px; }
.modal-form label { display: grid; gap: 6px; color: #334155; font-size: 13px; font-weight: 600; }
.modal-form input, .modal-form select {
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.modal-form input:focus, .modal-form select:focus {
  border-color: #93a9ff;
  box-shadow: 0 0 0 3px rgba(49, 94, 251, .12);
}
.modal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  scrollbar-width: thin;
}
.admin-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  color: #475569;
  background: none;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-tabs button:hover { background: #f1f5f9; }
.admin-tabs button.active { color: var(--blue); background: var(--pale); }

.admin-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
}
.admin-warning .icon { flex: none; color: #d97706; }
.admin-warning div { display: grid; flex: 1; gap: 3px; }
.admin-warning strong { font-size: 14px; }
.admin-warning span { color: #a16207; font-size: 12px; }

.admin-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-metric { display: flex; flex-direction: column; gap: 7px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.admin-metric > span { color: var(--muted); font-size: 12px; }
.admin-metric strong { font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.admin-metric small { color: #8492a7; font-size: 11px; line-height: 1.45; }

.admin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.admin-panel { margin-bottom: 16px; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.admin-split .admin-panel { margin-bottom: 0; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #edf1f6; }
.admin-panel-head h3 { font-size: 16px; }
.admin-panel-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.text-link { padding: 0; color: var(--blue); background: none; border: 0; font-size: 12px; font-weight: 600; }
.admin-panel-foot { padding: 12px 20px; color: #94a3b8; font-size: 11px; border-top: 1px solid #edf1f6; }

.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  padding: 11px 14px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #edf1f6;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}
.admin-table td { padding: 12px 14px; color: #334155; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.admin-table tbody tr:hover { background: #fbfcff; }
.admin-table td strong { color: #1e293b; font-weight: 600; }
.admin-table td small { color: #8492a7; font-size: 11px; }
.admin-table code { color: #475569; font-size: 11px; word-break: break-all; }
.admin-cell-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-empty-cell { padding: 34px 14px !important; color: #94a3b8 !important; text-align: center; }

.status-pill { display: inline-flex; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill.success { color: #047857; background: #ecfdf5; }
.status-pill.failed, .status-pill.cancelled { color: #b42318; background: #fef3f2; }
.status-pill.running { color: #1d4ed8; background: #eff6ff; }
.status-pill.queued { color: #92400e; background: #fffbeb; }

.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid #edf1f6; }
.admin-search { display: flex; flex: 1; gap: 8px; min-width: 240px; }
.admin-search input {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.admin-search input:focus { border-color: #93a9ff; box-shadow: 0 0 0 3px rgba(49, 94, 251, .12); }
.admin-search .secondary-button { min-height: 40px; }
.admin-select { min-height: 40px; padding: 0 10px; font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.admin-toolbar-spacer { flex: 1; }
.admin-row-actions { display: flex; gap: 4px; }
.admin-row-actions button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.admin-row-actions button:hover { color: var(--blue); background: var(--pale); border-color: #bdcaff; }
.admin-row-actions button.danger:hover { color: #b42318; background: #fef3f2; border-color: #fecaca; }
.admin-price-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.admin-price-list { display: grid; gap: 10px; margin-top: 16px; }
.admin-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 150px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #f8faff;
  border: 1px solid #e2e8f5;
  border-radius: 10px;
}
.admin-price-row strong { display: block; color: #1e293b; font-size: 13px; }
.admin-price-row small { display: block; margin-top: 3px; color: #8492a7; font-size: 11px; }
.admin-price-row input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.admin-price-row input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(49, 94, 251, .12); }
.admin-price-current { color: #173bba; font-size: 12px; font-weight: 700; text-align: right; }
.admin-price-note { margin-top: 12px; color: #8492a7; font-size: 11px; line-height: 1.6; }
@media (width <= 700px) {
  .admin-price-row { grid-template-columns: 1fr; }
  .admin-price-current { text-align: left; }
}

.admin-loading, .admin-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.admin-error strong { color: #b42318; }

.admin-settings-form { display: grid; gap: 18px; padding: 20px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.admin-channel-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-channel-editor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.admin-channel-editor-head strong { font-size: 13px; }
.admin-channel-editor-head small { color: var(--muted); font-size: 11px; }
.admin-channel-rows { display: grid; gap: 8px; }
.admin-channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.8fr) minmax(0, 1.2fr) auto;
  grid-template-areas:
    "model model model enable"
    "name price workflow workflow";
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-channel-model { display: grid; gap: 5px; min-width: 0; grid-area: model; }
.admin-channel-model small { color: var(--muted); font-size: 11px; }
.admin-channel-model code {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-channel-row label { font-size: 11px; min-width: 0; }
.admin-channel-row label:nth-of-type(1) { grid-area: name; }
.admin-channel-row label:nth-of-type(2) { grid-area: price; }
.admin-channel-row label:nth-of-type(3) { grid-area: workflow; }
.admin-channel-row input { min-height: 36px !important; width: 100%; }
.admin-channel-enabled {
  display: flex !important;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
  gap: 6px;
  font-weight: 600;
  grid-area: enable;
}
.admin-channel-enabled input { width: 16px; height: 16px; min-height: 0 !important; }
.admin-settings-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 600; }
.admin-settings-form input, .admin-settings-form textarea {
  padding: 10px 12px;
  font-weight: 400;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.admin-settings-form input { min-height: 42px; }
.admin-settings-form input:focus, .admin-settings-form textarea:focus {
  border-color: #93a9ff;
  box-shadow: 0 0 0 3px rgba(49, 94, 251, .12);
}
.admin-switches { display: grid; gap: 10px; }
.admin-switch { display: flex !important; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.admin-switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); }
.admin-switch span { display: grid; gap: 3px; }
.admin-switch small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.admin-form-actions { display: flex; gap: 10px; }
.admin-settings-form select {
  min-height: 42px;
  padding: 10px 12px;
  font-weight: 400;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.admin-settings-form select:focus {
  border-color: #93a9ff;
  box-shadow: 0 0 0 3px rgba(49, 94, 251, .12);
}
.admin-mail-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-mail-test-row label { flex: 1; min-width: 220px; }
.admin-mail-test-row .secondary-button { flex: none; }
.admin-server-info {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 18px;
  color: #64748b;
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-server-info strong { color: #334155; }

.announcement-source { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; color: #7c3aed; font-size: 11px; font-weight: 600; }

@media (width <= 1100px) {
  .admin-metric-grid { grid-template-columns: 1fr 1fr; }
  .admin-split { grid-template-columns: 1fr; }
}
@media (width <= 640px) {
  .admin-metric-grid { grid-template-columns: 1fr; }
  .admin-form-grid, .modal-form-row { grid-template-columns: 1fr; }
  .admin-channel-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "model"
      "name"
      "price"
      "workflow"
      "enable";
  }
  .admin-channel-enabled { justify-content: flex-start; }
  .admin-channel-editor-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  .account-profile-actions { width: 100%; margin-left: 0; }
  .account-profile-actions .secondary-button { flex: 1; }
  .ledger-row { grid-template-columns: 110px 80px minmax(150px, 1fr) 80px 80px; }
  .ledger-row > *:nth-child(4) { display: none; }
  .admin-warning { flex-wrap: wrap; }
  .admin-search { min-width: 100%; }
  .admin-toolbar-spacer { display: none; }
}

/* ---------- 下游 API 门户 ---------- */
.api-endpoint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #dbe4ff;
  border-radius: 16px;
  background: linear-gradient(120deg, #f7f9ff 0%, #eef3ff 100%);
}
.api-endpoint-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.api-endpoint-main code {
  color: #1e3a8a;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.api-endpoint-main p { margin: 2px 0 0; max-width: 760px; color: #55647e; font-size: 12px; line-height: 1.7; }
.api-endpoint-main p code { font-size: 12px; color: #1e3a8a; background: #e5ecff; padding: 1px 5px; border-radius: 5px; }
.api-endpoint-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.api-endpoint-side .secondary-button { background: #fff; }

.api-keys-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed #dbe3ef;
  border-radius: 12px;
  font-size: 13px;
}
.api-keys-empty.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.api-keys-empty .secondary-button { margin-left: auto; }

.api-key-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.api-key-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  background: #fbfcff;
  border: 1px solid #e6ebf5;
  border-radius: 12px;
}
.api-key-row-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.api-key-row-main strong { color: #1e293b; font-size: 13px; }
.api-key-row-main code { color: #475569; font-size: 12px; }
.api-key-row-main span { color: #8a97ab; font-size: 11px; }
.api-key-row .text-link.danger { color: #b42318; }

.api-key-reveal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 18px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
}
.api-key-reveal-head { display: flex; align-items: flex-start; gap: 10px; color: #047857; }
.api-key-reveal-head > div { display: flex; flex-direction: column; gap: 3px; }
.api-key-reveal-head strong { font-size: 14px; }
.api-key-reveal-head span { color: #3f6b58; font-size: 12px; line-height: 1.6; }
.api-key-reveal > code {
  display: block;
  padding: 12px 14px;
  color: #065f46;
  background: #fff;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.api-key-reveal-actions { display: flex; gap: 10px; }
.api-key-reveal-actions .primary-button, .api-key-reveal-actions .secondary-button { height: 38px; }

.admin-upstream-result {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 13px 16px;
  color: #55647e;
  background: #f8fafc;
  border: 1px solid #e6ebf5;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}
.admin-upstream-result.ok { color: #047857; background: #f0fdf4; border-color: #bbf7d0; }
.admin-upstream-result.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

@media (max-width: 720px) {
  .api-endpoint-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
  .api-endpoint-side { width: 100%; justify-content: space-between; }
  .api-key-row { flex-wrap: wrap; gap: 10px; }
  .api-key-row-main { flex-basis: 100%; }
  .api-key-reveal-actions { flex-wrap: wrap; }
}

/* =========================================================
   在线充值 / 充值订单
   ========================================================= */
.recharge-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 28px;
  margin-top: 20px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(15, 31, 68, .05);
}
.recharge-card-main h2 { margin: 7px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.recharge-card-main p { max-width: 640px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.recharge-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; }
.recharge-card-side .primary-button { min-width: 132px; }
.recharge-card-side small { color: #94a3b8; font-size: 11px; }
.recharge-history { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid #edf1f7; }
.recharge-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.recharge-history-head strong { font-size: 13px; }
.recharge-history-head span { color: var(--muted); font-size: 11px; }
.recharge-history-row {
  display: grid;
  grid-template-columns: minmax(110px, .8fr) minmax(0, 1.4fr) minmax(120px, .8fr);
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px dashed #eef2f7;
  font-size: 12px;
}
.recharge-history-row:first-of-type { border-top: 0; }
.recharge-history-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.recharge-history-row > div:last-child { align-items: flex-end; gap: 5px; }
.recharge-history-row strong { font-size: 13px; }
.recharge-history-row span { color: var(--muted); }
.recharge-history-row code { overflow: hidden; color: #334155; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recharge-history-links { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.recharge-expire-note { color: #b45309; font-size: 10px; }

.recharge-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.recharge-presets button {
  height: 40px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .15s, color .15s, background .15s;
}
.recharge-presets button:hover { border-color: #9db4ff; color: var(--blue); }
.recharge-presets button.active { color: var(--blue); background: var(--pale); border-color: #9db4ff; }
.recharge-preview {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 14px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  font-size: 13px;
}
.recharge-preview strong { color: var(--blue); font-size: 18px; }
.recharge-qr-wrap {
  display: grid;
  place-items: center;
  width: 244px;
  height: 244px;
  margin: 18px auto 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 31, 68, .07);
}
.recharge-qr { width: 100%; height: 100%; object-fit: contain; }
.recharge-status { margin: 0 0 4px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }
.recharge-status.pending { color: #b45309; }
.recharge-status.failed { color: #b42318; }
.recharge-actions { justify-content: center; }
.recharge-actions .primary-button,
.recharge-actions .secondary-button { display: inline-flex; align-items: center; justify-content: center; }
.recharge-success { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 2px; text-align: center; }
.recharge-success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  color: #047857;
  background: #ecfdf5;
  border-radius: 50%;
}
.recharge-success h2 { margin: 0; }
.recharge-success .modal-sub { margin: 0; }
.recharge-success-balance {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  font-size: 13px;
}
.recharge-success-balance strong { margin: 0 4px; color: var(--blue); font-size: 22px; }
.status-pill.pending { color: #92400e; background: #fffbeb; }

.modal-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  outline: none;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
}
.modal-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, .12); }
.admin-cache-panel { margin-top: 20px; }

@media (max-width: 720px) {
  .recharge-card { grid-template-columns: 1fr; padding: 20px; }
  .recharge-card-side { align-items: stretch; }
  .recharge-card-side .primary-button { width: 100%; }
  .recharge-history-row { grid-template-columns: 1fr; gap: 7px; }
  .recharge-history-row > div:last-child { align-items: flex-start; }
  .recharge-history-links { justify-content: flex-start; }
  .recharge-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recharge-qr-wrap { width: 220px; height: 220px; }
  .recharge-actions { flex-wrap: wrap; }
}

/* =========================================================
   联系站长 / 客服信息
   ========================================================= */
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.sidebar-foot .collapse { margin-top: 0; }

.support-card {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e6ebf5;
  border-radius: 12px;
}
.support-card-head { display: flex; align-items: center; gap: 7px; color: #334155; font-size: 12px; }
.support-card-head .icon { color: var(--blue); }
.support-line {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 7px;
  padding: 0;
  color: #64748b;
  background: none;
  border: 0;
  font-size: 11px;
  text-align: left;
}
.support-line > span { flex: 1; white-space: nowrap; }
.support-line strong { color: #0f172a; font-size: 12px; letter-spacing: .01em; }
.support-line .icon { flex: none; color: #94a3b8; }
.support-line:hover strong, .support-line:hover .icon { color: var(--blue); }

.support-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  color: var(--blue);
  background: var(--pale);
  border: 1px solid #d8e2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.support-chip:hover { background: #e6edff; border-color: #b9caff; }

.support-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px dashed #d9e2ef;
  border-radius: 10px;
}
.support-inline-label { display: inline-flex; align-items: center; gap: 5px; color: #64748b; font-size: 12px; font-weight: 600; }
.support-inline button {
  padding: 4px 10px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d8e2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}
.support-inline button:hover { background: var(--pale); }

.support-list { display: grid; gap: 10px; margin-top: 18px; }
.support-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e6ebf5;
  border-radius: 12px;
}
.support-item > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.support-item span { color: #64748b; font-size: 12px; }
.support-item strong { color: #0f172a; font-size: 17px; letter-spacing: .02em; overflow-wrap: anywhere; }
.support-item-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.support-item-actions .secondary-button { min-height: 34px; padding: 0 11px; font-size: 12px; }

/* 支付宝收银台二维码：由服务端从收银台页面提取，避免 iframe 在手机上裁切 */
.recharge-qr-hint { max-width: 420px; margin: 0 auto 6px; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.ref-upload-status { margin: 8px 0 0; color: var(--blue); font-size: 12px; text-align: center; }

@media (width <= 900px) {
  .support-card { display: none; }
}
@media (width <= 640px) {
  .support-chip { justify-content: center; width: 36px; height: 36px; padding: 0; }
  .support-chip span { display: none; }
  .support-inline { flex-direction: column; align-items: stretch; }
  .support-inline-label { justify-content: flex-start; }
  .support-inline button { width: 100%; text-align: left; }
  .auth-footer .support-inline { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .auth-footer .support-inline-label { justify-content: center; }
  .auth-footer .support-inline button { width: auto; text-align: center; }
  .support-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .support-item-actions { width: 100%; }
  .support-item-actions .secondary-button { flex: 1; justify-content: center; }
}
