/* 简约版共用布局层：历史变量名保留以兼容现有页面组件。 */
:root {
  --accent-purple: #6f6385;
  --accent-purple-rgb: 111, 99, 133;
  --accent-purple-soft: #e9e5ed;
  --accent-purple-ink: #51485f;
  --accent-purple-luminous: #c7bdd6;
  --accent-purple-strong: #7257e8;
  --accent-purple-strong-rgb: 114, 87, 232;
  --accent-purple-strong-soft: #eeeaff;
  --accent-purple-strong-ink: #4c35b5;
  --accent-purple-strong-luminous: #b8a7ff;
  --accent-purple-control: linear-gradient(145deg, rgba(133, 106, 244, .96), rgba(91, 65, 207, .98));
  --glass-card: rgba(255, 255, 255, .58);
  --glass-card-strong: rgba(255, 255, 255, .7);
  --glass-card-soft: rgba(250, 249, 252, .48);
  --glass-frost-surface: linear-gradient(145deg, rgba(255, 255, 255, .62), rgba(239, 236, 244, .46));
  --glass-dark-surface: radial-gradient(circle at 92% -12%, rgba(184, 167, 255, .22), transparent 42%), linear-gradient(145deg, rgba(53, 43, 80, .94), rgba(26, 23, 41, .9));
  --glass-frost-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 20px 48px rgba(50, 43, 62, .1), 0 4px 12px rgba(50, 43, 62, .035);
  --glass-dark: rgba(35, 30, 43, .92);
  --glass-border-purple: transparent;
  --glass-line-purple: rgba(81, 72, 95, .08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .38);
  --glass-shadow-purple: 0 20px 50px rgba(50, 43, 62, .1), 0 4px 12px rgba(50, 43, 62, .035);
  --glass-shadow-soft-purple: 0 14px 34px rgba(50, 43, 62, .075), 0 3px 9px rgba(50, 43, 62, .025);
  --creator-fixed-shell-width: 402px;
  --creator-fixed-shell-center: 201px;
  --creator-fixed-tabbar-width: 334px;
  --creator-fixed-dialog-width: 374px;
}

body.theme-liquid {
  --ink: #211d2d;
  --muted: #696477;
  --faint: #9892a5;
  --line: var(--glass-line-purple);
  --soft: rgba(244, 242, 250, .7);
  --paper: rgba(255, 255, 255, .82);
  --canvas: #fbfaff;
  --accent-yellow: var(--accent-purple);
  --accent-yellow-rgb: var(--accent-purple-rgb);
  --accent-yellow-soft: var(--accent-purple-soft);
  --amber: var(--accent-purple);
  --accent-orange: var(--accent-purple);
  --accent-orange-cream: var(--accent-purple-luminous);
  --accent-orange-soft: var(--accent-purple-soft);
  --accent-orange-deep: var(--accent-purple-ink);
  --shadow: var(--glass-shadow-purple);
  position: relative;
  min-width: var(--creator-fixed-shell-width);
  min-height: 100dvh;
  overflow-x: visible;
  background: #fff;
}

html {
  min-width: var(--creator-fixed-shell-width);
  overflow-x: auto;
  background: #ededed;
}

.theme-liquid .app-shell {
  z-index: 1;
  isolation: isolate;
  background: rgba(252, 251, 255, .46);
  box-shadow: 0 30px 90px rgba(42, 31, 78, .14), inset 0 1px 0 rgba(255, 255, 255, .88);
}

.theme-liquid .app-shell::before,
.theme-liquid .app-shell::after {
  display: none;
}

.theme-liquid .app-view {
  position: relative;
  z-index: 1;
}

.theme-liquid .app-header {
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.theme-liquid .app-header:not(.ai-chat-header) {
  display: none;
}

.theme-liquid .app-header.ai-chat-header h1 {
  display: none;
}

.theme-liquid .app-header.ai-chat-header {
  min-height: 54px;
  grid-template-columns: 1fr;
  padding: 8px 16px;
}

/* 浅玻璃卡片：高可读内容面。 */
.theme-liquid :is(
  .card,
  .calendar,
  .week-day,
  .daily-list,
  .more-row,
  .pipeline-summary,
  .milestone-card,
  .requirements-card,
  .receivable,
  .topic-idea-chat,
  .inspiration-card,
  .service-state,
  .script-library-card,
  .script-body-card,
  .brief-card,
  .account-feature-card,
  .assistant-intro,
  .form-section,
  .workspace-sheet,
  .schedule-add-menu,
  .empty-state,
  .analysis-box,
  .payment-row,
  .menu-card,
  .income-summary,
  .account-hero,
  .topic-search-panel,
  .topic-chat-message.assistant
) {
  border: 0;
  background: var(--glass-frost-surface);
  box-shadow: var(--glass-frost-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.06);
  backdrop-filter: blur(24px) saturate(1.06);
}

.theme-liquid :is(
  .calendar,
  .daily-list,
  .pipeline-summary,
  .milestone-card,
  .requirements-card,
  .receivable,
  .topic-idea-chat,
  .script-body-card,
  .brief-card,
  .income-summary
) {
  box-shadow: var(--glass-highlight), var(--glass-shadow-purple);
}

/* 深色烟熏玻璃：保留原英雄卡的白字对比。 */
.theme-liquid :is(
  .shoot-card,
  .project-banner,
  .topic-capture,
  .topics-page .topic-card,
  .project-list .project-card,
  .project-hero,
  .income-spotlight,
  .ledger-hero,
  .voice-orb,
  .new-script-hero,
  .script-title-card,
  .message.user .bubble,
  .timeline-row.current > div
) {
  border: 0;
  background: var(--glass-dark-surface);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 18px 40px rgba(39,28,75,.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}

.theme-liquid .stitch-schedule .spotlight-stack > .shoot-card,
.theme-liquid .stitch-schedule .spotlight-stack > .shoot-card:not(.featured),
.theme-liquid .stitch-schedule .spotlight-stack.stacked > .shoot-card:nth-child(n) {
  border: 0;
  background: var(--glass-dark-surface);
  color: #fff;
}

.theme-liquid .spotlight-stack.stacked > .shoot-card:nth-child(n+2) {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 -1px 0 rgba(255,255,255,.18), 0 15px 28px rgba(39,28,75,.16);
}

/* 共用胶囊与输入控件布局。 */
.theme-liquid :is(
  .button.secondary,
  .icon-button,
  .chip,
  .chip-button,
  .segment,
  .segment button,
  .stack-toggle,
  .project-filters button,
  .script-category-row button,
  .prompt-chips button,
  .title-ai-tools button,
  .conversation-delete,
  .project-add-inline,
  .script-editor-nav > .script-back-button,
  .detail-sticky-actions,
  .detail-sticky-actions button,
  .type-options,
  .type-option span,
  .topic-search-toggle,
  .topic-search-panel button,
  .round-add,
  .ledger-period button,
  .ledger-actions button,
  .brief-actions button,
  .inspiration-actions button,
  .inspiration-actions a,
  .inspiration-result-head button
) {
  border: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, .7), rgba(239, 235, 250, .46));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 14px 34px rgba(50,43,62,.075);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  backdrop-filter: blur(16px) saturate(1.06);
}

.theme-liquid :is(
  .search-input,
  .project-search,
  .topic-quick-add,
  .topic-search-panel input,
  .inspiration-search input,
  .field input,
  .field textarea,
  .field select,
  .money-input,
  .brief-text,
  .chat-compose,
  .assistant-compose,
  .script-block
) {
  border: 0 !important;
  background: rgba(255, 255, 255, .64) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 22px rgba(50, 43, 62, .06) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
  backdrop-filter: blur(14px) saturate(1.16);
}

.theme-liquid :is(
  .search-input,
  .project-search,
  .topic-search-panel input,
  .inspiration-search input,
  .field input,
  .field textarea,
  .field select,
  .money-input,
  .brief-text,
  .script-title,
  .script-block
):focus {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 0 0 3px var(--minimal-soft), inset 0 1px 0 rgba(255,255,255,.92) !important;
  outline: none;
}

.theme-liquid :is(button, a, input, textarea, select, [contenteditable="true"]):focus-visible {
  outline: 2px solid var(--accent-purple-ink);
  outline-offset: 2px;
}

/* 主操作与选中态用统一紫色，不覆盖成功与危险语义。 */
.theme-liquid :is(
  .button.primary,
  .header-add-button,
  .inspiration-search button,
  .send-message-button,
  .assistant-compose button,
  .voice-input-button,
  .floating-project-add,
  .milestone-add
) {
  border: 0;
  background: var(--accent-purple-control);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 24px rgba(91,65,207,.24);
}

.theme-liquid :is(
  .segment button.active,
  .chip-button.active,
  .project-filters button.active,
  .script-category-row button.active,
  .type-option input:checked + span,
  .calendar-day.selected,
  .week-day.selected,
  .task-check.done,
  .timeline-row.done > i,
  .timeline-row.current > i,
  .form-section-index
) {
  border: 0 !important;
  background: var(--accent-purple-control) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 8px 20px rgba(91,65,207,.22) !important;
}

.theme-liquid .tab-bar {
  border: 0;
  background: var(--glass-frost-surface);
  box-shadow: var(--glass-frost-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.06);
  backdrop-filter: blur(24px) saturate(1.06);
}

.theme-liquid .tab-bar::before {
  background: linear-gradient(145deg, rgba(131,104,242,.88), rgba(99,72,215,.94)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 10px 24px rgba(91,65,207,.22);
}

.theme-liquid .tab.active {
  color: #fff;
  text-shadow: 0 1px 2px rgba(52, 37, 100, .28);
}

.theme-liquid .calendar-head {
  background: linear-gradient(145deg, rgba(63, 49, 91, .94), rgba(30, 26, 45, .9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 6px 16px rgba(46,32,83,.14);
}

/* 2026-09-25：月历「今天」的黄色内描边已按用户要求整条删除（「全去掉」）。
   原规则：`.theme-liquid .calendar-day.today:not(.selected) { box-shadow: inset 0 0 0 1px var(--accent-purple) }`
   —— `--accent-purple` 在简约版下映射到品牌黄，实测渲染为 rgb(244,185,95) 的 1px 内描边。
   现在月历的「今天」与周历一致：**非选中时不带任何标记**。
   ⚠️ 同一天把 `.calendar-day.today:not(.selected)` 的**全部七条规则**一起删净了（小点、24×24 灰圆环、
   内墨描边、两条 `box-shadow:none` 中和、蓝/橙色数字色），所以这里**不需要**再留任何"复位"规则来
   压住旧的描边——留了反而会变成新的死规则。月历的「今天」现在是完全普通的日期。
   ⚠️ 将来若要给它加标记，请**新增一条明确规则**；不要指望"复活"已删的旧规则。 */

.theme-liquid :is(.calendar-dot, .week-event-dot) {
  background: var(--accent-purple) !important;
}

.theme-liquid :is(
  .shoot-progress > span i,
  .progress-track i,
  .month-bar i,
  .creator-progress > i,
  .project-list .project-card .shoot-progress > span i
) {
  background: var(--accent-purple-strong) !important;
}

.theme-liquid :is(
  .card-countdown,
  .shoot-progress > b,
  .topics-page .topic-card-foot em,
  .ledger-amount,
  .month-value,
  .inspiration-rank b,
  .script-title-card > label,
  .script-title-card .title-ai-tools > span,
  .creator-accent-text
) {
  color: var(--accent-purple-luminous) !important;
}

.theme-liquid :is(.ledger-row .ledger-amount, .month-row .month-value, .inspiration-rank b) {
  color: var(--accent-purple-ink) !important;
}

body.theme-liquid .shoot-card .shoot-tags .shoot-tag-order {
  border-color: rgba(255,255,255,.38) !important;
  background: var(--accent-purple-luminous) !important;
  color: #342e3b !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.48) !important;
}

.theme-liquid :is(
  .shoot-tag-order,
  .chip.amber,
  .topic-card-top span,
  .script-kind,
  .inspiration-rank span,
  .inline-ai-suggestion,
  .service-state
) {
  border-color: var(--minimal-line) !important;
  background: var(--minimal-soft) !important;
  color: var(--accent-purple-ink) !important;
}

.theme-liquid .topics-page .topic-card-top span {
  color: var(--minimal-ink) !important;
  background: var(--minimal-accent) !important;
}

.theme-liquid .topics-page .topic-card-foot em,
.theme-liquid .project-list .project-card .shoot-progress > b,
.theme-liquid .stitch-schedule .shoot-progress > b {
  color: var(--accent-purple-luminous) !important;
}

.theme-liquid .topics-page .topic-card-foot b {
  color: #fff;
}

.theme-liquid .income-number,
.theme-liquid .ledger-overview .income-number,
.theme-liquid .ledger-hero .ledger-total-value {
  color: var(--accent-purple-luminous);
}

.theme-liquid .topic-quick-add {
  padding: 6px;
  border-radius: 999px;
}

.theme-liquid .topic-quick-add button {
  border: 0;
  background: rgba(255,255,255,.64);
  color: var(--accent-purple-ink);
  box-shadow: var(--glass-highlight), 0 6px 16px rgba(50,43,62,.07);
}

.theme-liquid .script-editor-nav > .script-back-button {
  background:
    linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,255,255,.48)),
    rgba(255,255,255,.68);
}

.theme-liquid .script-title-card .script-title {
  border: 0 !important;
  background: rgba(255,255,255,.1) !important;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1) !important;
}

.theme-liquid .script-title-card .script-title:focus {
  border-color: var(--accent-purple) !important;
  box-shadow: 0 0 0 3px var(--minimal-soft) !important;
}

.theme-liquid .script-title-card .title-ai-tools button {
  border: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.theme-liquid .dialog-head,
.theme-liquid .dialog-actions {
  background: rgba(250,248,255,.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
}

.theme-liquid .editor-dialog {
  background: rgba(250,248,255,.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  backdrop-filter: blur(28px) saturate(1.25);
}

.theme-liquid .workspace-sheet-backdrop,
.theme-liquid .editor-dialog::backdrop {
  background: rgba(31, 25, 49, .24);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* iOS Safari 会在聚焦字号小于 16px 的文本控件时自动放大页面。
   只在粗指针设备提高编辑字号，不锁死 viewport，保留用户手动缩放。 */
@media (pointer: coarse) {
  .theme-liquid :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    textarea,
    select,
    [contenteditable="true"]
  ) {
    font-size: 16px !important;
  }

  /* 原本已大于 16px 的标题输入保持原有层级 = 脚本标题，DESIGN.md 写明它是「24px 特例」。
     这里原写 19px：那个数字既和 DESIGN.md 的 24 不一致，实际上也不生效——
     本文件的钳制用了 :where()（特异性 0），所以这条例外本来能赢，
     但 minimal-theme.css 里还有一条特异性 (0,6,3) 的 16px 钳制压过了它。
     目前真正生效的是 minimal-theme.css 的 `#appView input.script-title`（用 ID 才压得过）。
     三个数字现已统一为 24；numbers 改动不改变渲染（实测改动前后都是 24px）。 */
  .theme-liquid .script-title {
    font-size: 24px !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .theme-liquid .tab-bar,
  .theme-liquid :is(.card, .calendar, .week-day, .daily-list, .pipeline-summary, .milestone-card, .requirements-card, .receivable, .topic-idea-chat, .inspiration-card, .script-library-card, .script-body-card, .brief-card, .account-feature-card, .account-hero, .assistant-intro, .form-section) {
    background: #fbfaff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  body.theme-liquid {
    --accent-purple: #5a5068;
    --accent-purple-rgb: 90, 80, 104;
    --accent-purple-ink: #3e3648;
    --line: rgba(81, 72, 95, .42);
  }

  .theme-liquid :is(.card, .calendar, .week-day, .inspiration-card, .script-library-card, .script-body-card, .brief-card, .form-section) {
    box-shadow: inset 0 0 0 1px rgba(81, 72, 95, .3), var(--surface-shadow);
  }
}

@media (min-width: 700px) {
  .theme-liquid .app-shell {
    border: 0;
  }
}

/* 固定 402px 产品画布：拖动窗口不压缩内部界面。 */
body.theme-liquid .app-shell {
  width: var(--creator-fixed-shell-width);
  min-width: var(--creator-fixed-shell-width);
  max-width: var(--creator-fixed-shell-width);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body.theme-liquid {
  padding: 0;
}

.theme-liquid .tab-bar {
  left: max(50%, var(--creator-fixed-shell-center));
  bottom: max(15px, env(safe-area-inset-bottom));
  width: var(--creator-fixed-tabbar-width);
  min-width: var(--creator-fixed-tabbar-width);
  max-width: var(--creator-fixed-tabbar-width);
}

.theme-liquid .chat-compose {
  left: max(50%, var(--creator-fixed-shell-center));
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px);
  width: var(--creator-fixed-tabbar-width);
  min-width: var(--creator-fixed-tabbar-width);
  max-width: var(--creator-fixed-tabbar-width);
}

.theme-liquid .toast {
  left: max(50%, var(--creator-fixed-shell-center));
  max-width: 362px;
}

.theme-liquid .editor-dialog {
  width: var(--creator-fixed-dialog-width);
  min-width: var(--creator-fixed-dialog-width);
  max-width: var(--creator-fixed-dialog-width);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  border-radius: 0;
}

.theme-liquid .auth-dialog {
  width: var(--creator-fixed-shell-width);
  min-width: var(--creator-fixed-shell-width);
  max-width: var(--creator-fixed-shell-width);
  max-height: min(86dvh, 720px);
  margin: auto auto 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 28px 28px 0 0;
}

.theme-liquid .auth-dialog form { padding: 24px; }
.theme-liquid .account-hero { padding: 20px; }
.theme-liquid .account-profile { grid-template-columns: 56px 1fr auto; gap: 13px; }
.theme-liquid .account-profile .avatar { width: 56px; height: 56px; }

/* 中和旧版窄屏压缩规则，确保 402px 画布的组件尺寸不随 viewport 改变。 */
.theme-liquid .app-view { padding-inline: 16px; }
.theme-liquid .stage-grid { gap: 7px; }
.theme-liquid .stage { font-size: 10px; }
.theme-liquid .order-payment-fields { gap: 10px; }
.theme-liquid .assistant-capabilities { grid-template-columns: repeat(3, 1fr); }
.theme-liquid .ledger-actions { grid-template-columns: 1fr 1.12fr; }
.theme-liquid .project-hero { padding: 24px; }
.theme-liquid .ledger-hero { padding: 25px; }
.theme-liquid .tab { font-size: 10px; }
.theme-liquid .metric-row { grid-template-columns: repeat(4, 1fr); }
.theme-liquid .selection-command button { padding-inline: 9px; font-size: 10px; }
.theme-liquid .daily-title-actions { gap: 8px; }
.theme-liquid .stitch-schedule .daily-title-actions > button { padding-inline: 11px; }
.theme-liquid .topic-chat-head > span { display: inline; }
.theme-liquid .stitch-schedule .week-strip {
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 6px 20px;
  overflow: hidden;
}
.theme-liquid .topics-page .filter-row { margin-inline: -16px; padding-inline: 16px; }
.theme-liquid .script-category-row { margin-inline: -18px; padding-inline: 18px; }
.theme-liquid .project-add-inline { padding-inline: 13px; }
.theme-liquid .script-editor-nav { gap: 8px; }
.theme-liquid .script-editor-nav > .script-back-button { padding-inline: 12px; }
.theme-liquid .script-editor-nav > div button { padding-inline: 7px; }
.theme-liquid .day-focus-calendar { margin-inline: -4px; padding-inline: 10px; }
.theme-liquid .stitch-schedule .week-day {
  flex: 0 0 46px;
  width: 46px;
  height: 58px;
  min-height: 58px;
  padding: 5px 1px 4px;
  border: 0;
  border-radius: 16px;
  background: var(--glass-frost-surface);
  background-clip: border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 14px 30px rgba(50,43,62,.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  backdrop-filter: blur(24px) saturate(1.16);
}
.theme-liquid .stitch-schedule .week-day.selected {
  border-color: rgba(255,255,255,.3) !important;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px rgba(90,80,104,.16) !important;
}
.theme-liquid .stitch-schedule .week-day strong { width: 28px; height: 28px; font-size: 16px; }
.theme-liquid .stitch-schedule .spotlight-stack.stacked + .stack-toggle-row {
  position: relative;
  z-index: 50;
  margin: -25px 0 0;
}
.theme-liquid .day-agenda-head h2 { font-size: 19px; }
.theme-liquid .calendar-day { min-height: 82px; padding-inline: 3px; }
.theme-liquid .calendar-event { padding-inline: 4px; font-size: 8px; }
.theme-liquid :is(.milestone-fields, .order-payment-fields) { gap: 10px; }

@media (max-width: 340px) {
  .theme-liquid .milestone-field {
    grid-template-columns: minmax(0, 1fr) 154px;
    gap: 10px;
  }

  .theme-liquid .milestone-field input[type="date"] { justify-self: stretch; }
}
