/* ==========================================================================
   CROSSBORDER DESIGN SYSTEM 3.0 (CBDS 3.0 - LIGHTWEIGHT CALM TOKENS)
   ========================================================================== */

:root {
  /* --- 1. 中性色阶 (Neutral Slate Scale) --- */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* 语义化画板映射 */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --line-border: #e2e8f0;
  --line-divider: #f1f5f9;
  
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  /* 兼容旧变量名称 */
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;

  /* --- 2. 品牌主色 (Deep Forest Teal) --- */
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-deep: #134e4a;
  --brand-soft: #f0fdfa;
  --brand-border: #99f6e4;
  --brand-ring: rgba(15, 118, 110, 0.12);

  /* --- 3. 语义状态色阶 (Semantic Palette) --- */
  /* 成功 / Ozon 实结 (Emerald) */
  --pass: #166534;
  --pass-dark: #14532d;
  --pass-soft: #dcfce7;
  --pass-border: #bbf7d0;

  /* 预警 / 需补资料 / 审核 (Amber) */
  --warn: #9a3412;
  --warn-dark: #7c2d12;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --amber: #9a3412;

  /* 危险 / 退货全损 / 报错 (Rose) */
  --fail: #991b1b;
  --fail-dark: #7f1d1d;
  --fail-soft: #fef2f2;
  --fail-border: #fecaca;
  --red: #991b1b;
  --red-dark: #7f1d1d;

  /* --- 4. 尺寸与圆角标尺 (Radius Scale) --- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* --- 5. 投影标尺 (Shadow Elevation) --- */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-active: 0 4px 14px rgba(15, 118, 110, 0.12);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

/* ==========================================================================
   全局排版与组件基础标准
   ========================================================================== */

/* 财务等宽数字排版 */
.money, .tabular-nums, .order-ident strong, .order-ident small, .tracking-number, .metric strong {
  font-variant-numeric: tabular-nums !important;
}

/* 按钮通用基准 */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-md);
  box-sizing: border-box;
  user-select: none;
  transition: all .15s ease;
}

/* 统一输入框与选择器基准 (高度 32px) */
input[type="text"], input[type="search"], input[type="password"], input[type="number"], select {
  height: 32px;
  line-height: 30px;
  border: 1px solid var(--line-border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  padding: 0 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-ring) !important;
}

/* 选择器美化箭头 */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 12px 12px !important;
  padding-right: 26px !important;
  cursor: pointer;
}

/* 标准弹窗遮罩 */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
