:root {
  --bg: #f6f4f0; --card: #ffffff; --fg: #1b1a17; --mute: #6c675f; --line: #e3ded5;
  --acc: #a4520a; --acc-soft: #f6e9dc; --ok: #2f7a3c; --ok-soft: #e4f2e6; --bad: #b3261e; --bad-soft: #fbe9e7;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f; --card: #1b1a17; --fg: #ece8e1; --mute: #a39d93; --line: #2d2a25;
    --acc: #f09a4a; --acc-soft: #3a2a1b; --ok: #7fcf8b; --ok-soft: #1d2f20; --bad: #ff8a80; --bad-soft: #3a1f1c;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--acc); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
.loading, .landing { max-width: 640px; margin: 15vh auto; padding: 0 16px; color: var(--mute); }
.landing h1 { color: var(--fg); margin-bottom: 8px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; flex: none; }
.logo { font-weight: 800; letter-spacing: .18em; }
.dept { color: var(--mute); font-size: 14px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--acc); color: #fff; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge.soft { background: var(--acc-soft); color: var(--acc); }
/* 右上角:身份牌 + 语言(老板 11/6 要多语言)。头部高度不能超过 49px,下面的目录条贴在 49px 处 */
.top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top select.lang { width: auto; flex: none; font-size: 13px; line-height: 1.2; height: 26px; padding: 0 6px; background: var(--card); }
@media (max-width: 520px) { .dept { display: none; } }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 96px; }
.hero { padding: 36px 0 12px; }
.eyebrow { margin: 0 0 6px; color: var(--acc); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.hero h1 { font-size: clamp(26px, 4.5vw, 40px); }
.hero .sub { margin: 4px 0 14px; color: var(--mute); font-size: 18px; }
.lead { max-width: 760px; margin: 0 0 12px; }
.steps { margin: 0; padding-inline-start: 20px; color: var(--mute); }
.steps b { color: var(--fg); }

.tabs { position: sticky; top: 49px; z-index: 4; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 8px 0 4px;
  background: var(--bg); scrollbar-width: none; }
.tabs a { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; font-size: 14px; background: var(--card); }
.tabs a:hover { border-color: var(--acc); color: var(--acc); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.card > h2 { font-size: 21px; margin-bottom: 4px; }
.card h3 { font-size: 17px; }
.card h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 18px 0 8px; }
.hint { color: var(--mute); font-size: 14px; margin: 4px 0 10px; }
.empty { color: var(--mute); font-style: italic; margin: 12px 0; }
.methods { margin: 0 0 12px; padding-inline-start: 20px; font-size: 15px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 12px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: 1fr 1.4fr .8fr; gap: 8px 12px; }
.grid4 .wide, .grid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lbl { font-size: 13px; font-weight: 600; color: var(--mute); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }

.btn { font: inherit; font-size: 15px; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--acc); background: var(--acc); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.06); }
.btn.small { font-size: 14px; padding: 6px 12px; background: transparent; color: var(--acc); }
.link { font: inherit; font-size: 14px; background: none; border: 0; color: var(--acc); cursor: pointer; padding: 2px 4px; }
.link.danger { color: var(--mute); }
.link.danger:hover { color: var(--bad); }

.ep, .actor { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.ep-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* 别人打的长串(没空格的名字、备注、网址)到边就折行,手机上不把卡片撑宽(Codex 1106 第 10 条) */
.card { overflow-wrap: anywhere; }
.ep-head > *, .up-head > *, .files li > * { min-width: 0; }
.actors { display: grid; gap: 14px; }

.upload { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); min-width: 0; }
.upload.has { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.up-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.up-title { font-weight: 600; font-size: 15px; }
.ok { color: var(--ok); font-size: 13px; font-weight: 600; white-space: nowrap; }
.drop { margin-top: 8px; border: 1.5px dashed var(--line); border-radius: 8px; padding: 14px 10px; text-align: center; color: var(--mute); font-size: 14px; cursor: pointer; background: var(--card); }
.drop:hover, .drop:focus, .drop.over { border-color: var(--acc); color: var(--acc); outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tags { margin: 8px 0 0; }
.tags .hint { margin: 0 0 6px; }

.files { list-style: none; margin: 8px 0 0; padding: 0; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.files li.old { opacity: .55; }
.fname { font-weight: 600; word-break: break-all; }
.fmeta { color: var(--mute); font-size: 13px; }
.fname { unicode-bidi: isolate; } /* 从右往左的语言里,拉丁字母的文件名不被打乱 */
.fnote { flex-basis: 100%; color: var(--mute); font-size: 13px; }
.files progress { flex: 1 1 120px; height: 8px; accent-color: var(--acc); }
.pct { font-size: 13px; color: var(--mute); }
.files li.err .pct { color: var(--bad); flex-basis: 100%; }
.dl { font-size: 14px; }

.scenes { margin-top: 8px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); padding: 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
td input, td select { font-size: 14px; padding: 6px 8px; }
td input.xs { width: 70px; }
.scenes table { table-layout: fixed; min-width: 900px; }
.scenes th:nth-child(1) { width: 66px; } .scenes th:nth-child(2) { width: 22%; } .scenes th:nth-child(3) { width: 88px; }
.scenes th:nth-child(4) { width: 13%; } .scenes th:nth-child(5) { width: 150px; } .scenes th:nth-child(6) { width: 84px; }
.scenes th:nth-child(8) { width: 36px; }
@media (max-width: 640px) {
  .scenes .tablewrap { border: 0; overflow: visible; }
  .scenes table { min-width: 0; table-layout: auto; }
  .scenes thead { display: none; }
  .scenes table, .scenes tbody, .scenes tr, .scenes td { display: block; width: 100%; }
  .scenes tr { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 10px; background: var(--card); }
  .scenes td { border: 0; padding: 3px 0; }
  .scenes td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--mute); margin-bottom: 2px; }
  .scenes td.rm { position: absolute; top: 6px; inset-inline-end: 6px; width: auto; padding: 0; }
  .scenes td.rm::before { content: none; }
  .scenes td input.xs { width: 100%; }
}
.scenes .btn { margin-top: 10px; }

.status { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--acc-soft); color: var(--acc); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.voice { margin-top: 6px; }
.voice .qr { display: block; width: 180px; height: 180px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0 8px; }
.studio-box { margin-top: 16px; padding: 12px; border: 1px dashed var(--acc); border-radius: 8px; background: var(--acc-soft); }
.studio-box h4 { margin-top: 0; color: var(--acc); }
.card.studio { border-color: var(--acc); }
.activity { list-style: none; padding: 0; margin: 0; font-size: 14px; max-height: 260px; overflow: auto; }
.activity li { padding: 4px 0; border-top: 1px solid var(--line); }
.when { color: var(--mute); font-size: 13px; }
.who { font-weight: 600; }
.who.client { color: var(--acc); }

#specs ul { margin: 6px 0 14px; padding-inline-start: 20px; }
#specs h3 { margin-top: 14px; }
footer { color: var(--mute); font-size: 14px; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; }
footer p { margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 14px; transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }

/* 没有演员的角色、From Nova */
.sub-h { margin: 28px 0 4px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 19px; }
.deliver { margin-top: 18px; padding: 12px; border-radius: 8px; background: var(--ok-soft); }
.deliver > h4 { margin-top: 0; color: var(--ok); }
.deliver .upload { background: var(--card); }
.deliveries { background: var(--card); border-radius: 8px; padding: 0 12px; }
.deliveries li:first-child { border-top: 0; }
.fnote-in { flex-basis: 100%; }
.fnote-in textarea { font-size: 14px; margin-top: 4px; }
.fnote.fb { color: var(--acc); font-weight: 600; }
