/* ============================================
   AI视频工厂 · 全站样式（红色主题）
   布局对标茂隆掌柜AI，配色为自有红色系
   ============================================ */
:root {
  --red: #d0342c;
  --red-dark: #a32020;
  --red-deep: #7c1414;
  --red-soft: #fdecea;
  --gold: #f2b33d;
  --ink: #1f1b1b;
  --ink-2: #5c5350;
  --ink-3: #968c88;
  --bg: #faf7f6;
  --card: #ffffff;
  --line: #eee6e4;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(160, 40, 30, .08);
  --sidebar-w: 64px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- 顶部公告条 ---------- */
.topbar {
  height: 40px;
  background: linear-gradient(90deg, #e2402f 0%, #b01030 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  position: relative;
  padding: 0 44px;
}
.topbar b { color: var(--gold); }
.topbar .close-bar {
  position: absolute; right: 14px; background: none; border: 0;
  color: rgba(255,255,255,.85); font-size: 16px;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; z-index: 50;
}
.sidebar .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.sidebar nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0; color: var(--ink-2); font-size: 11px; border-radius: 10px;
  margin: 0 8px;
}
.sidebar nav a .ico { font-size: 18px; line-height: 1; }
.sidebar nav a.active { color: var(--red); background: var(--red-soft); font-weight: 600; }
.sidebar nav a:hover { color: var(--red); }
.sidebar .spacer { flex: 1; }
.sidebar .side-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 8px; }
.btn-sub {
  background: var(--red); color: #fff; border: 0; border-radius: 9px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.btn-login {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12px;
}

/* ---------- 主区 ---------- */
.page { margin-left: var(--sidebar-w); padding-top: 0; min-height: 100vh; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px 60px; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 46px 0 10px; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.hero h1 .brand { color: var(--red); }
.hero .sub { color: var(--ink-2); margin-top: 10px; font-size: 14px; }
.agent-box {
  max-width: 760px; margin: 26px auto 0; background: #fff;
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 18px 12px;
}
.agent-box textarea {
  width: 100%; border: 0; outline: none; resize: none; height: 64px;
  font-size: 14px; color: var(--ink);
}
.agent-box .row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.agent-mode {
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2);
  background: #f6f1f0; border-radius: 8px; padding: 5px 10px; font-size: 13px;
}
.send-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; font-size: 15px;
}

/* ---------- 快捷工具行 ---------- */
.quick-tools { display: flex; justify-content: center; gap: 42px; margin: 30px 0 8px; flex-wrap: wrap; }
.quick-tools a { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.quick-tools .qt {
  width: 52px; height: 52px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: .15s;
}
.quick-tools a:hover .qt { border-color: var(--red); color: var(--red); transform: translateY(-2px); }

/* ---------- 你想做什么 ---------- */
.sec-title { font-size: 19px; font-weight: 800; margin: 34px 0 4px; }
.sec-title small { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 10px; }
.goal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 16px; }
.goal-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); transition: .15s; display: block;
}
.goal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #f3c9c4; }
.goal-cover { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; }
.goal-meta { padding: 11px 13px 13px; }
.goal-meta .t { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.goal-meta .t::before { content: "▶"; font-size: 10px; color: var(--red); }
.goal-meta .d { color: var(--ink-3); font-size: 12px; margin-top: 4px; }

/* ---------- 发现瀑布流 ---------- */
.discover-tabs { display: flex; gap: 18px; margin: 26px 0 14px; font-size: 14px; }
.discover-tabs span { color: var(--ink-3); cursor: pointer; padding-bottom: 4px; }
.discover-tabs span.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--red); }
.masonry { columns: 5; column-gap: 14px; }
.masonry .card { break-inside: avoid; margin-bottom: 14px; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.masonry .ph { width: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); font-size: 13px; text-align: center; padding: 10px; }
.masonry .cap { padding: 9px 11px 12px; font-size: 12px; color: var(--ink-2); }
.masonry .cap b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 3px; }

/* ---------- 工作台（复刻/视频/图片 通用） ---------- */
.work { display: grid; grid-template-columns: 330px 1fr 260px; gap: 16px; padding: 18px 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel h3 .more { margin-left: auto; color: var(--red); font-size: 12px; font-weight: 400; }
.slot-row { display: flex; gap: 10px; margin: 14px 0 4px; }
.slot {
  flex: 1; border: 1px dashed #e5b9b4; border-radius: 12px; background: #fffafa;
  min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 12px; gap: 6px; cursor: pointer; position: relative;
}
.slot:hover { border-color: var(--red); color: var(--red); }
.slot .plus { width: 26px; height: 26px; border-radius: 8px; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.slot.req::after {
  content: "必选"; position: absolute; top: 6px; right: 6px;
  background: var(--red); color: #fff; font-size: 10px; border-radius: 6px; padding: 1px 5px;
}
.slot .limit { font-size: 10px; color: var(--ink-3); }
.prompt-area { margin-top: 12px; }
.prompt-area textarea {
  width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; resize: vertical; outline: none; font-size: 13px; color: var(--ink);
}
.prompt-area textarea:focus { border-color: var(--red); }
.hint { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.hint em { color: var(--red); font-style: normal; font-weight: 600; }

.cfg-row { display: flex; gap: 10px; margin-top: 12px; }
.cfg {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  background: #fbf7f6; font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.cfg b { display: block; color: var(--ink); font-size: 12px; margin-bottom: 2px; }
.cfg select, .cfg input {
  width: 100%; border: 0; background: transparent; outline: none; font-size: 12px; color: var(--ink);
}
.gen-btn {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; font-size: 14px; font-weight: 700;
}
.gen-btn:disabled { background: #d8cdc9; cursor: not-allowed; }
.gen-btn .price { font-weight: 400; font-size: 12px; margin-left: 8px; opacity: .9; }

.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 420px; color: var(--ink-3); }
.stage .big-ico { font-size: 46px; margin-bottom: 12px; }
.stage h4 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.stage h4 em { color: var(--red); font-style: normal; font-weight: 800; }
.stage p { font-size: 13px; }

.director-list { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.director-list button {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 11px; font-size: 12.5px; color: var(--ink-2);
}
.director-list button:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.queue-panel .q-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 12px; color: var(--ink-2); }
.queue-panel .q-item b { color: var(--ink); display: block; margin-bottom: 3px; }
.queue-empty { color: var(--ink-3); font-size: 12px; text-align: center; padding: 30px 0; }

/* ---------- 数量步进器（商详套图） ---------- */
.count-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.count-row:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; line-height: 1;
}
.stepper span { min-width: 18px; text-align: center; font-weight: 700; }

/* ---------- 订阅页 ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 30px; }
.plan {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px;
  position: relative;
}
.plan.hot { border: 2px solid var(--red); box-shadow: var(--shadow); }
.plan .tag {
  position: absolute; top: -11px; right: 16px; background: var(--red); color: #fff;
  font-size: 11px; border-radius: 8px; padding: 2px 8px;
}
.plan h4 { font-size: 15px; font-weight: 800; }
.plan .price { font-size: 30px; font-weight: 800; margin: 12px 0 2px; }
.plan .price i { font-style: normal; font-size: 14px; color: var(--ink-3); text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.plan .desc { color: var(--ink-3); font-size: 12px; }
.plan .credits { display: flex; align-items: center; gap: 6px; margin: 14px 0; font-weight: 700; color: var(--red); }
.plan .credits small { color: var(--ink-3); font-weight: 400; }
.plan ul { list-style: none; margin: 12px 0 18px; }
.plan ul li { font-size: 12.5px; color: var(--ink-2); padding: 4px 0; }
.plan ul li::before { content: "✓ "; color: var(--red); font-weight: 700; }
.plan .pick {
  width: 100%; padding: 10px; border-radius: 10px; border: 0; font-weight: 700;
  background: var(--ink); color: #fff;
}
.plan.hot .pick { background: var(--red); }

/* ---------- 资产库 ---------- */
.asset-toolbar { display: flex; align-items: center; gap: 14px; margin: 20px 0 16px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.asset-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.asset-item .thumb { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; }
.asset-item .meta { padding: 8px 10px 10px; font-size: 12px; color: var(--ink-2); }
.asset-item .meta b { display: block; color: var(--ink); font-size: 12.5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 表格 ---------- */
table.tb { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-top: 14px; }
table.tb th { background: var(--red-soft); color: var(--red-deep); text-align: left; font-size: 12.5px; padding: 9px 12px; }
table.tb td { padding: 9px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
table.tb td b { color: var(--ink); }

/* ---------- 徽标/状态 ---------- */
.pill { display: inline-block; border-radius: 7px; font-size: 11px; padding: 2px 8px; background: var(--red-soft); color: var(--red); font-weight: 600; }
.pill.gray { background: #f1eceb; color: var(--ink-3); }
.pill.green { background: #e8f6ee; color: #1d7a46; }
.pill.amber { background: #fdf3e0; color: #9a6b12; }

/* ---------- 通用页头 ---------- */
.page-head { padding: 26px 0 4px; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.page-head p { color: var(--ink-2); font-size: 13px; margin-top: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .goal-grid { grid-template-columns: repeat(3, 1fr); }
  .masonry { columns: 3; }
  .work { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .goal-grid { grid-template-columns: repeat(2, 1fr); }
  .masonry { columns: 2; }
  .plan-grid { grid-template-columns: 1fr; }
}

/* ---------- 首页模式下拉（真下拉，样式对齐原 pill） ---------- */
select.agent-mode {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 0; outline: none; cursor: pointer;
  font: inherit; color: var(--ink-2);
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>") no-repeat right 8px center;
  padding: 5px 24px 5px 10px;
}
select.agent-mode option { color: #333; background: #fff; }

/* ---------- 传图自动写提示词 ---------- */
.img2prompt-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.mini-btn:disabled { opacity: .5; cursor: wait; }
.mini-btn:hover { border-color: var(--red); color: var(--red); }


/* ===== 手机端适配 v1 (2026-09-29) ===== */
@media (max-width: 768px) {
  .topbar {
    height: auto; min-height: 34px; padding: 6px 34px 6px 10px;
    font-size: 11.5px; line-height: 1.5; text-align: left;
    justify-content: flex-start; align-items: flex-start;
  }
  .topbar .close-bar { top: 4px; }
  /* 侧栏 → 底部导航 */
  .sidebar {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: 60px;
    flex-direction: row; align-items: center; justify-content: flex-start;
    border-right: 0; border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .logo { display: none; }
  .sidebar nav { flex-direction: row; gap: 2px; width: auto; flex: 1 0 auto; }
  .sidebar nav a { min-width: 58px; margin: 0 1px; padding: 5px 3px; font-size: 10px; border-radius: 8px; }
  .sidebar nav a .ico { font-size: 17px; }
  .sidebar .spacer { flex: 0 0 auto; }
  .sidebar .side-foot { flex-direction: row; align-items: center; gap: 6px; padding: 0 4px 0 8px; flex: 0 0 auto; }
  .sidebar #navCredits { font-size: 11px !important; margin-left: 0 !important; white-space: nowrap; }
  .btn-sub { padding: 6px 9px; font-size: 11px; }
  .btn-login { width: 34px; height: 34px; font-size: 12px; }
  /* 正文 */
  .page { margin-left: 0; padding-bottom: 86px; }
  .wrap { padding: 0 13px 40px; }
  .hero { padding: 22px 0 6px; }
  .hero h1 { font-size: 21px; }
  .hero .sub { font-size: 12.5px; }
  .work { grid-template-columns: 1fr !important; gap: 12px; padding: 12px 0; }
  .slot-row { flex-wrap: wrap; }
  .slot { flex: 1 1 44%; min-width: 0; }
  .stage { min-height: 200px; }
  .panel { padding: 13px; }
  /* 防 iOS 聚焦自动放大 */
  input, select, textarea { font-size: 16px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .masonry { columns: 1 !important; }
  .plan-grid, .goal-grid { grid-template-columns: 1fr !important; }
  #board { touch-action: none; }
  .page-head h2 { font-size: 19px; }
  /* 首页/Agent 输入框：模式+比例+秒数+发送 一排在窄屏下允许收缩，发送键不被裁 */
  .agent-box .row { gap: 5px; }
  .agent-box .row select.agent-mode { min-width: 0; flex: 1 1 0; padding: 5px 18px 5px 6px; }
  .agent-box .row .send-btn { flex-shrink: 0; }
}


/* ---------- 各工具页教程条（app.js 注入） ---------- */
.guide-bar { margin: 14px 0 0; font-size: 13px; }
.guide-bar a { color: var(--red); font-weight: 600; text-decoration: none; }
.guide-bar a:hover { text-decoration: underline; }
