/* ==========================================================================
   小高AI系统 · 移动端原型
   base.css — 设计变量 / 基础重置 / 通用无障碍样式
   视觉变量来源：D:\ds\xiaogao\xg-ai-platform\frontend\src\index.css
   ========================================================================== */

:root {
  color-scheme: light;

  /* 品牌色 */
  --primary: #4666d6;
  --primary-strong: #304a9e;
  --primary-hover: #3a57bf;
  --primary-soft: rgba(70, 102, 214, 0.10);
  --accent: #22d3ee;
  --action-gradient: linear-gradient(135deg, #4666d6 0%, #22d3ee 100%);

  /* 背景与文字 */
  --bg-page: #f5f7fc;
  --bg-card: #ffffff;
  --bg-soft: #f8faff;
  --text-primary: #1a1b2e;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-faint: #98a2b3;
  --border-color: rgba(26, 27, 46, 0.10);
  --border-light: rgba(26, 27, 46, 0.06);
  --border-strong: rgba(26, 27, 46, 0.18);

  /* 线索漏斗色板（对齐 PC；valid 青色调至 #0891B2 以满足色度校验） */
  --c-leads: #d97706;
  --c-valid: #0891b2;
  --c-follow: #059669;
  --c-deal: #7c3aed;
  --c-rate: #2563eb;
  --c-adcost: #dc2626;
  --c-leads-soft: rgba(217, 119, 6, 0.10);
  --c-valid-soft: rgba(8, 145, 178, 0.10);
  --c-follow-soft: rgba(5, 150, 105, 0.10);
  --c-deal-soft: rgba(124, 58, 237, 0.10);
  --c-rate-soft: rgba(37, 99, 235, 0.10);
  --c-adcost-soft: rgba(220, 38, 38, 0.10);
  --c-muted: #94a3b8;

  /* 状态色 */
  --danger: #dc2626;
  --danger-text: #b42318;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.10);
  --warning: #d97706;

  /* 圆角与阴影 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 18px 44px -20px rgba(48, 74, 158, 0.28), 0 2px 8px rgba(26, 27, 46, 0.04);
  --shadow-soft: 0 4px 14px -10px rgba(48, 74, 158, 0.35);
  --focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.18);

  /* 字体 */
  --font-ui: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Helvetica Neue", system-ui, -apple-system, sans-serif;

  /* 安全区 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* 移动端原型：隐藏浏览器默认滚动条，保留滚动能力 */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 移动端点击态（避免 300ms 延迟带来的灰色闪块） */
@media (hover: none) {
  button,
  input {
    touch-action: manipulation;
  }
}

/* 动效降级 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
