/* ============================================================
   企业端多租户健康管理系统 · 设计系统
   风格：苹果简洁 + 白色企业质感 —— 浅色主导、留白、弱分隔、
        精致圆角与多层阴影、毛玻璃层、微交互
   ============================================================ */
:root {
  /* 语义变量（浅色默认；深色模式在 [data-theme=dark] 统一覆盖） */
  --glass: rgba(255, 255, 255, .78);   /* 毛玻璃面（侧边栏/topbar） */
  --surface: #ffffff;                  /* 卡片/弹窗面 */
  --surface-2: rgba(0, 0, 0, .025);    /* 表头/次级面 */
  --hover: rgba(0, 0, 0, .04);         /* hover 面 */
  --mask: rgba(0, 0, 0, .32);          /* 弹窗遮罩 */
  --navy: #1d1d1f;              /* 主文字/主按钮（苹果近黑） */
  --navy-2: #0077ed;            /* 主按钮 hover */
  --accent: #0071e3;            /* 苹果蓝 */
  --accent-soft: #e8f1fb;
  --bg: #f5f5f7;                /* 苹果浅灰 */
  --card: #ffffff;
  --line: rgba(0, 0, 0, .07);
  --line-dark: rgba(0, 0, 0, .12);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #aeaeb2;
  --red: #ff3b30;
  --red-soft: #fff0ef;
  --amber: #ff9500;
  --amber-soft: #fff8ec;
  --green: #34c759;
  --green-soft: #eafbee;
  --blue-soft: #e8f1fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 10px 30px rgba(0, 0, 0, .055);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); font-size: 14px; color: var(--text); }

/* ---------- 登录（品牌渐变底 + 白色毛玻璃卡，与 H5 同语言） ---------- */
#login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #0071e3 0%, #0068d1 58%, #0a9b6d 135%);
  position: relative;
  overflow: hidden;
}
#login::before {
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  right: -200px; top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 68%);
}
#login::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  left: -180px; bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 70%);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 408px;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 22px;
  padding: 42px 38px 34px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 28px 80px rgba(0, 40, 90, .28);
  border: 1px solid rgba(255, 255, 255, .9);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.login-logo {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
  box-shadow: 0 3px 12px rgba(0, 113, 227, .28);
  box-shadow: 0 4px 14px rgba(0, 113, 227, .28);
}
.login-title { font-size: 19px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.login-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .07em; }
.login-desc { color: var(--text-2); font-size: 13px; margin: 14px 0 22px; }
.login-demo {
  margin-top: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12px;
  color: var(--text-2);
}
.login-demo b { color: var(--accent); font-weight: 600; }

/* ---------- 布局 ---------- */
#app { display: none; min-height: 100vh; }
#app.on { display: block; }
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 232px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line);
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 17px;
  border-bottom: 1px solid var(--line);
}
.side-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 227, .25);
}
/* LOGO 图形（十字+心电）：SVG 自适应容器 */
.login-logo svg { width: 26px; height: 26px; }
.side-logo svg { width: 19px; height: 19px; }
.side-name { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.side-name small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.side-group {
  padding: 15px 20px 6px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .08em;
  font-weight: 500;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 9px;
  border-left: none;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.side-item:hover { background: var(--hover); color: var(--text); }
.side-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.side-item .ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.side-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
}

.main { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.crumb small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.top-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.content { padding: 26px 30px 48px; flex: 1; }


/* ---------- 全局搜索（topbar） ---------- */
.top-search {
  position: relative;
  flex: 1;
  max-width: 340px;
  margin: 0 20px;
}
.top-search .ts-ico {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3); font-size: 13px; pointer-events: none;
}
#gsearch {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
#gsearch:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}
#gsearch::placeholder { color: var(--text-3); }
.gs-result {
  display: none;
  position: absolute; top: 40px; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 16px 44px rgba(0, 0, 0, .12);
  overflow: hidden;
  z-index: 40;
  max-height: 340px;
  overflow-y: auto;
}
.gs-item { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: var(--hover); }
.gs-name { font-size: 13px; color: var(--text); font-weight: 500; }
.gs-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.gs-empty { padding: 14px; text-align: center; font-size: 12px; color: var(--text-3); }


/* ---------- 待办中心卡片 ---------- */
.todo-card { margin-bottom: 0; }
.todo-card.lvl-高 { border-left: 3px solid var(--red); }
.todo-card.lvl-中 { border-left: 3px solid var(--amber); }
.todo-head { display: flex; align-items: flex-start; gap: 12px; }
.todo-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.todo-card.lvl-高 .todo-ico { background: var(--red-soft); color: var(--red); }
.todo-card.lvl-中 .todo-ico { background: var(--amber-soft); color: var(--amber); }
.todo-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.todo-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.todo-count { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.2; letter-spacing: -.02em; }
.todo-card.lvl-高 .todo-count { color: var(--red); }
.todo-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.todo-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; color: var(--text); }
.todo-row .sub { color: var(--text-3); }

/* 工作台待办快捷入口（可点击指标卡） */
.stat-link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 14px 36px rgba(0,0,0,.09); }
.stat-link .v a { color: inherit; text-decoration: none; }
.stat-alert { border-left: 3px solid var(--red); }
.stat-alert .v { color: var(--red); }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, .045);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  letter-spacing: -.01em;
}
.card-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-title::before {
  content: "";
  width: 4px; height: 16px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 9px;
}
.card-title > span:first-child { display: flex; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s, color .15s, background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { border-color: rgba(0, 0, 0, .22); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(1.06); }
.btn.danger { color: var(--red); border-color: rgba(255, 59, 48, .35); background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 1.8;
  font-weight: 500;
}
.tag.high { background: var(--red-soft); color: var(--red); }
.tag.mid { background: var(--amber-soft); color: var(--amber); }
.tag.low { background: var(--green-soft); color: var(--green); }
.tag.info { background: var(--blue-soft); color: var(--accent); }
.tag.gray { background: rgba(0, 0, 0, .05); color: var(--text-2); }
.tag.orange { background: var(--accent-soft); color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--hover); }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin-right: 6px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 12px; color: var(--text-2); }
.input, select.input, textarea.input {
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: #fff;
  outline: none;
  min-width: 150px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
textarea.input { min-width: 380px; min-height: 84px; resize: vertical; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 指标卡 */
.stat {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, .045);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--text-2); }
.stat .v { font-size: 30px; font-weight: 600; color: var(--text); line-height: 1.3; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; color: var(--text-3); font-weight: 400; margin-left: 3px; }
.stat .hint { font-size: 12px; color: var(--text-3); }
.stat.accent .v { color: var(--accent); }

/* 风险分布条 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-label { width: 62px; color: var(--text-2); }
.bar-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .4s; }
.bar-num { width: 38px; text-align: right; color: var(--text-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
/* 空态插画化：图标衬底圆 + 主副文案 */
.empty-art {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--blue-soft) 0%, var(--bg) 75%);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.empty-art svg { width: 28px; height: 28px; }
.empty-t { font-size: 13.5px; color: var(--text-2); }
.empty-s { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.empty-box {
  padding: 48px 0;
  text-align: center;
  color: var(--text-3);
}

/* 微动效 */
.card { animation: fadein .25s ease; }
tbody tr { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* 弹窗入场 */
.modal { animation: popin .22s cubic-bezier(.2, .9, .3, 1.15); }
.modal-mask { animation: fadein .18s ease; }
@keyframes popin { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
/* 按钮过渡 */
.tag, .btn { transition: border-color .15s, color .15s, background .15s, transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.loading { padding: 34px 0; text-align: center; color: var(--text-3); }
.loading::before {
  content: "";
  display: inline-block;
  width: 16px; height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid var(--line-dark);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(255, 149, 0, .22); }
.alert.err { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255, 59, 48, .22); }
.alert.info { background: var(--blue-soft); color: var(--accent); border: 1px solid rgba(0, 113, 227, .2); }

/* toast */
#toast-box { position: fixed; top: 20px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(29, 29, 31, .92);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 10px 17px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  animation: slidein .25s ease;
  max-width: 380px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast .t-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  font-size: 11px; flex: none;
}
.toast.err { background: rgba(255, 59, 48, .94); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; } }

/* 按钮 loading 态 */
.btn.busy { pointer-events: none; opacity: .8; }
.spin {
  display: inline-block;
  width: 11px; height: 11px;
  margin-right: 6px; vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn:not(.primary):not(.accent):not(.danger) .spin { border-color: var(--line-dark); border-top-color: var(--accent); }

/* 骨架屏 */
.sk {
  display: block; height: 13px; border-radius: 4px;
  background: linear-gradient(90deg, #eef2f6 25%, #e2e8ef 50%, #eef2f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.sk.w60 { width: 60%; } .sk.w40 { width: 40%; } .sk.w30 { width: 30%; }
.sk-row td { padding: 12px 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 弹窗 */
.modal.wide { width: min(760px, 92vw); }
body.no-scroll { overflow: hidden; }

.modal-mask {
  position: fixed; inset: 0;
  background: var(--mask);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 70px 20px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 18px;
  width: 620px;
  max-width: 94vw;
  padding: 24px 26px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 28px 72px rgba(0, 0, 0, .16);
}
.modal h3 { font-size: 16px; color: var(--text); margin-bottom: 14px; font-weight: 600; letter-spacing: -.01em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 详情页 */
.detail-head {
  display: flex; align-items: center; gap: 16px;
  padding: 4px 0 16px;
}
.detail-avatar {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 113, 227, .25);
}
.detail-name { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.detail-meta { font-size: 12.5px; color: var(--text-2); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); }

/* 复核左右分栏 */
.review-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review-panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.review-panel h4 { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }

/* 标准 SVG 图标（统一线性风格） */
.svg-ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  stroke: currentColor;
}
.side-item .ico .svg-ico {
  width: 17px;
  height: 17px;
  vertical-align: middle;
  opacity: .9;
}

/* 功能开关 */
.sub { font-size: 12px; color: var(--text-3); }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; vertical-align: middle; margin-right: 10px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .14);
  border-radius: 12px;
  transition: background .18s;
  cursor: pointer;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 提醒中心 */
.notice-wrap { position: relative; }
.notice-badge {
  display: inline-block;
  margin-left: 2px;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 11px;
  font-style: normal;
  line-height: 1.6;
}
.notice-box {
  display: none;
  position: absolute;
  top: 38px; right: 0;
  width: 320px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 16px 44px rgba(0, 0, 0, .12);
  z-index: 60;
  overflow: hidden;
}
.notice-item {
  display: block;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.notice-item:hover { background: rgba(0, 0, 0, .02); }
.notice-item.high { border-left: 3px solid var(--red); }
.notice-item.warn { border-left: 3px solid var(--amber); }
.notice-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* 组织树 */
.org-tree { font-size: 13px; }
.org-node { padding: 4px 0; }
.org-node .nm { cursor: pointer; color: var(--accent); }
.org-node .nm:hover { text-decoration: underline; }
.org-kids { padding-left: 18px; border-left: 1px solid var(--line); margin-left: 6px; }

/* 表格筛选行 */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }

/* ---------- 微交互：按钮按压、卡片浮起、表格行动画 ---------- */
.btn, .btn-primary { transition: transform .13s ease, box-shadow .15s ease, filter .15s ease; }
.btn:active, .btn-primary:active { transform: scale(.96); }
.btn.primary:not(:disabled):hover { filter: brightness(1.06); }
.card { animation: cardIn .3s cubic-bezier(.22,.8,.3,1); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(0, 113, 227, .045); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .13); outline: none; }
.tag { transition: transform .12s ease; }
button:disabled { cursor: not-allowed; }
/* 开关滑动更顺 */
.switch .slider { transition: background .18s ease; }
.switch .slider::before { transition: transform .18s cubic-bezier(.3,1.4,.5,1); }
/* 弹窗进入 */
.modal { animation: modalIn .22s cubic-bezier(.22,.9,.3,1.1); }
@keyframes modalIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
/* 骨架屏呼吸 */
.skeleton { animation: skBreathe 1.4s ease-in-out infinite; }
@keyframes skBreathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
/* Toast 滑入（toast-box 内 .toast 卡片） */
#toast-box .toast { animation: toastIn .22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 语音合成 · 音色卡片 */
.tts-voices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.tts-voice {
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.tts-voice:hover { border-color: rgba(0, 0, 0, .22); }
.tts-voice.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}
.tts-voice .vn {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.tts-voice .vn .vg {
  font-size: 11px; font-weight: 400;
  padding: 1px 7px; border-radius: 10px;
  background: var(--blue-soft); color: var(--accent);
}
.tts-voice .vd { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }


/* ---------- 深色模式（苹果 Dark）---------- */
[data-theme="dark"] {
  --glass: rgba(28, 28, 30, .72);
  --surface: #1c1c1e;
  --surface-2: rgba(255, 255, 255, .05);
  --hover: rgba(255, 255, 255, .07);
  --mask: rgba(0, 0, 0, .55);
  --navy: #f5f5f7;
  --navy-2: #409cff;
  --accent: #409cff;
  --accent-soft: rgba(64, 156, 255, .16);
  --bg: #000000;
  --card: #1c1c1e;
  --line: rgba(255, 255, 255, .1);
  --line-dark: rgba(255, 255, 255, .16);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --red: #ff6961; --red-soft: rgba(255, 105, 97, .16);
  --amber: #ffd60a; --amber-soft: rgba(255, 214, 10, .14);
  --green: #30d94e; --green-soft: rgba(48, 217, 78, .14);
  --blue-soft: rgba(64, 156, 255, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
}
[data-theme="dark"] body { background: #000; }
[data-theme="dark"] #login { background: #000; }
[data-theme="dark"] #login::before {
  background: radial-gradient(circle, rgba(64, 156, 255, .12) 0%, rgba(64, 156, 255, 0) 68%);
}
[data-theme="dark"] .login-card {
  background: rgba(28, 28, 30, .88);
  border-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .login-demo { background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .toast { background: rgba(44, 44, 46, .94); }
[data-theme="dark"] .sk {
  background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%);
  background-size: 200% 100%;
}
[data-theme="dark"] .bar-track { background: rgba(255, 255, 255, .09); }
[data-theme="dark"] .switch .slider { background: rgba(255, 255, 255, .2); }
[data-theme="dark"] .notice-box,
[data-theme="dark"] .modal { background: var(--surface); }
[data-theme="dark"] .input, [data-theme="dark"] select.input, [data-theme="dark"] textarea.input {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}


/* ============================================================
   视觉精修（2026-10-21）：苹果风细节统一
   —— 表格密度、表头质感、行高呼吸感、表单聚焦、滚动条
   ============================================================ */

/* 表格：更细的分隔、更轻的表头、舒适行高 */
table { font-variant-numeric: tabular-nums; }
th {
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-3);
  background: transparent;
  border-bottom: 1px solid var(--line-dark);
  padding: 9px 12px;
}
td { padding: 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
td:first-child, th:first-child { padding-left: 4px; }
td:last-child, th:last-child { padding-right: 4px; }
td:first-child { color: var(--text); font-weight: 500; }

/* 表单：输入框更柔和、聚焦环更明显 */
.input, select.input, textarea.input {
  font-size: 13.5px;
  border-radius: 9px;
  border-color: var(--line-dark);
  background: var(--card);
}
.input:hover { border-color: rgba(0, 0, 0, .2); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .13); }
.input::placeholder { color: var(--text-3); }
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a8a8e' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  padding-right: 28px;
}

/* 按钮：次要按钮更轻（浅底无边框） */
.btn { font-weight: 500; letter-spacing: .01em; }
.btn:not(.primary):not(.accent):not(.danger) {
  background: var(--surface-2);
  border-color: transparent;
}
.btn:not(.primary):not(.accent):not(.danger):hover {
  background: var(--hover);
  border-color: transparent;
}

/* 卡片：更克制的阴影 + 更明确的标题层级 */
.card { padding: 20px 22px; }
.card-title { font-size: 14.5px; margin-bottom: 16px; }
.card-title::before { width: 3px; height: 14px; border-radius: 2px; margin-right: 8px; }

/* 指标卡：数值更突出 */
.stat { padding: 18px 20px; }
.stat .k { font-size: 12px; letter-spacing: .01em; }
.stat .v { font-size: 30px; margin: 2px 0 1px; }
.stat .hint { font-size: 11.5px; }

/* 标签：更小更圆润 */
.tag { font-size: 11.5px; padding: 1px 9px; letter-spacing: .01em; }

/* 滚动条（WebKit）：细、浅、无干扰 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .16);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .28); background-clip: content-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); background-clip: content-box; }

/* 侧边栏：分组标题更轻 */
.side-group { font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); padding: 16px 20px 5px; font-weight: 500; }
.side-item { font-size: 13.5px; padding: 8px 12px; margin: 1px 10px; }
.side-item.active { font-weight: 500; }

/* 内容区：顶部留白更舒展、宽屏限宽 */
.content { padding: 28px 32px 56px; max-width: 1560px; width: 100%; }

/* 焦点可见性（键盘可达性） */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 链接默认无下划线（hover 时由具体场景决定） */
a { text-decoration: none; }
.card-title a, .hint a { text-decoration: none; }

/* 界面说明弹窗（配置项旁「说明」按钮点开） */
.help-doc { max-height: 58vh; overflow: auto; line-height: 1.85; font-size: 13.5px; color: var(--ink); }
.help-doc h4 { font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; }
.help-doc h4:first-child { margin-top: 2px; }
.help-doc p { margin: 4px 0; color: var(--text-2, #444); }
.help-doc ul { margin: 4px 0 8px; padding-left: 18px; }
.help-doc li { margin: 3px 0; color: var(--text-2, #444); }
.help-doc b { color: var(--ink); }
/* 三问速览：这块干嘛的 / 关联哪块 / 前置要先建立哪块 */
.help-flow { background: var(--surface-2, #fafbfc); border: 1px solid var(--line, #dde4ec);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.help-flow p { margin: 5px 0; line-height: 1.7; }
.crumb-help { margin-left: 8px; vertical-align: middle; }
.crumb-help .btn { font-weight: 400; }

/* 页面搭建编辑器（积木拼装） */
.site-ed { display: flex; gap: 12px; align-items: flex-start; }
.site-palette { width: 168px; flex: 0 0 auto; background: var(--surface-2, #fafbfc); border: 1px solid var(--line, #dde4ec); border-radius: 10px; padding: 10px; }
.site-blocks { flex: 1 1 auto; min-width: 0; }
.site-preview { width: 392px; flex: 0 0 auto; }
.site-col-title { font-size: 12px; color: var(--text-3, #8a8f99); margin-bottom: 8px; }
.site-blk { border: 1px solid var(--line, #dde4ec); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.site-blk-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line, #dde4ec); cursor: move; }
.site-blk-body { padding: 10px 12px; }
.site-blk-ops { display: flex; gap: 4px; }
#se-frame { width: 375px; height: 620px; border: 1px solid var(--line, #dde4ec); border-radius: 12px; background: #fff; }
@media (max-width: 1100px) { .site-ed { flex-wrap: wrap; } .site-preview { width: 100%; } }

/* 打印 */
@media print {
  .sidebar, .topbar, .noprint, #toast-box, .notice-box { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ---------- 后台管理助手（悬浮对话面板） ---------- */
.asst-entry { position: fixed; right: 22px; bottom: 22px; z-index: 900; box-shadow: 0 6px 20px rgba(20,50,90,.22); border-radius: 20px; padding: 8px 16px; }
.asst-panel { position: fixed; right: 22px; bottom: 74px; width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 110px);
  background: var(--surface, #fff); border: 1px solid var(--line, #dde4ec); border-radius: 14px; z-index: 901;
  display: flex; flex-direction: column; box-shadow: 0 14px 40px rgba(20,50,90,.25); overflow: hidden; }
.asst-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line, #dde4ec); font-size: 13px; }
.asst-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.asst-msg { max-width: 88%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.65; white-space: normal; word-break: break-word; }
.asst-msg.me { align-self: flex-end; background: var(--navy, #14325a); color: #fff; }
.asst-msg.ai { align-self: flex-start; background: var(--surface-2, #f2f5f8); color: var(--text, #222); }
.asst-act { margin-top: 6px; font-size: 11.5px; color: var(--text-3, #8a97a8); }
.asst-voice { margin-top: 8px; }
.asst-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line, #dde4ec); }
.asst-foot .input { flex: 1; }

/* 助手麦克风录音态 */
#asst-mic.rec { background: var(--red, #d94848); color: #fff; border-color: transparent; animation: asstPulse 1.2s ease-in-out infinite; }
@keyframes asstPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,72,72,.45); } 50% { box-shadow: 0 0 0 7px rgba(217,72,72,0); } }

/* 组织树：当前筛选高亮 */
.org-node .nm.cur { background: var(--hover, #eef3f9); border-radius: 6px; box-shadow: inset 3px 0 0 var(--navy-2, #2f5c8f); padding-left: 6px; }

/* 助手写操作确认 */
.asst-confirm { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line, #dde4ec); border-radius: 8px; background: var(--surface, #fff); }
.asst-confirm .asst-act { color: var(--text-2, #445); }
