/* 共用交互品质层：语义 token 决定颜色，组件同时覆盖 normal / hover / focus / selected。 */
.df-theme-switch { position: relative; display: inline-flex; flex: none; align-items: center; }
.df-theme-switch button { font: inherit; color: var(--df-color-text-strong); cursor: pointer; border: 0; }
.df-theme-switch .df-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; }
.df-theme-trigger { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--df-radius-md); background: transparent; }
.df-theme-trigger:hover { background: var(--df-color-surface-hover); }
.df-theme-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; width: 256px; padding: 0; border-radius: var(--df-radius-lg); background: var(--df-color-surface); box-shadow: var(--df-shadow-popover); border: 1px solid var(--df-color-border-subtle); }
.df-theme-options[hidden] { display: none; }
.df-theme-switch .df-theme-option { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px; border-radius: var(--df-radius-md); background: transparent; text-align: left; font-size: var(--df-font-size-lg); white-space: nowrap; }
.df-theme-option:hover { background: var(--df-color-surface-hover); }
.df-theme-check { display: flex; margin-left: auto; visibility: hidden; }
.df-theme-option[aria-checked="true"] .df-theme-check { visibility: visible; }
.df-theme-switch button:focus-visible { outline: 2px solid var(--df-color-focus-ring); outline-offset: 2px; }
.df-theme-hint { position: absolute; z-index: 125; width: max-content; max-width: 220px; padding: 6px 10px; border-radius: var(--df-radius-md); background: var(--df-color-text-strong); color: var(--df-color-bg); font-size: var(--df-font-size-xs); font-weight: 400; line-height: 18px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease .3s, visibility 0s linear .3s; }
.df-theme-trigger > .df-theme-hint { top: calc(100% + 8px); right: 0; }
.df-theme-option > .df-theme-hint { right: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.df-theme-switch button:is(:hover,:focus-visible) > .df-theme-hint { opacity: 1; visibility: visible; }
.df-theme-trigger[aria-expanded="true"] > .df-theme-hint { display: none; }
.df-theme-tools--standalone { position: fixed; top: var(--df-space-4); right: var(--df-space-4); display: flex; align-items: center; gap: var(--df-space-3); z-index: 100; }
:is(.df-btn,.df-chip,.type-top-filter__chip,.copy-asset-btn__button,.membership-plan__btn,.team-action,.team-invite,.resource-actions button,.task-actions button,.entry-card__btn) { white-space: nowrap; }

:is(#history-new, #create, #episode-add, .team-action, .team-invite) > .df-icon:has(use[href="#icon-plus"]) {
  width: 16px;
  height: 16px;
  flex: none;
}
.team-action > .df-icon > use[href="#icon-plus"] {
  stroke: currentColor;
  stroke-width: .5;
}
.entry-card__btn { width: 125px; min-width: 125px; padding: 0 var(--df-space-4); line-height: 20px; gap: var(--df-space-2); white-space: nowrap; flex: none; }
.entry-card__btn .entry-card__arrow { display: inline-block; flex: none; width: 12px; height: 12px; margin-left: 0; }
.copy-asset-btn__button { padding-block: 0; white-space: nowrap; }
.copy-asset-btn__button .df-icon, .copy-asset-btn__button > svg { flex: none; }
/* 显式主题选择器防止页面后续 border:0 / 背景规则再次吞掉线框。 */
html[data-theme] #workshop-form :is(#type-trigger,#model-trigger,#params-trigger,#mode-trigger) {
  min-height: 32px; height: 32px; border: 1px solid var(--df-color-workshop-control-border);
  /* 与壳层 padding 12 同心：浅 24-12=12 / 深 28-12=16 */
  border-radius: calc(var(--df-hybrid-composer-radius, 24px) - 12px); white-space: nowrap;
}
html[data-theme] #workshop-form :is(#model-trigger,#params-trigger,#mode-trigger) { padding: 4px var(--df-space-2); background: transparent; }
html[data-theme] #workshop-form .ws-select__trigger:is(:hover,:focus-visible,[aria-expanded="true"]) { border-color: var(--df-color-border-subtle); background: var(--df-color-surface-active); color: var(--df-color-text); }
html[data-theme] #workshop-form .ws-select__trigger:focus-visible {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: 2px;
}
html[data-theme] #workshop-form .ws-popover :is(.ws-option, .ws-params__chips button):focus-visible {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: -2px;
}
#workshop-form footer { flex-wrap: wrap; gap: var(--df-space-3); }
#workshop-form .workshop-config { flex: 1 1 420px; min-width: 0; }
#workshop-form .workshop-send { flex: none; margin-left: auto; }
/* 浅色交互：可点击元素不再使用接近背景的装饰描边。 */
html[data-theme="light"] :is(.df-chip,.type-top-filter__chip) { background: var(--df-color-surface); border-color: var(--df-color-workshop-control-border); color: var(--df-color-text-secondary); }
html[data-theme="light"] :is(.df-chip,.type-top-filter__chip):hover { background: var(--df-color-surface-hover); border-color: var(--df-color-border-subtle); color: var(--df-color-text-strong); }
html[data-theme="light"] :is(.df-chip[aria-pressed="true"],.type-top-filter__chip.is-active) { background: var(--df-color-surface-active); border-color: var(--df-color-border-subtle); color: var(--df-color-text-strong); font-weight: var(--df-font-weight-semibold); }
html[data-theme="light"] .copy-asset-btn__button { border-color: var(--df-color-border-strong); background: transparent; color: var(--df-color-text-strong); }
html[data-theme="light"] .copy-asset-btn__button:is(:hover,:focus-visible) { background: transparent; border-color: var(--df-color-primary-active); color: var(--df-color-primary-active); }
html[data-theme="light"] .membership-plan__btn:not(:disabled) { background: var(--df-color-primary); color: var(--df-color-primary-text); box-shadow: none; }
html[data-theme="light"] .membership-plan__btn:not(:disabled):hover { opacity: 1; background: var(--df-color-primary-active); }
html[data-theme="light"] .membership-subscribe__tabs { padding: var(--df-space-1); border: 1px solid var(--df-color-toggle-bg); background: var(--df-color-toggle-bg); }
html[data-theme="light"] .membership-subscribe__tabs button { min-width: 96px; white-space: nowrap; color: var(--df-color-toggle-text); }
html[data-theme="light"] .membership-subscribe__tabs button[aria-pressed="true"] { background: var(--df-color-toggle-selected-bg); color: var(--df-color-toggle-selected-text); }
html[data-theme="light"] .membership-subscribe__tabs button:not([aria-pressed="true"]):hover { background: var(--df-color-surface-hover); color: var(--df-color-text-strong); }
html[data-theme="light"] .membership-subscribe__recharge-wrap { padding: 0; background: none; }
html[data-theme="light"] .membership-subscribe__recharge { padding-bottom: 0; border: 1px solid var(--df-color-primary); background: var(--df-color-surface); color: var(--df-color-primary-active); }
html[data-theme="light"] .membership-subscribe__recharge:hover { background: var(--df-color-primary-soft); }
html[data-theme="light"] body:not([data-df-sidebar]):is(.console-shell,:has(.home-page)) .home-side-bottom > a:first-child,
html[data-theme="light"] body:not([data-df-sidebar]):is(.console-shell,:has(.home-page)) .home-side-bottom > a:first-child span { background: none; color: var(--df-color-primary-active); -webkit-text-fill-color: currentColor; font-size: var(--df-font-size-xs); font-weight: 400; }
html[data-theme="light"] :is(body.console-shell,body:has(.home-page)) .home-side-bottom > a:first-child svg { fill: currentColor; }
/* 首页浅色沉浸：通用洗色不作用于首张氛围（专用 grade）与后续卡片 Banner（深色原片）。 */
html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) {
  top: 0;
  left: 0;
  height: auto;
  background: var(--df-color-bg);
  mask-image: linear-gradient(to bottom, var(--df-palette-black) 72%, color-mix(in srgb, var(--df-palette-black) 85%, transparent) 80%, color-mix(in srgb, var(--df-palette-black) 15%, transparent) 92%, transparent 100%);
}
html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) .home-bg-video-wrap { margin-top: -40px; height: auto; }
html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) .home-bg-video { height: auto; width: 100%; min-width: 1280px; opacity: var(--df-home-video-opacity); object-fit: cover; object-position: 50% 50%; filter: saturate(var(--df-home-video-saturation)) contrast(var(--df-home-video-contrast)) blur(var(--df-home-video-blur)); transform: translateY(var(--df-home-video-offset-y)); }
html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) .home-bg-mask { background: var(--df-color-home-title-mask), var(--df-color-home-header-clean-mask), var(--df-color-home-edge-mask), var(--df-color-home-hero-mask); }
:is(html[data-theme], html:not([data-theme])) :is(body.console-shell, body.recharge-body, body:has(.home-page)) .topbar { border-bottom: 1px solid var(--df-color-border-subtle); }
html[data-theme="light"] body:not([data-df-sidebar]):has(.home-page) .sidebar { border: 0; box-shadow: none; }
html[data-theme="light"] body[data-df-sidebar] .topbar { background: var(--df-color-bg-console); backdrop-filter: none; }
html[data-theme="light"] body[data-df-sidebar].df-shell-transparent .topbar { background: transparent; backdrop-filter: none; }
html[data-theme="light"] body:not([data-df-sidebar]):has(.home-page) .sidebar { background: var(--df-color-home-scroll-bg); transition: background .3s ease; }
html[data-theme="light"] body:not([data-df-sidebar]).home-header-transparent:has(.home-page) .sidebar { background: transparent; }
html[data-theme="light"] body:not([data-df-sidebar]):has(.home-page) .sidebar a.selected { background: var(--df-color-nav-selected); color: var(--df-color-text-strong); }
html[data-theme="light"] .hero-title { color: var(--df-color-text-strong); text-shadow: none; }
html[data-theme="light"] .hero-desc { color: var(--df-color-text-secondary); text-shadow: none; }
/* 未挂 Hybrid CTA 时浅色入口钮才用白底；.df-btn--hybrid-cta 走紫 pill */
/* 箭头内联复用原站素材，以 currentColor 跟随按钮文字。 */

html[data-theme="light"] .home-page .works-section { background: transparent; border-radius: 0; }
@media (max-width: 850px) { .df-theme-tools--standalone .df-theme-control > span { display: none; } }

/* 精选作品：封面独立四角圆角；元信息贴页面底，浅色不再套整卡描边。 */
html[data-theme="light"] .waterfall-item { background: transparent; outline: none; box-shadow: none; }
html[data-theme="light"] .waterfall-item__info { background: transparent; }
html[data-theme="light"] .waterfall-item .video-cover { box-shadow: 0 1px 2px #1a22300a; }
html[data-theme="light"] .waterfall-item:focus-within .video-cover { outline: 2px solid var(--df-color-focus-ring); outline-offset: 2px; }

/* hover 滑入操作行用表面色，避免透出页面底。 */
html[data-theme="light"] .waterfall-item .copy-asset-btn { background: var(--df-color-surface); border-radius: 8px; }

/* 只收敛浅色首页的前景层级，不改变深色原站样式。 */
html[data-theme="light"] body:has(.home-page) .hero-section { padding-top: 59px; }
/* 字号已在 home.css 与浅色统一；浅色只改颜色 */
html[data-theme="light"] .home-page .hero-desc { color: var(--df-color-home-description); }
/* 项目选择器为全局导航控件，所有页面共用相同浅色表面。 */
html[data-theme="light"] .home-project { background: var(--df-color-surface-sunken); border: 1px solid var(--df-color-border-subtle); border-radius: var(--df-radius-md); color: var(--df-color-text-strong); cursor: pointer; }
html[data-theme="light"] .home-project:is(:hover,[aria-expanded="true"]) { background: var(--df-color-surface-hover); border-color: var(--df-color-border); }
html[data-theme] .home-project__arrow { fill: var(--df-color-text-strong); }
html[data-theme] .history-card .card-stats .stat-item .stat-icon { color: var(--df-color-text-strong); }
html[data-theme="light"] .home-page .type-top-filter__chip { background: transparent; border-color: transparent; }
html[data-theme="light"] .home-page .type-top-filter__chip:not(.is-active):hover { background: var(--df-color-surface-hover); border-color: transparent; color: var(--df-color-text-strong); }
html[data-theme="light"] .home-page .type-top-filter__chip.is-active { background: var(--df-color-surface-active); border-color: transparent; color: var(--df-color-text-strong); }
html[data-theme="light"] .home-page .type-top-filter__chip:focus-visible { outline: 2px solid var(--df-color-focus-ring); outline-offset: 2px; }


@supports (mask-image: linear-gradient(transparent, transparent)) or (-webkit-mask-image: linear-gradient(transparent, transparent)) {
  html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) .home-bg-video { opacity: 1; -webkit-mask-image: var(--df-home-video-visibility-mask); mask-image: var(--df-home-video-visibility-mask); }
}

/* 精选作品仅统一间距，保留原站底部悬停操作。 */
.home-page .type-top-filter { margin: var(--df-space-4) 0; }
.home-page .type-top-filter__scroll { gap: var(--df-space-2); }
.home-page #works { gap: var(--df-space-4); }
.home-page .waterfall-item.is-copyable:focus-within .waterfall-item__info-track { transform: translateY(-72px); }

/* 视频几何与深色一致，仅减弱人物活动区的白色蒙层，不追踪或抠像。 */
@supports (mask-image: linear-gradient(transparent, transparent)) or (-webkit-mask-image: linear-gradient(transparent, transparent)) {
 html[data-theme="light"] .home-bg-wrapper:not([data-home-hero-id="kling-ambient"]):not([data-home-hero-surface="card"]) .home-bg-mask { -webkit-mask-image: var(--df-home-overlay-strength-mask); mask-image: var(--df-home-overlay-strength-mask); }
}

/* 浅色首张氛围与其它卡一样：深色原片 card（见 home-banner / surface=card） */

/* 浅色卡片 Banner：保持深色原片，不吃通用洗色 */
html[data-theme="light"] .home-bg-wrapper[data-home-hero-surface="card"] {
  background: transparent;
  -webkit-mask-image: none;
  mask-image: none;
}
html[data-theme="light"] .home-bg-wrapper[data-home-hero-surface="card"] .home-bg-video-wrap {
  margin-top: 0;
}
html[data-theme="light"] .home-bg-wrapper[data-home-hero-surface="card"] .home-bg-video {
  opacity: 1;
  filter: none;
  transform: none;
  -webkit-mask-image: none;
  mask-image: none;
}
html[data-theme="light"] .home-bg-wrapper[data-home-hero-surface="card"] .home-bg-mask {
  -webkit-mask-image: none;
  mask-image: none;
}

/* 提示词编辑器的聚焦状态由外层发送框表达，避免叠加矩形焦点框。 */
html[data-theme] #workshop-form > .prompt-editor:focus,
html[data-theme] #workshop-form > .prompt-editor:focus-visible { outline: none; box-shadow: none; }
html[data-theme] #workshop-form:focus-within { border-color: var(--df-color-focus-ring); }
html[data-theme] #workshop-form:has(> .prompt-editor:focus-visible) {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: 2px;
}

.credit-ledger { width: min(1100px, calc(100vw - 48px)); max-height: calc(100vh - 48px); padding: 24px; border: 0; border-radius: var(--df-radius-lg); background: var(--df-color-surface); color: var(--df-color-text); }
.credit-ledger::backdrop { background: var(--df-color-mask); }
.credit-ledger button, .credit-ledger input, .credit-ledger select { font: inherit; font-size: 12px; color: inherit; }
.credit-ledger__head { display:flex; justify-content:space-between; border-bottom:1px solid var(--df-color-border-subtle); }
.credit-ledger [role=tablist] { display:flex; gap:40px; }
.credit-ledger [role=tab] { padding:0 0 8px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--df-color-text-secondary); font-size:14px; cursor:pointer; }
.credit-ledger [aria-selected=true] { border-bottom-color:var(--df-color-text-strong); color:var(--df-color-text-strong); font-weight:600; }
.credit-ledger__close { border:0; background:transparent; cursor:pointer; }
.credit-ledger .df-icon { width:16px; height:16px; }
.credit-ledger__tools { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:24px 0 16px; }
.credit-ledger__tools input, .credit-ledger select, .credit-ledger__tools button, .credit-ledger footer button, .credit-ledger__records button { height:32px; padding:0 10px; border:1px solid var(--df-color-border); border-radius:var(--df-radius-md); background:var(--df-color-surface-raised); }
.credit-ledger__tools input[type=search] { width:160px; }
.credit-ledger :is(input, select) { border-color: var(--df-color-control-edge); }
.credit-ledger__exports { display:flex; gap:12px; margin-left:auto; }
.credit-ledger button:disabled { color:var(--df-color-text-faint); cursor:not-allowed; }
.credit-ledger__table { overflow:auto; }
.credit-ledger table { width:100%; min-width:850px; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.credit-ledger th { background:var(--df-color-bg); text-align:left; }
.credit-ledger td { background:var(--df-color-surface-sunken); }
.credit-ledger th,.credit-ledger td { padding:12px 20px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.credit-ledger th:last-child,.credit-ledger td:last-child { text-align:right; }
.credit-ledger .credit-ledger__empty { text-align:center; height:60px; color:var(--df-color-text-faint); }
.credit-ledger__negative { color:var(--df-color-danger); font-weight:600; }
html[data-theme="light"] .credit-ledger__negative { color: var(--df-color-danger-text, #bd252e); }
.credit-ledger footer { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:12px; font-size:12px; }
.credit-ledger footer [aria-current] { color:var(--df-color-text-link); border-color:var(--df-color-control-edge); }
.credit-ledger__records { padding:16px 0; }

/* 空态跨列仍是末单元格，需覆盖积分列的右对齐规则。 */
.credit-ledger td.credit-ledger__empty:last-child { text-align: center; }
.credit-ledger__empty-content { display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.credit-ledger__empty-content img { width: 24px; height: 24px; object-fit: contain; }

.df-form-popover { position:fixed; z-index:1000; box-sizing:border-box; max-width:calc(100vw - 16px); max-height:min(360px, calc(100vh - 16px)); overflow:auto; padding:4px; border:1px solid var(--df-color-border-subtle); border-radius:var(--df-radius-md); background:var(--df-color-surface); color:var(--df-color-text); box-shadow:var(--df-shadow-popover); font:12px var(--df-font-family); }
.df-form-popover button { border:0; border-radius:var(--df-radius-md); background:transparent; color:inherit; font:inherit; cursor:pointer; }
.df-form-options button { display:block; width:100%; padding:8px 12px; text-align:left; }
.df-form-popover button:hover { background:var(--df-color-surface-hover); }
html[data-theme] .df-form-popover button:focus-visible {
  background: var(--df-color-surface-hover);
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: -2px;
}
.df-form-popover [aria-selected="true"],.df-form-popover [aria-pressed="true"] { background:var(--df-color-surface-active); color:var(--df-color-text-strong); }
.df-form-popover button:disabled,.df-form-popover .is-muted { color:var(--df-color-text-faint); }
.df-calendar { width:280px; padding:12px; }
html[data-theme] .credit-ledger input[type="date"]:focus-visible {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: 2px;
}
.df-calendar-head { display:flex; align-items:center; justify-content:space-between; padding:4px 0; }
.df-calendar-head button { padding:6px 10px; }
.df-calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; }
.df-calendar-grid span,.df-calendar-grid button { display:grid; place-items:center; height:32px; }
html[data-theme="dark"] .df-form-popover :is([aria-selected="true"],[aria-pressed="true"]) { color: var(--df-color-text-strong); }

/* 浅色会员浮层：余额是信息重点，操作沿用品牌色。 */
html[data-theme="light"] .membership-entry-popover { border-color: var(--df-color-border-subtle); background: var(--df-color-surface); color: var(--df-color-text); }
html[data-theme="light"] .membership-entry-popover .membership-entry__balance-detail { color: var(--df-color-primary); }
html[data-theme="light"] .membership-entry-popover .membership-entry__balance-detail:hover { color: var(--df-color-primary-active); }
html[data-theme="light"] .membership-entry-popover .membership-entry__btn-open { background: var(--df-color-primary); color: var(--df-color-primary-text); }
html[data-theme="light"] .membership-entry-popover .membership-entry__btn-open:hover { background: var(--df-color-primary-active); }
html[data-theme="light"] body:not([data-df-sidebar]):is(.console-shell,:has(.home-page)) .home-side-bottom > a:first-child:is(:hover,.is-active) { background: var(--df-color-primary-soft); }

/* 深色入口背景高亮不能覆盖文字渐变后仍保持透明填充。 */
html[data-theme="dark"] body:not([data-df-sidebar]):is(.console-shell,:has(.home-page)) .home-side-bottom > a:first-child:is(:hover,.is-active) { background: var(--df-color-entry-hover); background-clip: border-box; -webkit-background-clip: border-box; color: var(--df-color-accent); -webkit-text-fill-color: currentColor; }

/* 积分数字沿用深色500字重，入口文字400，主题不额外加粗。 */
html[data-theme="light"] :is(body.console-shell,body:has(.home-page)) .home-side-bottom > a:first-child span { font-weight: 500; }

html[data-theme="light"] :is(.drama-page-wrapper,.canvas-list) > .header { background: var(--df-color-intro-banner-bg); box-shadow: var(--df-shadow-intro-banner); }
html[data-theme="light"] :is(.drama-page-wrapper,.canvas-list) > .header .header-bg { background: none; }
html[data-theme="light"] .canvas-list > .header .header-left .description { color: var(--df-color-text-secondary); }

/* 音色生成属于工具主操作，两种主题均采用实色主按钮。 */
html[data-theme="light"] .voice-generate-form .voice-submit { background: var(--df-color-primary); color: var(--df-color-primary-text); }
html[data-theme="light"] .voice-generate-form .voice-submit:not(:disabled):hover { background: var(--df-color-primary-active); cursor: pointer; }
html[data-theme="light"] .voice-generate-form .voice-submit:disabled { background: var(--df-color-primary-soft); color: var(--df-color-text-faint); cursor: not-allowed; }

/* 浅色工坊辅助控件减轻表面重量。 */
html[data-theme="light"] .workshop-chat-tools { background: var(--df-color-surface); border-color: var(--df-color-border-subtle); }
html[data-theme="light"] .workshop-chat-tools button:hover { background: var(--df-color-surface-hover); }
html[data-theme="light"] .workshop-page .arrow-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--df-color-border-subtle); border-radius: 50%; background: var(--df-color-surface); color: var(--df-color-text-secondary); box-shadow: var(--df-shadow-tab-active); }
.workshop-page .arrow-btn .df-icon { width: 16px; height: 16px; fill: currentColor; }
.workshop-page .prev .arrow-btn .df-icon { transform: rotate(90deg); }
.workshop-page .next .arrow-btn .df-icon { transform: rotate(-90deg); }
html[data-theme="light"] .workshop-page .arrow-btn:hover { background: var(--df-color-surface-hover); color: var(--df-color-text-strong); }
.team-management__notice::before { display: none; }
.team-management__notice .team-notice-icon { width: 14px; height: 14px; flex: none; margin-right: 8px; fill: currentColor; color: var(--df-color-warning-text); }

/* 浅色历史区是独立侧面板，保持原有几何尺寸。 */
html[data-theme="light"] .workshop-page .workshop-history { border-right-color: var(--df-color-border-subtle); box-shadow: none; border-radius: 0; }
html[data-theme="light"] .workshop-history .history-filters,
html[data-theme="light"] .workshop-history .history-search-box { background: transparent; border-color: var(--df-color-border); }
html[data-theme="light"] .workshop-history .history-new { background: transparent; border-color: var(--df-color-border); color: var(--df-color-text); }
html[data-theme="light"] .workshop-history .history-new:hover { background: var(--df-color-surface-hover); }
html[data-theme="light"] .workshop-history .history-card { background: transparent; }
html[data-theme="light"] .workshop-history .history-card:hover { background: var(--df-color-surface-sunken); }
/* 历史卡选中用中性灰，不用 primary-soft 浅紫 */
html[data-theme="light"] .workshop-history .history-card:is(.is-active,.active,.is-selected) { background: var(--df-color-surface-active); }

/* 未启用可折叠主侧栏时，沿用原有 80px 浅色侧栏宽度。 */
html[data-theme="light"] body:not([data-df-sidebar]) .workshop-page { margin-left: 80px; }
/* 历史面板左右内边距对称；顶距 24 与标题/新对话齐边，避免浅色 48 顶空把菜单顶歪。 */
html[data-theme="light"] .workshop-page .main-wrap .workshop-history.show-settings {
  margin-top: 0;
  margin-left: 0;
  width: 280px;
  padding: 24px 20px 16px;
}

/* 受限提示保持淡黄底，图文使用可读的琥珀金色。 */
html[data-theme="light"] .team-management__notice,
html[data-theme="light"] .team-management__notice .team-notice-icon,
html[data-theme="light"] .team-management__notice a { color: var(--df-color-team-notice-text); }
html[data-theme="light"] .team-management__notice a { text-decoration: underline; text-underline-offset: 2px; }

html[data-theme="light"] .team-management__notice .team-notice-icon { color: var(--df-color-team-notice-icon); }

/* 浅色角色说明采用浮层表面，而非输入控件灰底。 */
html[data-theme="light"] .team-role-tip { background: var(--df-color-surface); border-color: var(--df-color-border-subtle); color: var(--df-color-text-secondary); box-shadow: var(--df-shadow-membership-popover); }
html[data-theme="light"] .team-role-tip > button { background: transparent; border-color: var(--df-color-border); color: var(--df-color-text-secondary); }
html[data-theme="light"] .team-role-tip > button:hover { background: var(--df-color-surface-hover); color: var(--df-color-text-strong); }

/* 成员表格以白底行与细分割线组织信息，灰色保留给表头和可编辑控件。 */
html[data-theme="light"] .team-members-table tbody td { background: var(--df-color-surface); border-bottom-color: var(--df-color-table-divider); }
html[data-theme="light"] .team-members-table tbody tr:hover td { background: var(--df-color-surface-sunken); }


/* 用户管理 / 审计日志共用白色工作区；项目管理仍用左右面板卡。 */
html[data-theme="light"] .team-management :is(#users, #audit) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 420px;
  padding: 20px 20px 24px;
  border: 0;
  border-radius: var(--df-radius-lg);
  background: var(--df-color-surface);
}
html[data-theme="light"] .team-management :is(#users, #audit) tbody td { background: var(--df-color-surface); }
html[data-theme="light"] .team-management :is(#users, #audit) tbody tr:hover td { background: var(--df-color-surface-sunken); }
html[data-theme="light"] .audit-log__table th {
  color: var(--df-color-text-secondary);
  border-bottom-color: var(--df-color-table-divider);
}
html[data-theme="light"] .audit-log__table td {
  color: var(--df-color-text);
  border-bottom-color: var(--df-color-table-divider);
}
html[data-theme="light"] .audit-log__table td.audit-log__empty,
html[data-theme="light"] .audit-log__user-id { color: var(--df-color-text-faint); }
html[data-theme="light"] .audit-log__table td.audit-log__empty { height: 60px; }
html[data-theme="light"] .audit-log__date-range,
html[data-theme="light"] .audit-log__refresh,
html[data-theme="light"] .audit-log__operation-type {
  background: transparent;
  border-color: var(--df-color-border);
}

.df-management-surface { display: contents; }
html[data-theme="light"] .df-management-surface { display:block; box-sizing:border-box; min-width:0; padding:20px 20px 24px; border:0; border-radius:var(--df-radius-lg); background:var(--df-color-surface); }
html[data-theme="light"] .resource-list .df-management-surface > .card-list__empty { position:static; height:clamp(260px, 45vh, 480px); min-height:0; padding:0; }
html[data-theme="light"] .resource-list.is-person .df-management-surface > .card-list__empty { height:260px; }
html[data-theme="light"] .task-center .df-management-surface .task-table { border:0; border-radius:0; }
html[data-theme="light"] .task-center .df-management-surface .task-table tbody td { background:var(--df-color-surface); }
html[data-theme="light"] .task-center .df-management-surface .task-table tbody tr:hover td { background:var(--df-color-surface-sunken); }
html[data-theme="light"] .task-center .df-management-surface .table-pagination { margin-bottom:0; }

/* 浅色次级控件统一透明线框（无灰底），特异性需压过 .task-list .toolbar > label > input 等暗色填充规则。 */
html[data-theme="light"] body :is(.toolbar,.team-members-toolbar,.credit-ledger__tools,.table-pagination) :is(input[type="search"],input[type="date"],select),
html[data-theme="light"] body .task-list .toolbar :is(input:not([type="checkbox"]):not([type="radio"]),select),
html[data-theme="light"] body .task-list :is(.resource-search,.task-search) input,
html[data-theme="light"] body .story-detail .toolbar :is(input:not([type="checkbox"]):not([type="radio"]),select),
html[data-theme="light"] body :is(.task-type,.asset-date-range,.audit-log__date-range,.voice-result-search,.camera-search input),
html[data-theme="light"] body :is(.team-role-select,.df-input,.df-select,.df-textarea),
html[data-theme="light"] body .voice-generate-form :is(select,textarea),
html[data-theme="light"] body #copyright-dialog .search-input input { background: transparent; }
html[data-theme="light"] body :is(.df-input,.df-select,.df-textarea):where(:not(:focus,:disabled,[aria-disabled="true"])) { border-color: var(--df-color-border-field); }
html[data-theme="light"] body :is(.df-input,.df-select,.df-textarea):hover:where(:not(:focus,:disabled,[aria-disabled="true"],[readonly],[aria-invalid="true"],:user-invalid)) {
  border-color: var(--df-color-border-field-hover);
}
html[data-theme="light"] body :is(.df-input,.df-select,.df-textarea):disabled:where(:not([readonly],[aria-invalid="true"])) {
  color: var(--df-color-field-disabled-text);
  background-color: var(--df-color-surface-sunken);
  border-color: var(--df-color-border-field);
  cursor: not-allowed;
}
html[data-theme="light"] body :is(.task-type,.asset-date-range,.audit-log__date-range,.voice-result-search) :is(input,select) { background: transparent; border: 0; outline: none; box-shadow: none; }
html[data-theme="light"] .team-management #users input[type="search"],
html[data-theme="light"] .team-members-table .team-role-select { background: transparent; }
html[data-theme="light"] body :is(.resource-actions button,.team-members-toolbar .refresh,.search-group .refresh_btn,.credit-ledger__exports button) { background: transparent; border-color: var(--df-color-border); }
html[data-theme="light"] body .credit-ledger :is(input,select) { background: transparent; }
html[data-theme="light"] body .team-management #users .toolbar > button:disabled,
html[data-theme="light"] body .credit-ledger footer button:not([aria-current]),
html[data-theme="light"] body .membership-month-trigger,
html[data-theme="light"] body .workshop-history .history-search-box,
html[data-theme="light"] body .history-filters { background: transparent; border-color: var(--df-color-border); }
html[data-theme="light"] body .task-center .toolbar > .task-type,
html[data-theme="light"] body .task-center .toolbar .task-search input,
html[data-theme="light"] body .task-center .toolbar input:not([type="checkbox"]):not([type="radio"]) { background: transparent; }
html[data-theme] body :is(.task-center, .resource-list) .toolbar input[type="search"]:focus-visible {
  border-color: var(--df-color-focus-ring);
}
html[data-theme] body .workshop-history .history-search-box {
  border-color: var(--df-color-control-edge);
}
html[data-theme] body .workshop-history .history-search-box:has(#history-search:focus-visible) {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: 2px;
}
html[data-theme] body #history-search:focus-visible {
  outline: none;
}
html[data-theme] body #style-search:focus-visible {
  border-color: var(--df-color-control-edge);
}
html[data-theme] body .history-filter__menu button:focus-visible {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: -2px;
}
html[data-theme] body .history-filter__trigger:focus-visible {
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: 2px;
}

/* 媒体分段筛选同样采用无填充线框，选中仅强调文字与内描边。 */
html[data-theme="light"] .resource-list .asset-kinds button { background: transparent; color: var(--df-color-text-secondary); border-color: var(--df-color-border); }
html[data-theme="light"] .resource-list .asset-kinds button[aria-pressed="true"] { background: var(--df-color-surface-active); color: var(--df-color-text-strong); border-color: var(--df-color-border-subtle); }
html[data-theme="light"] .resource-list .toolbar__radio-group { background: transparent; box-shadow: inset 0 0 0 1px var(--df-color-border); }
html[data-theme="light"] .resource-list .toolbar__radio-group label { background: transparent; color: var(--df-color-text-secondary); }
html[data-theme="light"] .resource-list .toolbar__radio-group label + label { border-left: 1px solid var(--df-color-border); }
html[data-theme="light"] .resource-list .toolbar__radio-group label:has(:checked) { background: var(--df-color-surface-active); color: var(--df-color-text-strong); }

html[data-theme="light"] .entry-card .entry-card-bg { background: var(--df-color-home-light-entry-bg); border: 1px solid var(--df-color-home-light-entry-border); box-shadow: var(--df-shadow-home-light-entry); backdrop-filter: blur(2px); opacity: 1; }

html[data-theme="light"] .entry-card:hover .entry-card-bg { background: var(--df-color-home-light-entry-hover); border-color: var(--df-color-hover-border); }

html[data-theme="light"] .entry-card__btn:not(.df-btn--hybrid-cta) { background: var(--df-color-surface); }

html[data-theme="light"] .home-page .entry-card__desc { font-size: var(--df-font-size-sm); line-height: 20px; color: var(--df-color-home-card-description); }

html[data-theme="light"] .home-page .entry-card__info { min-width: 0; }

html[data-theme="light"] .home-page .entry-card__desc { white-space: normal; text-wrap: balance; }

@media (min-width: 1700px) { html[data-theme="light"] .home-page .entry-card__info { padding-right: 128px; } }
@media (min-width: 1250px) and (max-width: 1550px) { html[data-theme="light"] .home-page .entry-card__desc { font-size: var(--df-font-size-xs); line-height: 16px; } }

html[data-theme] .df-select:not(:focus-visible), .ws-params__stepper:not(:focus-within):not(:hover),
#recharge-agreement:not(:checked) {
  border-color: var(--df-color-control-edge);
}

/* Keep the visible field edge distinct on nested workspaces and dialogs. */
html[data-theme] body :is(.team-role-select, .df-input, .df-select, .df-textarea,
  .task-type, .asset-date-range, .audit-log__date-range, .voice-result-search):not(:focus-within),
html[data-theme] :is(#node-detail-name, #node-detail-prompt, #canvas-asset-search,
  #style-search, #drama-style-search, #voice-library-search, #custom-points):not(:focus-visible) {
  border-color: var(--df-color-control-edge);
}

html[data-theme] body :is(.toolbar, .team-members-toolbar, .table-pagination, .voice-generate-form)
  :is(input[type="search"], input[type="text"], select, textarea):not(:focus-visible, :disabled, [aria-invalid="true"]),
html[data-theme] body :is(.task-search, .resource-search) input:not(:focus-visible, :disabled),
html[data-theme] body .story-detail .toolbar > label:not(.mine):has(select):not(:focus-within),
html[data-theme] body #create-dialog :is(input[type="text"], select, textarea):not(:focus-visible, :disabled, [aria-invalid="true"]) {
  border-color: var(--df-color-control-edge);
}

html[data-theme] .editor-header input {
  border-bottom: 1px solid var(--df-color-control-edge);
}
html[data-theme] body .task-list :is(.task-search, .resource-search) input:not(:focus-visible, :disabled),
html[data-theme] body :is(#voice-library-search, #custom-points):not(:focus-visible, :disabled) {
  border-color: var(--df-color-control-edge);
}

html[data-theme] body .tab-builtin-voice-library__search:not(:focus-within),
html[data-theme] body .recharge-custom input:not(:focus-visible, :disabled) {
  border-color: var(--df-color-control-edge);
}

html[data-theme="light"] body .task-list .toolbar :is(.task-search, .resource-search) input:not(:focus-visible, :disabled),
html[data-theme="light"] body .story-detail .toolbar > input[type="search"]:not(:focus-visible, :disabled),
html[data-theme] body :is(.film-toolbar select, #shot-episode, .episode-row__name):not(:focus-visible, :disabled),
html[data-theme] body #create-dialog .drama-style-toolbar #drama-style-search:not(:focus-visible, :disabled) {
  border-color: var(--df-color-control-edge);
}

html[data-theme] body .canvas-asset-search:not(:focus-within),
html[data-theme] body #create-dialog .form-row input:not([type="radio"], [type="file"], [type="checkbox"]):not(:focus-visible, :disabled, [aria-invalid="true"]) {
  border-color: var(--df-color-control-edge);
}

@media (forced-colors: none) {
  html[data-theme] :is(.card-list__check input[type="checkbox"], #drama-style-favorites, #subscribe-renew, .team-selection input[type="checkbox"], .story-detail .mine input[type="checkbox"]) {
    appearance: none;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    border: 1px solid var(--df-color-control-edge);
    border-radius: var(--df-radius-xs);
    background: var(--df-color-surface);
  }
  html[data-theme] .card-list__check input[type="checkbox"] {
    border-color: var(--df-color-on-media);
    background: var(--df-palette-neutral-950);
  }
  html[data-theme] :is(.card-list__check input[type="checkbox"], #drama-style-favorites, #subscribe-renew, .team-selection input[type="checkbox"], .story-detail .mine input[type="checkbox"]):checked {
    background: var(--df-color-primary-fill);
    border-color: var(--df-color-on-media);
  }
  html[data-theme] :is(.card-list__check input[type="checkbox"], #drama-style-favorites, #subscribe-renew, .team-selection input[type="checkbox"], .story-detail .mine input[type="checkbox"]):checked::after {
    content: "";
    display: block;
    width: 4px;
    height: 7px;
    margin: 0 auto;
    border: solid var(--df-color-primary-text);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  html[data-theme] #user-select-all:indeterminate {
    background: var(--df-color-primary-fill);
    border-color: var(--df-color-on-media);
  }
  html[data-theme="light"] :is(#user-select-all, .team-selection input[type="checkbox"], .story-detail .mine input[type="checkbox"]):is(:checked, :indeterminate) {
    border-color: var(--df-color-control-edge);
  }
  html[data-theme] #user-select-all:indeterminate::after {
    content: "";
    display: block;
    width: 8px;
    height: 2px;
    margin: 6px auto 0;
    background: var(--df-color-primary-text);
  }
  html[data-theme] :is(.card-list__check input[type="checkbox"], #drama-style-favorites, #subscribe-renew, .team-selection input[type="checkbox"], .story-detail .mine input[type="checkbox"]):focus-visible {
    outline: 2px solid var(--df-color-focus-ring);
    outline-offset: 2px;
  }
  html[data-theme] .task-list .card-list__check input[type="checkbox"]:focus-visible {
    outline-color: var(--df-color-on-media);
    box-shadow: 0 0 0 6px var(--df-palette-neutral-950);
  }
}

html[data-theme] .task-list .card-list__check {
  background: var(--df-palette-neutral-950);
}
html[data-theme="light"] #create-dialog input[type="radio"] {
  accent-color: var(--df-color-primary-active);
}

html[data-theme] body #custom-style-name {
  border-color: var(--df-color-control-edge);
}
html[data-theme] body #custom-style-name:focus-visible {
  border-color: var(--df-color-focus-ring);
}
#custom-style-cover::file-selector-button {
  border: 1px solid var(--df-color-control-edge);
  border-radius: var(--df-radius-sm);
  background: var(--df-color-surface-raised);
  color: var(--df-color-text-strong);
}

html[data-theme] body .camera-search #camera-search:not(:focus-visible),
html[data-theme] body #camera-create-name:not(:focus-visible) {
  border-color: var(--df-color-control-edge);
}
html[data-theme="dark"] #result-preview #preview-delete {
  color: var(--df-color-danger-hover);
}

html[data-theme] body #camera-create-name { border-color: var(--df-color-control-edge); }
html[data-theme] body #camera-create-name:focus-visible { border-color: var(--df-color-focus-ring); }
html[data-theme] body #create-dialog + #custom-style-dialog .form-row :is(input:not([type="file"]), textarea) {
  border-color: var(--df-color-control-edge);
}
html[data-theme] body #create-dialog + #custom-style-dialog button[type="submit"] {
  background: var(--df-color-primary-fill);
  color: var(--df-color-primary-text);
}
html[data-theme="dark"] .person-asset-actions .df-btn--outline-danger { color: var(--df-color-danger-hover); }

.person-asset-actions .df-btn:focus-visible { outline: 2px solid var(--df-color-focus-ring); outline-offset: 2px; }
html[data-theme="light"] .person-asset-actions .df-btn--outline-danger { color: var(--df-color-danger-text, #bd252e); }
