/**
 * Tiffany 企业主题 — 桌面问数 / 企微内嵌
 * 深青 + 浅 Tiffany + 青灰中性色；仅作用于 .enterprise-theme（非护眼）
 */

:root {
  /* 与 enterprise-theme 同步的基础刻度，供移动端变量继承 */
  --brand-50: #f0f7f6;
  --brand-100: #e7f2f0;
  --brand-200: #c5dfdc;
  --brand-300: #9fcac5;
  --brand-400: #6ba8a1;
  --brand-500: #438f88;
  --brand-600: #347d76;
  --brand-700: #286a64;
  --brand-800: #1f5752;

  --enterprise-page-bg: #f7f9fa;
  --enterprise-panel-bg: #ffffff;
  --enterprise-selected-bg: #f0f4f3;
  --enterprise-shadow-soft: 0 4px 16px rgba(26, 71, 68, 0.05);
  --enterprise-shadow-btn: 0 4px 12px rgba(40, 106, 100, 0.18);
}

/* —— 企业版 Design Tokens —— */
html:not(.eye-care).enterprise-theme {
  /* 核心操作 */
  --primary: #347d76;
  --primary-hover: #286a64;
  --primary-strong: #1f5752;

  /* Tiffany 浅色 */
  --brand-soft: #f0f7f6;
  --brand-selected: #e7f2f0;
  --brand-border: #b8d8d4;
  --brand-tag-border: #c5dfdc;

  /* Neutral */
  --neutral-soft: #f6f8f8;
  --neutral-hover: #f3f6f5;

  /* Border */
  --border-default: #d9e3e1;
  --border-strong: #c9d9d6;
  --select-border: #d3e1df;
  --select-border-hover: #b8d8d4;
  --select-border-focus: #8fc5bf;

  /* Text */
  --text-primary: #344744;
  --text-body: #344744;
  --text-secondary: #526865;
  --text-muted: #82938f;
  --text-brand: #286a64;
  --select-text: #48615e;

  /* Status */
  --status-success: #43827b;

  /* Focus */
  --enterprise-focus-ring: rgba(63, 158, 150, 0.1);

  /* 回答区 */
  --report-text-strong: #075b55;
  --report-text-insight-title: #173f3c;
  --report-text-insight-body: #3e514f;
  --report-table-head-bg: #f3f9f8;
  --report-table-head-text: #245d58;
  --report-total-row-bg: #e4f0ee;
  --report-total-row-text: #1f534e;
  --report-user-bubble: #347d76;
  --report-user-bubble-hover: #286a64;
  --report-accent-line: #81d8d0;

  /* 映射旧变量（chat.html inline 与组件复用） */
  --primary-color: var(--primary);
  --primary-hover: var(--primary-strong);
  --accent: var(--brand-500);
  --accent-weak: var(--brand-soft);
  --bg-color: var(--enterprise-page-bg);
  --bg-soft: var(--brand-soft);
  --card: var(--enterprise-panel-bg);
  --card-elevated: var(--enterprise-panel-bg);
  --border-color: var(--border-default);
  --text-main: var(--text-secondary);
  --text-strong: var(--text-primary);
  --text-faint: #9aa8a5;
  --shadow-soft: var(--enterprise-shadow-soft);
  --focus-ring: var(--enterprise-focus-ring);

  --enterprise-text: var(--text-primary);
  --enterprise-text-secondary: var(--text-secondary);
  --enterprise-text-tertiary: var(--text-muted);
  --enterprise-border: var(--border-default);
  --enterprise-border-strong: var(--border-strong);
  --enterprise-primary: var(--text-brand);
  --enterprise-primary-hover: var(--primary-strong);
  --enterprise-primary-soft: var(--brand-soft);
  --enterprise-focus: var(--select-border-focus);

  --brand-50: var(--brand-soft);
  --brand-100: var(--brand-selected);
  --brand-200: var(--brand-border);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    Arial,
    sans-serif;
}

html:not(.eye-care).enterprise-theme body,
html:not(.eye-care).enterprise-theme button,
html:not(.eye-care).enterprise-theme input,
html:not(.eye-care).enterprise-theme textarea,
html:not(.eye-care).enterprise-theme select,
html:not(.eye-care).enterprise-theme table,
html:not(.eye-care).enterprise-theme th,
html:not(.eye-care).enterprise-theme td,
html:not(.eye-care).enterprise-theme .markdown-body,
html:not(.eye-care).enterprise-theme .answer-content,
html:not(.eye-care).enterprise-theme .msg-body {
  font-family: inherit;
}

html:not(.eye-care).enterprise-theme table {
  font-size: 13px;
}

html:not(.eye-care).enterprise-theme th {
  font-weight: 600;
}

html:not(.eye-care).enterprise-theme td {
  font-weight: 400;
}

html:not(.eye-care).enterprise-theme .answer-content {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-primary);
}

html:not(.eye-care).enterprise-theme .answer-content strong,
html:not(.eye-care).enterprise-theme .card-insights-panel strong {
  font-weight: 600;
  color: var(--report-text-strong);
}

/* —— 左侧历史 —— */
html:not(.eye-care).enterprise-theme .history-item {
  color: var(--text-secondary);
}

html:not(.eye-care).enterprise-theme .history-item:hover {
  background: var(--neutral-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

html:not(.eye-care).enterprise-theme .history-item.active {
  background: var(--enterprise-selected-bg);
  color: var(--text-primary);
  border-color: var(--border-default);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--report-accent-line);
}

/* —— 顶部模型 Tag —— */
html:not(.eye-care).enterprise-theme .badge {
  background: var(--brand-soft);
  border: 1px solid var(--brand-tag-border);
  color: var(--text-brand);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
  font-size: 12px;
}

html:not(.eye-care).enterprise-theme .badge:hover {
  background: var(--brand-selected);
  border-color: var(--brand-border);
}

html:not(.eye-care).enterprise-theme .badge-muted {
  background: var(--neutral-soft);
  border-color: var(--border-default);
  color: var(--text-muted);
}

html:not(.eye-care).enterprise-theme .badge-code {
  opacity: 0.85;
  font-weight: 500;
}

/* —— 推荐问题 Chip —— */
html:not(.eye-care).enterprise-theme .welcome-example,
html:not(.eye-care).enterprise-theme .tag {
  background: var(--neutral-soft);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

html:not(.eye-care).enterprise-theme .welcome-example:hover,
html:not(.eye-care).enterprise-theme .tag:hover {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--text-brand);
}

html:not(.eye-care).enterprise-theme .welcome-example:active,
html:not(.eye-care).enterprise-theme .tag:active {
  background: var(--brand-selected);
  border-color: #9fcac5;
  color: var(--primary-strong);
  font-weight: 500;
}

/* —— 下拉框 —— */
html:not(.eye-care).enterprise-theme .nav-select {
  background-color: #f8fafa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23286A64' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--select-text);
  border: 1px solid var(--select-border);
}

html:not(.eye-care).enterprise-theme .nav-select:hover:not(:disabled) {
  border-color: var(--select-border-hover);
}

html:not(.eye-care).enterprise-theme .nav-select:focus {
  border-color: var(--select-border-focus);
  box-shadow: 0 0 0 3px var(--enterprise-focus-ring);
  outline: none;
}

html:not(.eye-care).enterprise-theme .nav-select:disabled {
  color: var(--text-muted);
  background-color: var(--neutral-soft);
}

/* —— 用户提问气泡 —— */
html:not(.eye-care).enterprise-theme .user-bubble {
  background: #347d76;
  color: #ffffff;
  box-shadow: none;
  background-image: none;
}

html:not(.eye-care).enterprise-theme .user-bubble:hover {
  background: #286a64;
}

/* —— 主按钮 —— */
html:not(.eye-care).enterprise-theme .submit-btn {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: var(--enterprise-shadow-btn);
}

html:not(.eye-care).enterprise-theme .submit-btn:hover:not(:disabled) {
  background: var(--primary-strong);
}

/* —— 底部分析状态 —— */
html:not(.eye-care).enterprise-theme .info-tip,
html:not(.eye-care).enterprise-theme .status-inline,
html:not(.eye-care).enterprise-theme #status {
  color: var(--text-muted);
}

html:not(.eye-care).enterprise-theme #status.status-ok {
  color: var(--status-success);
}

/* —— 顶栏 / 辅助 —— */
html:not(.eye-care).enterprise-theme .icon-btn:hover {
  background: var(--brand-soft);
  color: var(--text-brand);
}

html:not(.eye-care).enterprise-theme .sidebar-footer a:hover {
  color: var(--text-brand);
}

html:not(.eye-care).enterprise-theme .nav-text-btn {
  color: var(--text-brand);
}

html:not(.eye-care).enterprise-theme .nav-text-btn:hover {
  background: var(--brand-soft);
  color: var(--primary-strong);
}

html:not(.eye-care).enterprise-theme .question-card-label,
html:not(.eye-care).enterprise-theme .resolved-label,
html:not(.eye-care).enterprise-theme .nav-label {
  color: var(--text-muted);
}

html:not(.eye-care).enterprise-theme .user-profile {
  color: var(--text-secondary);
}

html:not(.eye-care).enterprise-theme .bi-textarea {
  color: var(--text-primary);
}

html:not(.eye-care).enterprise-theme .search-box-group {
  border-color: var(--select-border);
}

html:not(.eye-care).enterprise-theme .search-box-group:focus-within {
  border-color: var(--select-border-focus);
  box-shadow: 0 0 0 3px var(--enterprise-focus-ring);
}

html:not(.eye-care).enterprise-theme .welcome-section__title,
html:not(.eye-care).enterprise-theme .welcome-panel h2 {
  color: var(--text-primary);
}

html:not(.eye-care).enterprise-theme .welcome-panel > .welcome-sub,
html:not(.eye-care).enterprise-theme .welcome-tips li,
html:not(.eye-care).enterprise-theme .welcome-module__desc,
html:not(.eye-care).enterprise-theme .welcome-empty {
  color: var(--text-secondary);
}

html:not(.eye-care).enterprise-theme .welcome-module__cat {
  color: var(--text-muted);
}

/* —— 回答区表格表头 —— */
html:not(.eye-care).enterprise-theme .data-table th,
html:not(.eye-care).enterprise-theme .viz-table th,
html:not(.eye-care).enterprise-theme .card-text-panel th {
  background: var(--report-table-head-bg);
  color: var(--report-table-head-text);
  border-bottom-color: var(--border-default);
}

html:not(.eye-care).enterprise-theme .data-table tr:hover td,
html:not(.eye-care).enterprise-theme .viz-table tr:hover td {
  background: #fbfefd;
}

html:not(.eye-care).enterprise-theme .card-insights-panel a,
html:not(.eye-care).enterprise-theme .card-text-panel a {
  color: var(--text-brand);
}

/* —— 加载态 —— */
html:not(.eye-care).enterprise-theme .typing-dots span {
  background: var(--brand-500);
}

html:not(.eye-care).enterprise-theme .typing-indicator,
html:not(.eye-care).enterprise-theme .typing-step-text {
  color: var(--text-secondary);
  background: transparent;
}

/* —— 移动端 / 企微（继承 enterprise token） —— */
.enterprise-theme .mobile-question-root,
html.enterprise-theme .mobile-question-root {
  --mobile-primary: var(--text-brand);
  --mobile-primary-dark: var(--primary-strong);
  --mobile-primary-light: var(--brand-soft);
  --mobile-primary-soft: var(--brand-soft);
  --mobile-bg: var(--enterprise-page-bg);
  --mobile-surface: var(--enterprise-panel-bg);
  --mobile-text-primary: var(--text-primary);
  --mobile-text-secondary: var(--text-secondary);
  --mobile-border: var(--border-default);
  --mobile-shadow-card: var(--enterprise-shadow-soft);
  font-family: inherit;
}

.enterprise-theme .mobile-question-root .mobile-header__dot,
html.enterprise-theme .mobile-question-root .mobile-header__dot {
  background: var(--brand-500);
}

.enterprise-theme .mobile-question-root .mobile-header__btn--user,
.enterprise-theme .mobile-question-root .mobile-composer__send,
.enterprise-theme .mobile-question-root .mobile-btn,
.enterprise-theme .mobile-question-root .mobile-hero__btn--primary,
html.enterprise-theme .mobile-question-root .mobile-header__btn--user,
html.enterprise-theme .mobile-question-root .mobile-composer__send,
html.enterprise-theme .mobile-question-root .mobile-btn,
html.enterprise-theme .mobile-question-root .mobile-hero__btn--primary {
  background: var(--primary-hover);
  box-shadow: var(--enterprise-shadow-btn);
}

.enterprise-theme .mobile-question-root .mobile-composer__send:not(:disabled):hover,
html.enterprise-theme .mobile-question-root .mobile-composer__send:not(:disabled):hover {
  background: var(--primary-strong);
}

.enterprise-theme .mobile-question-root .mobile-composer__input:focus,
html.enterprise-theme .mobile-question-root .mobile-composer__input:focus {
  border-color: var(--select-border-focus);
  box-shadow: 0 0 0 3px var(--enterprise-focus-ring);
}

.enterprise-theme .mobile-question-root .mobile-theme-tab.is-active,
html.enterprise-theme .mobile-question-root .mobile-theme-tab.is-active {
  background: var(--enterprise-selected-bg);
  border-color: var(--border-default);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--report-accent-line);
}

.enterprise-theme .mobile-question-root .mobile-chip,
.enterprise-theme .mobile-question-root .mobile-chip--action,
html.enterprise-theme .mobile-question-root .mobile-chip,
html.enterprise-theme .mobile-question-root .mobile-chip--action {
  background: var(--neutral-soft);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.enterprise-theme .mobile-question-root .mobile-chip:hover,
.enterprise-theme .mobile-question-root .mobile-chip--action:hover,
html.enterprise-theme .mobile-question-root .mobile-chip:hover,
html.enterprise-theme .mobile-question-root .mobile-chip--action:hover {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--text-brand);
}

.enterprise-theme .mobile-question-root .mobile-route-chip,
html.enterprise-theme .mobile-question-root .mobile-route-chip {
  background: var(--brand-soft);
  border: 1px solid var(--brand-tag-border);
  color: var(--text-brand);
}

.enterprise-theme .mobile-question-root .mobile-table th,
html.enterprise-theme .mobile-question-root .mobile-table th {
  background: var(--report-table-head-bg);
  color: var(--report-table-head-text);
}

.enterprise-theme .mobile-question-root .mobile-link-btn,
.enterprise-theme .mobile-question-root .mobile-section-title,
.enterprise-theme .mobile-question-root .mobile-thinking__summary,
.enterprise-theme .mobile-question-root .mobile-markdown a,
html.enterprise-theme .mobile-question-root .mobile-link-btn,
html.enterprise-theme .mobile-question-root .mobile-section-title,
html.enterprise-theme .mobile-question-root .mobile-thinking__summary,
html.enterprise-theme .mobile-question-root .mobile-markdown a {
  color: var(--text-brand);
}

.enterprise-theme .mobile-question-root .mobile-loading__spinner,
html.enterprise-theme .mobile-question-root .mobile-loading__spinner {
  border-top-color: var(--text-brand);
}
