/* ============================================================
   Console v2 设计层 — 通千算智AI短剧 控制台统一重设计（r160）
   策略：叠加在 aurora.css 之后的第二层覆盖（令牌 + !important 压制内联）
   定调：大气简约 —— 大留白 / 少边框 / 层级靠字重与灰阶 / 紫色唯一强调 / 柔和圆角微阴影
   红线：不改功能 DOM/JS；只做视觉与排布
   ============================================================ */

:root {
  /* 灰阶与底色 */
  --c2-bg: #f7f8fa;
  --c2-surface: #ffffff;
  --c2-ink: #16181f;
  --c2-ink-2: #5a6072;
  --c2-ink-3: #9298a8;
  --c2-line: #eceef3;
  --c2-line-2: #e0e3ec;

  /* 品牌（与官网/aurora 同源） */
  --c2-brand: #5b2ee5;
  --c2-brand-2: #7c4dff;
  --c2-brand-deep: #4020a8;
  --c2-brand-soft: #f1edff;
  --c2-brand-line: #ded4ff;
  --c2-brand-grad: linear-gradient(135deg, #5b2ee5 0%, #7c4dff 100%);

  /* 语义色 */
  --c2-green: #0a8a5f;
  --c2-green-bg: #ecfaf4;
  --c2-amber: #8a5a00;
  --c2-amber-bg: #fff8ea;
  --c2-red: #d92d20;
  --c2-blue: #175cd3;

  /* 形状与阴影 */
  --c2-r-l: 18px;
  --c2-r: 14px;
  --c2-r-s: 10px;
  --c2-sh-1: 0 1px 2px rgba(18, 20, 32, 0.04), 0 8px 24px rgba(18, 20, 32, 0.05);
  --c2-sh-2: 0 2px 8px rgba(18, 20, 32, 0.08), 0 20px 48px rgba(64, 32, 168, 0.12);
  --c2-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

/* ---------- 基底 ---------- */
body {
  background: var(--c2-bg) !important;
  font-family: var(--c2-font) !important;
  color: var(--c2-ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.1px;
}
::selection { background: rgba(91, 46, 229, 0.16); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd3dd; border-radius: 8px; border: 3px solid var(--c2-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏：克制的品牌条 ---------- */
header.header, header {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: saturate(1.5) blur(16px);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--c2-line) !important;
  box-shadow: none !important;
}
/* 杂项入口收进设置页哲学：顶栏只留 品牌 + 导航（GitHub/主题/语言对小白是噪声） */
header.header a.github-link,
header.header button.theme-toggle,
header.header button.locale-trigger,
header.header .locale-menu { display: none !important; }

header.header .brand { font-weight: 800 !important; letter-spacing: 0.3px; }
header.header .brand-sub { color: var(--c2-ink-3) !important; font-weight: 500; }

header.header nav.header-nav, header.header nav {
  gap: 6px;
  flex: 1;
  justify-content: center;
}
header.header nav a, header.header nav.header-nav a {
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--c2-r-s) !important;
  padding: 8px 18px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: var(--c2-ink-2) !important;
  transition: background 0.15s ease, color 0.15s ease;
}
header.header nav a:hover, header.header nav.header-nav a:hover {
  background: #f0f1f6 !important;
  color: var(--c2-ink) !important;
}
header.header nav a.router-link-active,
header.header nav a.active {
  background: var(--c2-brand-grad) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(91, 46, 229, 0.30);
}

/* ---------- 主画布：更宽、更透气 ---------- */
main { max-width: 1120px !important; padding-left: 28px !important; padding-right: 28px !important; }
main h1 { font-size: 24px !important; font-weight: 800 !important; letter-spacing: 0.2px; }
main h2 { font-weight: 700 !important; }

/* ---------- 启动台 hero ---------- */
.launcher-head { margin-bottom: 6px !important; }
.launcher-title { font-size: 26px !important; font-weight: 800 !important; letter-spacing: 0.2px; }
.launcher-sub { color: var(--c2-ink-3) !important; font-size: 13px !important; }
.hero-stats { gap: 8px; }
.hero-stats .tag {
  background: #f0f1f6 !important;
  color: var(--c2-ink-2) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
}
.hero-stats .tag-success { background: var(--c2-green-bg) !important; color: var(--c2-green) !important; }
.hero-stats .tag-accent { background: var(--c2-brand-soft) !important; color: var(--c2-brand) !important; }

/* ---------- 一句话生成卡（tqOneBox 结构由注入脚本重建，此处兜底压内联残留） ---------- */
#tqOneBox {
  background: var(--c2-surface) !important;
  border: 1px solid var(--c2-line) !important;
  border-radius: var(--c2-r-l) !important;
  box-shadow: var(--c2-sh-1) !important;
  padding: 22px 24px !important;
  margin: 0 0 14px 0 !important;
  position: relative;
  overflow: hidden;
}
#tqOneBox::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--c2-brand-grad);
  opacity: 0.9;
}
.tqOneHead { margin-bottom: 14px; }
.tqOneBadge {
  display: inline-block;
  background: var(--c2-brand-soft);
  color: var(--c2-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.tqOneTitle { font-size: 20px; font-weight: 800; color: var(--c2-ink); letter-spacing: 0.2px; }
.tqOneSub { font-size: 13px; color: var(--c2-ink-2); margin-top: 4px; }
#tqOneIdea {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1.5px solid var(--c2-line-2) !important;
  border-radius: var(--c2-r) !important;
  padding: 14px 16px !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  min-height: 92px !important;
  color: var(--c2-ink) !important; /* Nuxt entry.css 的 .textarea{color:var(--text-0)=白} 会打进浅色卡，必须显式压回深色 */
  background: #fff !important;
  caret-color: var(--c2-brand) !important;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#tqOneIdea::placeholder { color: var(--c2-ink-3) !important; }
#tqOneIdea:focus {
  outline: none !important;
  border-color: var(--c2-brand-2) !important;
  box-shadow: 0 0 0 4px rgba(91, 46, 229, 0.10) !important;
}
.tqOneRow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.tqOneRow select, #tqOneBox select {
  flex: 0 0 auto !important; /* 不压缩：flex 行内曾被压到 52px 把「题材/分辨率/语言」文字掐断 */
  width: auto !important;
  min-width: max-content !important;
  padding: 9px 12px !important;
  border: 1.5px solid var(--c2-line-2) !important;
  border-radius: var(--c2-r-s) !important;
  background: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--c2-ink) !important;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
#tqOneBox select:hover { border-color: var(--c2-brand-line) !important; }
/* aurora.css:325 `#tqOneBox > div:nth-child(3) select{min-width:0!important;flex:0 1 auto!important}`（特异性 1-1-1）
   把三个 select 压到 52px 掐断文字——用 body 前缀抬到 1-1-2 直接压死，恢复按内容自然宽 */
body #tqOneBox .tqOneRow select,
body #tqOneBox > div:nth-child(3) select {
  flex: 0 0 auto !important;
  min-width: max-content !important;
  width: auto !important;
  max-width: 100% !important; /* 窄窗口（内嵌浏览器）下按容器收窄，配合行的 wrap 不再溢出裁边 */
}
#tqOneGo {
  background: var(--c2-brand-grad) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--c2-r-s) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 11px 26px !important;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(91, 46, 229, 0.28) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#tqOneGo:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(91, 46, 229, 0.34) !important; }
#tqOneGo:active { transform: translateY(0); }
#tqOneGo:disabled { opacity: 0.65; transform: none !important; }
.tqOneMeta { margin-top: 10px; font-size: 12px; color: var(--c2-ink-3); }

/* ---------- 新手三步条（r160 重构：白卡 + 数字圆标） ---------- */
#tqNewbieCard {
  background: var(--c2-surface) !important;
  border: 1px solid var(--c2-line) !important;
  border-radius: var(--c2-r-l) !important;
  box-shadow: var(--c2-sh-1) !important;
  padding: 16px 20px !important;
  margin: 0 0 14px 0 !important;
}
.tqStepsHead { font-size: 13px; font-weight: 700; color: var(--c2-ink); margin-bottom: 10px; }
.tqSteps { display: flex; gap: 12px; flex-wrap: wrap; }
.tqStep {
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f8f8fc;
  border-radius: var(--c2-r);
  padding: 10px 12px;
}
.tqStep .n {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--c2-brand-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.tqStep .t { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.tqStep .t b { font-size: 13px; color: var(--c2-ink); }
.tqStep .t span { color: var(--c2-ink-2); line-height: 1.55; }
.tqStep .t .markPub { color: var(--c2-green); font-weight: 600; text-decoration: none; }
.tqStep .t .markPub:hover { text-decoration: underline; }
.tqStep .t .done { color: var(--c2-green); font-style: normal; font-weight: 700; }
.tqStepsFoot { margin-top: 10px; font-size: 12px; color: var(--c2-ink-3); }
.tqStepsFoot a { color: var(--c2-brand); font-weight: 600; }

/* ---------- 工具栏：搜索 / 分段筛选 / 排序 ---------- */
.toolbar {
  background: var(--c2-surface) !important;
  border: 1px solid var(--c2-line) !important;
  border-radius: var(--c2-r) !important;
  box-shadow: var(--c2-sh-1) !important;
  padding: 10px 12px !important;
}
.toolbar .search-box { border-radius: var(--c2-r-s) !important; }
.toolbar input.input {
  border: 1.5px solid transparent !important;
  background: #f0f1f6 !important;
  border-radius: var(--c2-r-s) !important;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.toolbar input.input:focus {
  outline: none !important;
  background: #fff !important;
  border-color: var(--c2-brand-2) !important;
  box-shadow: 0 0 0 4px rgba(91, 46, 229, 0.10) !important;
}
.chip-row {
  background: #f0f1f6 !important;
  border-radius: 999px !important;
  padding: 3px !important;
  gap: 2px !important;
}
.chip-row .filter-chip {
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--c2-ink-2) !important;
  transition: all 0.15s ease;
}
.chip-row .filter-chip:hover { color: var(--c2-ink) !important; }
.chip-row .filter-chip.on {
  background: var(--c2-surface) !important;
  color: var(--c2-brand) !important;
  box-shadow: 0 1px 4px rgba(18, 20, 32, 0.12);
}

/* ---------- 空态 ---------- */
.empty-state {
  background: var(--c2-surface) !important;
  border: 1px dashed var(--c2-line-2) !important;
  border-radius: var(--c2-r-l) !important;
  padding: 48px 24px !important;
}
.empty-title { font-weight: 700 !important; color: var(--c2-ink) !important; }
.empty-desc { color: var(--c2-ink-3) !important; }

/* ---------- 按钮体系（全站通用类） ---------- */
.btn {
  border-radius: var(--c2-r-s) !important;
  font-weight: 600 !important;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--c2-brand-grad) !important;
  box-shadow: 0 4px 14px rgba(91, 46, 229, 0.24);
  border: 0 !important;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 20px rgba(91, 46, 229, 0.3); }
.btn-icon { background: #f0f1f6 !important; border: 0 !important; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c2-brand-2) !important;
  outline-offset: 2px !important;
}

/* ---------- 通用输入与下拉 ---------- */
input.input, textarea.input, .base-select {
  border-radius: var(--c2-r-s) !important;
}
.base-select { border: 1.5px solid var(--c2-line-2) !important; background: #fff !important; }

/* ---------- 右侧工具 dock：统一三悬浮入口 + 反馈按钮 ----------
   现状：灵感/自检/质检 三个内联 <a>（各自彩色描边散乱）+ 💬 反馈 + 账户悬浮簇全部挤在右下角互相压
   v2：等距纵向 dock，白底、统一次序、品牌色图标；账户胶囊移到顶栏下方 */
body > a[href^="/ideas.html"],
body > a[href^="/publish.html"],
body > a[href^="/qc.html"] {
  position: fixed !important;
  right: 18px !important;
  z-index: 9998 !important;
  width: auto !important;
  padding: 9px 16px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--c2-line-2) !important;
  color: var(--c2-ink-2) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: var(--c2-sh-1) !important;
  transition: all 0.15s ease;
}
body > a[href^="/ideas.html"]:hover,
body > a[href^="/publish.html"]:hover,
body > a[href^="/qc.html"]:hover {
  color: var(--c2-brand) !important;
  border-color: var(--c2-brand-line) !important;
  transform: translateX(-2px);
}
body > a[href^="/qc.html"] { bottom: 18px !important; }
body > a[href^="/publish.html"] { bottom: 74px !important; }
body > a[href^="/ideas.html"] { bottom: 130px !important; }

#tqFbBtn {
  bottom: 178px !important;
  right: 18px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--c2-line-2) !important;
  box-shadow: var(--c2-sh-1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 账户胶囊（🔔 + 我/余额 + 菜单）：右下角拥挤 → 顶栏正下方，像头部账户区 */
#tqFloatWrap { top: 64px !important; bottom: auto !important; right: 18px !important; }
#tqFloatWrap #tqUserBtn, #tqFloatWrap .tqUserBtn {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--c2-line-2) !important;
  border-radius: 999px !important;
  box-shadow: var(--c2-sh-1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#tqUserMenu, #tqFloatWrap .menu {
  border-radius: var(--c2-r) !important;
  border: 1px solid var(--c2-line) !important;
  box-shadow: var(--c2-sh-2) !important;
  overflow: hidden;
}
#tqUserMenu .mi:hover { background: #f4f2ff !important; }

/* ---------- 弹层（登录/充值等注入弹窗统一压圆角阴影） ---------- */
#tqPayMask > div, #tqAuthMask > div { border-radius: var(--c2-r-l) !important; box-shadow: var(--c2-sh-2) !important; }
#tqWxPkgs button { border-radius: var(--c2-r-s) !important; }
#tqWxPkgs button:hover { border-color: var(--c2-brand-line) !important; }
#tqWxPay { background: #07c160 !important; border-radius: var(--c2-r-s) !important; font-weight: 700 !important; }

/* ---------- toast ---------- */
#tqToast, .tqToast {
  border-radius: var(--c2-r) !important;
  box-shadow: var(--c2-sh-2) !important;
  font-weight: 600 !important;
}

/* ---------- 独立控制台页统一（auto / publish / qc / ideas / funnel，body 打 pg-* 标记） ---------- */
body[class^="pg-"] h1 { font-size: 22px !important; font-weight: 800 !important; letter-spacing: 0.2px; }
body[class^="pg-"] h2 { font-weight: 700 !important; }
body[class^="pg-"] .card {
  border-radius: var(--c2-r-l) !important;
  border: 1px solid var(--c2-line) !important;
  box-shadow: var(--c2-sh-1) !important;
}
/* 按钮统一品牌渐变；ghost 次级按钮白底紫描边；注入的 .btn 体系已自带样式故排除 */
body[class^="pg-"] button:not(.btn):not(.tqSampleBtn):not(.btn-icon) {
  background: var(--c2-brand-grad) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--c2-r-s) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(91, 46, 229, 0.20);
  transition: all 0.15s ease;
}
body[class^="pg-"] button:not(.btn):not(.tqSampleBtn):hover { filter: brightness(1.06); }
body[class^="pg-"] button.ghost {
  background: #fff !important;
  color: var(--c2-brand) !important;
  border: 1.5px solid var(--c2-brand-line) !important;
  box-shadow: none;
}
body[class^="pg-"] button:disabled {
  background: #c8cbd6 !important;
  box-shadow: none;
  filter: none;
}
/* 输入控件统一圆角与聚焦环 */
body[class^="pg-"] input, body[class^="pg-"] select, body[class^="pg-"] textarea {
  border: 1.5px solid var(--c2-line-2) !important;
  border-radius: var(--c2-r-s) !important;
  background: #fff !important;
  color: var(--c2-ink) !important; /* 同 #tqOneIdea：压回深色，防 Nuxt 深色主题白字打进浅色底 */
  caret-color: var(--c2-brand) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body[class^="pg-"] input::placeholder, body[class^="pg-"] textarea::placeholder {
  color: var(--c2-ink-3) !important;
}
body[class^="pg-"] input:focus, body[class^="pg-"] select:focus, body[class^="pg-"] textarea:focus {
  outline: none !important;
  border-color: var(--c2-brand-2) !important;
  box-shadow: 0 0 0 4px rgba(91, 46, 229, 0.10) !important;
}
/* 发布助手主 CTA 强化（次级 ghost 保持小号对比） */
body.pg-publish #btnCheck {
  min-width: 220px;
  font-size: 15px !important;
  padding: 12px 28px !important;
}

/* 灵感选题库：卡片行高收齐（一句话简介钳 3 行 + 底高），网格更整齐 */
body.pg-ideas .logline {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 58px;
}
body.pg-ideas .card { min-height: 232px; }

/* worker 状态灯（auto 页注入元素）：贴边裸文本 → 状态 pill（红/绿随 inline color 切换） */
#tqWorkerLamp {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-weight: 600;
  margin-left: 10px;
}
#tqWorkerLamp[style*="059669"], #tqWorkerLamp[style*="10b981"] {
  background: var(--c2-green-bg);
  border-color: #b8ead2;
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  main { padding-left: 16px !important; padding-right: 16px !important; }
  .launcher-title { font-size: 21px !important; }
  body > a[href^="/ideas.html"], body > a[href^="/publish.html"], body > a[href^="/qc.html"], #tqFbBtn {
    right: 10px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
  }
  body > a[href^="/qc.html"] { bottom: 14px !important; }
  body > a[href^="/publish.html"] { bottom: 64px !important; }
  body > a[href^="/ideas.html"] { bottom: 114px !important; }
  #tqFbBtn { bottom: 158px !important; width: 36px !important; height: 36px !important; }
  #tqFloatWrap { top: 58px !important; right: 10px !important; }
}

/* ===== 登录页（login.html，pg-login）r164：输入框边框可见性 + 登录卡片打磨 ===== */
body.pg-login #u,
body.pg-login #p {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1.5px solid var(--c2-line-2) !important;
  border-radius: var(--c2-r-s) !important;
  padding: 11px 14px !important;
  font-size: 14px !important;
  background: #fff !important;
  color: var(--c2-ink) !important;
  caret-color: var(--c2-brand) !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body.pg-login #u:focus,
body.pg-login #p:focus {
  outline: none !important;
  border-color: var(--c2-brand-2) !important;
  box-shadow: 0 0 0 4px rgba(91, 46, 229, 0.10) !important;
}
body.pg-login #u::placeholder,
body.pg-login #p::placeholder { color: var(--c2-ink-3) !important; }
body.pg-login #b,
body.pg-login #r { font-weight: 700 !important; letter-spacing: 2px; }
