/* ==========================================================
   星剧 · 短剧创作后台 — 浅色主题
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

/* 统一兜底：hidden 属性必须优先于任何 display 声明 */
[hidden] { display: none !important; }

:root {
  --sidebar-bg: #1b2a3d;
  --sidebar-bg2: #162335;
  --sidebar-text: #9db0c5;
  --sidebar-active: #ffffff;
  --primary: #2e5bff;
  --primary-hover: #2452f0;
  --primary-soft: #e8f0ff;
  --bg: #ffffff;
  --border: #e4e7ec;
  --border-2: #d5dae2;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --green: #00b42a;
  --green-soft: #e8f7ec;
  --danger: #f53f3f;
  --radius: 8px;
  --shadow-card: 0 2px 10px rgba(31, 35, 41, .06);
  --shadow-pop: 0 8px 24px rgba(31, 35, 41, .14);
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
svg { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* 插画类 svg（头像 / 场景 / 道具 / 分镜画面）不继承图标描边，避免出现黑框 */
svg.art,
svg.cover-art,
.pk-item__img svg,
.cast-av svg,
.lb-item svg,
.pv-frame svg,
.am-preview svg { stroke: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d9e2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bfc7d2; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 208px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg2));
  display: flex;
  flex-direction: column;
  user-select: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 20px 16px;
}
/* logo 可点击回首页 */
a.logo { text-decoration: none; color: inherit; cursor: pointer; }
a.logo .logo__mark { transition: transform .18s ease, box-shadow .18s ease; }
a.logo:hover .logo__mark { transform: translateY(-1px) scale(1.04); box-shadow: 0 6px 16px -3px rgba(46, 91, 255, .7); }
a.logo:active .logo__mark { transform: translateY(0) scale(.97); }
a.logo:focus-visible { outline: 2px solid #7ea2ff; outline-offset: 2px; border-radius: 10px; }
.logo__mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, #3f6fff, #2452f0);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(46, 91, 255, .55);
}
.logo__mark svg { width: 12px; height: 12px; stroke: none; }
.logo__text { color: #fff; font-size: 16.5px; font-weight: 600; letter-spacing: 1px; }

.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-group {
  margin: 18px 10px 6px;
  font-size: 12.5px;
  color: #5c718c;
  letter-spacing: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 14.5px;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e6edf5; }
.nav-item.is-active {
  background: rgba(46, 91, 255, .28);
  color: var(--sidebar-active);
  font-weight: 500;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(46, 91, 255, .8);
}

.sidebar__foot {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.foot-btn {
  background: none; border: none;
  color: #5c718c;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: .15s;
}
.foot-btn svg { width: 15px; height: 15px; }
.foot-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.foot-ver { font-size: 12.5px; color: #46586f; }

/* 登录用户（侧栏底部）：未登录时由 hidden 隐藏 */
.side-acc {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 20px);
  margin: 0 10px 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #a79c8c;
  font-family: inherit;
  text-align: left;
  transition: background-color .15s, border-color .15s, color .15s;
}
.side-acc:hover { background: rgba(255, 255, 255, .08); border-color: rgba(201, 169, 110, .28); color: #ede7dc; }
.side-acc__av {
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #26211b;
  background: linear-gradient(145deg, #d8bd8c, #a9884e);
}
.side-acc__meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-acc__meta b {
  font-size: 12.5px;
  font-weight: 500;
  color: #e6ddcd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-acc__meta em { font-style: normal; font-size: 10.5px; color: #8b8071; }
.side-acc__out {
  width: 13px; height: 13px;
  flex: none;
  margin-left: auto;
  opacity: .5;
  transition: opacity .15s;
}
.side-acc:hover .side-acc__out { opacity: 1; }

/* ============ 主区域 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  background: #fff;
}
.topbar__right { display: flex; align-items: center; gap: 6px; }

.top-search {
  display: flex; align-items: center; gap: 7px;
  width: 180px; height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-3);
  transition: border-color .15s, box-shadow .15s;
  margin-right: 6px;
}
.top-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 91, 255, .1); }
.top-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.top-search input { border: none; outline: none; width: 100%; font-size: 14px; color: var(--text); background: transparent; }
.top-search input::placeholder { color: var(--text-3); }

.top-icon {
  position: relative;
  height: 34px;
  min-width: 32px;
  border: none;
  background: none;
  border-radius: 7px;
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 14px;
  padding: 0 7px;
  transition: .15s;
}
.top-icon svg { width: 16px; height: 16px; }
.top-icon:hover { background: #f2f4f7; color: var(--text); }
.badge-dot {
  position: absolute; top: 6px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

.user {
  position: relative;
  display: flex; align-items: center; gap: 5px;
  padding: 4px 6px;
  border-radius: 7px;
  cursor: pointer;
  margin-left: 4px;
}
.user:hover { background: #f2f4f7; }
.user__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, #4d7bff, #2e5bff);
  color: #fff;
  font-size: 14.5px; font-weight: 600;
  display: grid; place-items: center;
}
.user__arrow { width: 13px; height: 13px; color: var(--text-3); transition: transform .2s; }
.user.is-open .user__arrow { transform: rotate(180deg); }
.user__menu {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  width: 132px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 5px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: .15s;
  z-index: 60;
}
.user.is-open .user__menu { opacity: 1; transform: none; pointer-events: auto; }
.user__menu a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.user__menu a:hover { background: #f2f4f7; }
.user__menu a[data-act="logout"] { color: var(--danger); }

/* ============ 内容区 ============ */
.content { flex: 1; overflow-y: auto; padding: 18px 24px 24px; }

.page-title { font-size: 18.5px; font-weight: 600; margin: 0 0 14px; letter-spacing: .3px; }

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tb-search {
  display: flex; align-items: center; gap: 8px;
  width: 380px; max-width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-3);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.tb-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 91, 255, .1); }
.tb-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.tb-search input { border: none; outline: none; width: 100%; font-size: 14px; color: var(--text); background: transparent; }
.tb-search input::placeholder { color: var(--text-3); }

.toolbar__right { display: flex; align-items: center; gap: 8px; }

.daterange {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0 8px;
  height: 34px;
  transition: border-color .15s;
}
.daterange:focus-within { border-color: var(--primary); }
.daterange__sep { color: var(--text-3); font-size: 13.5px; }
.daterange input {
  border: none; outline: none;
  font-size: 13.5px; color: var(--text);
  width: 108px;
  background: transparent;
  color-scheme: light;
}
.daterange input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }

.dropdown { position: relative; }
.dropdown__trigger {
  display: flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s;
}
.dropdown__trigger:hover { border-color: var(--primary); color: var(--primary); }
.dropdown__trigger svg { width: 14px; height: 14px; }
.dropdown__trigger .caret { width: 12px; height: 12px; color: var(--text-3); transition: transform .2s; }
.dropdown.is-open .caret { transform: rotate(180deg); }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 5px); left: 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 5px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: .15s;
  z-index: 50;
}
.dropdown.is-open .dropdown__menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown__menu a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.dropdown__menu a:hover { background: #f2f4f7; }
.dropdown__menu a.is-on { color: var(--primary); background: var(--primary-soft); font-weight: 500; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.btn-primary svg { width: 13px; height: 13px; stroke-width: 2.2; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px -4px rgba(46, 91, 255, .5); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  height: 32px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: .15s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.view-toggle {
  display: flex;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  height: 34px;
}
.view-toggle button {
  width: 36px;
  border: none;
  background: #fff;
  color: var(--text-3);
  display: grid; place-items: center;
  transition: .15s;
}
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button:hover { color: var(--primary); }
.view-toggle button.is-on { background: var(--primary-soft); color: var(--primary); }
.view-toggle svg { width: 15px; height: 15px; }

/* ============ 卡片网格 ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 16px;
  min-height: 200px;
}

.dcard {
  border-radius: 10px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  position: relative;
}
.dcard:hover { transform: translateY(-2px); }
.dcard:hover .dcard__cover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px -6px rgba(46, 91, 255, .35);
}

.dcard__cover {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  transition: border-color .15s, box-shadow .18s;
}
.dcard.is-selected .dcard__cover { border-color: var(--primary); }
.dcard__cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16, 34, 64, 0) 62%, rgba(16, 34, 64, .16));
  pointer-events: none;
}
.cover-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #c4def8 0%, #dcebfb 48%, #eef6ff 100%);
}
.cover-placeholder--dark {
  background: linear-gradient(155deg, #3d4c63 0%, #54687f 55%, #6d8098 100%);
}
.cover-placeholder .ph-inner {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255, 255, 255, .85);
  font-size: 16.5px;
  letter-spacing: 2px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(46, 91, 255, .25);
}
.cover-placeholder--dark .ph-inner { color: rgba(255, 255, 255, .75); text-shadow: none; }
.ph-inner svg { width: 14px; height: 14px; stroke: none; fill: currentColor; }

.dcard__more {
  position: absolute;
  right: 8px; bottom: 8px;
  z-index: 4;
  width: 26px; height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  opacity: 0;
  transform: translateY(3px);
  transition: .15s;
}
.dcard:hover .dcard__more, .dcard.is-selected .dcard__more { opacity: 1; transform: none; }
.dcard__more:hover { color: var(--text); background: #fff; }

/* ---- 悬停统计浮层 ---- */
.dcard__stats {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s;
}
.dcard:hover .dcard__stats { opacity: 1; visibility: visible; }

.st {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  padding: 0 2px;
}
.st + .st::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 20px;
  background: #e6e9ef;
}
.st__num {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.st__label {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.2;
  white-space: nowrap;
}

.dcard__body { padding: 9px 2px 0; }
.dcard__title {
  margin: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden;
}
.dcard__title .t-name { overflow: hidden; text-overflow: ellipsis; }
.dcard__meta {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden;
}
.dcard__meta .dot { flex-shrink: 0; }

.tag {
  flex-shrink: 0;
  display: inline-block;
  height: 20px;
  line-height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
}
.tag--doing { background: var(--primary-soft); color: var(--primary); }
.tag--done  { background: #f2f3f5; color: var(--text-2); }

/* ============ 列表视图 ============ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dtable { width: 100%; border-collapse: collapse; }
.dtable th {
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  background: #f7f8fa;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dtable td {
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.dtable tbody tr { transition: background .12s; }
.dtable tbody tr:hover { background: #f7f9ff; }
.dtable tbody tr:last-child td { border-bottom: none; }
.td-drama { display: flex; align-items: center; gap: 10px; min-width: 0; }
.td-thumb {
  width: 62px; aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #c4def8, #eef6ff);
  color: rgba(255, 255, 255, .9);
}
.td-thumb.dark { background: linear-gradient(155deg, #3d4c63, #6d8098); }
.td-thumb svg { width: 11px; height: 11px; stroke: none; fill: currentColor; }
.td-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-time, .td-creator { color: var(--text-2); }
.td-op { display: flex; gap: 12px; }
.td-op a { color: var(--primary); text-decoration: none; font-size: 13.5px; cursor: pointer; }
.td-op a:hover { text-decoration: underline; }
.td-op a.danger { color: var(--danger); }

/* ============ 空状态 ============ */
.empty {
  padding: 70px 0;
  text-align: center;
  color: var(--text-3);
}
.empty svg { width: 44px; height: 44px; color: #c9cfda; stroke-width: 1.2; }
.empty p { margin: 12px 0 16px; font-size: 14.5px; }

/* ============ 分页 ============ */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 0 4px;
  font-size: 14px;
  color: var(--text-2);
}
.pager__btn {
  min-width: 30px; height: 30px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px;
  transition: .15s;
}
.pager__btn svg { width: 13px; height: 13px; }
.pager__btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager__btn.is-cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager__btn:disabled { color: #c1c7d0; cursor: not-allowed; }
.pager select {
  height: 30px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  padding: 0 4px;
  outline: none;
}
.pager__jump input {
  width: 48px; height: 30px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  outline: none;
  margin: 0 4px;
}
.pager__jump input:focus { border-color: var(--primary); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(23, 26, 31, .45);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 400px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  animation: popIn .2s ease;
  overflow: hidden;
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
}
.modal__head h3 { margin: 0; font-size: 16.5px; }
.modal__close {
  border: none; background: none;
  width: 30px; height: 30px;
  border-radius: 6px;
  color: var(--text-3);
  display: grid; place-items: center;
}
.modal__close:hover { background: #f2f4f7; color: var(--text); }
.modal__close svg { width: 15px; height: 15px; }
.modal__body { padding: 18px 20px 4px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.field span i { color: var(--danger); font-style: normal; margin-left: 2px; }
.field input, .field select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 91, 255, .1); }
.field input.err { border-color: var(--danger); animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px;
}
.modal__foot .btn-ghost { height: 34px; }
.modal__foot .btn-primary { height: 34px; }

/* ---- 创建项目弹窗：双列字段 / 制作时间 / 封面 ---- */
.modal--create { width: 528px; max-width: calc(100vw - 32px); }
.modal--create .modal__body {
  max-height: min(72vh, 644px);
  overflow-y: auto;
  padding-bottom: 6px;
}
.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.eps-box { position: relative; }
.eps-box input { padding-right: 34px; }
.eps-box input::-webkit-outer-spin-button,
.eps-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.eps-box input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.eps-box em {
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-50%);
  font-style: normal; font-size: 13px;
  color: var(--text-3);
  pointer-events: none;
}
/* 画面比例：竖屏 9:16 / 横屏 16:9（单选） */
.ratio-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ratio-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.ratio-opt:hover { border-color: #cdbfa6; background: #fdfbf7; }
/* 复位 .field span 的块级与间距，避免图标被撑开 */
.ratio-opt span {
  display: block;
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.ratio-ico {
  flex: none;
  border: 1.5px solid #c6b9a3;
  border-radius: 2px;
  background: #f2ece0;
  transition: border-color .15s, background-color .15s;
}
.ratio-ico--v { width: 11px; height: 19px; }
.ratio-ico--h { width: 19px; height: 11px; }
.ratio-txt b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: .2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ratio-txt em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text-3);
}
.ratio-opt.is-on {
  border-color: var(--accent);
  background: #fdf8ee;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, .14);
}
.ratio-opt.is-on .ratio-ico { border-color: #b08e50; background: rgba(201, 169, 110, .3); }
.ratio-opt.is-on .ratio-txt b { color: #6d4f18; }
.ratio-opt.is-on .ratio-txt em { color: #8a6a2c; }
.ratio-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dr-box { display: flex; align-items: center; gap: 8px; }
.dr-box input { flex: 1 1 0; min-width: 0; }
.field span.dr-box__sep {
  display: inline;
  margin: 0;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-3);
}
.field__hint {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-3);
}
.field__hint.is-err { color: var(--danger); }
.field span .field__tag {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 12px;
  font-style: normal;
  color: var(--text-3);
}

.cover-up {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  background: #fbf9f6;
  transition: border-color .15s, background .15s;
}
.cover-up.is-drop {
  border-color: var(--accent);
  background: rgba(201, 169, 110, .12);
}
.cover-up__thumb {
  width: 112px; height: 63px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #efe8db, #f9f5ee);
  color: var(--text-3);
}
.cover-up__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-up__thumb .ph {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px;
  letter-spacing: .5px;
}
.cover-up__thumb .ph svg { width: 17px; height: 17px; stroke-width: 1.5; }
.cover-up__main { min-width: 0; }
.cover-up__t {
  margin: 0 0 3px;
  font-size: 13.5px;
  color: var(--text);
}
.cover-up__d {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}
.cover-up__acts { display: flex; gap: 8px; }
.btn-mini {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text-2);
  transition: .15s;
}
.btn-mini:hover { border-color: var(--accent); color: var(--text); }
.btn-mini--del:hover { border-color: var(--danger); color: var(--danger); }

/* 卡片 / 列表：自定义封面与集数标识 */
.dcard__cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcard__eps {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 2;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(23, 20, 16, .62);
  color: #f8f2e7;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: .3px;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13);
}
/* 画面比例角标：缩略图右下角，与左上「N 集」对角呼应，同一套深底白字语言 */
.dcard__ratio {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(23, 20, 16, .54);
  color: #f7f1e5;
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: opacity .16s;
}
/* 悬停时整块被统计浮层盖住；选中态让位给右下角的「更多」按钮 */
.dcard:hover .dcard__ratio,
.dcard.is-selected .dcard__ratio { opacity: 0; }
.td-ratio {
  margin-left: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.td-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ 右键 / 更多菜单 ============ */
.ctx-menu {
  position: fixed;
  min-width: 128px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 5px;
  z-index: 110;
  animation: popIn .12s ease;
}
.ctx-menu a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.ctx-menu a:hover { background: #f2f4f7; }
.ctx-menu a.danger { color: var(--danger); }
.ctx-menu a.danger:hover { background: #fef0f0; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translate(-50%, -12px);
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--danger); }

/* 卡片入场 */
.dcard, .dtable tbody tr { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1100px) {
  .tb-search { width: 260px; }
  .daterange input { width: 92px; }
}

/* ============ 删除暗口令弹窗 ============ */
.modal--pass { width: 436px; max-width: calc(100vw - 32px); }

.pass-proj {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.pass-proj b { color: var(--text); font-weight: 600; }

.pass-warn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(160, 59, 50, .18);
  border-radius: 9px;
  background: rgba(160, 59, 50, .055);
  font-size: 13px;
  line-height: 1.6;
  color: #8a4038;
}
.pass-warn svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--danger); }
.pass-warn__t b {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #7d3229;
  letter-spacing: .2px;
}
.pass-warn__t span { display: block; }

.pass-field { margin-bottom: 10px; }
.pass-field__l {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  color: var(--text-2);
}

.pass-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pass-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, .16);
}
.pass-input.is-err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(160, 59, 50, .1);
  animation: shake .25s;
}
.pass-input__ico {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  color: var(--text-3);
}
.pass-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: .6px;
}
.pass-input input::placeholder { color: var(--text-3); letter-spacing: 0; }

.pass-eye {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-3);
  transition: background-color .14s, color .14s;
}
.pass-eye svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pass-eye:hover { background: #f2ece0; color: var(--text); }
.pass-eye.is-on { color: #a5803f; }

.pass-err {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-style: normal;
  color: var(--danger);
}
.pass-hint { margin: 0; font-size: 12px; color: var(--text-3); }
.pass-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f4eee2;
  color: #7a5f2c;
  font-size: 12px;
}

/* 只作用于暗口令弹窗，避免和其他页面的「删除」按钮互相干扰 */
.modal--pass .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.modal--pass .btn-danger:hover { background: #8d322a; box-shadow: 0 4px 12px -4px rgba(160, 59, 50, .45); }
.modal--pass .btn-danger:active { transform: translateY(1px); }

/* ============ 指派负责人弹窗 ============ */
.modal--assign { width: 468px; }
.assign-proj {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}
.assign-proj b { color: var(--text); font-weight: 600; }

.member-pick {
  max-height: 292px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 -4px;
  padding: 2px 4px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .13s, border-color .13s;
}
.member-row:hover { background: #f6f2e9; }
.member-row.is-cur {
  background: var(--primary-soft);
  border-color: var(--accent);
}
.member-row.is-off { cursor: not-allowed; opacity: .55; }
.member-row.is-off:hover { background: none; }

.member-row__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.member-row__main { flex: 1; min-width: 0; }
.member-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.member-row__role {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 15px;
}
.member-row__sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 1px;
}
.member-row__cnt {
  font-size: 13px;
  color: var(--text-3);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.member-row__tick {
  width: 16px;
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.member-row__tick svg { width: 15px; height: 15px; }

.assign-more {
  margin-right: auto;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  align-self: center;
}
.assign-more:hover { color: #8a6a2f; }

/* 列表里的负责人 */
.td-creator { white-space: nowrap; }
.td-role {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 15px;
  flex-shrink: 0;
}
.td-unassigned { color: var(--text-3); }

/* ==========================================================
   多制作员协作 · 身份切换 / 工作区范围（首页）
   ========================================================== */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.ph-titles { min-width: 0; }

/* ---------- 当前制作员胶囊 ---------- */
.me-wrap { position: relative; flex: none; margin-top: 1px; }
.me-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fdfcfa;
  color: var(--text);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.me-chip:hover { border-color: #d9c9a9; box-shadow: 0 4px 12px -5px rgba(43, 38, 32, .24); }
.me-chip.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 169, 110, .16); }
.me-chip__av {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  font-size: 12.5px; font-weight: 600;
  color: #fdfaf3;
  background: linear-gradient(145deg, #c9a96e, #a9884e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.me-chip__txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.me-chip__txt b { font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.me-chip__txt em { font-style: normal; font-size: 11px; color: var(--text-3); letter-spacing: .3px; }
.me-chip__caret { width: 11px; height: 11px; color: #a3843f; transition: transform .18s; margin-left: 1px; }
.me-chip.is-open .me-chip__caret { transform: rotate(180deg); }

/* ---------- 切换菜单 ---------- */
.me-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 268px;
  padding: 6px;
  background: #fdfcfa;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 120;
  animation: meIn .16s ease both;
}
@keyframes meIn { from { opacity: 0; transform: translateY(-5px); } }
.me-menu__t {
  display: flex; align-items: center; justify-content: space-between;
  margin: 3px 8px 6px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: .4px;
}
.me-menu__t em {
  font-style: normal;
  padding: 0 5px;
  border-radius: 4px;
  color: #96702f;
  background: rgba(201, 169, 110, .16);
}
.me-menu__list { display: flex; flex-direction: column; gap: 2px; }
.me-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0; border-radius: 8px;
  background: none;
  text-align: left;
}
.me-item:hover { background: #f4efe5; }
.me-item.is-on { background: rgba(201, 169, 110, .16); }
.me-item__av {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  font-size: 11.5px; font-weight: 600;
  color: #fdfaf3;
}
.me-item__txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-item__txt b { font-size: 13px; font-weight: 500; color: var(--text); }
.me-item__txt em { font-style: normal; font-size: 11px; color: var(--text-3); }
.me-item__ck { width: 13px; height: 13px; color: #a3843f; margin-left: auto; flex: none; }
.me-menu__foot {
  margin: 6px 8px 4px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-3);
}

/* ---------- 工作区范围条 ---------- */
.scope-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
}
.scope-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #ece5d9;
  border-radius: 9px;
  flex: none;
}
.scope-seg button {
  border: 0;
  background: none;
  padding: 5px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  color: #6e665a;
  letter-spacing: .3px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.scope-seg button:hover { color: #2b2620; }
.scope-seg button.is-on {
  background: #fdfcfa;
  color: #2b2620;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(43, 38, 32, .14);
}
.scope-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.scope-note b { color: #96702f; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 他人项目：只读标记 ---------- */
.dcard__collab {
  position: absolute;
  right: 8px; top: 8px;
  z-index: 2;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: .3px;
  color: #f6f0e4;
  background: rgba(23, 20, 16, .42);
  backdrop-filter: blur(3px);
}
.dm-owner.is-other::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #b9ab92;
  vertical-align: 1px;
}
.dtable tbody tr.is-other .td-name { color: var(--text-2); }
.td-op a.is-locked { color: var(--text-3); cursor: not-allowed; text-decoration: none; }

/* 卡片更多菜单里的只读说明 */
.ctx-menu__lock {
  margin: 0 0 4px;
  padding: 6px 10px 7px;
  border-bottom: 1px dashed var(--border);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-3);
  max-width: 178px;
}
.ctx-menu a.is-locked {
  color: #b3aa9c;
  cursor: not-allowed;
  pointer-events: auto;
}
.ctx-menu a.is-locked:hover { background: none; }
