/* 智绘云耀 OA · 视觉设计系统（年轻活力版） */
:root {
  --c-main: #2C2C34;
  --c-main-soft: #3D3D47;
  --c-accent: #2C2C34;
  --c-accent-soft: #EDEDf2;
  --c-accent-ink: #2C2C34;
  --c-bg: #F7F8FA;
  --c-card: #FFFFFF;
  --c-line: #EBECF0;
  --c-text: #2C2C34;
  --c-text-2: #6B6B78;
  --c-text-3: #9A9AA8;
  --c-ok: #3FBF9A;
  --c-warn: #FF8A5B;
  --c-info: #6FA8DC;
  --c-danger: #F2685F;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow: 0 2px 10px rgba(44, 44, 52, .06);
  --shadow-hover: 0 8px 24px rgba(44, 44, 52, .10);
  --font: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body[data-biz="yangwan"] {
  --c-accent: #FF9BB3;
  --c-accent-soft: #FFEDF2;
  --c-accent-ink: #D9527A;
}

body[data-biz="guanxu"] {
  --c-accent: #54B8D8;
  --c-accent-soft: #E6F5FA;
  --c-accent-ink: #2A7F9E;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .2px; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8DAE0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--c-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: box-shadow .22s ease, transform .22s ease;
}
.card.hoverable:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 34px; padding: 0 14px; border: 1px solid var(--c-line);
  background: #fff; color: var(--c-text); border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px; transition: all .18s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--c-accent); color: var(--c-accent-ink); background: var(--c-accent-soft); }
.btn.primary { background: var(--c-main); border-color: var(--c-main); color: #fff; }
.btn.primary:hover { background: var(--c-accent); border-color: var(--c-accent); color: #fff; filter: brightness(1.02); }
.btn.accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--c-text-2); }
.btn.ghost:hover { background: var(--c-accent-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: var(--c-danger); border-color: #F7D9D6; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 12px;
  background: var(--c-accent-soft); color: var(--c-accent-ink);
}
.tag.gray { background: #F0F1F4; color: var(--c-text-2); }
.tag.ok { background: #E4F7F1; color: #2A9C7B; }
.tag.warn { background: #FFF0E6; color: #D2682F; }
.tag.info { background: #EAF3FC; color: #3D7EBB; }
.tag.danger { background: #FDECEA; color: #C94B42; }
.tag.line-yw { background: #FFEDF2; color: #D9527A; }
.tag.line-gx { background: #E6F5FA; color: #2A7F9E; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px; font-size: 13px;
  border: 1px solid var(--c-line); border-radius: var(--r-sm); background: #fff;
  color: var(--c-text); outline: none; transition: border-color .18s, box-shadow .18s;
}
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12px; color: var(--c-text-2); margin-bottom: 6px; }
.field > label i { color: var(--c-danger); font-style: normal; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--c-text-2); }
.small { font-size: 12px; }
.b { font-weight: 700; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.grow { flex: 1; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(30, 30, 36, .42);
  display: flex; align-items: center; justify-content: center; z-index: 900;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.dialog {
  background: #fff; border-radius: var(--r-lg); width: 520px; max-width: 92vw;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18); animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }
.dialog .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; justify-content: space-between; }
.dialog .dlg-body { padding: 20px; overflow: auto; }
.dialog .dlg-foot { padding: 12px 20px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { cursor: pointer; color: var(--c-text-3); font-size: 18px; line-height: 1; }

/* ---------- 右侧抽屉：所有新建 / 编辑表单都从这里滑出，左边列表还看得见 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(30, 30, 36, .42); z-index: 900;
  animation: fade .18s ease;
}
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; background: #fff;
  width: 520px; max-width: 100vw; display: flex; flex-direction: column;
  box-shadow: -12px 0 44px rgba(0, 0, 0, .18); animation: slideIn .22s cubic-bezier(.4, 0, .2, 1);
}
@keyframes slideIn { from { transform: translateX(100%) } to { transform: none } }
.drawer .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; justify-content: space-between; }
.drawer .dlg-body { padding: 20px; overflow: auto; flex: 1; }
.drawer .dlg-foot { padding: 12px 20px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 10px; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--c-main); color: #fff; padding: 9px 18px; border-radius: 22px;
  font-size: 13px; box-shadow: var(--shadow-hover); animation: fade .18s ease;
}
.toast.ok { background: var(--c-ok); }
.toast.err { background: var(--c-danger); }
.toast.warn { background: #E8892B; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--c-text-3); }
.empty img { width: 132px; opacity: .95; margin-bottom: 10px; }
.empty .t { color: var(--c-text-2); font-size: 13px; }

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  background: var(--c-accent-soft); color: var(--c-accent-ink); overflow: hidden; flex: none;
}
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 图表 ---------- */
.chart { width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--c-text-2); margin-top: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* ---------- 插画装饰 ---------- */
.deco { position: absolute; pointer-events: none; opacity: .5; }
.deco.bear { width: 120px; right: 18px; bottom: 12px; }
.deco.chirp { width: 84px; right: 130px; bottom: 20px; }
