/* 法义视频工坊 — 藏式庄严配色：绛红 / 赭金 / 米白 / 墨色。手机优先。 */
@font-face {
  font-family: "Noto Serif Tibetan";
  /* woff2 子集版 747KB（原 TTF 2MB 已按 YC 建议从网页移除；ttf 文件保留在磁盘供 ffmpeg 烧字幕 fontsdir 用）
     unicode-range 限藏文块——纯中文页面完全不下载这个字体 */
  src: url("/fonts/NotoSerifTibetan.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0F00-0FFF;
}

:root {
  --maroon: #7b2d26;
  --maroon-dark: #5e211c;
  --gold: #b8860b;
  --gold-soft: #d9b35c;
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --ink: #2b2620;
  --ink-soft: #6f655a;
  --line: #e4dccb;
  --ok: #3a7d44;
  --warn: #b3541e;
  --bad: #9e2b25;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Serif Tibetan", sans-serif;
  line-height: 1.6;
  padding-bottom: 40px;
}
[lang="bo"], .bo { font-family: "Noto Serif Tibetan", "Kailasa", "Microsoft Himalaya", serif; line-height: 1.9; }

/* 顶栏 */
.topbar {
  background: var(--maroon);
  color: #f5e9d6;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar .who { font-size: .8rem; opacity: .85; }
.topbar button {
  background: rgba(255,255,255,.14); color: #f5e9d6;
  border: 1px solid rgba(255,255,255,.3); border-radius: 8px;
  padding: 4px 10px; font-size: .85rem;
}

/* 导航 */
.nav {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 10px; background: var(--maroon-dark);
  position: sticky; top: 46px; z-index: 49;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; text-decoration: none;
  color: #e8d9bd; font-size: .9rem;
  padding: 5px 12px; border-radius: 16px;
}
.nav a.active { background: var(--gold); color: #fff; font-weight: 600; }

.wrap { padding: 14px; max-width: 860px; margin: 0 auto; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(60,40,20,.06);
}
.card h3 { margin: 0 0 8px; font-size: 1rem; color: var(--maroon); }

h2.page-title { font-size: 1.15rem; margin: 4px 0 14px; color: var(--maroon-dark); }
.muted { color: var(--ink-soft); font-size: .85rem; }
.small { font-size: .8rem; }

/* 按钮 */
button, .btn {
  font-family: inherit;
  border: none; border-radius: 10px;
  padding: 10px 16px; font-size: .95rem;
  background: var(--maroon); color: #fff;
  cursor: pointer; touch-action: manipulation;
}
button:disabled { opacity: .45; }
.btn-ghost { background: transparent; color: var(--maroon); border: 1.5px solid var(--maroon); }
.btn-gold { background: var(--gold); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-danger { background: var(--bad); }

/* 表单 */
input[type=text], input[type=number], textarea, select {
  width: 100%; font-family: inherit; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
label.fld { display: block; margin: 10px 0 4px; font-size: .85rem; color: var(--ink-soft); }

/* 徽章 */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: .75rem; font-weight: 600;
  background: var(--line); color: var(--ink-soft);
}
.badge.ok { background: #e2efe3; color: var(--ok); }
.badge.warn { background: #f7e8d8; color: var(--warn); }
.badge.bad { background: #f6e0de; color: var(--bad); }
.badge.gold { background: #f3e9d0; color: var(--gold); }
.badge.sacred { background: var(--maroon); color: #f3e3c3; }

/* 网格 */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.grid .cell {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: pointer; text-align: center;
}
.grid .cell.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.grid .cell img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.grid .cell .lbl { font-size: .75rem; padding: 4px 6px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 镜头卡 */
.shot-card { border-left: 4px solid var(--gold-soft); }
.shot-card.sacred { border-left-color: var(--maroon); }
.shot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.shot-head .num {
  background: var(--maroon); color: #fff; border-radius: 50%;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}
.shot-thumb { width: 100%; max-width: 280px; border-radius: 8px; display: block; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 待校对标记 */
.pf-pending { border-bottom: 1.5px dashed var(--gold); cursor: pointer; }
.pf-pending::after { content: "✎"; font-size: .7em; color: var(--gold); margin-left: 2px; }

/* toast & modal */
#toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: .88rem; z-index: 200; display: none; max-width: 86vw;
}
.modal-bg {
  position: fixed; inset: 0; background: rgba(40,30,20,.5); z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--paper); width: 100%; max-width: 560px;
  border-radius: 16px 16px 0 0; padding: 18px; max-height: 84vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: 16px; }
}

/* 原文阅读 */
.scripture {
  font-family: "STKaiti", "KaiTi", "Noto Serif Tibetan", serif;
  font-size: 1.02rem; line-height: 2; white-space: pre-wrap;
  background: #fbf7ec; border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}

/* 登录页 */
.login-hero {
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #f5e9d6; text-align: center; padding: 44px 20px 30px;
}
.login-hero .dharma { font-size: 1.6rem; font-weight: 700; letter-spacing: .12em; }
.login-hero .bo-line { font-size: 1.05rem; margin-top: 8px; opacity: .9; }
.roster { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.roster button {
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--line);
  padding: 14px 8px; border-radius: 12px; font-size: 1rem;
}
.roster button.selected { border-color: var(--maroon); background: #f3e3c3; font-weight: 700; }
.roster .bo-name { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }

video, audio { max-width: 100%; border-radius: 10px; }
.log-box {
  background: #1e1a16; color: #cfe3cf; font-family: Consolas, monospace;
  font-size: .75rem; padding: 10px; border-radius: 8px;
  white-space: pre-wrap; max-height: 280px; overflow-y: auto;
}
table.simple { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.simple th, table.simple td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; }

/* 制作流程条：故事→分镜→素材→配音→合成→送审。让用户随时知道"我在第几步、下一步做什么"。 */
.flow {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 8px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(60,40,20,.06);
}
.flow-steps { display: flex; align-items: flex-start; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.flow-steps::-webkit-scrollbar { display: none; }
.flow-step {
  flex: 1 0 auto; min-width: 54px; text-align: center; cursor: pointer;
  background: none; border: none; padding: 4px 4px 6px; border-radius: 8px;
  font-size: .78rem; line-height: 1.3; color: var(--ink-soft);
}
.flow-step .fs-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; margin-bottom: 3px;
  background: var(--line); color: var(--ink-soft); font-size: .74rem; font-weight: 700;
}
.flow-step .fs-lbl { display: block; white-space: nowrap; }
.flow-step.done .fs-num { background: var(--ok); color: #fff; }
.flow-step.partial .fs-num { background: var(--gold); color: #fff; }
.flow-step.active { background: #f3e3c3; }
.flow-step.active .fs-num { background: var(--maroon); color: #fff; }
.flow-step.active .fs-lbl { color: var(--maroon); font-weight: 700; }
.flow-hint {
  margin-top: 8px; padding: 10px 12px; background: #fbf7ec;
  border: 1px solid var(--line); border-radius: 10px;
}
.flow-hint .fh-txt { font-size: .9rem; color: var(--ink); }
.flow-hint .btn-gold { margin-top: 10px; }

/* 分镜镜头卡：电脑端左文右图两栏；手机端保持单列（夏海 2026-07-12 建议"画面放右边·电脑端"） */
.shot-cols { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 720px) {
  .shot-cols { flex-direction: row; gap: 16px; align-items: flex-start; }
  .shot-col-left { flex: 1 1 0; min-width: 0; }
  .shot-col-right { flex: 1 1 0; min-width: 0; }
  .shot-col-right .shot-thumb { max-width: 100%; }
}
/* 电脑宽屏用更宽的工作区（手机端不变） */
@media (min-width: 1000px) { .wrap { max-width: 1040px; } }
