/* ============================================================
   锦泰 ERP 公共视觉系统  v1  2026-12-03
   色板对齐对外网站：藏蓝 + 金色
   ============================================================ */
:root {
  --navy: #0b2242;
  --navy2: #103258;
  --navy3: #1a467c;
  --brand: #1b4f9c;
  --gold: #c9a227;
  --gold2: #e3c463;
  --ink: #1c2430;
  --muted: #5c6675;
  --line: #e4e8ef;
  --bg: #f6f8fa;
  --ok-bg: #d4edda; --ok-fg: #155724;
  --wait-bg: #fdf3d7; --wait-fg: #8a6d1d;
  --danger: #b03a2e;
  --shadow: 0 6px 18px rgba(11, 34, 66, .08);
}

/* ---------- 字体系统 ---------- */
html { font-size: 15px; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* 数字（金额/单号/日期）等宽 */
table td, .kv, .msg .who { font-variant-numeric: tabular-nums; }

/* ---------- 顶栏：藏蓝渐变 + 金色当前页 ---------- */
header {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy2) 60%, var(--navy3) 100%) !important;
  box-shadow: 0 2px 10px rgba(11, 34, 66, .25);
  color: #fff;
}
header .brand { letter-spacing: .02em; display: flex; align-items: center; }
header .brand::before { content: ""; display: inline-block; width: 58px; height: 20px; border-radius: 4px;
  background: #fff url('/static/logo.jpg') center / contain no-repeat; padding: 2px 4px; margin-right: 8px; }
header nav a { color: #b8c6dc !important; transition: color .15s; }
header nav a:hover { color: #fff !important; }
header nav a.on { color: var(--gold2) !important; font-weight: bold; }
header .me { color: #b8c6dc !important; }
header .me a { color: var(--gold2) !important; }

/* ---------- 卡片 ---------- */
.panel, #modal {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow);
}

/* ---------- 按钮分级 ---------- */
button.btn, #taskbar button, #sendbtn {
  background: linear-gradient(135deg, var(--navy2), var(--brand)) !important;
  box-shadow: 0 3px 10px rgba(27, 79, 156, .25);
}
button.btn:hover, #taskbar button:hover, #sendbtn:hover { filter: brightness(1.1); }
button.btn.grey { background: #8a94a6 !important; box-shadow: none; }
button.mini { background: var(--brand) !important; }
.approve { background: var(--gold) !important; color: #fff !important; }
button { cursor: pointer; }

/* ---------- 表单 ---------- */
input, select, textarea {
  border: 1px solid #d5dbe5 !important;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(27, 79, 156, .15);
}
input[readonly], select[disabled] { background: #f2f4f8 !important; color: var(--muted) !important; }

/* ---------- 表格 ---------- */
table { border-radius: 8px; overflow: hidden; }
th { background: var(--navy2) !important; color: #e8eef7 !important; font-weight: 500 !important; }
tbody tr:nth-child(even) td { background: #f8fafc; }
tbody tr:hover td { background: #f2f7fc; }
th, td { border-bottom: 1px solid var(--line) !important; }

/* ---------- 徽标 ---------- */
.badge { border-radius: 20px; }
.b-ok { background: var(--ok-bg) !important; color: var(--ok-fg) !important; }
.b-wait { background: var(--wait-bg) !important; color: var(--wait-fg) !important; border: 1px solid var(--gold2); }

/* ---------- 对话窗 ---------- */
.msg { border-radius: 12px !important; }
.msg.in { background: #fff; border: 1px solid var(--line) !important; box-shadow: 0 2px 8px rgba(11,34,66,.05); }
.msg.out { background: #eef4fb !important; border: 1px solid #d7e5f5 !important; }
.msg.thinking { background: #fdf9ec !important; border: 1px dashed var(--gold2) !important; color: #8a6d1d !important; }
#taskbar { border-bottom: 1px solid var(--line) !important; }
.chip { background: #eef3fa !important; color: var(--ink) !important; }
.msg .who { color: var(--muted) !important; }

/* ---------- 区块标题金色点缀 ---------- */
.sect { border-left: 4px solid var(--gold) !important; color: var(--navy2) !important; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c4ceda; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 打印单据页保持干净 ---------- */
@media print {
  header, #taskbar, .panel > h3, button, .bar { box-shadow: none !important; }
  th { background: #f5f5f5 !important; color: #000 !important; }
  tbody tr:hover td { background: inherit; }
}

/* ---------- 字号层级 ---------- */
.panel h3, #modal h3 { font-size: 16px !important; color: var(--navy2) !important; letter-spacing: .02em; }
.msg { font-size: 14.5px; }
#taskbar, .kv, .items-tbl { font-variant-numeric: tabular-nums; }
label { color: var(--muted) !important; }

/* ---------- 下拉框统一 ---------- */
select {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235c6675'/%3E%3C/svg%3E") no-repeat right 10px center !important;
  -webkit-appearance: none; appearance: none; padding-right: 26px !important;
}

/* ---------- 手机适配 ---------- */
@media (max-width: 640px) {
  html { font-size: 16px; }
  input, select, textarea { font-size: 16px !important; } /* 防 iOS 聚焦自动放大 */
  button.btn, #sendbtn, #taskbar button { min-height: 44px; font-size: 16px; }
  button.mini, .approve { min-height: 36px; }
  main { padding: 10px !important; }
  .panel { padding: 12px !important; }
  #modal { left: 0 !important; transform: none !important; width: 100% !important; max-width: none !important;
           top: 1vh !important; max-height: 98vh !important; border-radius: 10px !important; }
  header { flex-wrap: nowrap !important; overflow-x: auto; }
  header nav { flex-shrink: 0; }
  /* 对话窗输入区比例修正 2026-12-03 */
  #inputbar { gap: 6px !important; padding: 8px !important; flex-wrap: nowrap; }
  #inputbar textarea { height: 88px !important; font-size: 16px; flex: 1; min-width: 0; }
  #prio { font-size: 12px !important; padding: 6px 2px !important; max-width: 70px; }
  label.file { padding: 10px !important; font-size: 16px !important; }
  #sendbtn { padding: 10px 16px !important; font-size: 15px !important; min-height: 44px; }
  #filechips { max-width: 96px; }
  .chip { font-size: 11px; }
}
