/* Visual system refinement 2026-05-16 → V3 Refined Industrial update
   Source principles: semantic color roles, WCAG AA contrast, restrained spacing, and width-bounded work surfaces. */
:root {
  color-scheme: light;
  --color-bg: #fbf7f5;
  --color-sidebar: #ffffff;
  --color-card: #ffffff;
  --color-border: #E7E7E7;
  --color-border-strong: #d4d4d4;
  --text-main: #1f1e1d;
  --text-muted: #6e6b63;
  --text-subtle: #a8a59c;
  --text-disabled: #aeaaa3;
  --primary: #1f1e1d;
  --primary-hover: #33322f;
  --primary-accent: #c96442;
  --primary-accent-hover: #b05730;
  --primary-soft: #faf0ea;
  --accent: #0f9f8f;
  --warning: #b86600;
  --danger: #c72a3d;
  --secondary: #f0eee6;
  --secondary-hover: #e8e6dc;
  --surface-raised: #ffffff;
  --surface-muted: #faf9f5;
  --surface-strong: #f6f0ee;
  --disabled-bg: #f6f0ee;
  --focus-ring: rgba(31, 30, 29, 0.18);
  --shadow-sm: 0 1px 2px rgba(33, 32, 30, 0.06), 0 1px 8px rgba(33, 32, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(33, 32, 30, 0.10);
  --shadow-hover: 0 4px 12px rgba(33, 32, 30, 0.08), 0 1px 3px rgba(33, 32, 30, 0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  /* HAZ-191：把今日看板/个人档案/灵感选题/文案内容的面板上限拉齐到
     reference-workbench-page（资料库/资源库/文案库/数据复盘）的 1680px，
     消除宽屏（≥1800px 起明显，1920 时右侧 ~60px）下两组右侧留白不一致。
     登录/公开页走 body.auth-gate-active，不命中 .workbench-panel 卡片规则；
     setting/access-review 仍按自己 token（none/980px）走，不被这里影响。 */
  --workbench-max: 1680px;

  /* Sidebar nav tokens — independent of --primary to avoid theme drift.
     HAZ-178 R1 patch：nav 强调色（hover/active text/icon）转引用 --primary-accent，
     雾蓝/抹茶/暮紫主题下侧栏 hover/active 跟 palette 走。bg 仍是中性灰（§12 纪律）。 */
  /* 老板 2026-06-20：左侧 nav + 账号栏（.sidebar-account-trigger 也引用 --nav-text）默认态文字偏灰看不清，拉到近黑 text-main(#1f1e1d)；sidebar 实测底色为 neutral palette 的 #f1f1ee 浅灰，黑字可读。hover/active 仍走 accent。 */
  --nav-text: var(--text-main);
  --nav-icon: #6e6b63;
  --nav-hover-bg: rgba(15, 14, 12, 0.10); /* §12: 中性灰，不带陶土 */
  --nav-hover-text: var(--text-main);
  --nav-hover-icon: #4f4c45;
  --nav-hover-border: transparent; /* §12: 嵌入式无边框 */
  --nav-active-bg: rgba(15, 14, 12, 0.12);
  --nav-active-text: var(--text-main);
  --nav-active-icon: #4f4c45;
  --nav-active-border: transparent; /* §12: 嵌入式，无可见边框，浅灰底突出 */
  --nav-focus-ring: color-mix(in srgb, var(--primary-accent) 18%, transparent);

  /* §12 ghost icon action 中性灰 hover/active token —— 不带任何陶土橙 */
  --ghost-hover-bg: rgba(15, 14, 12, 0.05);
  --ghost-active-bg: rgba(15, 14, 12, 0.07);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #262624;
  --color-sidebar: #1c1b19;
  --color-card: #23221f;
  --color-border: #413e39;
  --color-border-strong: #57544e;
  --text-main: #fcf4f1;
  --text-muted: #bbb8b3;
  --text-subtle: #98938a;
  --text-disabled: #7d786e;
  --primary: #fcf4f1;
  --primary-hover: #e6d2ca;
  --primary-accent: #d97757;
  --primary-accent-hover: #c96442;
  --primary-soft: rgba(217, 119, 87, 0.12);
  --accent: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --secondary: #2f2d29;
  --secondary-hover: #3a3833;
  --surface-raised: #292825;
  --surface-muted: #201f1d;
  --surface-strong: #363430;
  --disabled-bg: #1f1e1d;
  --focus-ring: rgba(217, 119, 87, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 1px 12px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.30);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.20);

  /* Sidebar nav tokens — dark mode.
     HAZ-178 R1 patch：dark mode 同 light，nav 强调色引用 --primary-accent。 */
  --nav-text: #98938a;
  --nav-icon: #98938a;
  --nav-hover-bg: rgba(255, 255, 255, 0.14); /* §12 dark: 中性浅白 */
  --nav-hover-text: #f2eee6;
  --nav-hover-icon: #f2eee6;
  --nav-hover-border: transparent;
  --nav-active-bg: rgba(255, 255, 255, 0.16);
  --nav-active-text: #f2eee6;
  --nav-active-icon: #f2eee6;
  --nav-active-border: transparent; /* §12 dark：同 light，无可见边框 */
  --nav-focus-ring: color-mix(in srgb, var(--primary-accent) 24%, transparent);

  /* §12 ghost icon action 中性浅白 hover/active token （暗色） */
  --ghost-hover-bg: rgba(255, 255, 255, 0.07);
  --ghost-active-bg: rgba(255, 255, 255, 0.10);
}

body {
  background: var(--color-bg);
  color: var(--text-main);
  scrollbar-gutter: stable;
}

.main-content,
.workspace {
  background: var(--color-bg);
}

.topbar {
  min-height: 72px;
  padding: 18px clamp(18px, 2vw, 32px);
  background: var(--color-bg);
  border-bottom: 1px solid rgba(149, 144, 135, 0.16);
}

.topbar h1 {
  color: var(--text-main);
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.18;
}

.topbar p {
  margin-top: 4px;
  color: var(--text-muted);
}

.view-container {
  width: min(100%, var(--workbench-max));
  padding: 20px clamp(18px, 2.2vw, 34px) 30px;
  gap: 18px;
}

body.reference-workbench-page {
  --workbench-max: 1680px;
  background: var(--color-bg);
  color: var(--text-main);
}

body.reference-workbench-page .main-content,
body.reference-workbench-page .view-container {
  background: var(--color-bg);
}

body.reference-workbench-page .view-container {
  width: min(100%, var(--workbench-max));
  max-width: var(--workbench-max);
  margin: 0 auto;
  padding: 20px clamp(18px, 2.2vw, 34px) 30px;
  gap: 18px;
}

.sidebar {
  background: var(--color-sidebar);
  border-color: var(--color-border);
}

.nav-item {
  min-height: 42px;
  color: var(--nav-text);
  border-radius: var(--radius-md);
}

.nav-item .nav-icon svg {
  stroke: var(--nav-icon);
}

.nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
  border-color: var(--nav-hover-border);
}

.nav-item:hover .nav-icon svg {
  stroke: var(--nav-hover-icon);
}

.nav-item.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--nav-active-text);
  font-weight: 600;
}

.nav-item.active .nav-icon svg {
  stroke: var(--nav-active-icon);
  stroke-width: 1.8;
}

.nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--nav-focus-ring);
  border-color: var(--nav-active-border);
}

.logo-mark,
.primary-btn {
  background: var(--primary);
  color: #ffffff;
}

.primary-btn {
  border-color: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.module-card,
.utility-strip,
.review-kpi-card,
.review-chart-card,
.review-table-card,
.review-summary-card,
.settings-card,
.settings-hero,
.profile-editor-panel,
.profile-context-card,
.profile-occupancy-card,
.inspiration-filter-panel,
.inspiration-result-toolbar,
.inspiration-detail-panel,
.copylibrary-list-card,
.copylibrary-detail-panel,
.materials-table-card,
.material-detail-panel,
.assets-tree-panel,
.assets-grid-card,
.asset-detail-panel,
.asset-card {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.module-card,
.settings-card,
.settings-hero {
  padding: clamp(16px, 1.4vw, 22px);
}

.module-heading,
.settings-card-head,
.right-panel-header {
  gap: 14px;
}

.section-title,
.module-heading h2,
.module-heading h3,
.module-heading h4,
.right-panel-header h3,
.settings-card h2 {
  color: var(--text-main);
}

.section-subtitle,
.muted,
.data-item-meta,
.detail-body,
.creator-line,
.list-row-meta,
.review-kpi-card span,
.review-kpi-card p,
.review-insight-list span,
.review-insight-list p,
.review-boundary-note,
.settings-muted,
.settings-card-head p,
.settings-hero p {
  color: var(--text-muted);
}

.input-field,
.textarea-field,
.select-field,
input,
textarea,
select {
  min-height: 40px;
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
  border-radius: var(--radius-md);
}

.input-field::placeholder,
.textarea-field::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

.input-field:focus,
.textarea-field:focus,
.select-field:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.btn {
  min-height: 40px;
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
}

.secondary-btn,
.page-btn,
.filter-chip,
.tab-btn,
.theme-choice,
.status-pill {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

.secondary-btn:hover,
.page-btn:not(:disabled):hover,
.filter-chip:hover,
.tab-btn:hover {
  background: var(--secondary-hover);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--color-border));
}

.secondary-btn.active,
.page-btn.active,
.filter-chip.active,
.tab-btn.active,
.theme-choice.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 46%, transparent);
  color: var(--primary);
}

button:disabled,
.btn:disabled,
.page-btn:disabled,
.theme-choice:disabled {
  background: var(--disabled-bg);
  border-color: var(--color-border);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
  transform: none;
}

.primary-btn:disabled {
  background: var(--surface-strong);
  border-color: var(--color-border);
  color: var(--text-disabled);
}

.review-filterbar,
.materials-toolbar,
.assets-toolbar,
.copylibrary-toolbar,
.review-import-card,
body.reference-workbench-page .materials-toolbar,
body.reference-workbench-page .assets-toolbar,
body.reference-workbench-page .copylibrary-toolbar,
body.reference-workbench-page .review-filterbar {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

body.review-page .review-filterbar {
  grid-template-columns: minmax(150px, 0.8fr) repeat(4, minmax(128px, 1fr));
  align-items: end;
}

body.review-page .review-toolbar-actions {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: flex-start;
  padding-top: 2px;
}

body.review-page .review-toolbar-actions .btn,
body.review-page .review-import-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
}

body.review-page .review-toolbar-actions .btn:hover,
body.review-page .review-toolbar-actions .btn:active,
body.review-page .review-import-actions .btn:hover,
body.review-page .review-import-actions .btn:active,
body.review-page .review-action-stack .btn:hover,
body.review-page .review-action-stack .btn:active {
  transform: none;
}

.review-dashboard {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 18px;
}

.review-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
}

.review-kpi-card strong {
  color: var(--text-main);
  font-size: clamp(24px, 2vw, 34px);
}

.review-chart-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 18px;
}

body.review-page .review-chart-card .compact-heading {
  flex-wrap: wrap;
}

body.review-page .review-chart-card .compact-heading>div:first-child {
  flex: 1 1 150px;
  min-width: 0;
}

.review-metric-segment {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  overflow: visible;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.review-metric-segment .tab-btn {
  min-width: auto;
  min-height: 28px;
  padding: 5px 12px;
  border: 0;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.review-metric-segment .tab-btn:hover {
  background: var(--surface-strong);
  color: var(--text-main);
  transform: none;
}

.review-metric-segment .tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

body.review-page .review-action-stack.compact-action-row {
  display: flex;
  flex-wrap: wrap;
}

body.review-page .review-action-stack .compact-icon-action {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
  box-shadow: none;
  transform: none;
}

body.review-page .review-action-stack .compact-icon-action:hover,
body.review-page .review-action-stack .compact-icon-action:focus-visible {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--color-border));
  color: var(--primary);
  transform: none;
}

body.review-page .review-action-stack .compact-icon-action.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

body.review-page .review-action-stack .compact-icon-action.primary:hover,
body.review-page .review-action-stack .compact-icon-action.primary:focus-visible {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

body.review-page .review-action-stack .compact-icon-action.danger {
  color: var(--danger);
}

body.review-page .review-action-stack .compact-icon-action.danger:hover,
body.review-page .review-action-stack .compact-icon-action.danger:focus-visible {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--danger) 34%, var(--color-border));
  color: var(--danger);
}

.review-report-preview,
.review-insight-list div,
.metric-box,
.settings-status-item,
.settings-env-list code,
.theme-choice {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

.review-table-wrap,
.materials-table-wrap,
.copylibrary-table-wrap {
  background: var(--color-card);
  border-color: var(--color-border);
}

.review-table-head,
.materials-table-head,
.copylibrary-table-head {
  background: var(--surface-strong);
  color: var(--text-muted);
}

.review-table-row,
.materials-table-row,
.copylibrary-table-row {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--text-main);
}

.review-table-row:hover,
.review-table-row.active,
.materials-table-row:hover,
.materials-table-row.active,
.copylibrary-table-row:hover,
.copylibrary-table-row.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* data-item inset shadow — EXCLUDED from dashboard to prevent blue left bar */
body:not([data-dashboard]) .data-item:hover,
body:not([data-dashboard]) .data-item.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.review-grid-line {
  stroke: color-mix(in srgb, var(--text-muted) 28%, transparent);
}

.review-line-main,
.review-line-dot {
  stroke: var(--primary);
}

.review-line-dot {
  fill: var(--color-card);
}

.review-platform-row div {
  background: var(--surface-strong);
}

.review-platform-row i {
  background: var(--warning);
}

.review-table-row mark,
.status-pill.success {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.ai-status-note,
.settings-provider-summary {
  background: color-mix(in srgb, var(--warning) 14%, var(--color-card));
  border-color: color-mix(in srgb, var(--warning) 40%, var(--color-border));
  color: var(--warning);
}

.ai-status-note.ok,
.settings-provider-summary.ok {
  background: color-mix(in srgb, var(--accent) 12%, var(--color-card));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--color-border));
  color: var(--accent);
}

html[data-theme="dark"] .review-import-card,
html[data-theme="dark"] .review-report-preview,
html[data-theme="dark"] .review-insight-list div,
html[data-theme="dark"] .review-table-row:hover,
html[data-theme="dark"] .review-table-row.active,
html[data-theme="dark"] .materials-table-row:hover,
html[data-theme="dark"] .materials-table-row.active,
html[data-theme="dark"] .copylibrary-table-row:hover,
html[data-theme="dark"] .copylibrary-table-row.active,
/* data-item dark mode — EXCLUDED from dashboard */
html[data-theme="dark"] body:not([data-dashboard]) .data-item:hover,
html[data-theme="dark"] body:not([data-dashboard]) .data-item.active {
  background: var(--surface-strong);
}

html[data-theme="dark"] .settings-provider-summary strong,
html[data-theme="dark"] .ai-status-note strong {
  color: var(--text-main);
}

html[data-theme="dark"] body.reference-workbench-page .materials-toolbar,
html[data-theme="dark"] body.reference-workbench-page .assets-toolbar,
html[data-theme="dark"] body.reference-workbench-page .copylibrary-toolbar,
html[data-theme="dark"] body.reference-workbench-page .review-filterbar {
  background: var(--color-card);
}

html[data-theme="dark"] body.reference-workbench-page {
  /* HAZ-178 R1 patch：删掉本块对 --primary-accent / --primary-accent-hover / --primary-soft / --focus-ring
     的硬编码陶土覆盖，让 html[data-palette] 全局值穿透到这里；本块只保留 reference-workbench 专属的
     surface / text 暗色 token。 */
  --color-bg: #262624;
  --color-sidebar: #1c1b19;
  --color-card: #23221f;
  --color-border: #413e39;
  --color-border-strong: #57544e;
  --text-main: #fcf4f1;
  --text-muted: #bbb8b3;
  --text-subtle: #98938a;
  --text-disabled: #7d786e;
  --primary: #fcf4f1;
  --primary-hover: #e6d2ca;
  --accent: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --secondary: #2f2d29;
  --secondary-hover: #3a3833;
  --surface-raised: #292825;
  --surface-muted: #201f1d;
  --surface-strong: #363430;
  --disabled-bg: #1f1e1d;
  background: var(--color-bg);
  color: var(--text-main);
}

@media (min-width: 1800px) {

  .view-container,
  body.reference-workbench-page .view-container {
    --workbench-max: 1680px;
  }
}

@media (max-width: 1320px) {
  .review-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {

  body.review-page .review-filterbar,
  .review-dashboard {
    grid-template-columns: 1fr;
  }

  .review-side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding: 16px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .view-container,
  body.reference-workbench-page .view-container {
    padding: 14px;
    gap: 14px;
  }

  .module-card,
  .settings-card,
  .settings-hero {
    padding: 14px;
  }

  .review-kpi-grid,
  .review-side-panel {
    grid-template-columns: 1fr;
  }

  .review-filterbar,
  .materials-toolbar,
  .assets-toolbar,
  .copylibrary-toolbar {
    padding: 12px;
  }
}

/* HAZ-248: the resource page already renders its own title; avoid a duplicate pseudo heading. */
body.reference-workbench-page .materials-toolbar::before {
  display: none;
  content: none;
}

body .sidebar-account-menu-item[href] {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

body .sidebar-account-menu-item.is-disabled,
body .sidebar-account-menu-item[disabled] {
  color: var(--text-subtle);
  cursor: not-allowed;
  opacity: 0.7;
}

body .sidebar-account-menu-item.is-disabled:hover,
body .sidebar-account-menu-item[disabled]:hover {
  background: transparent;
}

/* Page-by-page dark theme QA fixes, 2026-05-16. Keep this block after legacy
   page rules because several older modules still hard-coded white surfaces. */
html[data-theme="dark"] .profile-topbar,
html[data-theme="dark"] .profile-editor-panel,
html[data-theme="dark"] .profile-context-card,
html[data-theme="dark"] .profile-selector,
html[data-theme="dark"] .profile-menu-trigger,
html[data-theme="dark"] .profile-switch-menu,
html[data-theme="dark"] .profile-archived-row,
html[data-theme="dark"] .profile-search,
html[data-theme="dark"] .profile-input,
html[data-theme="dark"] .chip-editor,
html[data-theme="dark"] .chip-inline-input,
html[data-theme="dark"] .profile-chip,
html[data-theme="dark"] .profile-summary-chips em,
html[data-theme="dark"] .tag-field,
html[data-theme="dark"] .tag-chip,
html[data-theme="dark"] .tag-add-input,
html[data-theme="dark"] .tag-add-button,
html[data-theme="dark"] .profile-analysis-item,
html[data-theme="dark"] .required-dot,
html[data-theme="dark"] .status-chip,
html[data-theme="dark"] .config-readonly,
html[data-theme="dark"] .status-block,
html[data-theme="dark"] .content-step.done,
html[data-theme="dark"] .content-step.active,
html[data-theme="dark"] .asset-tree-item.active,
html[data-theme="dark"] .asset-tree-item.create,
html[data-theme="dark"] .asset-capacity-box,
html[data-theme="dark"] .asset-card-thumb,
html[data-theme="dark"] .asset-card-body,
html[data-theme="dark"] .copylibrary-table-head,
html[data-theme="dark"] .copylibrary-table-row:hover,
html[data-theme="dark"] .copylibrary-table-row.active,
html[data-theme="dark"] .copylibrary-version-item,
html[data-theme="dark"] .material-reference-item,
html[data-theme="dark"] .preview-window-actions,
html[data-theme="dark"] .preview-window-actions .icon-btn {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

html[data-theme="dark"] .profile-topbar,
html[data-theme="dark"] .profile-editor-panel,
html[data-theme="dark"] .profile-context-card,
html[data-theme="dark"] .content-stepper,
html[data-theme="dark"] .inspiration-tabs,
html[data-theme="dark"] .inspiration-filter-panel {
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .profile-title-block h2,
html[data-theme="dark"] .profile-section-heading h3,
html[data-theme="dark"] .profile-context-head h3,
html[data-theme="dark"] .profile-editor-meta strong,
html[data-theme="dark"] .profile-selector select,
html[data-theme="dark"] .profile-menu-copy strong,
html[data-theme="dark"] .profile-row-copy strong,
html[data-theme="dark"] .profile-archived-copy strong,
html[data-theme="dark"] .profile-search input,
html[data-theme="dark"] .profile-input,
html[data-theme="dark"] .profile-occupancy-grid strong,
html[data-theme="dark"] .profile-summary-list dd,
html[data-theme="dark"] .profile-analysis-item strong,
html[data-theme="dark"] .chip-inline-input,
html[data-theme="dark"] .asset-capacity-box strong,
html[data-theme="dark"] .copylibrary-version-item strong {
  color: var(--text-main);
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .profile-context-selector span,
html[data-theme="dark"] .profile-status-light,
html[data-theme="dark"] .profile-row-state,
html[data-theme="dark"] .profile-menu-copy em,
html[data-theme="dark"] .profile-row-copy em,
html[data-theme="dark"] .profile-archived-copy em,
html[data-theme="dark"] .profile-archived-copy small,
html[data-theme="dark"] .profile-archived-empty,
html[data-theme="dark"] .profile-menu-caret,
html[data-theme="dark"] .profile-editor-meta span,
html[data-theme="dark"] .profile-summary-list dt,
html[data-theme="dark"] .profile-summary-chips>span,
html[data-theme="dark"] .profile-analysis-item p,
html[data-theme="dark"] .profile-row-field>span,
html[data-theme="dark"] .profile-section-heading p,
html[data-theme="dark"] .profile-help-text,
html[data-theme="dark"] .profile-chip button,
html[data-theme="dark"] .asset-capacity-box p,
html[data-theme="dark"] .copylibrary-version-item span {
  color: var(--text-muted);
}

html[data-theme="dark"] .profile-input,
html[data-theme="dark"] .chip-editor,
html[data-theme="dark"] .chip-inline-input,
html[data-theme="dark"] .profile-selector,
html[data-theme="dark"] .profile-menu-trigger,
html[data-theme="dark"] .profile-search {
  background: var(--surface-muted);
}

html[data-theme="dark"] .profile-chip,
html[data-theme="dark"] .profile-summary-chips em,
html[data-theme="dark"] .status-chip.neutral,
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .asset-card-tags em {
  background: var(--surface-strong);
  color: var(--text-main);
  border-color: var(--color-border);
}

html[data-theme="dark"] .status-chip.ok,
html[data-theme="dark"] .profile-current-status.ok {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-muted));
  color: #95f3df;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--color-border));
}

html[data-theme="dark"] .profile-status-light.ok,
html[data-theme="dark"] .profile-row-state.active {
  color: #95f3df;
}

html[data-theme="dark"] .profile-menu-trigger:hover,
html[data-theme="dark"] .profile-menu-trigger[aria-expanded="true"],
html[data-theme="dark"] .profile-switch-item.active,
html[data-theme="dark"] .profile-switch-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--color-border));
}

html[data-theme="dark"] .profile-archive-icon:hover {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--color-border));
  color: #fecaca;
}

html[data-theme="dark"] .status-chip.warn {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface-muted));
  color: #ffd38a;
  border-color: color-mix(in srgb, var(--warning) 34%, var(--color-border));
}

html[data-theme="dark"] body.inspiration-page .inspiration-title-block h2,
html[data-theme="dark"] body.inspiration-page .filter-label {
  color: var(--text-main);
}

html[data-theme="dark"] body.inspiration-page .inspiration-title-block span {
  color: var(--text-muted);
}

html[data-theme="dark"] body.inspiration-page .inspiration-search .input-field,
html[data-theme="dark"] body.inspiration-page .secondary-btn,
html[data-theme="dark"] body.inspiration-page .inspiration-tabs,
html[data-theme="dark"] body.inspiration-page .inspiration-filter-panel,
html[data-theme="dark"] body.inspiration-page .filter-chip,
html[data-theme="dark"] body.inspiration-page .filter-chip em {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

html[data-theme="dark"] body.inspiration-page .filter-chip.active,
html[data-theme="dark"] body.inspiration-page .inspiration-tabs .tab-btn.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--color-border));
  color: var(--primary);
}

html[data-theme="dark"] body.inspiration-page .filter-chip.active em {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface-strong));
  color: var(--primary);
}

html[data-theme="dark"] .content-step.done,
html[data-theme="dark"] .content-step.active,
html[data-theme="dark"] .asset-tree-item.active,
html[data-theme="dark"] .copylibrary-table-row.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--color-border));
  color: var(--primary);
}

html[data-theme="dark"] .config-readonly,
html[data-theme="dark"] .status-block,
html[data-theme="dark"] .asset-capacity-box,
html[data-theme="dark"] .copylibrary-version-item,
html[data-theme="dark"] .material-reference-item {
  background: var(--surface-muted);
}

html[data-theme="dark"] .asset-card-thumb,
html[data-theme="dark"] .asset-card-body {
  background: var(--surface-muted);
}

html[data-theme="dark"] .access-request-source {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--color-border));
  background: var(--primary-soft);
  color: var(--primary);
}

html[data-theme="dark"] .asset-card:hover .asset-card-tags em,
html[data-theme="dark"] .asset-tree-item:hover,
html[data-theme="dark"] .asset-tree-item.create,
html[data-theme="dark"] .copylibrary-table-row:hover {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--primary) 32%, var(--color-border));
  color: var(--text-main);
}

html[data-theme="dark"] .asset-card.active,
html[data-theme="dark"] .asset-card:hover {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--color-border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent), var(--shadow-md);
}

html[data-theme="dark"] .asset-favorite-badge {
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--text-muted);
}

html[data-theme="dark"] .preview-window-actions {
  background: color-mix(in srgb, var(--surface-muted) 94%, transparent);
}

html[data-theme="dark"] .profile-ai-entry-card,
html[data-theme="dark"] .profile-ai-starter,
html[data-theme="dark"] .profile-occupancy-grid div,
html[data-theme="dark"] .profile-archive-note,
html[data-theme="dark"] .profile-delete-note {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

html[data-theme="dark"] .profile-ai-example,
html[data-theme="dark"] .profile-ai-example em {
  color: var(--text-muted);
}

html[data-theme="dark"] .profile-ai-starter {
  background: var(--primary-soft);
  color: var(--primary);
}

html[data-theme="dark"] .profile-archive-note,
html[data-theme="dark"] .profile-delete-note {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--color-border));
  color: #ffd38a;
}

html[data-theme="dark"] .benchmark-monitor-panel,
html[data-theme="dark"] .crawl-queue-popover,
html[data-theme="dark"] .crawl-queue-panel,
html[data-theme="dark"] .crawl-queue-item,
html[data-theme="dark"] .watchlist-row,
html[data-theme="dark"] .inspiration-card-v2,
html[data-theme="dark"] .inspiration-cover,
html[data-theme="dark"] body.inspiration-page .inspiration-detail-panel,
html[data-theme="dark"] body.inspiration-page .ip-context-card,
html[data-theme="dark"] body.inspiration-page .agent-suggest-card,
html[data-theme="dark"] body.inspiration-page .detail-strategy-card p,
html[data-theme="dark"] .xiaohongshu-scroll,
html[data-theme="dark"] .inspiration-tag,
html[data-theme="dark"] body.inspiration-page .inspiration-tag,
html[data-theme="dark"] .asset-usage-item {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

html[data-theme="dark"] .inspiration-card-v2.active,
html[data-theme="dark"] .inspiration-card-v2:hover {
  background: var(--surface-muted);
  border-color: color-mix(in srgb, var(--primary) 46%, var(--color-border));
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .inspiration-card-v2.active {
  outline-color: rgba(224, 139, 109, 0.56);
  box-shadow: 0 10px 28px rgba(224, 139, 109, 0.14);
}

html[data-theme="dark"] .inspiration-card-v2 h3,
html[data-theme="dark"] body.inspiration-page .right-panel-header h3,
html[data-theme="dark"] body.inspiration-page .detail-title,
html[data-theme="dark"] body.inspiration-page .detail-author-profile strong,
html[data-theme="dark"] body.inspiration-page .detail-author-line strong,
html[data-theme="dark"] body.inspiration-page .detail-body,
html[data-theme="dark"] body.inspiration-page .detail-strategy-card p,
html[data-theme="dark"] .xiaohongshu-scroll-copy,
html[data-theme="dark"] .watchlist-row {
  color: var(--text-main);
}

html[data-theme="dark"] .inspiration-cover {
  background: var(--surface-strong);
}

html[data-theme="dark"] .inspiration-tag,
html[data-theme="dark"] body.inspiration-page .inspiration-tag,
html[data-theme="dark"] .benchmark-monitor-panel mark,
html[data-theme="dark"] .crawl-queue-item mark,
html[data-theme="dark"] .queue-toggle-btn b,
html[data-theme="dark"] .benchmark-monitor-panel span,
html[data-theme="dark"] body.inspiration-page .detail-metric-strip .inspiration-card-metrics span,
html[data-theme="dark"] body.inspiration-page .status-pill.success {
  background: var(--surface-strong);
  color: var(--text-muted);
  border-color: var(--color-border);
}

html[data-theme="dark"] body.inspiration-page .secondary-btn.active,
html[data-theme="dark"] body.inspiration-page .detail-action-grid .btn.active,
html[data-theme="dark"] body.inspiration-page .status-pill.success {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--color-border));
  color: var(--primary);
}

html[data-theme="dark"] body.inspiration-page .detail-identity,
html[data-theme="dark"] body.inspiration-page .detail-author-profile span,
html[data-theme="dark"] body.inspiration-page .detail-author-line,
html[data-theme="dark"] body.inspiration-page .metric-note,
html[data-theme="dark"] body.inspiration-page .ip-context-card p {
  color: var(--text-muted);
}

/* --- 灵感选题页深色模式补全 --- */

/* 卡片指标徽章（点赞/收藏/评论/转发） */
html[data-theme="dark"] .inspiration-card-metrics span {
  background: var(--surface-strong);
  border-color: var(--color-border);
  color: var(--text-muted);
}

html[data-theme="dark"] .inspiration-card-metrics b {
  color: var(--text-main);
}

/* 标签+号按钮 */
html[data-theme="dark"] .tag-add-btn {
  background: var(--surface-strong);
  border-color: var(--color-border);
  color: var(--text-muted);
}

/* 标签复制按钮 */
html[data-theme="dark"] .tag-copy-btn {
  background: var(--surface-strong);
  border-color: var(--color-border);
  color: var(--text-muted);
}

html[data-theme="dark"] .tag-copy-btn.copied {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border-color: #4ade80;
}

/* 排序下拉选择器 */
html[data-theme="dark"] body.inspiration-page .inspiration-sort-choice .aha-choice-trigger {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

/* 右侧详情面板关闭按钮 */
html[data-theme="dark"] body.inspiration-page .right-panel-header .icon-btn {
  background: var(--surface-strong);
  border-color: var(--color-border);
  color: var(--text-muted);
  box-shadow: none;
}

html[data-theme="dark"] body.inspiration-page .right-panel-header .icon-btn:hover {
  background: var(--surface-muted);
  border-color: var(--text-muted);
  color: var(--text-main);
}

/* 详情面板作者名称 */
html[data-theme="dark"] body.inspiration-page .detail-author-line strong {
  color: var(--text-main);
}

/* 详情面板指标文字颜色 */
html[data-theme="dark"] body.inspiration-page .detail-author-line,
html[data-theme="dark"] body.inspiration-page .detail-author-profile span {
  color: var(--text-muted);
}

html[data-theme="dark"] .watchlist-head {
  color: var(--text-muted);
}

html[data-theme="dark"] .queue-panel-head h3,
html[data-theme="dark"] .crawl-queue-empty span {
  color: var(--text-main);
}

html[data-theme="dark"] .queue-panel-head span,
html[data-theme="dark"] .queue-item-url,
html[data-theme="dark"] .crawl-queue-empty {
  color: var(--text-muted);
}

html[data-theme="dark"] .asset-usage-item {
  background: var(--surface-muted);
}

/* Full button interaction polish 2026-05-16. These overrides sit last because
   earlier page-specific rules intentionally use higher specificity. */
.clickable-card,
.inspiration-card,
.inspiration-card-v2,
.inspiration-list-row {
  cursor: pointer;
}

.clickable-card:hover,
.clickable-card:focus-visible,
.inspiration-card:focus-visible,
.inspiration-card-v2:focus-visible,
.inspiration-list-row:focus-visible,
.nav-item:focus-visible,
.icon-btn:focus-visible,
.platform-icon-btn:focus-visible,
.compact-icon-action:focus-visible,
.upload-dropzone:focus-within,
.upload-modal-dropzone:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.clickable-card:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--color-border));
  background: var(--surface-strong) !important;
}

.nav-item:active {
  /* §12: 嵌入式不挂阴影 / 内描边；按下用底色加深一档表达 */
  transform: translateY(0);
  box-shadow: none;
  background: var(--ghost-active-bg);
}

.btn:not(:disabled):active,
.filter-chip:not(:disabled):active,
.tab-btn:not(:disabled):active,
.material-chip:not(:disabled):active,
.asset-tree-item:not(:disabled):active,
.asset-card:not(:disabled):active,
.materials-table-row:not(:disabled):active,
.copylibrary-table-row:not(:disabled):active,
.review-table-row:not(:disabled):active,
.icon-btn:not(:disabled):active,
.compact-icon-action:not(:disabled):active {
  transform: translateY(0);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

.materials-table-wrap,
.review-table-wrap,
.copylibrary-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  contain: inline-size;
}

.materials-main-panel,
.assets-main-panel,
.copylibrary-main-panel,
.review-main-panel,
.materials-table-card,
.assets-grid-card,
.copylibrary-list-card,
.review-table-card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1180px) {

  body.materials-page .materials-grid,
  body.assets-page .assets-layout,
  body.copylibrary-page .copylibrary-layout,
  body.review-page .review-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  body.materials-page .materials-toolbar,
  body.assets-page .assets-toolbar,
  body.copylibrary-page .copylibrary-toolbar,
  body.review-page .review-filterbar {
    grid-template-columns: minmax(0, 1fr);
  }

  body.assets-page .asset-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  }

  .materials-table,
  .review-table,
  .copylibrary-table {
    min-width: min(760px, calc(100vw - 32px));
  }
}

@media (max-width: 760px) {

  html,
  body,
  .app-container,
  .main-content,
  .view-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    max-width: 100%;
    overflow: hidden;
  }

  .sidebar-nav {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    contain: inline-size;
  }

  .sidebar-nav ul {
    width: max-content;
    max-width: none;
  }

  .nav-item {
    min-height: 38px;
  }

  .topbar {
    width: 100%;
    max-width: 100vw;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .topbar-info {
    min-width: 0;
  }

  #refresh-button {
    flex: 0 0 auto;
  }

  .data-item {
    align-items: stretch;
  }

  .data-item-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .data-item-actions {
    justify-content: flex-start;
  }

  .materials-table-card,
  .copylibrary-list-card,
  .review-table-card,
  .assets-grid-card {
    overflow: hidden;
  }

  .materials-table,
  .review-table,
  .copylibrary-table {
    min-width: 680px;
  }

  body.assets-page .asset-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .asset-card {
    width: 100%;
  }
}

/* Frontend-design layout refit, 2026-05-16.
   A single page grammar for dense workbench screens: title rail, filters,
   actions, primary canvas, and bounded detail panels. */
body.reference-workbench-page .view-container {
  padding: 18px clamp(18px, 2vw, 28px) 28px;
  gap: 16px;
}

.module-card,
.utility-strip,
.profile-editor-panel,
.profile-context-card,
.assets-tree-panel,
.asset-detail-panel,
.material-detail-panel,
.copylibrary-detail-panel,
.review-summary-card {
  border-radius: 10px;
}

.module-heading,
.compact-heading,
.settings-card-head,
.right-panel-header {
  align-items: center;
}

.module-heading .section-title,
.compact-heading .section-title,
.section-title {
  margin-bottom: 0;
}

.section-subtitle {
  margin-top: 4px;
}

body.reference-workbench-page .materials-toolbar,
body.reference-workbench-page .assets-toolbar,
body.reference-workbench-page .copylibrary-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(340px, 1fr) minmax(280px, max-content);
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
}

body.reference-workbench-page .materials-toolbar::before,
body.reference-workbench-page .assets-toolbar::before,
body.reference-workbench-page .copylibrary-toolbar::before,
body.reference-workbench-page .review-filterbar::before {
  align-self: center;
  margin: 0;
  color: var(--text-main);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.12;
}

body.reference-workbench-page .materials-search,
body.reference-workbench-page .assets-search {
  min-width: 0;
}

body.reference-workbench-page .assets-search {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

body.reference-workbench-page .materials-toolbar-actions,
body.reference-workbench-page .assets-toolbar-actions,
body.reference-workbench-page .copylibrary-toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

body.reference-workbench-page .materials-toolbar-actions .btn,
body.reference-workbench-page .assets-toolbar-actions .btn,
body.reference-workbench-page .copylibrary-toolbar-actions .btn,
body.review-page .review-toolbar-actions .btn {
  min-width: 112px;
}

body.assets-page .assets-layout {
  grid-template-columns: 72fr 28fr;
  gap: 14px;
}

body.assets-page .asset-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
}

body.assets-page .asset-card {
  min-height: 264px;
}

body.assets-page .asset-card-thumb {
  aspect-ratio: 16 / 10;
}

body.assets-page .asset-card-body {
  min-height: 124px;
}

body.assets-page .asset-detail-panel,
body.materials-page .material-detail-panel,
body.copylibrary-page .copylibrary-detail-panel {
  top: 18px;
  max-height: calc(100vh - 56px);
}

body.materials-page .material-detail-panel {
  margin-top: 24px;
  max-height: calc(100vh - 80px);
}

body.review-page .review-dashboard {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 360px);
  gap: 18px;
  align-items: start;
}

body.review-page .review-filterbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) repeat(4, minmax(118px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 0;
  padding: 14px 16px;
}

body.review-page .review-filterbar::before {
  grid-row: 1;
}

body.review-page .review-toolbar-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

body.review-page .review-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.review-page .review-chart-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.review-page .review-summary-card {
  top: 18px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

body.profile-page .view-container {
  padding: 14px 18px 24px;
}

body.profile-page .profile-workbench {
  gap: 16px;
}

body.profile-page .profile-topbar {
  min-height: 74px;
  padding: 14px 18px;
}

body.profile-page .profile-toolbar-actions {
  flex-wrap: wrap;
}

body.profile-page .profile-toolbar-actions .btn {
  min-width: 108px;
}

body.profile-page .profile-workbench-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  gap: 18px;
}

body.profile-page .profile-editor-panel,
body.profile-page .profile-context-card {
  padding: 18px;
}

body.profile-page .profile-context-panel {
  top: 18px;
}

body.profile-page .profile-editor-meta {
  grid-template-columns: repeat(2, minmax(160px, 1fr)) minmax(190px, auto);
  gap: 14px;
}

body.profile-page .profile-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

body.profile-page .profile-row-field {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

body.profile-page .profile-row-field>span {
  padding-top: 10px;
}

body.profile-page .profile-input {
  min-height: 42px;
  padding: 9px 11px;
}

body.profile-page .compact-textarea {
  min-height: 104px;
  resize: vertical;
}

body.profile-page .tag-field {
  min-height: 44px;
  align-items: flex-start;
}

body.profile-page .chip-editor {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
}

body.profile-page .chip-list {
  width: 100%;
  align-content: flex-start;
}

body.profile-page .profile-occupancy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.profile-page .profile-summary-list {
  gap: 10px;
}

body.profile-page .profile-summary-list div {
  grid-template-columns: 64px minmax(0, 1fr);
}

body.profile-page .profile-summary-list dd {
  line-height: 1.65;
}

body.profile-page .profile-switch-menu,
body.profile-page .profile-switch-list {
  max-height: 270px;
}

body.content-page .content-workflow-grid {
  grid-template-columns: minmax(250px, 300px) minmax(420px, 1fr) minmax(280px, 330px);
  gap: 14px;
}

body.content-page .content-stepper {
  gap: 10px;
  padding: 10px;
}

body.content-page .content-step {
  min-height: 58px;
}

@media (max-width: 1320px) {

  body.reference-workbench-page .materials-toolbar,
  body.reference-workbench-page .assets-toolbar,
  body.reference-workbench-page .copylibrary-toolbar {
    grid-template-columns: minmax(150px, 200px) minmax(260px, 1fr);
  }

  body.reference-workbench-page .materials-toolbar-actions,
  body.reference-workbench-page .assets-toolbar-actions,
  body.reference-workbench-page .copylibrary-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body.profile-page .profile-workbench-grid,
  body.content-page .content-workflow-grid,
  body.review-page .review-dashboard,
  body.assets-page .assets-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.profile-page .profile-context-panel,
  body.assets-page .asset-detail-panel,
  body.assets-page .assets-tree-panel,
  body.review-page .review-summary-card {
    position: static;
    max-height: none;
  }

  body.profile-page .profile-field-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {

  body.reference-workbench-page .materials-toolbar,
  body.reference-workbench-page .assets-toolbar,
  body.reference-workbench-page .copylibrary-toolbar,
  body.review-page .review-filterbar,
  body.profile-page .profile-editor-meta,
  body.profile-page .profile-form-grid.two,
  body.profile-page .profile-row-field,
  body.profile-page .profile-occupancy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.profile-page .profile-row-field>span {
    padding-top: 0;
  }

  body.profile-page .profile-ai-entry-card .profile-section-heading {
    align-items: stretch;
  }

  body.profile-page .profile-ai-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.profile-page .profile-ai-example {
    grid-template-columns: minmax(0, 1fr);
  }

  body.profile-page .profile-field-analysis-heading {
    align-items: stretch;
  }

  body.profile-page .profile-field-analysis-score {
    justify-items: start;
  }

  body.profile-page .profile-field-analysis-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.review-page .review-toolbar-actions,
  body.reference-workbench-page .materials-toolbar-actions,
  body.reference-workbench-page .assets-toolbar-actions,
  body.reference-workbench-page .copylibrary-toolbar-actions {
    justify-content: flex-start;
  }
}

/* HAZ-126 full-workbench layout harmony pass.
   Keep after previous visual overrides so shared sizing rules win consistently. */
.app-container,
.workspace,
.main-content,
.view-container,
.topbar,
.topbar-info,
.module-card,
.utility-strip,
.split-layout,
.split-main,
.split-side,
.profile-workbench,
.profile-workbench-grid,
.profile-context-panel,
.content-workbench,
.content-workflow-grid,
.content-config-panel,
.content-editor-panel,
.content-status-panel,
.inspiration-workbench,
.inspiration-main,
.copylibrary-workbench,
.copylibrary-layout,
.copylibrary-main-panel,
.materials-workbench,
.materials-grid,
.materials-main-panel,
.assets-workbench,
.assets-layout,
.assets-main-panel,
.review-dashboard,
.review-main-panel,
.review-side-panel,
.settings-grid {
  min-width: 0;
}

.sidebar {
  flex: 0 0 var(--sidebar-width, 216px);
}

.workspace,
.main-content {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar {
  flex: 0 0 auto;
  gap: 16px;
}

.topbar-info {
  flex: 1 1 auto;
  min-width: 0;
}

#refresh-button {
  flex: 0 0 auto;
}

.topbar-actions {
  flex: 0 1 auto;
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-redeem {
    flex: 1 1 auto;
  }

  .topbar-redeem input {
    width: 100%;
    max-width: none;
  }
}

.view-container {
  max-width: 100%;
}

.module-heading,
.compact-heading,
.right-panel-header,
.profile-topbar,
.profile-editor-meta,
.settings-card-head,
.review-toolbar-actions,
.materials-toolbar-actions,
.assets-toolbar-actions,
.copylibrary-toolbar-actions {
  min-width: 0;
}

.module-heading>div,
.compact-heading>div,
.right-panel-header>div,
.profile-title-block,
.profile-meta-actions,
.settings-card-head>div {
  min-width: 0;
}

.right-panel-header .icon-btn,
.profile-history-header .icon-btn,
.profile-ai-header .icon-btn,
.upload-modal-header .icon-btn,
.inspiration-modal header .icon-btn {
  flex: 0 0 auto;
}

.copylibrary-detail-panel,
.material-detail-panel,
.asset-detail-panel,
.review-summary-card,
body.inspiration-page .inspiration-detail-panel {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.inspiration-page .inspiration-filter-panel {
  overflow: visible;
}

.filter-chip,
.material-chip,
.tab-btn {
  white-space: nowrap;
}

.upload-modal-backdrop,
.inspiration-modal-backdrop,
.profile-ai-backdrop,
.profile-history-backdrop {
  overflow-y: auto;
}

/* Preview modal: prevent body scroll when open */
body:has(.preview-backdrop) {
  overflow: hidden;
}

.upload-modal,
.inspiration-modal,
.profile-ai-dialog,
.profile-history-dialog,
.preview-dialog {
  max-width: calc(100vw - 32px);
}

.upload-modal {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.upload-modal-actions,
.inspiration-modal .form-row,
.profile-ai-save-actions,
.profile-history-toolbar {
  flex-wrap: wrap;
}

@media (max-width: 1320px) {

  body.content-page .content-config-panel,
  body.content-page .content-status-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1180px) {
  .sidebar {
    flex-basis: min(var(--sidebar-width, 216px), 204px);
  }

  .topbar {
    padding-inline: 18px;
  }

  .view-container,
  body.reference-workbench-page .view-container {
    padding-inline: 18px;
  }

  body.reference-workbench-page .materials-toolbar,
  body.reference-workbench-page .assets-toolbar,
  body.reference-workbench-page .copylibrary-toolbar,
  body.review-page .review-filterbar {
    align-items: stretch;
  }
}

@media (max-width: 1020px) {
  body.inspiration-page .inspiration-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  body.inspiration-page .inspiration-detail-panel {
    position: static;
    width: 100%;
    max-height: none;
    border: 1px solid var(--inspiration-border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }
}

@media (max-width: 900px) {
  body.inspiration-page .inspiration-detail-panel {
    inset: auto;
    z-index: auto;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .sidebar {
    flex: 0 0 auto;
  }

  .topbar {
    gap: 10px;
  }

  #refresh-button {
    min-width: 112px;
  }

  .view-container,
  body.reference-workbench-page .view-container,
  body.inspiration-page #app {
    padding-inline: 14px;
  }

  .btn,
  .page-btn,
  .filter-chip,
  .material-chip,
  .tab-btn {
    max-width: 100%;
  }

  .upload-modal-backdrop,
  .inspiration-modal-backdrop,
  .profile-ai-backdrop,
  .profile-history-backdrop,
  .preview-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .upload-modal,
  .inspiration-modal,
  .profile-ai-dialog,
  .profile-history-dialog,
  .preview-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .upload-modal {
    gap: 12px;
  }

  .upload-modal-dropzone {
    min-height: 180px;
  }

  body.inspiration-page .inspiration-tabs,
  body.inspiration-page .chip-row,
  body.inspiration-page .filter-row {
    scrollbar-gutter: stable;
  }

  body.inspiration-page .detail-action-grid,
  .asset-action-grid,
  .copylibrary-action-grid,
  .review-action-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-action-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .password-recovery-form,
  .password-reset-form,
  .settings-inline-grid,
  .access-ledger-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-code-row,
  .access-ledger-row,
  .access-code-created {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .access-code-created .btn {
    grid-row: auto;
    grid-column: auto;
  }
}

/* HAZ-127 readability, module proportion, and smooth option-panel pass. */
.compact-action-label {
  display: none;
}

.copylibrary-action-grid .compact-icon-action,
.asset-action-grid .compact-icon-action,
.review-action-stack .compact-icon-action,
body.inspiration-page .detail-primary-actions .compact-icon-action {
  width: auto;
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  gap: 6px;
}

.copylibrary-action-grid .compact-action-label,
.asset-action-grid .compact-action-label,
.review-action-stack .compact-action-label,
body.inspiration-page .detail-primary-actions .compact-action-label {
  display: inline;

  overflow: visible;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}

.dashboard-target-selector {
  position: relative;
}

.dashboard-target-list {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.2s ease,
    opacity 0.16s ease,
    transform 0.16s ease,
    padding 0.16s ease;
}

.dashboard-target-selector:hover .dashboard-target-list,
.dashboard-target-selector:focus-within .dashboard-target-list {
  max-height: 224px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
}

.dashboard-target-option {
  min-height: 52px;
  align-items: center;
}

body.profile-page .profile-workbench-grid {
  grid-template-columns: minmax(0, 1fr) clamp(360px, 24vw, 520px);
  align-items: stretch;
}

body.profile-page .profile-context-panel {
  position: static;
  top: auto;
  width: 100%;
  min-width: 0;
  max-height: none;
  overflow: visible;
  scrollbar-gutter: auto;
}

body.profile-page .profile-main-panel,
body.profile-page .profile-context-panel {
  height: 100%;
}

body.profile-page .profile-context-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

body.profile-page .profile-reference-panel {
  flex: 1 1 260px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

body.profile-page .profile-reference-table {
  flex: 1 1 auto;
}

body.profile-page .profile-reference-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

body.profile-page .profile-ai-entry-card {
  background:
    linear-gradient(135deg, rgba(201, 100, 66, 0.06), rgba(20, 184, 166, 0.05)),
    var(--color-card);
}

body.profile-page .profile-ai-entry-card .profile-section-heading {
  align-items: center;
}

body.profile-page .profile-ai-entry-card .primary-btn {
  min-width: 116px;
}

body.profile-page .profile-field-analysis-panel {
  grid-column: 1 / -1;
}

body.profile-page .profile-field-analysis-heading {
  align-items: flex-start;
}

body.profile-page .profile-field-analysis-score {
  display: grid;
  justify-items: end;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 92px;
}

body.profile-page .profile-field-analysis-score strong {
  color: var(--accent, #0f9f8f);
  font-size: 1.35rem;
  line-height: 1;
}

body.profile-page .profile-field-analysis-score span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

body.profile-page .profile-field-analysis-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

body.profile-page .profile-field-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

body.profile-page .profile-context-card {
  min-width: 0;
  overflow: hidden;
}

body.profile-page .profile-current-head,
body.profile-page .profile-analysis-head {
  flex-wrap: wrap;
}

body.profile-page .profile-status-light {
  max-width: 100%;
  white-space: normal;
}

body.profile-page .profile-summary-list,
body.profile-page .profile-summary-list div,
body.profile-page .profile-summary-chips,
body.profile-page .profile-summary-chips div,
body.profile-page .profile-local-analysis,
body.profile-page .profile-analysis-item {
  min-width: 0;
}

body.profile-page .profile-summary-list dd,
body.profile-page .profile-summary-chips em,
body.profile-page .profile-analysis-item p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.profile-page .profile-summary-chips div {
  align-items: flex-start;
}

body.profile-page .profile-summary-chips em {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

@media (min-width: 1800px) {
  body.profile-page .profile-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }

  body.profile-page .profile-summary-list div {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}

body.copylibrary-page .copylibrary-layout {
  grid-template-columns: clamp(280px, 34vw, 420px) minmax(0, 1fr);
}

body.copylibrary-page .copylibrary-detail-panel {
  max-height: calc(100vh - 112px);
  scrollbar-gutter: stable;
}

body.inspiration-page .inspiration-workbench {
  grid-template-columns: minmax(0, 1fr) clamp(306px, 22vw, 340px);
}

body.inspiration-page .inspiration-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 6px 4px 8px;
}

@media (min-width: 1560px) {
  body.inspiration-page .inspiration-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.inspiration-page .inspiration-card-v2 {
  height: auto;
  min-height: 368px;
}

body.inspiration-page .inspiration-cover {
  flex: 0 0 auto;
  min-height: 152px;
}

body.inspiration-page .inspiration-card-v2 h3 {
  min-height: calc(1.45em * 2);
  max-height: calc(1.45em * 2);
  -webkit-line-clamp: 2;
}

body.inspiration-page .inspiration-card-v2.active h3 {
  max-height: calc(1.45em * 2);
  -webkit-line-clamp: 2;
}

body.inspiration-page .card-meta-line,
body.inspiration-page .creator-line,
body.inspiration-page .detail-identity,
body.inspiration-page .detail-author-line {
  font-size: 0.8rem;
}

body.inspiration-page .inspiration-card-metrics {
  gap: 5px;
}

body.inspiration-page .inspiration-card-metrics span {
  min-height: 26px;
  padding: 4px 5px;
}

body.inspiration-page .filter-row {
  align-items: flex-start;
}

body.inspiration-page .filter-label {
  padding-top: 6px;
}

body.inspiration-page .chip-row {
  gap: 7px;
}

/* ========== 灵感选题 UI 优化 - 新增组件 ========== */

/* --- 数据概览栏 --- */
body.inspiration-page .inspiration-data-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--inspiration-border);
  border-radius: 8px;
  background: #fff;
  flex-wrap: wrap;
}

.overview-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.overview-stat .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  flex: 0 0 24px;
  box-shadow: 0 1px 2px rgba(33, 32, 30, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.overview-stat .stat-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-stat .stat-count {
  font-weight: 700;
  color: #1f1e1d;
  font-size: 0.92rem;
  min-width: 16px;
}

.overview-stat .stat-label {
  color: #6e6b63;
}

.overview-stat.stat-total .stat-icon {
  /* HAZ-178 R1 patch：总计统计 icon 走 palette token，雾蓝/抹茶/暮紫下也跟着换色。 */
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary-accent) 30%, var(--color-border));
  color: var(--primary-accent);
}

.overview-stat.stat-unprocessed .stat-icon {
  background: #fff3bf;
  border-color: #fde68a;
  color: #92400e;
}

.overview-stat.stat-favorited .stat-icon {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #be123c;
}

.overview-stat.stat-library .stat-icon {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
}

.overview-stat.stat-pending .stat-icon {
  background: #fbf0ec;
  border-color: #f7e4dd;
  color: #6d28d9;
}

.overview-divider {
  width: 1px;
  height: 20px;
  background: #e8e6dc;
  flex: 0 0 1px;
}

/* --- 封面竖图/方图模糊背景 --- */
.inspiration-cover.cover-portrait,
.inspiration-cover.cover-square,
.inspiration-cover.cover-landscape {
  background: #1f1e1d;
}

.inspiration-cover.cover-landscape img,
.inspiration-cover.cover-landscape video,
.inspiration-cover.cover-landscape iframe {
  position: relative;
  z-index: 1;
  object-fit: contain;
  object-position: center;
}

.inspiration-cover .cover-blur-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) brightness(0.55);
  transform: scale(1.25);
  z-index: 0;
}

.inspiration-cover.cover-landscape .cover-blur-bg {
  position: absolute;
  z-index: 0;
  object-fit: cover;
  filter: blur(18px) brightness(0.72) saturate(1.08);
  transform: scale(1.16);
}

.inspiration-cover.cover-landscape img:not(.cover-blur-bg),
.inspiration-cover.cover-landscape video:not(.cover-blur-bg),
.inspiration-cover.cover-landscape iframe:not(.cover-blur-bg) {
  position: relative;
  z-index: 2;
}

.inspiration-cover .cover-foreground {
  position: relative;
  z-index: 1;
  width: auto;
  height: 100%;
  max-width: 80%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.inspiration-cover.cover-missing {
  background: linear-gradient(135deg, #e8e6dc, #f0eee6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8a59c;
}

.inspiration-cover.cover-missing .cover-missing-icon {
  font-size: 1.8rem;
  opacity: 0.5;
}

/* --- 卡片底部操作栏 --- */
.card-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--color-border, var(--color-border));
}

.card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
}

.card-status-badge.status-unprocessed {
  background: #fef3c7;
  color: #92400e;
}

.card-status-badge.status-favorited {
  background: #fee2e2;
  color: #991b1b;
}

.card-status-badge.status-library {
  background: #dcfce7;
  color: #166534;
}

.card-status-badge.status-pending {
  background: #fbf0ec;
  color: #5b21b6;
}

.card-status-badge.status-processed {
  background: #f9ebe5;
  color: #4a4742;
}

.card-action-buttons {
  display: inline-flex;
  gap: 4px;
}

.card-action-buttons .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.card-action-buttons .icon-btn svg {
  width: 12px;
  height: 12px;
}

/* HAZ-285 FR-INS-DEL: 灵感条目删除按钮 —— 静态低调，hover 才亮出 danger 色，避免误点。 */
.icon-btn.danger-icon-btn {
  color: var(--color-danger);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.icon-btn.danger-icon-btn:hover,
.icon-btn.danger-icon-btn:focus-visible {
  color: var(--color-danger);
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .icon-btn.danger-icon-btn {
  color: var(--color-danger);
}

html[data-theme="dark"] .icon-btn.danger-icon-btn:hover,
html[data-theme="dark"] .icon-btn.danger-icon-btn:focus-visible {
  color: var(--color-danger);
  background: transparent;
}

/* --- 类型徽章（封面左下角，与平台badge上下对称） --- */
.type-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  color: #44423c;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  z-index: 4;
}

/* --- 详情面板信息网格 --- */
body.inspiration-page .detail-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #faf9f5;
  font-size: 0.78rem;
}

body.inspiration-page .detail-info-grid dt {
  color: #6e6b63;
  font-weight: 500;
}

body.inspiration-page .detail-info-grid dd {
  color: #1f1e1d;
  font-weight: 600;
  margin: 0;
}

/* --- 空状态增强 --- */
body.inspiration-page .inspiration-empty-state .empty-actions {
  display: inline-flex;
  gap: 8px;
  margin-top: 4px;
}

/* --- 单条提示 --- */
body.inspiration-page .inspiration-single-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background: #faf9f5;
  color: #6e6b63;
  font-size: 0.8rem;
  text-align: center;
  justify-content: center;
  margin-bottom: 10px;
}

/* --- 暗色主题覆盖 --- */
html[data-theme="dark"] body.inspiration-page .inspiration-data-overview {
  background: var(--surface-muted);
  border-color: var(--color-border);
}

html[data-theme="dark"] .overview-stat .stat-count {
  color: var(--text-main);
}

html[data-theme="dark"] .overview-divider {
  background: var(--color-border);
}

html[data-theme="dark"] .inspiration-cover.cover-missing {
  background: linear-gradient(135deg, #33322f, #44423c);
}

html[data-theme="dark"] .inspiration-cover.cover-missing .cover-missing-icon {
  color: #6e6b63;
}

html[data-theme="dark"] .card-bottom-bar {
  border-top-color: var(--color-border);
}

html[data-theme="dark"] .card-status-badge {
  background: var(--surface-strong);
  color: var(--text-muted);
}

html[data-theme="dark"] .card-action-buttons .icon-btn {
  background: var(--surface-muted);
  color: var(--text-muted);
}

html[data-theme="dark"] body.inspiration-page .detail-info-grid {
  background: var(--surface-muted);
}

html[data-theme="dark"] body.inspiration-page .detail-info-grid dt {
  color: var(--text-muted);
}

html[data-theme="dark"] body.inspiration-page .detail-info-grid dd {
  color: var(--text-main);
}

html[data-theme="dark"] body.inspiration-page .inspiration-single-hint {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-muted);
}

html[data-theme="dark"] body.inspiration-page .inspiration-empty-state .empty-actions .btn {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

/* ========== 灵感选题 UI 优化 - 新增组件 END ========== */

.inspiration-modal,
.upload-modal,
.profile-history-dialog,
.profile-ai-dialog {
  animation: haz127-popover-in 0.18s ease both;
  transform-origin: top right;
}

.inspiration-modal,
.upload-modal,
.profile-history-dialog,
.profile-ai-dialog {
  transform-origin: center;
}

@keyframes haz127-popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html[data-theme="dark"] .input-field,
html[data-theme="dark"] .textarea-field,
html[data-theme="dark"] .select-field {
  background: var(--surface-muted);
  border-color: var(--color-border);
  color: var(--text-main);
}

html[data-theme="dark"] .input-field::placeholder,
html[data-theme="dark"] .textarea-field::placeholder {
  color: #98938a;
}

html[data-theme="dark"] .compact-icon-action,
html[data-theme="dark"] body.inspiration-page .detail-primary-actions .compact-icon-action,
html[data-theme="dark"] .card-quick-actions .icon-btn,
html[data-theme="dark"] body.inspiration-page .favorite-toggle,
html[data-theme="dark"] body.inspiration-page .preview-toggle {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--color-border));
  color: var(--text-main);
}

html[data-theme="dark"] .compact-icon-action:hover,
html[data-theme="dark"] .card-quick-actions .icon-btn:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 48%, var(--color-border));
  color: var(--primary);
}

html[data-theme="dark"] .compact-icon-action.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #141312;
}

html[data-theme="dark"] .compact-icon-action.active {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--warning) 40%, var(--color-border));
  color: #ffd38a;
}

html[data-theme="dark"] .compact-icon-action.danger {
  color: #ff9aa5;
}

html[data-theme="dark"] .dashboard-target-option:hover {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--color-border));
}

@media (max-width: 1320px) {

  body.profile-page .profile-workbench-grid,
  body.copylibrary-page .copylibrary-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.profile-page .profile-context-panel,
  body.copylibrary-page .copylibrary-detail-panel {
    position: static;
    width: 100%;
    max-height: none;
  }

  body.inspiration-page .inspiration-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  body.inspiration-page .inspiration-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-todo-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-target-list {
    max-height: 0;
  }

  .dashboard-target-selector:hover .dashboard-target-list,
  .dashboard-target-selector:focus-within .dashboard-target-list {
    max-height: 208px;
  }

  .copylibrary-action-grid .compact-icon-action,
  .material-action-grid .compact-icon-action,
  .asset-action-grid .compact-icon-action,
  .review-action-stack .compact-icon-action,
  body.inspiration-page .detail-primary-actions .compact-icon-action {
    justify-content: center;
    min-width: 0;
  }

  body.inspiration-page .inspiration-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.inspiration-page .inspiration-card-v2 {
    min-height: 0;
  }
}

/* HAZ-125 settings layout polish.
   Keep settings aligned to the workbench chrome and use consistent card rhythm
   instead of centering a narrow island inside wide desktop viewports. */
body.settings-page {
  --workbench-max: none;
}

body.settings-page .view-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 24px 28px;
}

body.settings-page .settings-workbench {
  width: 100%;
  max-width: 1680px;
  margin: 0;
  gap: 20px;
}

body.settings-page .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

body.settings-page .settings-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

body.settings-page .settings-main-column .settings-template-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.settings-page .settings-provider-card {
  align-self: start;
}

body.settings-page .settings-provider-card .settings-provider-summary,
body.settings-page .settings-provider-config-card .settings-config-readback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

body.settings-page .settings-provider-card .settings-provider-summary::before,
body.settings-page .settings-provider-config-card .settings-config-readback::before {
  content: "";
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

body.settings-page .settings-provider-card .settings-provider-summary span,
body.settings-page .settings-provider-config-card .settings-config-readback span {
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  line-height: 1.2;
}

body.settings-page .settings-provider-card .settings-provider-summary strong,
body.settings-page .settings-provider-card .settings-provider-summary p,
body.settings-page .settings-provider-config-card .settings-config-readback strong,
body.settings-page .settings-provider-config-card .settings-config-readback p {
  margin-top: 0;
  min-width: 0;
}

body.settings-page .settings-provider-card .settings-provider-summary strong,
body.settings-page .settings-provider-config-card .settings-config-readback strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.settings-page .settings-provider-card .settings-provider-summary p,
body.settings-page .settings-provider-config-card .settings-config-readback p {
  grid-column: 2;
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.settings-page .settings-provider-config-card .settings-config-footnote {
  margin-top: 10px;
}

body.settings-page .settings-env-list code {
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
}

body.settings-page .settings-test-row {
  align-items: center;
  flex-wrap: wrap;
}

body.settings-page .settings-test-row .btn {
  flex: 0 0 auto;
}

body.settings-page .settings-test-result {
  flex: 1 1 220px;
}

body.settings-page .settings-hero {
  position: relative;
  overflow: hidden;
  min-height: 80px;
  padding: 22px 26px;
  border-color: var(--color-border);
  background: var(--surface-muted);
  box-shadow: none;
}

body.settings-page .settings-hero h1 {
  font-size: 20px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-overview-card,
.settings-map-item {
  min-width: 0;
  border: 0;
  background: transparent;
}

.settings-overview-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 3px 12px;
  min-height: 104px;
  align-content: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--color-border) 84%, transparent);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 68%, transparent), transparent),
    var(--color-card);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.settings-overview-card::before {
  content: "";
  grid-row: 1 / span 3;
  align-self: start;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, currentColor 0 4px, transparent 5px),
    color-mix(in srgb, currentColor 13%, var(--color-card));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 28%, transparent);
}

.settings-overview-card.ok::before {
  color: var(--accent);
}

.settings-overview-card.warn::before {
  color: var(--warning);
}

.settings-overview-card.neutral::before {
  color: var(--primary);
}

.settings-overview-card span,
.settings-map-item span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.settings-overview-card strong,
.settings-map-item strong {
  min-width: 0;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-overview-card strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--weight-bold);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.settings-overview-card p {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.settings-overview-card span,
.settings-overview-card strong,
.settings-overview-card p {
  grid-column: 2;
}

.settings-overview-card.ok {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--color-border));
}

.settings-overview-card.warn {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--color-border));
}

.settings-overview-card.neutral {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--color-border));
}

body.settings-page .settings-card {
  padding: 20px;
  box-shadow: none;
}

body.settings-page .settings-card-head {
  align-items: flex-start;
}

body.settings-page .settings-card-head .btn {
  flex: 0 0 auto;
}

.settings-theme-card .theme-choice-row {
  gap: 12px;
}

.settings-theme-card .theme-choice {
  position: relative;
  min-height: 86px;
  overflow: hidden;
  padding: 16px;
  background: var(--surface-muted);
  transition: border-color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.settings-theme-card .theme-choice:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.settings-theme-card .theme-choice.active {
  background: var(--color-card);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--color-border));
  color: var(--text-main);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--primary) 58%, transparent);
}

.settings-theme-card .theme-choice.active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.settings-map-card {
  background: var(--color-card);
}

.settings-map-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
}

.settings-map-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
}

.settings-map-item:last-child {
  border-bottom: 0;
}

.settings-map-item.ok,
.settings-map-item.warn {
  border-color: var(--color-border);
}

body.settings-page .settings-provider-summary,
body.settings-page .settings-config-readback,
body.settings-page .ai-status-note {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 2px 12px;
  margin-top: 12px;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--color-border));
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warning) 8%, transparent), transparent),
    var(--color-card);
  color: var(--text-muted);
}

body.settings-page .settings-provider-summary.ok,
body.settings-page .settings-config-readback.ok,
body.settings-page .ai-status-note.ok {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--color-border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--color-card);
  color: var(--text-muted);
}

body.settings-page .settings-config-readback.neutral {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--color-border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent),
    var(--color-card);
  color: var(--text-muted);
}

body.settings-page .settings-provider-summary::before,
body.settings-page .settings-config-readback::before,
body.settings-page .ai-status-note::before {
  content: "";
  grid-row: 1 / span 3;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, currentColor 0 4px, transparent 5px),
    color-mix(in srgb, currentColor 13%, var(--color-card));
  color: var(--warning);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 28%, transparent);
}

body.settings-page .settings-provider-summary.ok::before,
body.settings-page .settings-config-readback.ok::before,
body.settings-page .ai-status-note.ok::before {
  color: var(--accent);
}

body.settings-page .settings-config-readback.neutral::before {
  color: var(--primary);
}

body.settings-page .settings-provider-summary strong,
body.settings-page .settings-config-readback strong,
body.settings-page .ai-status-note strong {
  grid-column: 2;
  margin-top: 1px;
  font-size: 15px;
  line-height: 1.25;
}

body.settings-page .settings-provider-summary span,
body.settings-page .settings-config-readback span,
body.settings-page .ai-status-note span {
  grid-column: 2;
  color: var(--text-subtle);
  font-weight: 600;
}

body.settings-page .settings-provider-summary p,
body.settings-page .settings-config-readback p,
body.settings-page .ai-status-note p {
  grid-column: 2;
}

body.settings-page .settings-archive-card {
  padding: 18px 20px;
}

body.settings-page .settings-archive-summary {
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.settings-page .settings-archive-summary:hover,
body.settings-page .settings-archive-summary:focus-visible,
body.settings-page .settings-archive-card[open] .settings-archive-summary {
  background: transparent;
  box-shadow: none;
}

body.settings-page .settings-archive-count {
  min-height: 24px;
  border-color: var(--color-border);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 600;
}

.workbench-empty {
  border-style: dashed;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--secondary) 58%, var(--color-card)), var(--color-card));
}

.compact-empty {
  align-items: flex-start;
  padding: 18px;
  text-align: left;
}

.compact-empty strong {
  color: var(--text-main);
  font-size: 14px;
}

.compact-empty p {
  margin-top: 4px;
  line-height: 1.55;
}

.muted-pill {
  color: var(--text-muted);
}

@media (max-width: 1180px) {
  body.settings-page .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.settings-page .settings-main-column .settings-template-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {

  body.settings-page .settings-grid,
  .settings-overview,
  body.settings-page .settings-main-column .settings-template-form {
    grid-template-columns: minmax(0, 1fr);
  }

  body.settings-page .settings-provider-card .settings-provider-summary,
  body.settings-page .settings-provider-config-card .settings-config-readback {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.settings-page .settings-provider-card .settings-provider-summary,
  body.settings-page .settings-provider-config-card .settings-config-readback {
    align-items: center;
  }

  .settings-archive-summary,
  body.settings-page .settings-archive-card .profile-archived-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-archive-count {
    justify-self: start;
  }

  body.settings-page .settings-archive-card .profile-restore-btn {
    justify-self: stretch;
    width: 100%;
  }
}

/* ========== Workbench First-Run Guidance ========== */
.dashboard-next-step-card,
.profile-start-panel,
body.inspiration-page .inspiration-start-empty {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--color-border));
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-card) 92%, white), var(--color-card));
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

.dashboard-next-step-card::before,
.profile-start-panel::before,
body.inspiration-page .inspiration-start-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 34%);
}

.dashboard-next-step-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.95fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
}

.dashboard-next-copy,
.dashboard-next-progress,
.dashboard-next-actions,
.profile-start-copy,
.profile-start-checks,
.profile-start-actions,
body.inspiration-page .inspiration-start-copy,
body.inspiration-page .inspiration-start-actions,
body.inspiration-page .inspiration-start-flow {
  position: relative;
  z-index: 1;
}

.dashboard-next-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 6px;
  color: color-mix(in srgb, var(--primary) 82%, var(--text-main));
  font-size: 0.72rem;
  font-weight: 800;
}

.dashboard-next-copy h2,
.profile-start-copy h3,
body.inspiration-page .inspiration-start-copy h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.03rem;
  line-height: 1.32;
}

.dashboard-next-copy p,
.profile-start-copy p,
body.inspiration-page .inspiration-start-copy p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.dashboard-next-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-next-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
}

.dashboard-next-step i,
body.inspiration-page .inspiration-start-flow i {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
}

.dashboard-next-step.done i,
.dashboard-next-step.current i {
  background: color-mix(in srgb, var(--primary) 12%, var(--color-card));
  color: var(--primary);
}

.dashboard-next-step.current {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--color-border));
  background: color-mix(in srgb, var(--primary) 8%, var(--color-card));
}

.dashboard-next-step b,
body.inspiration-page .inspiration-start-flow b {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-next-step em,
body.inspiration-page .inspiration-start-flow em {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-next-actions,
.profile-start-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-btn.recommended {
  border-color: color-mix(in srgb, var(--color-border) 70%, transparent);
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 38%, var(--color-card, #fff));
}

.quick-btn.recommended .quick-btn-icon {
  color: inherit;
}

.profile-start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.profile-start-checks {
  display: grid;
  gap: 8px;
}

.profile-start-checks span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-start-checks i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 82%, var(--primary));
}

.profile-start-checks span.ok i {
  background: color-mix(in srgb, var(--color-success) 80%, var(--primary));
}

.profile-start-checks em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 650;
}

body.inspiration-page .inspiration-workbench.inspiration-start-mode {
  grid-template-columns: minmax(0, 1fr);
}

body.inspiration-page .inspiration-start-empty {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: stretch;
  min-height: 360px;
  padding: 22px;
}

body.inspiration-page .inspiration-start-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.inspiration-page .inspiration-start-action {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-card) 90%, var(--surface-muted));
  color: var(--text-main);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

body.inspiration-page .inspiration-start-action:hover,
body.inspiration-page .inspiration-start-action:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--color-border));
  background: color-mix(in srgb, var(--primary) 7%, var(--color-card));
}

body.inspiration-page .inspiration-start-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

body.inspiration-page .inspiration-start-action.primary span {
  background: color-mix(in srgb, var(--primary) 13%, var(--color-card));
  color: var(--primary);
}

body.inspiration-page .inspiration-start-action strong {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.35;
}

body.inspiration-page .inspiration-start-action em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.82rem;
  line-height: 1.62;
}

body.inspiration-page .inspiration-start-advice {
  display: grid;
  gap: 8px;
  max-width: 540px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--color-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 8%, var(--color-card));
}

body.inspiration-page .inspiration-start-advice strong {
  color: var(--text-main);
  font-size: 0.88rem;
}

body.inspiration-page .inspiration-start-advice span {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.58;
}

body.inspiration-page .inspiration-start-advice .btn {
  justify-self: start;
}

body.inspiration-page .inspiration-start-flow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

body.inspiration-page .inspiration-start-flow span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

html[data-theme="dark"] .dashboard-next-step-card,
html[data-theme="dark"] .profile-start-panel,
html[data-theme="dark"] body.inspiration-page .inspiration-start-empty {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--color-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 72%, var(--color-card)), var(--color-card));
}

html[data-theme="dark"] .dashboard-next-step,
html[data-theme="dark"] body.inspiration-page .inspiration-start-flow span,
html[data-theme="dark"] body.inspiration-page .inspiration-start-action {
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  border-color: var(--color-border);
}

html[data-theme="dark"] .quick-btn.recommended {
  background: color-mix(in srgb, var(--surface-muted) 38%, var(--color-card));
}

html[data-theme="dark"] body.inspiration-page .inspiration-start-action:hover,
html[data-theme="dark"] body.inspiration-page .inspiration-start-action:focus-visible {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-muted));
}

html[data-theme="dark"] body.inspiration-page .inspiration-start-advice {
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--warning) 24%, var(--color-border));
}

@media (max-width: 1180px) {
  .dashboard-next-step-card,
  .profile-start-panel,
  body.inspiration-page .inspiration-start-empty {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-next-actions,
  .profile-start-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .dashboard-next-progress,
  body.inspiration-page .inspiration-start-actions,
  body.inspiration-page .inspiration-start-flow {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   R9 · Dashboard 1:1 复刻设计稿
   参考：HAZ-169 R9 用户提供的 ChatGPT 设计图（hero / kpi / 4-col kanban / bottom）
   规则：自带命名空间 .dash-r9-*，不破老 .dashboard-* 类；尽量复用 token。
   ========================================================================== */

/* R13：板块纵向间距标度 = 16px（4px 基线档之一）。
   提高选择器特异性盖过 dashboard-themes.css 里 `body[data-dashboard] .dashboard-wrapper { gap: 0 }`，
   R10–R12 期间 14px gap 一直未生效（Lao Li 1440 实测 0/0/0 抓出）。
   横向 gutter 10px 是 R10 列对齐主轴（hero-card 770 = 4×185 + 3×10），不收进 4px 标度。 */
body[data-dashboard] .dash-r9-page,
.dash-r9-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 24px;
  width: 100%;
  min-width: 0;
}

.dash-r9-tone-warn { --r9-tone: var(--primary, #d8704a); --r9-tone-soft: color-mix(in srgb, var(--primary, #d8704a) 12%, var(--color-card, #fff)); }
.dash-r9-tone-accent { --r9-tone: var(--primary, #d8704a); --r9-tone-soft: color-mix(in srgb, var(--primary, #d8704a) 10%, var(--color-card, #fff)); }
.dash-r9-tone-good { --r9-tone: #6aa455; --r9-tone-soft: color-mix(in srgb, #6aa455 12%, var(--color-card, #fff)); }
.dash-r9-tone-info { --r9-tone: #5a89b8; --r9-tone-soft: color-mix(in srgb, #5a89b8 10%, var(--color-card, #fff)); }
.dash-r9-tone-neutral { --r9-tone: var(--text-muted, #6e6b63); --r9-tone-soft: var(--surface-muted, #f3f1ea); }

/* ── ① Hero row（R14 重排）：6 列栅格三宫格，hero / KPI / IP 各占 2 列。
       按老板手绘标注：hero 缩窄、KPI 上移到中宫、IP 卡上移到右宫，原 hero CTA 移到第 5 列「快捷开始」。
       gutter 保持 10px（R10 列对齐主轴），高度压在 ~140-160px 之间。 ── */
.dash-r9-hero-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.dash-r9-hero-card {
  grid-column: span 2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 34%, var(--color-card, #fff));
  border: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 86%, transparent);
  overflow: hidden;
  min-height: 100px;
}

.dash-r9-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.dash-r9-hero-chip {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 78%, var(--color-card, #fff));
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.dash-r9-hero-card h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.dash-r9-hero-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-r9-hero-art {
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #d8704a);
  opacity: 0.7;
}

/* R14：hero CTA 整块下线（按钮迁去第 5 列「快捷开始」），保留 .dash-r9-hero-cta-primary/secondary
   token 仅作兼容，没新调用方。 */

/* ── ② KPI 6 卡条
   R10 默认：单独成行的 6 列横条。
   R14 新增 .dash-r9-kpi-tiles-compact 子状态：嵌入 row-1 中宫格（span 2），3 列 × 2 行紧凑栅格。 ── */
.dash-r9-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact {
  grid-column: span 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-tile {
  padding: 6px 10px;
  border-radius: 10px;
  gap: 8px;
  min-height: 0;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-icon svg {
  width: 16px;
  height: 16px;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-meta em {
  font-size: 0.66rem;
  line-height: 1.2;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-meta b {
  font-size: 0.92rem;
  line-height: 1.2;
}

.dash-r9-kpi-strip.dash-r9-kpi-tiles-compact .dash-r9-kpi-meta b span {
  font-size: 0.66rem;
}

.dash-r9-kpi-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e6e2d6);
  min-width: 0;
}

.dash-r9-kpi-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--r9-tone-soft);
  color: var(--r9-tone);
}

.dash-r9-kpi-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-r9-kpi-meta em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dash-r9-kpi-meta b {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.005em;
}

.dash-r9-kpi-meta b span {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ── ③ 看板（R14：4 列 → 5 列，加入第 5 列「快捷开始」） ── */
.dash-r9-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.dash-r9-kanban-col {
  display: flex;
  flex-direction: column;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e6e2d6);
  border-radius: 14px;
  min-height: 280px;
  min-width: 0;
}

.dash-r9-kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 65%, transparent);
}

.dash-r9-kanban-head-title {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.dash-r9-kanban-head-title strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.dash-r9-kanban-head-count {
  font-size: 0.78rem;
  color: var(--r9-tone);
  font-weight: 600;
}

.dash-r9-kanban-head-action {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--r9-tone-soft);
  color: var(--r9-tone);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.dash-r9-kanban-head-action:hover {
  background: color-mix(in srgb, var(--r9-tone) 18%, var(--color-card, #fff));
}

.dash-r9-kanban-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

/* R14（老板第 4 条）：4 列网格 = bullet + title + pill + 三点。pill 跟「···」
   原本因为 3 列网格被推到下一行（绿勾下方），改 4 列后跟状态同一行，已完成列
   立刻紧凑。 */
.dash-r9-kanban-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.dash-r9-kanban-item:hover {
  background: color-mix(in srgb, var(--text-main, #2c2a26) 4%, var(--color-card, #fff));
}

.dash-r9-kanban-bullet {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--r9-tone);
  background: var(--r9-tone-soft);
  flex: 0 0 18px;
}

.dash-r9-kanban-item-title {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.dash-r9-kanban-item-title.is-done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.dash-r9-kanban-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 4px;
}

.dash-r9-kanban-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--r9-tone-soft);
  color: var(--r9-tone);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.dash-r9-kanban-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dash-r9-kanban-foot {
  padding: 8px 12px;
  border-top: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 55%, transparent);
}

.dash-r9-kanban-foot-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--primary, #d8704a);
  font-size: 0.74rem;
  cursor: pointer;
}

.dash-r9-kanban-foot-link:hover {
  text-decoration: underline;
}

/* ── ④ R14：原 .dash-r9-bottom-row 整块下线（IP 上移到 row-1 右宫，快捷开始拆进看板第 5 列）。
       保留 .dash-r9-ip-card 基本骨架以承载 row-1 紧凑变体；旧 .dash-r9-quick-card 暂留兜底但默认不会渲染。 ── */
.dash-r9-ip-card,
.dash-r9-quick-card {
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e6e2d6);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dash-r9-ip-card.dash-r9-ip-card-compact {
  grid-column: span 2;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-body-compact {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-meta h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-meta p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-tags {
  margin-top: 0;
}

.dash-r9-ip-card.dash-r9-ip-card-compact .dash-r9-ip-cta {
  align-self: stretch;
  margin-top: 2px;
}

.dash-r9-ip-head strong,
.dash-r9-quick-head strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.dash-r9-ip-body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.dash-r9-ip-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary, #d8704a) 0%, color-mix(in srgb, var(--primary, #d8704a) 70%, #fff) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dash-r9-ip-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dash-r9-ip-meta-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-r9-ip-meta-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.dash-r9-ip-current-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #d8704a) 16%, transparent);
  color: var(--primary, #d8704a);
  font-size: 0.66rem;
  font-weight: 600;
}

.dash-r9-ip-meta p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.dash-r9-ip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.dash-r9-ip-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-muted, #f3f1ea);
  color: var(--text-muted);
  font-size: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 70%, transparent);
}

.dash-r9-ip-cta {
  align-self: center;
  white-space: nowrap;
  border-radius: 10px !important;
  min-height: 32px !important;
  padding: 4px 14px !important;
}

.dash-r9-ip-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 60%, transparent);
}

.dash-r9-ip-stat em {
  font-style: normal;
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dash-r9-ip-stat b {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* R12：从 3 列 → 2 列 × 3 行（1366 笔记本下 4 字 label 反截断）。
   R13：gap 8 → 10，对齐主 6 列横向 gutter 标度。
   R14：默认 grid 在 row-1 已经没有调用方（旧 bottom-row 下线）。新增
        .dash-r9-quick-grid-inkanban 状态供看板第 5 列内嵌使用：2 列 × 4 行的 8 tile 紧凑栅格。 */
.dash-r9-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dash-r9-quick-grid.dash-r9-quick-grid-inkanban {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  flex: 1 1 auto;
}

/* R14：嵌入看板第 5 列时，tile 改为 icon 上 / label 下（垂直堆叠），让 label 拿到整 tile 的宽度，
   1366 笔记本宽 5 列 × 4 字 label 不再被 ellipsis 切。 */
.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 4px;
  min-height: 40px;
  gap: 2px;
  border-radius: 8px;
}

.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile-icon svg {
  width: 14px;
  height: 14px;
}

.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile-label {
  font-size: 0.72rem;
  line-height: 1.2;
}

/* R14：CTA tile 保持与其余快捷入口同一轻量层级，只靠 hover 表达可操作性。 */
.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile-accent {
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 38%, var(--color-card, #fff));
  border-color: color-mix(in srgb, var(--color-border, #e6e2d6) 64%, transparent);
}

.dash-r9-quick-grid.dash-r9-quick-grid-inkanban .dash-r9-quick-tile-accent .dash-r9-quick-tile-icon {
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 72%, var(--color-card, #fff));
}

.dash-r9-quick-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 38%, var(--color-card, #fff));
  border: 1px solid color-mix(in srgb, var(--color-border, #e6e2d6) 64%, transparent);
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
  min-width: 0;
  min-height: 40px;
}

.dash-r9-quick-tile:hover {
  background: color-mix(in srgb, var(--primary-soft, #eeeeea) 20%, var(--color-card, #fff));
  border-color: color-mix(in srgb, var(--primary, #d8704a) 20%, var(--color-border, #e6e2d6));
  transform: translateY(-1px);
}

.dash-r9-quick-tile-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted, #f1f1ee) 72%, var(--color-card, #fff));
  color: var(--text-muted);
}

.dash-r9-quick-tile-icon svg {
  width: 18px;
  height: 18px;
}

.dash-r9-quick-tile-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── 响应式（R14）：≤1280 hero-row 3 宫格折成 2 行（hero+KPI 同行 span 3，IP 卡占满下一行）；
       看板保持 5 列（每列收窄到 ~190px 仍能装下紧凑 4 字 chip）；≤760 全部单列 ── */
@media (max-width: 1280px) {
  .dash-r9-hero-card { grid-column: span 3; }
  .dash-r9-kpi-strip.dash-r9-kpi-tiles-compact { grid-column: span 3; }
  .dash-r9-ip-card.dash-r9-ip-card-compact { grid-column: 1 / -1; }
  .dash-r9-kpi-strip:not(.dash-r9-kpi-tiles-compact) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dash-r9-hero-row,
  .dash-r9-kpi-strip,
  .dash-r9-kanban,
  .dash-r9-bottom-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .dash-r9-hero-card,
  .dash-r9-ip-card.dash-r9-ip-card-compact,
  .dash-r9-kpi-strip.dash-r9-kpi-tiles-compact { grid-column: 1 / -1; }
  .dash-r9-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-r9-ip-card,
  .dash-r9-quick-card { grid-column: 1 / -1; }
  .dash-r9-ip-body {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .dash-r9-ip-cta {
    grid-column: 1 / -1;
    justify-self: start;
  }
  /* R12：≤760 也走默认 2 列，不再单独覆盖 */
}

/* 兑换码 / 通行证弹窗（老板拍板 2026-06-18）：复用 feedback-modal 的遮罩+卡片外壳，这里补内部布局 */
.redeem-modal {
  max-width: 880px;
  width: 100%;
}
.redeem-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.redeem-modal-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-main, #1f1e1d);
}
.redeem-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 473px;
}
.redeem-modal-ent {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #6e6b63);
}
.redeem-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.redeem-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #6e6b63);
}
.redeem-submit {
  align-self: flex-start;
}
.redeem-modal-msg {
  margin: 0;
  font-size: 13px;
}
.redeem-modal-msg.ok {
  color: #1a7f37;
}
.redeem-modal-msg.err {
  color: #d1242f;
}
.redeem-modal-buy {
  border-top: 1px solid var(--color-border, #ebdfda);
  padding-top: 16px;
}
.redeem-modal-buy h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-main, #1f1e1d);
}
.redeem-modal-buy p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #6e6b63);
}
.redeem-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}
.redeem-entry-card {
  padding: 18px;
  border: 1px solid var(--color-border, #ebdfda);
  border-radius: var(--radius-md, 10px);
  background: var(--color-card, #ffffff);
}
.redeem-form.redeem-entry-card {
  min-height: 246px;
  justify-content: center;
}
.redeem-modal-buy.redeem-entry-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--color-border, #ebdfda);
}
.redeem-modal-buy.redeem-entry-card .btn {
  margin-top: auto;
  justify-content: center;
}
.sidebar-redeem-button .nav-icon svg {
  display: block;
}

/* HAZ-200 P2 Demo：通行证弹窗两 tab + 订阅档位三卡片（占位，不接支付） */
.redeem-modal--wide {
  max-width: 880px;
}
.redeem-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border, #ebdfda);
  border-radius: var(--radius-md, 10px);
  background: var(--secondary, #f7f3ee);
}
.redeem-tab {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--text-muted, #6e6b63);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.redeem-tab:hover {
  color: var(--text-main, #1f1e1d);
}
.redeem-tab.is-active {
  background: var(--color-card, #ffffff);
  color: var(--text-main, #1f1e1d);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.redeem-tab .phosphor-icon {
  font-size: 16px;
}
.redeem-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.redeem-tab-panel--subscribe {
  gap: 12px;
}

.sub-plan-demo-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm, 6px);
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
}
.sub-plan-intro {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}
.sub-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.sub-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 16px;
  border: 1px solid var(--color-border, #ebdfda);
  border-radius: var(--radius-md, 10px);
  background: var(--color-card, #ffffff);
  min-width: 0;
}
.sub-plan-card.is-featured {
  border-color: var(--primary-accent, #b45309);
  box-shadow: 0 6px 22px rgba(180, 83, 9, 0.12);
}
.sub-plan-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-accent, #b45309);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sub-plan-badge .phosphor-icon {
  font-size: 12px;
}
.sub-plan-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sub-plan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--secondary, #f7f3ee);
  color: var(--text-main, #1f1e1d);
}
.sub-plan-icon .phosphor-icon {
  font-size: 18px;
}
.sub-plan-card.is-featured .sub-plan-icon {
  background: rgba(180, 83, 9, 0.12);
  color: var(--primary-accent, #b45309);
}
.sub-plan-head h4 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main, #1f1e1d);
}
.sub-plan-tagline {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #6e6b63);
}
.sub-plan-credits {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--secondary, #f7f3ee);
}
.sub-plan-credits strong {
  font-family: var(--font-numeric, var(--font-mono, ui-monospace));
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-main, #1f1e1d);
}
.sub-plan-credits span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6e6b63);
}
.sub-plan-credits span .phosphor-icon {
  font-size: 13px;
}
.sub-plan-placeholder-tag {
  font-size: 11px;
  font-style: normal;
  color: #b45309;
  letter-spacing: 0.04em;
}
.sub-plan-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sub-plan-price strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main, #1f1e1d);
}
.sub-plan-price span {
  font-size: 12px;
  color: var(--text-muted, #6e6b63);
}
.sub-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sub-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-main, #1f1e1d);
  line-height: 1.45;
}
.sub-plan-features li .phosphor-icon {
  margin-top: 2px;
  color: var(--primary-accent, #b45309);
  font-size: 13px;
}
.sub-plan-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

@media (max-width: 760px) {
  .redeem-modal--wide {
    max-width: 440px;
  }
  .redeem-modal-body {
    min-height: auto;
  }
  .redeem-entry-grid {
    grid-template-columns: 1fr;
  }
  .sub-plan-grid {
    grid-template-columns: 1fr;
  }
  .sub-plan-badge {
    top: -10px;
    right: 12px;
  }
}

/* HAZ-248 visual acceptance: keep dense profile chips from stretching the paired field row. */
body.profile-page .profile-form-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

body.profile-page .tag-field {
  max-height: 104px;
  align-items: flex-start;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body.profile-page .tag-list {
  align-content: flex-start;
}

/* Keep profile tags readable as compact hashtag text instead of large pills. */
body.profile-page .tag-chip {
  height: auto;
  min-height: 22px;
  padding: 0;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 12px;
}

body.profile-page .tag-chip-text {
  max-width: 160px;
}

body.profile-page .tag-chip-text::before,
body.profile-page .profile-summary-chips em::before {
  content: "#";
  color: var(--text-subtle);
}

body.profile-page .tag-chip-remove {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  font-size: 12px;
}

body.profile-page .tag-chip-remove:hover,
body.profile-page .tag-chip-remove:focus-visible {
  background: var(--surface-muted);
  color: var(--text-main);
}

body.profile-page .profile-summary-chips em {
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 0.78rem;
}

/* Wide profile summaries should flow by column, not inherit the tallest sibling row. */
@media (min-width: 1800px) {
  body.profile-page .profile-summary-list {
    display: block;
    column-count: 2;
    column-gap: 14px;
    column-fill: balance;
  }

body.profile-page .profile-summary-list > div {
    break-inside: avoid;
    margin-bottom: 10px;
  }
}

@media (max-width: 1024px) {
  body.profile-page .profile-form-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  body.inspiration-page .inspiration-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  body.inspiration-page .inspiration-detail-panel {
    position: static;
    max-height: none;
  }

  body.inspiration-page .inspiration-topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  body.inspiration-page .inspiration-import-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body.profile-page .tag-field {
    max-height: none;
    overflow-y: visible;
  }

  body.profile-page .profile-summary-list {
    column-count: 1;
  }
}
