/* comm-os 共享样式（自 _template@2026-10-25 复制，根目录唯一副本，不再按 app 快照）
   base.css = 品牌色板（design tokens）+ 语义组件类（.btn/.card/.chip/表单/表格…）。
   分工：原子工具类（mt-2/flex/gap-4…）在 shared/util.css；两者都没有的写业务专属类，放 app 自己的 css。
   业务组件类里也尽量用工具类补细节（如 class="card flex items-center gap-2 mt-2"），减少重复 CSS。 */

:root {
  /* 织传 Comm-OS 六色板：
     紫=主色/强调，洋红=次强调与激活，浅紫=边界与浅底，橙=图表与提示，
     珊瑚/粉红只做小面积点缀（大面积文字不用，白底上对比不够） */
  --brand: #8A2CF6;
  --brand-deep: #6D21C9;
  --brand-magenta: #D42BC9;
  --brand-pink: #FF5A8E;
  --brand-coral: #FF7A59;
  --brand-orange: #F5A623;
  --brand-sky: #BCA4FF;
  --brand-line: #D8C6FF;
  --brand-tint: #F4EEFF;
  --ink: #1f2328;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --line: #E7E3EF;
  --bg: #F8F7FB;
  --white: #fff;
  --card-radius: 14px;
  --green: #0f6e56;
  --green-bg: #e6f4ee;
  --amber: #9c6500;
  --amber-bg: #fff5d6;
  --red: #b42318;
  --red-bg: #fdecea;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.3; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局壳（页面主容器） */
.container { max-width: 960px; margin: 0 auto; padding: 20px 16px; }

/* 顶级导航（配合 hash 路由的 data-nav 高亮） */
.nav-link { color: var(--muted); padding: 4px 2px; }
.nav-link:hover { color: var(--brand); text-decoration: none; }
.nav-link.active { color: var(--brand); font-weight: 600; }

/* 卡片 */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title { font-size: 13.5px; font-weight: 600; margin: 0 0 14px; }

/* 按钮（变体用组合：btn + ghost/danger/sm/block） */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: var(--white);
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--white); color: var(--brand); }
.btn.ghost:hover { background: var(--brand-tint); }
.btn.subtle { background: var(--white); color: var(--muted); border-color: var(--line); }
.btn.subtle:hover { background: #f2f4f7; color: var(--ink); }
.btn.danger { background: var(--white); color: var(--red); border-color: #f0c2bd; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }

/* 表单 */
input, select, textarea {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* 表格 */
table { border-collapse: collapse; width: 100%; background: var(--white); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: var(--bg); }
tr:hover td { background: #faf8fd; }

/* 状态标签（业务状态色挂 .chip.t3 之类的业务类，见各 app 自己的 css） */
.chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg);
  color: var(--muted);
}

/* 提示条 */
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.msg-error { background: var(--red-bg); color: var(--red); border: 1px solid #f5c6c0; }
.msg-ok { background: var(--green-bg); color: var(--green); border: 1px solid #bfe3d6; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 轻提示（替代 alert/confirm：预览面板会静默拦截原生弹窗） */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  background: #1f2328;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
  max-width: 78vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

/* 页头「当前客户」角标：切了客户以后一眼能看到自己在哪一家 */
.client-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--brand-deep);
  background: var(--brand-tint);
  vertical-align: middle;
  white-space: nowrap;
}
.client-chip:empty { display: none; }
