/* 首e陪诊 · 管理后台样式（设计规范见开发文档 1.1 / 1.5） */
:root {
  --c-primary: #FF7A45;
  --c-primary-dark: #E2601F;
  --c-primary-light: #FFF1E4;
  --c-price: #ff6b35;
  --c-warn: #ffb020;
  --c-danger: #ff4d4f;
  --c-info: #3b82f6;
  --c-text-1: #33291F;
  --c-sidebar: #3A281C;
  --c-text-2: #7A6A5C;
  --c-text-3: #A99788;
  --c-line: #F6EADD;
  --c-bg: #FFFBF6;
  --c-card: #fff;
  --sidebar: 200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
#root { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--c-text-1); background: var(--c-bg);
}
a { color: var(--c-info); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 登录页 ---------- */
.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FFB272 0%, #FF7A45 45%, #E2601F 100%);
}
.login-card {
  width: 400px; background: #fff; border-radius: 14px; padding: 36px 36px 30px;
  box-shadow: 0 24px 60px rgba(6, 78, 59, 0.28);
}
.login-card h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: 1px; }
.login-card .sub { color: var(--c-text-3); font-size: 12px; margin-bottom: 26px; }
.login-logo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--c-primary-light);
  color: var(--c-primary-dark); display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 14px;
}
.login-card input {
  width: 100%; height: 44px; border: 1px solid var(--c-line); background: #fafbfc;
  border-radius: 8px; padding: 0 14px; font-size: 14px; margin-bottom: 14px; outline: none;
}
.login-card input:focus { border-color: var(--c-primary); background: #fff; }
.login-card .btn { width: 100%; height: 44px; margin-top: 6px; }
.login-hint { font-size: 12px; color: var(--c-text-3); margin-top: 18px; line-height: 1.7; }
.login-hint b { color: var(--c-text-2); font-weight: 500; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100%; }
.sidebar {
  width: var(--sidebar); background: var(--c-sidebar); flex: 0 0 var(--sidebar);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  color: #fff; font-size: 15px; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.brand i {
  width: 26px; height: 26px; border-radius: 7px; background: var(--c-primary);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-style: normal;
}
.menu-group { padding: 10px 0 4px; }
.menu-group > .g-title {
  color: #7b8794; font-size: 11px; padding: 8px 16px; letter-spacing: 1px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  color: #cbd5e1; font-size: 13px; cursor: pointer; border-left: 3px solid transparent;
  white-space: nowrap;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.menu-item.active { background: rgba(34, 197, 132, 0.12); color: #fff; border-left-color: var(--c-primary); }
.menu-item .ic { width: 16px; text-align: center; opacity: 0.85; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex: 0 0 auto;
}
.crumb { font-size: 13px; color: var(--c-text-3); }
.crumb b { color: var(--c-text-1); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--c-text-2); }
.role-pill {
  background: var(--c-primary-light); color: var(--c-primary-dark); border-radius: 20px;
  padding: 3px 10px; font-size: 12px;
}
.content { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* ---------- 卡片 / 区块 ---------- */
.card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .tools { display: flex; gap: 8px; align-items: center; }
.muted { color: var(--c-text-3); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { .grid-dash { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-dash { grid-template-columns: 1fr; } .stat .num { font-size: 24px; } }

/* 统计卡 */
.stat { background: #fff; border-radius: 8px; padding: 18px 18px 14px; box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04); position: relative; overflow: hidden; }
.stat .label { font-size: 12px; color: var(--c-text-3); }
.stat .num { font-size: 28px; font-weight: 700; margin: 8px 0 6px; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 14px; font-weight: 500; margin-left: 3px; color: var(--c-text-2); }
.stat .growth { font-size: 12px; color: var(--c-text-3); }
.stat .growth em { font-style: normal; font-weight: 600; }
.stat .up { color: #E2601F; }
.stat .down { color: var(--c-danger); }
.stat::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 76px; height: 76px;
  border-radius: 50%; background: var(--c-primary-light); opacity: 0.75;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--c-line);
  background: #fff; color: var(--c-text-1); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: 0.15s;
}
.btn:hover { border-color: #d7dde6; background: #fafbfc; }
.btn.primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn.primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--c-info); padding: 0 6px; }
.btn.danger { color: var(--c-danger); border-color: #ffd7d8; background: #fff6f6; }
.btn.warn { color: #b45309; border-color: #ffe1ae; background: #fffaec; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  font-family: inherit; font-size: 13px; color: var(--c-text-1); outline: none;
}
.fld { display: block; }
.fld > label { display: block; font-size: 12px; color: var(--c-text-2); margin-bottom: 6px; }
.fld > label b { color: var(--c-danger); font-weight: 400; margin-right: 2px; }
.fld input[type="text"], .fld input[type="number"], .fld input[type="date"], .fld input[type="password"],
.fld select, .fld textarea {
  width: 100%; height: 36px; border: 1px solid #e3e8ef; border-radius: 6px; padding: 0 10px;
  background: #fff; transition: 0.15s;
}
.fld textarea { height: auto; min-height: 84px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(34, 197, 132, 0.12); }
.fld .hint { font-size: 11px; color: var(--c-text-3); margin-top: 5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch .track {
  width: 40px; height: 20px; border-radius: 20px; background: #d8dee8; position: relative; transition: 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}
.switch.on .track { background: var(--c-primary); }
.switch.on .track::after { left: 22px; }

/* ---------- 筛选条 ---------- */
.filter {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 14px 16px; background: #fff; border-radius: 8px; margin-bottom: 14px;
}
.filter .f { display: flex; flex-direction: column; gap: 5px; }
.filter .f > span { font-size: 12px; color: var(--c-text-3); }
.filter input, .filter select {
  height: 34px; border: 1px solid #e3e8ef; border-radius: 6px; padding: 0 10px; min-width: 150px; background: #fff;
}
.filter .spacer { flex: 1; }

/* ---------- 表格 ---------- */
.tbl-wrap { background: #fff; border-radius: 8px; overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; table-layout: auto; }
.tbl thead th {
  background: #fafbfc; color: var(--c-text-2); font-size: 12px; font-weight: 500;
  text-align: left; padding: 0 12px; height: 42px; border-bottom: 1px solid var(--c-line); white-space: nowrap;
}
.tbl tbody td {
  height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--c-line); font-size: 13px; vertical-align: middle;
}
.tbl tbody tr:hover { background: #f9fbfc; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.tbl .ell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 46px 0; text-align: center; color: var(--c-text-3); font-size: 13px; }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: 0.5; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--c-line); background: #fff; font-size: 13px; color: var(--c-text-2); }
.pager .pages { display: flex; gap: 6px; }
.pager .pg { min-width: 30px; height: 28px; border: 1px solid var(--c-line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 12px; }
.pager .pg.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px;
  font-size: 12px; white-space: nowrap;
}
.tag.gray { background: #f2f4f7; color: var(--c-text-2); }
.tag.green { background: var(--c-primary-light); color: var(--c-primary-dark); }
.tag.orange { background: #fff4ec; color: var(--c-price); }
.tag.warn { background: #fff7e6; color: #d48806; }
.tag.blue { background: #eff5ff; color: var(--c-info); }
.tag.red { background: #fff1f0; color: var(--c-danger); }
.tag.grey { background: #f4f5f7; color: var(--c-text-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------- 弹窗 / 抽屉 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 80; display: flex; align-items: center; justify-content: center; }
.mask.drawer-mask { justify-content: flex-end; align-items: stretch; }
.modal { background: #fff; border-radius: 10px; width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3); }
.modal.wide { width: 720px; }
.modal.narrow { width: 440px; }
.modal-head { padding: 18px 22px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--c-line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { border: none; background: none; font-size: 20px; color: var(--c-text-3); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 10px; }
.drawer { width: 640px; background: #fff; height: 100%; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(15, 23, 42, 0.16); }
.drawer .modal-body { flex: 1; background: var(--c-bg); }
.drawer .modal-head { flex: 0 0 auto; }
.drawer .modal-foot { flex: 0 0 auto; background: #fff; }

/* 详情区块 */
.sec { background: #fff; border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.sec h4 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sec h4::before { content: ""; width: 3px; height: 14px; background: var(--c-primary); border-radius: 2px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; font-size: 13px; }
.kv .k { color: var(--c-text-3); }
.kv .v { color: var(--c-text-1); word-break: break-all; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs .ph {
  width: 80px; height: 80px; border-radius: 6px; background: linear-gradient(135deg, #FFF1E4, #d3f2e3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--c-primary-dark);
  border: 1px solid #d6efdf;
}
/* 证书缩略图（审核抽屉 / 审核弹窗共用） */
.certs { display: flex; gap: 10px; flex-wrap: wrap; }
.certimg {
  position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden;
  border: 1px solid #E8DCD0; background: #FFF7EF;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.certimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.certimg > span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; text-align: center;
  font-size: 10px; color: #fff; background: linear-gradient(180deg, rgba(40,22,10,0), rgba(40,22,10,.7));
}
.certimg.ph > span { position: static; background: none; color: var(--c-primary-dark); font-size: 11px; }
.certimg.ph em { font-style: normal; font-size: 9px; color: var(--c-text-muted); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; background: var(--c-line); }
.tl-item { position: relative; padding: 0 0 16px 14px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--c-primary); }
.tl-item:last-child::before { background: var(--c-primary); }
.tl-item .t1 { font-size: 13px; font-weight: 500; }
.tl-item .t2 { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* toast */
.toasts { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #fff; border-radius: 8px; padding: 10px 18px; font-size: 13px; box-shadow: 0 8px 26px rgba(15, 23, 42, 0.16);
  border-left: 3px solid var(--c-primary); animation: tin 0.2s ease;
}
.toast.err { border-left-color: var(--c-danger); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* 图表 */
.chart { width: 100%; height: 220px; }
.chart-tabs { display: flex; gap: 6px; }
.chart-tabs .b {
  height: 26px; padding: 0 10px; border-radius: 5px; border: 1px solid var(--c-line); background: #fff;
  font-size: 12px; color: var(--c-text-2); cursor: pointer;
}
.chart-tabs .b.on { background: var(--c-primary-light); border-color: #cdeedf; color: var(--c-primary-dark); }
.rank-row { display: grid; grid-template-columns: 1.3fr 60px 90px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--c-line); font-size: 13px; }
.rank-row:last-child { border-bottom: none; }
.bar { height: 6px; background: #f0f3f7; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #FFB272, #FF7A45); border-radius: 4px; }

.todo-chip { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--c-line); font-size: 13px; cursor: pointer; }
.todo-chip b { font-size: 16px; color: var(--c-price); }
.todo-chip:hover { border-color: #cdeedf; background: #fbfefc; }
.covers { width: 46px; height: 46px; border-radius: 6px; background: linear-gradient(135deg, #FFF1E4, #cdeddd); display: flex; align-items: center; justify-content: center; color: #E2601F; font-size: 12px; }
.covers.img { padding: 0; overflow: hidden; }
.covers.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--c-primary-light); color: var(--c-primary-dark); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.flex { display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--c-line); margin-bottom: 14px; }
.tabs .t { padding: 8px 0 10px; font-size: 13px; color: var(--c-text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs .t.on { color: var(--c-primary-dark); font-weight: 600; border-bottom-color: var(--c-primary); }
.spec-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 60px; gap: 8px; margin-bottom: 8px; }
.spec-row input { height: 34px; border: 1px solid #e3e8ef; border-radius: 6px; padding: 0 8px; width: 100%; }
.perm-matrix td, .perm-matrix th { font-size: 12px; }

/* 宽表：横向滚动，避免长文案被挤成竖排 */
.tbl-scroll { overflow-x: auto; margin: 0 -4px; }
.tbl.wide { min-width: 1280px; }
.tbl.wide td { white-space: normal; word-break: break-word; }

.tbl .actions .btn { flex: 0 0 auto; white-space: nowrap; }

