/*
 * 暖色轻盈工作台 · 统一视觉收口层
 * Warm Editorial Minimalism
 *
 * 原则：内容优先、边界克制、暖而不甜、安静但不寡淡。
 * 只在输入、选择、独立信息单元和高密度数据区保留必要边界。
 */

:root {
  --warm-bg: #faf7f3;
  --warm-bg-deep: #f6f1ec;
  --warm-surface: #fffdfa;
  --warm-surface-muted: #f7f1ec;
  --warm-surface-hover: #fff8f4;
  --warm-ink: #342b27;
  --warm-muted: #746861;
  --warm-faint: #867970;
  --warm-coral: #b34f38;
  --warm-coral-deep: #8f3f2f;
  --warm-coral-soft: #f8eae3;
  --warm-line: #e4d9d1;
  --warm-line-strong: #d8c8be;
  --warm-shadow: 0 10px 28px rgba(75, 50, 38, .055);
  --warm-shadow-modal: 0 24px 68px rgba(53, 38, 31, .15);

  --brand: var(--warm-coral);
  --brand-2: #d9785e;
  --brand-grad: linear-gradient(135deg, #bd573f, #a94733);
  --brand-soft: var(--warm-coral-soft);
  --brand-dark: var(--warm-coral-deep);
  --bg: var(--warm-bg);
  --card: var(--warm-surface);
  --text: var(--warm-ink);
  --text-soft: var(--warm-muted);
  --border: var(--warm-line);
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(75, 50, 38, .04);
  --shadow: var(--warm-shadow);
  --shadow-lift: 0 18px 46px rgba(75, 50, 38, .1);
  --focus-ring: 0 0 0 3px rgba(207, 98, 72, .12);

  /* 功能分类靠文字分辨，图形色统一回到品牌暖色。 */
  --c0: #b85a40; --c0-soft: #f8ebe5;
  --c1: #a7614b; --c1-soft: #f5ebe6;
  --c2: #936451; --c2-soft: #f2ece8;
  --c3: #b06b54; --c3-soft: #f8ede7;
  --c4: #8f6959; --c4-soft: #f3ece8;
}

html,
body {
  background: var(--warm-bg);
  color: var(--warm-ink);
}

body,
body.home-mode,
body.diagnosis-mode {
  background:
    radial-gradient(circle at 12% -8%, rgba(224, 137, 99, .065), transparent 27rem),
    linear-gradient(180deg, #fbf9f6 0%, var(--warm-bg) 58%, #f8f4f0 100%);
}

::selection { background: rgba(207, 98, 72, .2); color: var(--warm-ink); }

/* ---------- 顶栏、按钮与输入 ---------- */
.topbar,
body.home-mode .topbar,
body.diagnosis-mode .topbar {
  border-bottom-color: rgba(218, 204, 195, .78);
  background: rgba(255, 253, 250, .95);
  box-shadow: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar .logo .dot,
body.home-mode .topbar .logo .dot,
body.diagnosis-mode .topbar .logo .dot,
.login-logo .dot {
  background: linear-gradient(145deg, #e58061, #c95740);
  box-shadow: 0 5px 14px rgba(159, 70, 48, .16);
}

.btn-primary,
.composer .btn-send,
.composer .btn-pause {
  background: var(--brand-grad);
  box-shadow: 0 5px 14px rgba(157, 67, 45, .14);
}

.btn-primary:hover,
.composer .btn-send:hover,
.composer .btn-pause:hover {
  box-shadow: 0 7px 18px rgba(157, 67, 45, .18);
}

.btn-ghost,
.topbar button {
  border-color: var(--warm-line);
  background: var(--warm-surface);
  box-shadow: none;
}

input,
textarea,
select,
.modal input,
.modal textarea,
.modal select {
  border-color: var(--warm-line);
  background: var(--warm-surface);
}

input:focus,
textarea:focus,
select:focus,
.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  border-color: rgba(207, 98, 72, .52);
  background: #fff;
  box-shadow: var(--focus-ring);
}

/* ---------- 弹窗：去掉渐变顶条、玻璃感和重嵌套 ---------- */
.modal-mask {
  background: rgba(52, 42, 37, .28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  border: 1px solid var(--warm-line);
  border-radius: 22px;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow-modal);
}

.modal::before,
.danger-dialog::before { display: none; }

.modal-close,
.skill-editor-modal .modal-close {
  border: 0;
  background: var(--warm-surface-muted);
  box-shadow: none;
}

.modal-close:hover { background: var(--warm-coral-soft); color: var(--warm-coral-deep); }

.modal .modal-btns {
  border-top-color: var(--warm-line);
  background: var(--warm-surface);
  backdrop-filter: none;
}

.modal small { color: #6b5f58; }

.skill-editor-head {
  border-bottom-color: var(--warm-line);
  background: var(--warm-surface);
}

.modal.skill-editor-modal { background: var(--warm-surface); }

/* ---------- 专项功能选择：从卡片墙改为编辑式清单 ---------- */
.task-picker-modal { padding: 28px 30px 24px; }
.task-picker-head > span { color: var(--warm-coral-deep); }
.task-picker-head > p { color: var(--warm-muted); }

.modal .task-picker-search {
  border-color: var(--warm-line);
  border-radius: 12px;
  background: #fff;
}

.task-picker-filters { padding-bottom: 13px; border-bottom: 1px solid var(--warm-line); }

.task-picker-filters button {
  border-color: transparent;
  background: transparent;
  color: var(--warm-muted);
}

.task-picker-filters button:hover { background: var(--warm-surface-muted); }
.task-picker-filters button.active {
  border-color: transparent;
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
}

.task-picker-results { margin-top: 4px; padding: 0; }
.task-picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 0;
}

.task-picker-item {
  min-height: 82px;
  padding: 13px 4px;
  border: 0;
  border-bottom: 1px solid var(--warm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color .16s ease, color .16s ease;
}

.task-picker-item:hover,
.task-picker-item:focus-visible {
  border-color: var(--warm-line);
  border-radius: 10px;
  background: var(--warm-surface-hover);
  box-shadow: none;
  transform: none;
}

.task-picker-item-icon {
  background: #f7e9e2;
  color: #ad5b43;
}

.task-picker-item:hover .task-picker-item-icon,
.task-picker-item:focus-visible .task-picker-item-icon {
  background: #f4dfd6;
  color: #94432f;
  transform: none;
}

/* ---------- 主页与任务侧栏 ---------- */
.workspace-overview-main,
.workspace-overview-page .workspace-overview-main,
.chat-main,
.poster-workspace-main {
  background:
    radial-gradient(circle at 15% 0%, rgba(232, 157, 119, .045), transparent 24rem),
    var(--warm-bg);
}

.workspace-overview-page .workspace-conversation-start::before,
.workspace-welcome::before {
  background: radial-gradient(circle, rgba(255,255,255,.8), rgba(244,235,228,.22) 52%, transparent 74%);
}

.workspace-conversation-start .workspace-start-card,
.workspace-conversation-start .workspace-start-card.special,
.workspace-conversation-start .workspace-profile-entry {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .72);
  box-shadow: none;
}

.workspace-conversation-start .workspace-start-card:hover:not(:disabled),
.workspace-conversation-start .workspace-start-card:focus-visible,
.workspace-conversation-start .workspace-start-card.special:hover,
.workspace-conversation-start .workspace-start-card.special:focus-visible {
  border-color: #d5b7a7;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow), var(--focus-ring);
}

.workspace-conversation-start .workspace-start-mark,
.workspace-conversation-start .workspace-start-card.special .workspace-start-mark,
.workspace-conversation-start .workspace-profile-entry .workspace-start-mark {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
}

.chat-sidebar,
.workspace-sidebar {
  border-right-color: var(--warm-line);
  background: var(--warm-bg);
  box-shadow: none;
  backdrop-filter: none;
}

.chat-session-row.active,
.chat-session-item.active { background: #f5e9e3; }

.chat-business-context > .business-context-button,
.expression-style-context-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.chat-business-context > .business-context-button:hover,
.expression-style-context-button:hover {
  border-color: transparent;
  background: var(--warm-surface-muted);
}

.expression-style-context-button.is-empty { border-style: solid; }

.composer {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .97);
  box-shadow: 0 8px 28px rgba(75, 50, 38, .07);
}

.quick-replies button,
.topic-result-actions button {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .8);
  box-shadow: none;
}

.quick-replies .quick-reply-option,
.quick-replies .quick-reply-other-trigger,
.quick-replies.multiple .quick-reply-option,
.quick-replies.multiple .quick-reply-option:not(.quick-reply-other-trigger) {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .82);
  color: var(--warm-coral-deep);
  box-shadow: none;
}

.quick-replies .quick-reply-option:hover,
.quick-replies .quick-reply-option:focus-visible {
  border-color: #d5b7a7;
  background: var(--warm-surface-hover);
}

/* ---------- 海报专项：去紫、去装饰水印、减少框套框 ---------- */
.poster-tool .tool-head {
  margin-bottom: 20px;
  padding: 4px 0 20px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--warm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.poster-tool .tool-head::after { display: none; }

.tool-head .skill-icon,
.poster-tool .tool-head .skill-icon {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
  box-shadow: none;
}

.tool-panel,
.poster-result {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .86);
  box-shadow: none;
}

.poster-engine-lab {
  margin: 18px -20px 0;
  padding: 20px;
  border: 0;
  border-top: 1px solid var(--warm-line);
  border-bottom: 1px solid var(--warm-line);
  border-radius: 0;
  background: var(--warm-surface-muted);
  box-shadow: none;
}

.poster-engine-lab-head span { color: var(--warm-coral-deep); }
.poster-engine-lab-head b { color: var(--warm-ink); }
.poster-engine-lab-head small,
.poster-engine-meta,
.poster-engine-meta small { color: var(--warm-muted); }
.poster-engine-meta b { color: #6d5145; }

.poster-result-empty > span,
.poster-generation-meta,
.poster-result .poster-preview-badge {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
}

.poster-result-empty li i,
.poster-generation-progress i,
.poster-progress-bar > i { background: var(--brand-grad); }

/* ---------- 个人事业档案：章节有边界，章节内部不再卡片套卡片 ---------- */
body.profile-mode,
.profile-page {
  background:
    radial-gradient(circle at 12% 0%, rgba(230, 151, 113, .05), transparent 25rem),
    var(--warm-bg);
}

.profile-anchor-nav {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .95);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.profile-anchor-links { background: var(--warm-surface-muted); }

.profile-shell > .profile-panel,
.profile-shell > #profile-core-product-root > .profile-panel,
.profile-shell > #profile-expression-style-root > .profile-panel,
.profile-shell > #profile-achievements-root > .profile-panel {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .88);
  box-shadow: none;
}

.profile-empty-state,
.expression-style-empty {
  min-height: 176px;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--warm-line);
  border-radius: 0;
  background: transparent;
}

.profile-empty-mark,
.expression-style-profile-mark {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
  box-shadow: none;
}

.expression-style-profile-card {
  border-color: var(--warm-line);
  background: var(--warm-surface-muted);
  box-shadow: none;
}

.profile-business-statement > div:first-child,
.profile-completion-card,
.profile-highlight-card,
.profile-full-details,
.expression-style-facts {
  border-color: var(--warm-line);
  background: var(--warm-surface-muted);
  box-shadow: none;
}

.profile-completion-card > i > em { background: var(--brand-grad); }

.profile-editor-section {
  padding: 20px 0 4px;
  border: 0;
  border-top: 1px solid var(--warm-line);
  border-radius: 0;
  background: transparent;
}

.profile-editor-section + .profile-editor-section { margin-top: 16px; }
.profile-editor-section-head > span { background: var(--warm-coral-soft); color: var(--warm-coral-deep); }
.profile-editor-kicker { color: var(--warm-coral-deep); }
.profile-editor-section-head p { color: var(--warm-muted); }
.profile-edit-grid label small { color: #5d524b; }
.profile-editor-discard { color: var(--warm-muted); }
.profile-editor-draft-status { color: #514740; }

.profile-edit-modal .modal-btns,
.profile-editor-actions {
  background: var(--warm-surface);
}

.profile-shell .btn-primary,
.profile-edit-modal .btn-primary {
  box-shadow: 0 5px 14px rgba(157, 67, 45, .12);
}

/* ---------- 个人事业诊断：保留报告感，去掉紫色与黑色科技感 ---------- */
.diagnosis-shell { color: var(--warm-ink); }

.diagnosis-intro {
  border: 1px solid var(--warm-line);
  background: rgba(255, 253, 250, .78);
  box-shadow: none;
}

.diagnosis-intro-preview {
  border-color: var(--warm-line);
  background: var(--warm-surface-muted);
  box-shadow: none;
}

.diagnosis-intro-preview::after { display: none; }

.diagnosis-intro-mark { background: var(--warm-coral-soft); color: var(--warm-coral-deep); }

.diagnosis-preview-result {
  border: 0;
  background: #433630;
  box-shadow: none;
}

.diagnosis-preview-result small { color: #e8aa86; }
.diagnosis-preview-result h2 span { color: #f0c3a6; }

@media (min-width: 821px) {
  .diagnosis-intro {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
    gap: 48px;
  }

  .diagnosis-intro-copy h1 {
    max-width: 10.5em;
    margin: 20px 0 24px;
    font-size: clamp(40px, 3.9vw, 50px);
    line-height: 1.18;
    letter-spacing: -.035em;
  }

  .diagnosis-intro-preview { padding: 30px; }

  .diagnosis-preview-result {
    display: grid;
    min-height: 170px;
    align-content: center;
    margin-top: 32px;
    padding: 28px 30px;
  }

  .diagnosis-preview-result h2 {
    margin-top: 10px;
    font-size: 26px;
    line-height: 1.5;
    letter-spacing: -.02em;
  }

  .diagnosis-preview-result h2 span {
    display: inline-block;
    margin-top: 2px;
  }
}

.diagnosis-wizard,
.diagnosis-review,
.diagnosis-generating,
.diagnosis-report-cover {
  border-color: var(--warm-line);
  background: rgba(255, 253, 250, .82);
  box-shadow: none;
}

.diagnosis-option {
  border-color: var(--warm-line);
  background: var(--warm-surface);
  box-shadow: none;
}

.diagnosis-option:hover,
.diagnosis-option.selected {
  border-color: #d6ad9b;
  background: var(--warm-surface-hover);
  box-shadow: none;
}

.diagnosis-report-section.diagnosis-priority-card,
.diagnosis-report-section.diagnosis-branch-output,
.diagnosis-report-section.diagnosis-action-tool,
.diagnosis-report-section.diagnosis-course-match {
  background: var(--warm-surface-muted);
  box-shadow: inset 3px 0 0 var(--warm-coral);
}

.diagnosis-report-section.diagnosis-hypothesis {
  background: #f3f4ef;
  box-shadow: inset 3px 0 0 #74806a;
}

/* ---------- 管理后台：高密度信息保留面板，但统一为暖色轻边界 ---------- */
.admin-console {
  --ac-bg: var(--warm-bg);
  --ac-panel: var(--warm-surface);
  --ac-line: var(--warm-line);
  --ac-text: var(--warm-ink);
  --ac-muted: var(--warm-muted);
  --ac-coral: var(--warm-coral);
  --ac-coral-soft: var(--warm-coral-soft);
  --ac-violet: #9b624d;
  --ac-violet-soft: #f3eae5;
  background: var(--warm-bg);
}

.ac-sidebar {
  border-right-color: var(--warm-line);
  background: #f8f4f0;
  backdrop-filter: none;
}

.ac-brand > span {
  background: var(--brand-grad);
  box-shadow: none;
}

.ac-nav button.active {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
  box-shadow: inset 3px 0 var(--warm-coral);
}

.ac-nav button.active i {
  background: var(--warm-surface);
  color: var(--warm-coral);
  box-shadow: none;
}

.ac-button {
  background: var(--brand-grad);
  box-shadow: none;
}

.ac-hero-strip {
  border-color: var(--warm-line);
  background: linear-gradient(120deg, var(--warm-surface), #fbf4ef);
  box-shadow: none;
}

.ac-hero-strip::after { display: none; }

.ac-metric,
.ac-panel,
.diagnosis-lead-card {
  border-color: var(--warm-line);
  background: var(--warm-surface);
  box-shadow: none;
}

.ac-badge.neutral { background: var(--warm-surface-muted); color: #7d6559; }
.ac-action-list i { background: var(--warm-coral-soft); color: var(--warm-coral-deep); }

.ac-usage-day > div > span,
.ac-user-usage-chart > div > div > span {
  background: var(--brand-grad);
  box-shadow: none;
}

.ac-drawer-jump-nav {
  background: var(--warm-surface);
  box-shadow: none;
}

.ac-drawer-jump-nav button.active {
  background: var(--brand-grad);
  box-shadow: none;
}

.ac-user-achievement-grid > article.unlocked,
.ac-evidence-thumb.placeholder,
.ac-evidence-detail {
  background: var(--warm-surface-muted);
}

/* 小字号说明文字使用更深的暖灰，满足正文级对比度。 */
.feedback-flow-modal > .fb-quote span,
.feedback-step > label small,
.skill-editor-head p,
.skill-editor-section-head p,
.skill-editor-field > small,
.field-help,
.visibility-copy small,
.skill-editor-label-line span,
.skill-editor-feedback > span {
  color: #6b5f58;
}

.feedback-low-reasons button.is-selected {
  border-color: var(--warm-coral-deep);
  background: var(--warm-coral-deep);
  color: #fff;
}

.skill-editor-section-head > span {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
}

.modal .draft-tip.quiet { color: #6b5f58; }

.user-editor-modal label {
  color: #695d55;
}

.session-dialog > p {
  color: #695d55;
}

.ac-case-score,
.ac-drawer-summary {
  background: var(--warm-coral-soft);
  color: var(--warm-coral-deep);
}

/* ---------- 移动端：首屏先完成任务，不让装饰抢位置 ---------- */
@media (max-width: 760px) {
  .login-visual { display: none !important; }
  .login-shell,
  .login-wrap { align-items: center; }

  .task-picker-mask { background: rgba(52, 42, 37, .24); }
  .task-picker-modal {
    height: min(88dvh, 760px);
    padding: 20px 16px 14px;
    border-radius: 22px 22px 0 0;
  }
  .task-picker-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .task-picker-filters::-webkit-scrollbar { display: none; }
  .task-picker-grid { grid-template-columns: minmax(0, 1fr); }
  .task-picker-item { min-height: 78px; padding-inline: 3px; }

  .poster-workspace-main .poster-tool .tool-head {
    margin-bottom: 14px;
    padding: 2px 0 16px;
    border-radius: 0;
  }
  .poster-engine-lab { margin-inline: -14px; padding-inline: 14px; }

  .profile-anchor-nav {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .profile-shell > .profile-panel,
  .profile-shell > #profile-core-product-root > .profile-panel,
  .profile-shell > #profile-expression-style-root > .profile-panel,
  .profile-shell > #profile-achievements-root > .profile-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
  }
  .profile-empty-state,
  .expression-style-empty { padding: 20px 0; }

  .diagnosis-intro {
    padding: 26px 20px 22px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
  }
  .diagnosis-intro-preview { padding: 18px; }

  .ac-metric,
  .ac-panel { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
