/* ==============================================================================
   WP4 · 导演 / 创作伙伴 —— apple-director.css
   ------------------------------------------------------------------------------
   范围：去琥珀、步骤条横向可滚、审批卡 16 圆角实色面、结果/分镜卡统一状态色、
        伙伴页（/agent、/join）卡片 16 圆角去紫。
   不碰：费用与审批逻辑、分镜数据结构、上传与 @ 引用（MASTER §0.2）。
   约定：每条规则都以 html[data-apple="on"] 开头，删掉总开关即回到改造前。
   ------------------------------------------------------------------------------
   权重的现实：本文件按 index.html 顺序在所有业务样式之后加载（第 68 个 link），
   但业务文件里有一批高权重规则要压：
   · atelier.css:160  :is(#app,#qj-dialog) :is(...,.d-stepnav,...) button   → (1,1,1)
   · brand.css:82-83  亮色把金币写死成金色 #A97F2E，且 (0,5,1)
   · director.css:653-655  .d-stage-content .d-stepnav button               → (0,2,1)
   所以下面凡是与它们正面冲突的，都显式写成 #app / :root 提权，不靠加载顺序赌。
   ============================================================================== */

/* ==============================================================================
   1 · 去琥珀：导演 / 伙伴页残留的橙、金、奶油一律换石墨
   ============================================================================== */

/* 1.1 顶栏金币。brand.css:82-83 在亮色主题把颜色写死成 #A97F2E（金），深色走
   --qj-gold（已被 apple-theme 指到石墨）。只在导演/伙伴页看得到橙色金币的是它，
   _apple_sat.cjs 每次都会把 credit-coin 报出来。补 :root 把权重抬到 (0,5,2)
   才压得住 brand.css 的 (0,5,1)；这不是扩大改皮范围，是同一处颜色在两个主题
   下必须一致，否则亮色留一颗金扣子。 */
html[data-apple="on"]:root body .fa-topbar .credit-pill .credit-coin,
html[data-apple="on"]:root body .fa-topbar .credit-pill .credit-coin svg{ color:var(--text-2) }

/* 1.1b 品牌标记的旋转环。brand.css:473 在亮色用 conic-gradient(#8A6A2E …)
   画一圈琥珀；apple-theme.css:416 的 .fa-brand-mark i 覆盖权重 (0,2,2)，压不过
   brand.css 的 (0,3,1)，所以亮色下这圈金环还在（深色因为走 --qj-teal 已被换掉）。
   这里补到 (0,3,2) 把它归零，和 1.1 一样是外壳漏色，不是新样式。 */
html[data-apple="on"]:root .fa-brand-mark i{ background:none; box-shadow:none }

/* 1.2 对话改写提示条。director.css:371 用 color-mix(--warning 35%) 做边框、
   --warning 5% 做底，深色下是一块淡橙。改成发丝描边的实色条，只在左侧留一道
   语义色细线表示"这是提示，不是错误"，颜色不做面积。 */
html[data-apple="on"] .d-dialogue-notice{
  border:1px solid var(--line);
  border-left:2px solid var(--warning);
  border-radius:var(--radius-control);
  background:var(--surface-2);
  color:var(--text-2);
  box-shadow:none;
}
html[data-apple="on"] .d-dialogue-notice strong{ color:var(--text-1) }

/* 1.3 Agent Beta 会话头像。director-agent.css:549 是 radial-gradient(#FFFDF8,#F4EEE1)
   的奶油底，深色页面上一眼是暖色。换成实色面 + 发丝内描边。 */
html[data-apple="on"] .da-chat-avatar{
  background:var(--surface-3);
  box-shadow:inset 0 0 0 1px var(--line);
  color:var(--text-1);
}

/* 1.4 伙伴页两张深色/奶油大卡。agent-ui.css:19-26 / 55-65 在深色下把
   .agent-apply-card / .agent-invite 反过来刷成 #F2E7D8→#E4D5C1 的奶油渐变，
   文字却是浅色（实测 1440 深色截图里标题几乎看不见）。这两块是整页唯一
   还带暖色的面积，改成 --surface-2 实色 + 发丝描边，文字回到 --text-1。 */
html[data-apple="on"] :is(.agent-apply-card,.agent-invite){
  background:var(--surface-2);
  background-image:none;
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  color:var(--text-1);
  box-shadow:none;
}
html[data-apple="on"] :is(.agent-apply-card,.agent-invite) :is(h2,strong){ color:var(--text-1) }
html[data-apple="on"] :is(.agent-apply-card,.agent-invite) p{ color:var(--text-2); opacity:1 }

/* 1.5 卡片里的 eyebrow（"伙伴计划 / 加入计划 / 怎么开始"）。前三处用的是
   --atelier-ochre，深色下又被 agent-ui.css:22/58 写死 #8D5E2F（棕）。统一到
   --text-3 的元数据层级，靠字距和大写字重区分，不靠颜色。 */
html[data-apple="on"] :is(.agent-apply-card,.agent-invite,.agent-invite-control) .eyebrow{
  color:var(--text-3);
}
html[data-apple="on"] .agent-how .eyebrow{ color:var(--text-3) }

/* 1.6 奶油卡里的主按钮。agent-ui.css:25-26 给它 #FFF8EF/#20170F 的暖白底，
   与全站石墨主按钮不一致；跟随 --fill/--on-fill 两个令牌。 */
html[data-apple="on"] :is(.agent-apply-card,.agent-invite-control) .button.primary{
  background:var(--fill);
  border-color:var(--fill);
  color:var(--on-fill);
}
html[data-apple="on"] :is(.agent-apply-card,.agent-invite-control) .button.primary:hover:enabled{
  background:var(--text-1);
  border-color:var(--text-1);
  color:var(--bg);
}

/* ==============================================================================
   2 · 步骤条：1180 / 900 档横向可滚，不换行溢出、不遮挡右上工具区
   ------------------------------------------------------------------------------
   病灶：.d-stage-content .d-worknav 是 grid「minmax(0,1fr) auto」，步骤条在
   第一列；.d-stepnav 的按钮是 flex:none + white-space:nowrap，列被压窄时
   （900 档 + 分镜页的"更多"工具栏）按钮不缩，靠 overflow:visible 直接漫到
   右侧工具区上——900 档实测步骤条内容 390px 塞进 322px 的列，"成片"被
   "模型与助手"盖住。改法是让这一列自己滚，而不是让它溢出。
   ============================================================================== */

/* 2.1 滚动的容器：单行、不换行、横向滚动、隐藏滚动条（Apple 的做法是内容
   自己露出来，而不是画一根 8px 的灰条）。overscroll-behavior 阻止滚动链传到
   整页。 */
html[data-apple="on"] #app .d-stepnav{
  min-width:0;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
html[data-apple="on"] #app .d-stepnav::-webkit-scrollbar{ display:none; width:0; height:0 }

/* 2.2 按钮不参与收缩。atelier.css:160 给的是 min-height:38/padding:8 14，
   director.css:654 给的是 flex:none；这里只锁"不缩、不换行"两件事，
   尺寸留给原文件，避免两处都改产生新的不一致。 */
html[data-apple="on"] #app .d-stepnav button{
  flex:0 0 auto;
  white-space:nowrap;
  max-width:18em;
}

/* 2.3 工具区（模型与助手 / 已保存 / 更多）不参与压缩，否则被步骤条挤到换行。 */
html[data-apple="on"] #app .d-worknav{ min-width:0 }
html[data-apple="on"] #app .d-work-tools{ flex:none; min-width:0 }

/* 2.4 1180 档：上面 director.css:13 把 .d-stepnav 设成 width:100% 再
   space-between。宽度交给栅格，两端对齐在可滚容器里没有意义，统一从行首排列，
   滚动位置才可预期。 */
@media (max-width:1180px){
  html[data-apple="on"] #app .d-stage-content .d-stepnav{
    width:auto;
    justify-content:flex-start;
  }
  html[data-apple="on"] #app .d-stage-content .d-worknav{ gap:12px }
}

/* 2.5a 900 档：步骤条独占一行，工具区落到第二行。
   这一档的工具栏会涨到 5–6 项（主体页："模型与助手 / 生成本集图片 / 拆分分镜 /
   ⋯ / 已保存 / ≡"），实测它独占 478px，把步骤条压到 139px——当前所在的"主体"
   整颗被推出可视区，用户看不到自己在第几步。让步骤条吃掉整行（628px，5 个步骤
   全部可见、当前步骤一定在视口内），工具区右对齐排在第二行，两者都不再抢宽度。
   横向滚动仍是兜底：≤760 或标签再变长时由 2.1 的 overflow-x 接管。 */
@media (max-width:900px){
  html[data-apple="on"] #app .d-stage-content .d-worknav{
    grid-template-columns:minmax(0,1fr);
    row-gap:8px;
  }
  html[data-apple="on"] #app .d-stage-content .d-worknav>.d-stepnav{
    grid-column:1/-1;
    grid-row:1;
    width:100%;
  }
  html[data-apple="on"] #app .d-stage-content .d-worknav>.d-work-tools{
    grid-column:1/-1;
    grid-row:2;
    justify-self:end;
    justify-content:flex-end;
  }
}

/* 2.5 900 档：按钮内边距收到 10px（原 18），5 个中文标签在总览页刚好装满、
   在分镜页（工具栏多一个"更多"）溢出 42px 进入滚动。director.css:736 在 ≤760
   用 flex:1 把按钮均分，那条在更窄屏幕上保留，这里只处理 761–900。 */
@media (min-width:761px) and (max-width:900px){
  html[data-apple="on"] #app .d-stepnav button{ padding-inline:10px; font-size:13.5px }
}

/* 2.6 滚动提示：只在 ≤900 给右缘一道 22px 的渐隐。
   容器内按钮是左对齐的，内容装得下时这一区域是空的（900 档总览页实测容器 396
   / 内容 360，最后一颗按钮在 596 结束、渐隐区 610–632 无像素可盖），所以它
   不会误伤正常状态；只有真的滚起来、第五个 tab 被切在边缘时才会淡出，读作
   "右边还有"。这不是引导层，不占位、不拦截点击。 */
@media (max-width:900px){
  html[data-apple="on"] #app .d-stepnav{
    -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 22px),transparent);
    mask-image:linear-gradient(to right,#000 calc(100% - 22px),transparent);
  }
}

/* 2.7 键盘可达：滚动容器会把按钮的 focus 外圈裁掉，给一条内阴影顶替，
   保证 Tab 到第 5 个步骤时仍然看得见焦点。 */
html[data-apple="on"] #app .d-stepnav button:focus-visible{
  outline:none;
  box-shadow:inset 0 0 0 2px var(--text-1);
}

/* ==============================================================================
   3 · 审批卡：16 圆角、实色面、发丝描边（费用与审批逻辑一行未改）
   ------------------------------------------------------------------------------
   覆盖两处同族卡片：novel.css:595-625 的 .cp-askcard（Agent 的"HITL 澄清/确认
   卡"，/novels /scripts 编辑器里出现），以及 director.css:903 的
   .d-subjects-candidate（"确认并替换本集主体"）。两者原来都是 12 圆角 + 半透明
   color-mix 面 + 大阴影，按 MASTER §2.7 统一成卡片 16 / 控件 10。
   ============================================================================== */

/* 3.1 卡体 */
html[data-apple="on"] .cp-askcard,
html[data-apple="on"] .d-subjects-candidate{
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  color:var(--text-1);
  box-shadow:none;
}

/* 3.2 卡头：原来头部底色是 --accent 4% 的混合，浅色下会发灰；改成 --surface-2
   实色 + 一条发丝分隔线，靠层次而不是靠染色区分。 */
html[data-apple="on"] .cp-askcard-head{
  background:var(--surface-2);
  border-bottom:1px solid var(--line);
}
html[data-apple="on"] .cp-askcard-foot{
  background:var(--surface-2);
  border-top:1px solid var(--line);
}

/* 3.3 印章与进度点：原来用 --accent 反白，现在是石墨反白；未完成的点降到
   --line-strong，当前点用 --text-1，三档一眼可辨。 */
html[data-apple="on"] .cp-askcard-seal{
  background:var(--text-1);
  color:var(--bg);
  border-radius:6px;
}
html[data-apple="on"] .cp-askcard-cap{ color:var(--text-1) }
html[data-apple="on"] .cp-askcard-step{ color:var(--text-3) }
html[data-apple="on"] .cp-askcard-dots i{ background:var(--line-strong) }
html[data-apple="on"] .cp-askcard-dots i.is-done{ background:var(--text-3) }
html[data-apple="on"] .cp-askcard-dots i.is-on{ background:var(--text-1) }

/* 3.4 选项：原来是 999 药丸 + --accent 边框。MASTER §2.7 是"控件 10"，选中态
   用 --surface-3 实底 + --line-strong 描边，不用高亮色块。 */
html[data-apple="on"] .cp-askcard-opt{
  border:1px solid var(--line);
  border-radius:var(--radius-control);
  background:var(--surface-2);
  color:var(--text-1);
}
html[data-apple="on"] .cp-askcard-opt:hover{ border-color:var(--line-strong); background:var(--surface-3) }
html[data-apple="on"] .cp-askcard-opt.is-on{
  border-color:var(--text-2);
  background:var(--surface-3);
  color:var(--text-1);
}
html[data-apple="on"] .cp-askcard-rec{
  background:var(--surface-1);
  color:var(--text-2);
  border:1px solid var(--line);
  border-radius:999px;
}
html[data-apple="on"] .cp-askcard-opt.is-on .cp-askcard-rec{ background:var(--text-1); color:var(--bg); border-color:var(--text-1) }

/* 3.5 引用句与说明块：原来是左道 --accent 细线，改 --line-strong，只做缩进提示。 */
html[data-apple="on"] .cp-askcard-quote{
  border-left:2px solid var(--line-strong);
  background:var(--surface-2);
  color:var(--text-2);
}
html[data-apple="on"] .cp-askcard-detail{
  border-left:2px solid var(--line-strong);
  background:var(--surface-2);
  color:var(--text-2);
}
html[data-apple="on"] .cp-askcard-meta{ color:var(--text-3) }
html[data-apple="on"] .cp-askcard-hint{ color:var(--text-3) }

/* 3.6 手填输入：8 圆角 → 控件 10，焦点环改成外描边而不是发光阴影。 */
html[data-apple="on"] .cp-askcard-custom{
  border:1px solid var(--line);
  border-radius:var(--radius-control);
  background:var(--surface-1);
  color:var(--text-1);
}
html[data-apple="on"] .cp-askcard-custom:focus{
  border-color:var(--line-strong);
  box-shadow:none;
  outline:2px solid var(--text-1);
  outline-offset:1px;
}

/* 3.7 导演页的"主体提取结果待确认"卡：director.css:904 在 READY 时用
   --accent 35% 描边 + 4% 底色，equal-weight 地跟正文抢注意力。改成实色面，
   状态交给标题旁的状态字（见 §4）。 */
html[data-apple="on"] .d-subjects-candidate[data-status="READY"]{
  border-color:var(--line);
  background:var(--surface-1);
}
html[data-apple="on"] .d-subjects-candidate :is(h2,h3,strong){ color:var(--text-1) }

/* ==============================================================================
   4 · 结果卡 / 分镜卡：状态色统一到 --success / --warning / --danger，不做发光
   ------------------------------------------------------------------------------
   director.css:125 只给 UNKNOWN/FAILED 上了语义色，成功态还停在 --text，
   于是同一屏里"已完成"和"待生成"长得一样。这里按语义分三层：
   已完成/待审核 = 成功；待确认/待补款/待更新 = 警告；失败 = 危险；
   其余（排队、生成中、已取消）保持中性，不把在途状态涂成警告色。
   ============================================================================== */

/* 4.1 结果卡：director.css:846 是 12 圆角 + --surface 底 + 1px 描边。
   统一到卡片 16，去掉可能的阴影与文字阴影。 */
html[data-apple="on"] .d-workflow-result{
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  box-shadow:none;
  text-shadow:none;
}
html[data-apple="on"] .d-workflow-result.is-running{ border-color:var(--line) }
html[data-apple="on"] .d-workflow-skeleton span{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--radius-control);
}

/* 4.2 等待/阻塞提示。director.css 里 ready 与 unknown 共用 .d-workflow-wait-note，
   只有 unknown 是真警告，用 :has 之外的属性无法区分，所以这里只把"待确认"
   的强标文字着色，其余保持 --text-2。 */
html[data-apple="on"] .d-workflow-wait-note{ color:var(--text-2) }
html[data-apple="on"] .d-workflow-wait-note>strong{ color:var(--text-1) }

/* 4.3 分镜/主体卡上的状态字（.d-status-<状态>，assetStatus() 与 group.status 的
   产物：done/ready/COMPLETED/READY/ADOPTED、unknown/stale/QUEUED/RUNNING、
   failed/FAILED、idle/cancelled）。 */
html[data-apple="on"] :is(.d-status-done,.d-status-ready,.d-status-DONE,
  .d-status-COMPLETED,.d-status-READY,.d-status-ADOPTED){
  color:var(--success);
  background:var(--surface-2);
  border-color:var(--line);
  box-shadow:none;
  text-shadow:none;
}
html[data-apple="on"] :is(.d-status-unknown,.d-status-UNKNOWN,.d-status-stale,
  .d-status-AWAITING_CONTINUE,.d-status-AWAITING_PAYMENT,.d-status-RETRIEVING){
  color:var(--warning);
  background:var(--surface-2);
  border-color:var(--line);
  box-shadow:none;
  text-shadow:none;
}
html[data-apple="on"] :is(.d-status-failed,.d-status-FAILED){
  color:var(--danger);
  background:var(--surface-2);
  border-color:var(--line);
  box-shadow:none;
  text-shadow:none;
}
/* 在途与空态保持中性：排队/生成中不是错误，也不是成功。 */
html[data-apple="on"] :is(.d-status-idle,.d-status-queued,.d-status-running,
  .d-status-cancelled,.d-status-QUEUED,.d-status-PREPARING,.d-status-PROCESSING,
  .d-status-RUNNING,.d-status-SUBMITTING,.d-status-CANCELLED){
  color:var(--text-2);
  background:var(--surface-2);
  border-color:var(--line);
  box-shadow:none;
  text-shadow:none;
}

/* 4.4 任务级状态字（.d-job-status[data-status]）。director.css:126 只覆盖了
   UNKNOWN，补 COMPLETED / FAILED，三种之外不动。 */
html[data-apple="on"] .d-job-status{ color:var(--text-3) }
html[data-apple="on"] .d-job-status[data-status="COMPLETED"]{ color:var(--success) }
html[data-apple="on"] .d-job-status[data-status="UNKNOWN"]{ color:var(--warning) }
html[data-apple="on"] .d-job-status[data-status="FAILED"]{ color:var(--danger) }
html[data-apple="on"] .d-job-status[data-status="CANCELLED"]{ color:var(--text-3) }

/* 4.5 候选条与主体候选块的状态：只在文字层着色，避免整条被染色。 */
html[data-apple="on"] .d-candidate-bar[data-status="FAILED"] .d-candidate-copy strong{ color:var(--danger) }
html[data-apple="on"] .d-candidate-bar[data-status="READY"] .d-candidate-copy strong{ color:var(--success) }
html[data-apple="on"] .d-subjects-candidate[data-status="FAILED"] :is(h2,h3,strong){ color:var(--danger) }
html[data-apple="on"] .d-subjects-candidate[data-status="UNKNOWN"] :is(h2,h3,strong){ color:var(--warning) }

/* 4.6 分镜缩略图与资产卡的状态角标：director.css:127/1158 给的是 --surface +
   --muted（中性），这里只补圆角与描边，颜色仍在 §4.3 的三档里。 */
html[data-apple="on"] .d-group-thumb .d-status{
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--surface-1);
  box-shadow:none;
}

/* ==============================================================================
   5 · 创作伙伴（/agent、/join）：卡片 16 圆角、去紫、实色面
   ------------------------------------------------------------------------------
   原值散在 18 / 20 / 22 / 17 / 14 五种（agent-ui.css），MASTER §2.7 统一到卡片
   16。--accent 已被 apple-theme 指到石墨，所以"去紫"在这里表现为：把
   atelier.css:325 给 .agent-hero 的 linear-gradient 压掉，只留实色面。
   ============================================================================== */

html[data-apple="on"] :is(.agent-benefit,.agent-how,.agent-apply-card,.agent-pending,
  .agent-metric,.agent-invite,.agent-panel,.agent-review-card,.agent-note,.agent-hero){
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  background-image:none;
  box-shadow:none;
}

/* 5.1 英雄卡：atelier.css:325 的渐变来自 color-mix(--accent …)，深色下是一层
   从右上来的灰雾。压掉渐变后靠描边分层，内容仍在上层。 */
html[data-apple="on"] .agent-hero{
  background:var(--surface-1);
  background-image:none;
}
/* atelier.css:326 在右上角画了一个 300px 的装饰圆环（border + 两圈 3% 的
   box-shadow 光晕）——这正是 MASTER §2.7 禁止的"发光/装饰"。整只伪元素拿掉，
   卡片只留描边与内容。 */
html[data-apple="on"] .agent-hero::after{ content:none; border:0; box-shadow:none }
html[data-apple="on"] .agent-hero .eyebrow{ color:var(--text-3) }

/* 5.2 指标卡与序号：数字用等宽（MASTER §2.2），序号降成 --text-3。 */
html[data-apple="on"] .agent-metric strong{ font-variant-numeric:tabular-nums }
html[data-apple="on"] .agent-benefit>small,
html[data-apple="on"] .agent-step>span{ color:var(--bg); background:var(--text-1) }
html[data-apple="on"] .agent-benefit-icon{
  border:1px solid var(--line);
  border-radius:var(--radius-control);
  background:var(--surface-2);
  color:var(--text-1);
}
html[data-apple="on"] .agent-metric-top{ color:var(--text-3) }

/* 5.3 /join：workspace-ui.css:127-139 的三张卡是 18 圆角，统一 16 实色面。
   只命中 .ws-join* 这组只在加盟页出现的选择器，不波及 WP5 的其它页面。 */
html[data-apple="on"] :is(.ws-join-hero,.ws-join-status,.ws-join-form){
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  box-shadow:none;
}
html[data-apple="on"] .ws-join-hero>span{
  background:var(--surface-2);
  border:1px solid var(--line);
  color:var(--text-1);
}

/* ==============================================================================
   6 · 导演落地页 /director：7 个 tab、项目网格、任务队列入口保持可用
   ------------------------------------------------------------------------------
   这一节只做"不挡路"的两件事：tab 条在窄屏可横滚、项目卡圆角归 16。
   不给任何入口加禁用态、不加引导层、不改按钮的 data-action。
   ============================================================================== */

/* 6.1 上传 / Agent 导演 两个模式 tab（studio-home.css:6-11）。900 档以下
   .sh-modes 没有滚动，两个中文长标签会被压到换行；补成单行可滚。 */
html[data-apple="on"] .sh-modes{
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
}
html[data-apple="on"] .sh-modes::-webkit-scrollbar{ display:none; width:0; height:0 }
html[data-apple="on"] .sh-mode{
  flex:0 0 auto;
  white-space:nowrap;
}
/* 选中态原来的 2px 下划线用 --studio-accent（已石墨），改为一条 1px 发丝线，
   与项目页的步骤条选中样式（实心底）区分开：这里是页签，不是进度。 */
html[data-apple="on"] .sh-mode[aria-selected="true"]::after{
  height:1px;
  background:var(--text-1);
}

/* 6.2 项目网格卡：director.css:3 是 15 圆角。归 16，hover 不给平移/发光
   （director.css:112 已经把 transform 压掉了，这里只确认一次）。 */
html[data-apple="on"] #app .d-project-card{
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  box-shadow:none;
}
html[data-apple="on"] #app .d-project-card:hover{ border-color:var(--line-strong); transform:none }

/* 6.3 落地页那张上传卡（.sh-card）与虚线投放区：圆角归 16 / 10，虚线只在
   悬停时加深，不做位移。 */
html[data-apple="on"] .d-landing .sh-card{
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface-1);
  box-shadow:none;
}
html[data-apple="on"] .d-landing-drop{ border-radius:var(--radius-control) }
html[data-apple="on"] .d-landing-drop:hover,
html[data-apple="on"] .d-landing-drop:focus-visible,
html[data-apple="on"] .d-landing-drop.is-over{ border-color:var(--line-strong) }
/* ==============================================================================
   2 · 一键成片 · 工作台外壳（2026-11-04 线上评审）
   ------------------------------------------------------------------------------
   问题清单（都在这组规则里收口）：
   1) 左栏是一条 118px 的裸列表 + 右侧竖线，和右边的内容卡不是同一套容器语言；
   2) 阶段标签贴着内容边缘，右侧工具组和标签抢位置，切换阶段时整行抖动；
   3) 剧本页：工具栏只剩右半边（标题被业务样式 display:none），正文是纸面里又套了
      一个 714px 宽的带框输入框，左右各 180px 空白，看起来"文字位置不对"；
   4) 概览页：阶段行 90px 高、编号 23px，和右侧设置列不在同一栅格；
   5) 主体页：没选中主体时右栏仍渲染一个空壳 + 竖线，整页右边多出一条"空抽屉"。

   目标：左「剧集卡」、中「纸面卡」、顶「分段标签」，三块共用 12–14px 圆角与发丝线，
   内容列 900px 居中，工具栏标题回到左边。全部只在 data-apple="on" 下生效。
   ============================================================================== */

/* ---------- 2.1 外壳：左剧集卡 + 右内容 ---------- */
html[data-apple="on"] #app .d-episode-workspace{
  grid-template-columns:184px minmax(0,1fr);
  gap:16px;
  align-items:stretch;
}
html[data-apple="on"] #app .d-episode-rail{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  padding:10px;
}
html[data-apple="on"] #app .d-rail-head{
  justify-content:flex-start;
  gap:6px;
  height:32px;
  padding:0 4px 8px;
  margin-bottom:8px;
  border-bottom:1px solid var(--line);
}
html[data-apple="on"] #app .d-rail-head strong{
  order:-1;
  margin-right:auto;
  font-size:11px;
  font-weight:600;
  letter-spacing:.1em;
  color:var(--text-3);
}
html[data-apple="on"] #app .d-rail-head .button{
  width:26px; min-width:26px; height:26px; min-height:26px; padding:0;
  border-radius:7px; background:transparent; color:var(--text-3);
}
html[data-apple="on"] #app .d-rail-head .button:hover{ background:var(--surface-3); color:var(--text-1) }
html[data-apple="on"] #app .d-rail-items{ gap:2px }
html[data-apple="on"] #app .d-rail-episode{
  height:32px;
  padding:0 9px;
  border:0;
  border-radius:8px;
  display:flex;
  align-items:center;
  color:var(--text-2);
}
html[data-apple="on"] #app .d-rail-episode strong{ font-size:12.5px; font-weight:500 }
html[data-apple="on"] #app .d-rail-episode:hover{ background:var(--surface-2); color:var(--text-1) }
html[data-apple="on"] #app .d-rail-episode.active{
  background:var(--surface-3);
  color:var(--text-1);
}
html[data-apple="on"] #app .d-rail-episode.active strong{ font-weight:600 }

/* ---------- 2.2 阶段标签：分段控件，右侧工具固定 ---------- */
html[data-apple="on"] #app .d-stage-content{
  display:flex;
  flex-direction:column;
  min-width:0;
  padding:0;
  gap:0;
}
html[data-apple="on"] #app .d-worknav{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 0 12px;
  margin:0 0 14px;
  border-bottom:0;
  flex-wrap:wrap;
}
html[data-apple="on"] #app .d-stepnav{
  display:inline-flex;
  align-items:center;
  gap:2px;
  margin:0;
  padding:3px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-2);
  width:auto;
  justify-content:flex-start;
  overflow:visible;
}
html[data-apple="on"] #app .d-stepnav button{
  height:30px;
  padding:0 12px;
  border:0;
  border-radius:7px;
  gap:6px;
  font-size:12.5px;
  font-weight:500;
  color:var(--text-3);
  background:transparent;
}
html[data-apple="on"] #app .d-stepnav button:hover{ background:transparent; color:var(--text-1) }
html[data-apple="on"] #app .d-stepnav button.active{
  background:var(--surface);
  color:var(--text-1);
  box-shadow:0 1px 2px #00000059;
}
html[data-apple="on"] #app .d-stepnav button .qj-icon{ width:14px; height:14px; opacity:.75 }
html[data-apple="on"] #app .d-work-tools{ margin-left:auto; gap:8px; flex-wrap:nowrap }
html[data-apple="on"] #app .d-sync-status{ font-size:11.5px; color:var(--text-3) }

/* ---------- 2.3 剧本页：一张纸，不是纸里再套一张纸 ---------- */
html[data-apple="on"] #app .d-script-upload-workspace{ max-width:none; margin:0 }
html[data-apple="on"] #app .d-script-paper{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  padding:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  min-height:0;
}
html[data-apple="on"] #app .d-script-paper>.d-section-top{
  margin:0;
  padding:10px 16px;
  border-bottom:1px solid var(--line);
  justify-content:space-between;
  flex-wrap:nowrap;
  gap:10px;
}
html[data-apple="on"] #app .d-script-paper>.d-section-top h2{
  display:block;
  font-size:13px;
  font-weight:600;
  letter-spacing:0;
  color:var(--text-2);
  white-space:nowrap;
}
html[data-apple="on"] #app .d-script-paper>.d-section-top .toolbar{ gap:6px; flex-wrap:nowrap }
html[data-apple="on"] #app .d-script-editor{
  width:100%;
  /* 一行 40–46 个汉字是剧本的可读上限；再宽读者要回行找位置。
     46em 比原来的 42em 略宽，同时不再画边框——正文是纸面本身，不是纸里的另一个框。 */
  max-width:var(--d-measure,690px);
  margin:0 auto;
  padding:clamp(22px,3.4vh,40px) 4px;
  border:0;
  border-radius:0;
  background:transparent;
  font-size:15px;
  line-height:2.05;
  resize:none;
  flex:1;
  min-height:0;
}
html[data-apple="on"] #app .d-script-editor:focus-visible{ outline:none }
html[data-apple="on"] #app .d-script-footer{
  /* 页脚宽度必须和正文同一测度，否则字数与集数会飘到正文两侧 */
  width:100%;
  max-width:var(--d-measure,690px);
  margin:0 auto;
  padding:10px 4px 12px;
  border-top:0;
  color:var(--text-3);
  font-size:11.5px;
}

/* ---------- 2.4 概览：阶段行与右侧设置列对齐 ---------- */
html[data-apple="on"] #app .d-overview-layout{
  grid-template-columns:minmax(0,1fr) 296px;
  gap:20px;
  align-items:start;
}
html[data-apple="on"] #app .d-stage-list{
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  overflow:hidden;
}
html[data-apple="on"] #app .d-stage-list>button{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:13px 16px;
  border-bottom:1px solid var(--line);
}
html[data-apple="on"] #app .d-stage-list>button:last-child{ border-bottom:0 }
html[data-apple="on"] #app .d-stage-list>button:hover{ background:var(--surface-2) }
html[data-apple="on"] #app .d-stage-number{
  font-size:11px;
  font-weight:600;
  letter-spacing:.06em;
  color:var(--text-3);
  font-variant-numeric:tabular-nums;
}
html[data-apple="on"] #app .d-stage-copy{ display:flex; flex-direction:column; gap:2px; min-width:0 }
html[data-apple="on"] #app .d-stage-copy strong{ font-size:13.5px; font-weight:600 }
html[data-apple="on"] #app .d-stage-copy small{ font-size:12px; color:var(--text-3) }
html[data-apple="on"] #app .d-stage-status{ font-size:12px; color:var(--text-3); white-space:nowrap }
html[data-apple="on"] #app .d-settings{
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  padding:14px 16px;
  gap:10px;
}
html[data-apple="on"] #app .d-settings h2{ font-size:13px; font-weight:600; color:var(--text-2); margin:0 0 2px }
html[data-apple="on"] #app .d-settings .d-select-field>span{ font-size:12px; color:var(--text-3) }
html[data-apple="on"] #app .d-settings .select{ height:32px; font-size:12.5px }

/* ---------- 2.5 主体页：没选中主体就不要那条空右栏 ---------- */
html[data-apple="on"] #app .d-asset-inspector:empty{ display:none }
html[data-apple="on"] #app .d-assets-layout:not(:has(.d-asset-inspector)){ grid-template-columns:minmax(0,1fr) }
html[data-apple="on"] #app .d-asset-toolbar{
  border:0;
  padding:0 0 12px;
  margin-bottom:2px;
}
html[data-apple="on"] #app .d-asset-grid{
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  padding:14px;
}

/* ---------- 2.6 成片页：空时间线不占大块黑色 ---------- */
html[data-apple="on"] #app .d-stage-export .d-board,
html[data-apple="on"] #app .d-export-layout{ gap:20px }

/* ---------- 2.7 项目库：标题与上传卡收成一段 ---------- */
html[data-apple="on"] #app .d-landing{ margin:0 0 18px }
html[data-apple="on"] #app .d-landing-drop{ min-height:168px; padding:22px 18px }
html[data-apple="on"] #app .d-landing-title{ font-size:22px; line-height:1.35 }
html[data-apple="on"] #app .d-landing-hint{ font-size:12.5px }
html[data-apple="on"] #app .d-library-toolbar{
  display:flex; align-items:center; gap:12px;
  padding:16px 0 12px;
}
html[data-apple="on"] #app .d-library-toolbar h2{ font-size:15px; font-weight:600; margin:0 }
html[data-apple="on"] #app .d-library-toolbar>span{ font-size:12px; color:var(--text-3) }
html[data-apple="on"] #app .d-library-toolbar .input{ margin-left:auto; width:220px; height:32px; font-size:12.5px }

@media (max-width:1180px){
  html[data-apple="on"] #app .d-episode-workspace{ grid-template-columns:164px minmax(0,1fr) }
  html[data-apple="on"] #app .d-overview-layout{ grid-template-columns:minmax(0,1fr) }
}
@media (max-width:760px){
  html[data-apple="on"] #app .d-episode-workspace{ grid-template-columns:minmax(0,1fr) }
  html[data-apple="on"] #app .d-episode-rail{ border-radius:12px }
  html[data-apple="on"] #app .d-rail-items{ flex-direction:row; overflow-x:auto }
}

/* 2.8 纸面填满内容列：剧本页与别页不同高会显得"页面没铺满" */
html[data-apple="on"] #app .d-script-upload-workspace{ flex:1; min-height:0; display:flex }
html[data-apple="on"] #app .d-script-paper{ flex:1; min-height:0 }
html[data-apple="on"] #app .d-script-footer{ box-sizing:border-box; align-self:center }
html[data-apple="on"] #app .d-script-paper{ --d-measure:690px }
html[data-apple="on"] #app .d-script-paper>.d-script-footer{ max-width:var(--d-measure) }
html[data-apple="on"] #app .d-episode-workspace .d-rail-head>strong{ display:block }

/* 2.9 概览页细节修正：按钮盒模型与分组控件换行 */
html[data-apple="on"] #app .d-stage-list>button{ box-sizing:border-box; width:100% }
html[data-apple="on"] #app .d-settings .d-split-mode{ display:flex; flex-wrap:wrap; gap:6px }
html[data-apple="on"] #app .d-settings .d-split-mode .button{
  flex:1 1 auto; min-width:0; height:28px; min-height:28px; padding:0 8px;
  font-size:11.5px; border-radius:7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
html[data-apple="on"] #app .d-settings .d-split-mode .button[aria-pressed="true"]{
  background:var(--surface-3); border-color:var(--line-strong); color:var(--text-1);
}
html[data-apple="on"] #app .d-settings .d-fixed-row{ display:flex; flex-wrap:wrap; align-items:center; gap:5px; width:100% }
html[data-apple="on"] #app .d-settings .d-fixed-input{ width:56px; height:28px }
html[data-apple="on"] #app .d-settings .d-fixed-note{ width:100%; font-size:11px; line-height:1.6; color:var(--text-3) }
html[data-apple="on"] #app .d-settings>.button{ width:100%; justify-content:center; height:32px; min-height:32px; font-size:12px }
html[data-apple="on"] #app .d-current-heading{ margin:22px 0 10px; display:flex; align-items:baseline; gap:8px }
html[data-apple="on"] #app .d-current-heading>span{ font-size:11px; letter-spacing:.1em; color:var(--text-3) }
html[data-apple="on"] #app .d-current-heading .d-current-label{ font-size:15px; font-weight:600; margin:0; color:var(--text-1) }

/* 2.10 分组控件改成两列网格：flex 换行在 label 内部会被 min-content 顶开 */
html[data-apple="on"] #app .d-settings{ min-width:0; overflow:hidden }
html[data-apple="on"] #app .d-settings .d-split-mode{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  width:100%;
}
html[data-apple="on"] #app .d-settings .d-split-mode .button{
  display:inline-flex; align-items:center; justify-content:center;
  width:100%; max-width:100%; min-width:0;
  padding:0 6px; font-size:11px;
}

/* 2.11 阶段行状态列：允许省略，别顶出卡片 */
html[data-apple="on"] #app .d-stage-list>button{ grid-template-columns:28px minmax(0,1fr) minmax(0,44%) }
html[data-apple="on"] #app .d-stage-status{
  min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis;
  text-align:right; color:var(--text-2);
}
/* 设置行：标签左、控件右，控件定宽，不再各写各的 */
html[data-apple="on"] #app .d-settings .d-select-field{
  display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:10px;
}
html[data-apple="on"] #app .d-settings .d-select-field>span{ flex:0 0 auto }
html[data-apple="on"] #app .d-settings .d-select-field .select{ flex:0 1 148px; width:148px; max-width:148px }
html[data-apple="on"] #app .d-settings>label.ws-check{ display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--text-3) }

/* 2.12 项目库：标题左对齐，上传区压成一条，项目卡回到 16:9 */
html[data-apple="on"] #app .d-landing .sh-hero{
  text-align:left; padding:0 0 14px; margin:0;
  display:flex; flex-direction:column; gap:4px;
}
html[data-apple="on"] #app .d-landing .sh-hero h1{
  font-size:22px; line-height:1.3; font-weight:600; letter-spacing:-.01em; margin:0;
}
html[data-apple="on"] #app .d-landing .sh-hero p{ font-size:13px; color:var(--text-3); margin:0 }
html[data-apple="on"] #app .d-landing .sh-card{
  border:1px solid var(--line); border-radius:14px; background:var(--surface); padding:0; overflow:hidden;
}
html[data-apple="on"] #app .d-landing .sh-modes{ padding:10px 12px 0; gap:4px; border:0 }
html[data-apple="on"] #app .d-landing .sh-mode{ height:28px; min-height:28px; border-radius:7px; font-size:12.5px }
html[data-apple="on"] #app .d-landing .sh-body{ padding:10px 12px 12px }

html[data-apple="on"] #app .d-landing-drop{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:2px 14px;
  min-height:0;
  padding:16px 18px;
  text-align:left;
}
html[data-apple="on"] #app .d-landing-drop .d-landing-mark{ grid-column:1; grid-row:1 / span 2; width:38px; height:38px; margin:0 }
html[data-apple="on"] #app .d-landing-drop .d-landing-hint{ grid-column:2; grid-row:1; margin:0; text-align:left; font-size:12.5px }
html[data-apple="on"] #app .d-landing-drop .d-landing-formats{ grid-column:2; grid-row:2; text-align:left; font-size:11px }
html[data-apple="on"] #app .d-landing-drop .d-landing-actions{ grid-column:3; grid-row:1 / span 2; margin:0; display:flex; gap:8px }
html[data-apple="on"] #app .d-landing-drop .d-landing-actions .button{ height:32px; min-height:32px; font-size:12.5px; padding:0 14px }
html[data-apple="on"] #app .d-landing-drop--agent{ display:flex; flex-direction:column; align-items:flex-start; gap:6px }
html[data-apple="on"] #app .d-landing-drop--agent .d-landing-mark{ margin:0 0 2px }
html[data-apple="on"] #app .d-landing-drop--agent .d-landing-hint{ text-align:left }
html[data-apple="on"] #app .d-landing-drop--agent .d-landing-actions{ margin-top:6px }

html[data-apple="on"] #app .d-project-grid{ grid-template-columns:repeat(auto-fill,minmax(236px,1fr)); gap:14px }
html[data-apple="on"] #app .d-project-cover{ aspect-ratio:16/9; border-radius:10px; overflow:hidden }
html[data-apple="on"] #app .d-project-cover .d-cover-label{ font-size:11px }
html[data-apple="on"] #app .d-project-body h2{ font-size:14px }

/* 2.13 项目库标题：容器是 flex 列，必须显式左对齐，否则子项仍被居中 */
html[data-apple="on"] #app .d-landing .sh-hero{ align-items:flex-start; text-align:left }
html[data-apple="on"] #app .d-landing .sh-hero h1,
html[data-apple="on"] #app .d-landing .sh-hero p{ text-align:left; max-width:none }
html[data-apple="on"] #app .d-project-cover .d-media-empty{ background:var(--surface-2) }

/* 2.14 主体页空态：没有选中主体时不显示右侧详情栏（只留一对空标题没有意义） */
html[data-apple="on"] #app .d-asset-inspector.is-empty{ display:none }
html[data-apple="on"] #app .d-assets-layout:has(.d-asset-inspector.is-empty){ grid-template-columns:minmax(0,1fr) }

/* 2.15 前置条件条：从页脚位置提到标签下面，做成一条状态带，不再横着割一刀 */
html[data-apple="on"] #app .d-stage-content>.d-worknav{ order:-2 }
html[data-apple="on"] #app .d-stage-content>.d-prerequisites{
  order:-1;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin:0 0 14px; padding:10px 14px;
  border:1px solid var(--line); border-radius:10px; background:var(--surface);
}
html[data-apple="on"] #app .d-stage-content>.d-prerequisites>strong{ font-size:12.5px; font-weight:600 }
html[data-apple="on"] #app .d-stage-content>.d-prerequisites>span{ font-size:12px; color:var(--text-3); flex:1 1 auto; min-width:0 }
html[data-apple="on"] #app .d-stage-content>.d-prerequisites>.toolbar{ margin-left:auto; gap:6px; flex-wrap:nowrap }
html[data-apple="on"] #app .d-stage-content>.d-prerequisites .button{ height:28px; min-height:28px; font-size:12px; padding:0 10px }

/* 2.16 成片页：右栏做成卡、预览框去掉纯黑、空时间线不留一条灰带 */
html[data-apple="on"] #app .d-export-console{
  border:1px solid var(--line); border-radius:12px; background:var(--surface);
  padding:14px 16px; gap:12px;
}
html[data-apple="on"] #app .d-export-console h2{ font-size:13px; font-weight:600; color:var(--text-2); margin:0 }
html[data-apple="on"] #app .d-export-facts>div{ padding:10px 0; border-bottom:1px solid var(--line) }
html[data-apple="on"] #app .d-export-facts>div:last-child{ border-bottom:0 }
html[data-apple="on"] #app .d-export-facts span{ font-size:11.5px; color:var(--text-3) }
html[data-apple="on"] #app .d-export-facts strong{ font-size:18px; font-weight:600; font-variant-numeric:tabular-nums }
html[data-apple="on"] #app .d-final-screen{
  border:1px solid var(--line); border-radius:14px; background:var(--surface-2);
  box-shadow:none;
}
html[data-apple="on"] #app .d-timeline:not(:has(.d-group-cell)) .d-sequence-scroll{ display:none }
html[data-apple="on"] #app .d-timeline:not(:has(.d-group-cell)){ border:0; padding:0 }
html[data-apple="on"] #app .d-timeline-heading strong{ font-size:12.5px; color:var(--text-3); font-weight:500 }
html[data-apple="on"] #app .d-final-screen,
html[data-apple="on"] #app .d-final-screen .d-media-empty{ background:var(--surface-2) }
html[data-apple="on"] #app .d-final-screen .d-media-empty span{ color:var(--text-3); font-size:12.5px }
