:root {
  --bg: #0b0d10;
  --bg-soft: #101318;
  --panel: #151920;
  --panel-2: #1b2029;
  --line: #262c36;
  --line-soft: #1e242d;
  --text: #e6e9ef;
  --text-2: #9aa3b2;
  --text-3: #6b7585;
  --accent: #e0a458;
  --accent-2: #4aa3ff;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --bad: #ef5b5b;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2b323d; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-hero { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.login-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -20%; height: 120%;
  background: radial-gradient(ellipse at 30% 20%, rgba(224,164,88,.18), transparent 55%),
              radial-gradient(ellipse at 70% 70%, rgba(74,163,255,.12), transparent 55%);
  filter: blur(40px);
}
.login-hero h1 { position: relative; font-size: 46px; line-height: 1.25; margin: 0 0 18px; letter-spacing: .5px; }
.login-hero h1 em { font-style: normal; color: var(--accent); }
.login-hero p { position: relative; color: var(--text-2); max-width: 520px; font-size: 15px; }
.login-hero .tags { position: relative; margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.login-hero .tags span { border: 1px solid var(--line); background: rgba(255,255,255,.03); padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--text-2); }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; border-left: 1px solid var(--line-soft); background: var(--bg-soft); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { color: var(--text-3); margin-bottom: 26px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field .calc { display: flex; gap: 8px; }
.input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #37404d; background: #20262f; }
.btn.primary { background: linear-gradient(90deg, #e0a458, #d2813a); border-color: transparent; color: #1a1206; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); }
.err { color: var(--bad); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: var(--bg-soft); position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #e0a458, #8a5a1f); display: grid; place-items: center; font-size: 13px; color: #1a1206; }
.brand small { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 2px; }
.topbar .grow { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 6px 11px; border-radius: 999px; font-size: 12px; color: var(--text-2); cursor: pointer;
}
.chip:hover { border-color: #37404d; }
.chip .num { color: var(--accent); font-weight: 600; }

/* ---------- 侧栏 ---------- */
.shell { display: flex; min-height: calc(100vh - 56px); }
.side { width: 176px; flex: 0 0 176px; border-right: 1px solid var(--line); padding: 14px 10px; background: var(--bg-soft); }
.side .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; margin-bottom: 2px; font-size: 13px;
}
.side .nav-item:hover { background: #161b23; color: var(--text); }
.side .nav-item.active { background: linear-gradient(90deg, rgba(224,164,88,.16), transparent); color: var(--text); border-left: 2px solid var(--accent); padding-left: 10px; }
.side .icon { width: 16px; text-align: center; opacity: .8; }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .sub { color: var(--text-3); font-size: 12px; }
.spacer { flex: 1; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: #12161c; }
.tag.ok { color: var(--ok); border-color: rgba(62,207,142,.3); background: rgba(62,207,142,.08); }
.tag.warn { color: var(--warn); border-color: rgba(240,180,41,.3); background: rgba(240,180,41,.08); }
.tag.bad { color: var(--bad); border-color: rgba(239,91,91,.3); background: rgba(239,91,91,.08); }
.tag.acc { color: var(--accent); border-color: rgba(224,164,88,.35); background: rgba(224,164,88,.09); }
.muted { color: var(--text-3); font-size: 12px; }
.sel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 0; margin-bottom: 16px; flex-wrap: wrap; }
.tabs .t { padding: 9px 14px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; font-size: 13px; }
.tabs .t.active { color: var(--text); border-bottom-color: var(--accent); }
.empty { color: var(--text-3); text-align: center; padding: 40px 0; font-size: 13px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--text-3); font-weight: 500; font-size: 12px; }
tbody tr:hover { background: #141922; }

/* 模态 */
.mask { position: fixed; inset: 0; background: rgba(3,5,8,.72); display: grid; place-items: center; z-index: 50; padding: 24px; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 760px; max-height: 90vh; overflow: auto; }
.modal.wide { max-width: 1100px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--panel); }
.x { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1; }
.x:hover { color: var(--text); }

/* 项目卡 */
.proj-card { position: relative; cursor: pointer; transition: .18s; }
.proj-card:hover { border-color: #38414e; transform: translateY(-2px); }
.proj-cover { height: 110px; border-radius: 8px; background: linear-gradient(135deg, #1c2531, #131820); display: grid; place-items: center; margin-bottom: 12px; font-size: 26px; color: var(--accent); border: 1px solid var(--line-soft); }
.proj-card h3 { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }

/* 剧集卡 */
.ep-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ep-thumb { height: 96px; background: repeating-linear-gradient(45deg, #161b22, #161b22 8px, #131820 8px, #131820 16px); display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.ep-body { padding: 10px 12px; }
.ep-body .t { font-weight: 600; font-size: 13px; }
.ep-meta { color: var(--text-3); font-size: 11px; margin-top: 4px; }

/* 分镜表 */
.shot-table th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.shot-input { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 6px; outline: none; resize: vertical; min-height: 32px; }
.shot-input:hover { border-color: var(--line); }
.shot-input:focus { border-color: var(--accent); background: #0f131a; }
.tc { color: var(--accent-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }

/* 状态点 */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .k { color: var(--text-3); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 脚本工具卡 */
.tool-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; transition: .15s; }
.tool-card:hover { border-color: #3a4351; }
.tool-card .badge { align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(224,164,88,.12); color: var(--accent); }
.tool-card h3 { margin: 0; font-size: 15px; }
.tool-card p { margin: 0; color: var(--text-2); font-size: 12.5px; flex: 1; }
.tool-card .price { font-size: 11px; color: var(--text-3); }

/* 进程条 */
.bar { height: 6px; border-radius: 6px; background: #222834; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #e0a458, #d2813a); width: 0; transition: width .3s; }

/* 提示条 */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1b2029; border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 80; font-size: 13px; }
.toast.err { border-color: rgba(239,91,91,.5); color: #ffb4b4; }
.toast.ok { border-color: rgba(62,207,142,.4); color: #b9f6d8; }

/* 画布 */
.canvas-area {
  position: relative; height: calc(100vh - 220px); min-height: 420px; border: 1px solid var(--line);
  border-radius: 12px; background-color: #0d1117;
  background-image: radial-gradient(#20262f 1px, transparent 1px); background-size: 22px 22px; overflow: hidden;
}
.canvas-node {
  position: absolute; width: 190px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; cursor: grab; user-select: none; box-shadow: var(--shadow);
}
.canvas-node .h { display: flex; justify-content: space-between; font-size: 11px; color: var(--accent); margin-bottom: 6px; }
.canvas-node .c { font-size: 12px; color: var(--text-2); }

/* 顶栏文字入口（对齐吸顶条） */
.top-links { display: flex; gap: 18px; margin-left: 26px; }
.top-links span { font-size: 12px; color: var(--text-3); cursor: pointer; }
.top-links span:hover { color: var(--accent); }

/* 菜单 */
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item {
  text-align: left; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text-1);
  padding: 11px 14px; border-radius: 9px; cursor: pointer; font-size: 13px;
}
.menu-item:hover { border-color: var(--accent); color: var(--accent); }
.menu-item.danger { color: #ef8a8a; }
.menu-item.danger:hover { border-color: #ef5b5b; color: #ffb4b4; }

/* 分集更多按钮 */
.more-dot { margin-left: auto; color: var(--text-3); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.more-dot:hover { color: var(--accent); }
.proj-more { position: absolute; top: 8px; right: 8px; z-index: 5; }

/* 播放预览 */
.pv-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.pv-video .pv-frame {
  aspect-ratio: 9/16; max-height: 58vh; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(160deg, #14181e, #0c0f13); display: grid; place-items: center; color: var(--text-3);
}
.pv-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.pv-desc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 120px; font-size: 12.5px; line-height: 1.7; }
.pv-list { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.pv-item { display: flex; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--text-2); }
.pv-item.on { background: rgba(224,164,88,.14); color: var(--text-1); }
.pv-item .tc { color: var(--accent); min-width: 18px; }

/* 资产图 */
.asset-thumb {
  width: 150px; height: 150px; border-radius: 10px; border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; color: var(--text-3); font-size: 12px; background: #0e1216;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-panel { border-left: 0; }
  .side { width: 132px; flex: 0 0 132px; }
  .pv-wrap { grid-template-columns: 1fr; }
  .top-links { display: none; }
}
