:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #f9f9fb;
  --line: #d2d2d7;
  --line-2: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --primary: #1e5a46;
  --primary-d: #143f30;
  --primary-bg: #eaf3ee;
  --accent: #a6ce39;
  --accent-d: #8fb62b;
  --accent-bg: #f5f9ea;
  --ink: #161617;
  --ink-2: #1d1d1f;
  --ok: #2e8b57;
  --ok-bg: #e9f5ec;
  --warn: #c47f16;
  --warn-bg: #fdf4e3;
  --danger: #d33b3b;
  --danger-bg: #fdeceb;
  --info: #1e5a46;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .05);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; }
input, select, textarea, button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------- boot ---------------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ---------------- 登录 ---------------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; max-width: 1120px; width: 100%; }
.login-hero { padding: 8px 0; }
.login-title { font-size: 48px; line-height: 1.12; letter-spacing: -.026em; font-weight: 700; margin: 32px 0 16px; }
.login-title .thin { font-weight: 500; color: var(--muted); }
.login-desc { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 500px; margin: 0 0 28px; letter-spacing: -.01em; }
.login-points { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.login-points .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-bg); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.login-langs { display: flex; gap: 6px; }
.login-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 24px; padding: 32px; box-shadow: 0 12px 48px rgba(0, 0, 0, .08); }
.login-card h2 { font-size: 22px; margin-bottom: 22px; letter-spacing: -.02em; }
.login-card form { display: grid; gap: 15px; }
.btn-block { width: 100%; justify-content: center; padding: 12px 18px; font-size: 15px; }
.demo-accounts { margin-top: 22px; border-top: 1px solid var(--line-2); padding-top: 16px; font-size: 13px; }
.demo-accounts summary { cursor: pointer; color: var(--muted); }
.demo-accounts table { margin-top: 10px; }
.login-foot { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.form-error { background: var(--danger-bg); color: #a32020; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; }
@media (max-width: 880px) { .login-wrap { grid-template-columns: 1fr; gap: 32px; } .login-title { font-size: 36px; margin-top: 20px; } }

/* ---------------- 布局：顶部导航 ---------------- */
.app { min-height: 100vh; }
.topnav { position: sticky; top: 0; z-index: 40; background: linear-gradient(180deg, #1c1d20 0%, #121316 100%); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
.topnav-inner { max-width: none; margin: 0; height: 54px; display: flex; align-items: center; gap: 16px; padding: 0 28px; }
.brand { display: flex; gap: 10px; align-items: center; flex: none; }
.brand-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; letter-spacing: .02em; color: #f5f5f7; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .01em; }
.brand-lg .brand-name { font-size: 15px; color: var(--text); }
.nav { flex: 1; display: flex; align-items: center; gap: 3px; min-width: 0; }
.nav-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 980px; color: rgba(245, 245, 247, .62); cursor: pointer; font-size: 13px; letter-spacing: .01em; border: none; background: transparent; transition: color .15s, background .15s, box-shadow .15s; white-space: nowrap; font-family: inherit; }
.nav-item:hover { color: #f5f5f7; background: rgba(255, 255, 255, .06); }
.nav-item.active { background: rgba(166, 206, 57, .13); color: #d3e98a; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(166, 206, 57, .26); }
.nav-item .cnt { background: var(--accent); color: #1a2410; border-radius: 980px; font-size: 10.5px; padding: 0 7px; font-weight: 700; line-height: 17px; }
.nav-item .cnt.danger { background: var(--danger); color: #fff; }
.nav-item .cnt.soft { background: rgba(255, 255, 255, .14); color: #a1a1a6; }
#nav .nav-item.sub { display: none; } /* 桌面端子项进第二行导航条 */
.subnav { position: fixed; left: 0; top: 54px; bottom: 0; width: 208px; z-index: 30; background: #f2f3f4; border-right: 1px solid var(--line); overflow-y: auto; }
.subnav-inner { display: flex; flex-direction: column; gap: 4px; padding: 24px 14px; }
.subnav-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--text); display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 14px; }
.subnav-title::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%); flex: none; }
.subnav-links { display: flex; flex-direction: column; gap: 4px; }
.subnav-item { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; position: relative; transition: color .15s, background .15s, box-shadow .15s, border-color .15s; }
.subnav-item:hover { background: rgba(255, 255, 255, .75); color: var(--text); }
.subnav-item.active { background: #fff; border-color: rgba(120, 120, 128, .16); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); color: var(--primary); font-weight: 600; }
.subnav-item.active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--primary); }
.subnav-item .cnt { background: var(--accent); color: #1a2410; border-radius: 980px; font-size: 10.5px; padding: 0 7px; font-weight: 700; line-height: 17px; margin-left: auto; }
.subnav-item .cnt.danger { background: var(--danger); color: #fff; }
.subnav-item .cnt.soft { background: rgba(120, 120, 128, .18); color: var(--muted); }
.nav-menu { display: none; }
/* 有竖排子导航时内容区右移 */
body.has-subnav .view { margin-left: 208px; }

/* 系统管理首页入口卡片 */
.admin-entry { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.admin-entry:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0, 0, 0, .1); }
.admin-entry h3 { margin: 10px 0 4px; font-size: 16px; }
.admin-entry p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.admin-entry-ico { font-size: 26px; }
.topnav-right { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; }
.topnav .userchip .who b { color: #f5f5f7; font-size: 13px; font-weight: 600; }
.topnav .btn-ghost { color: rgba(245, 245, 247, .68); }
.topnav .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #f5f5f7; }
.topnav .icon-btn { color: rgba(245, 245, 247, .68); }
.topnav .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #f5f5f7; }
.userchip { display: flex; gap: 9px; align-items: center; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #1e5a46, #a6ce39); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.view { padding: 28px 28px 72px; max-width: 1680px; margin: 0 auto; }
/* 数据表密集的页面（设备/库存/装机/维护）占满全宽，减少横向滚动 */
.view.view-wide { max-width: none; margin: 0; }
.nav-toggle { display: none; }
.topnav .nav-toggle { display: none; }
@media (max-width: 1000px) {
  .topnav .nav-toggle { display: inline-grid; }
  .topnav-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .nav { order: 3; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 8px; }
  .nav.open { display: flex; }
  #nav .nav-item.sub { display: flex; padding-left: 28px; font-size: 12px; opacity: .85; }
  .subnav { display: none !important; } /* 移动端子项直接列在展开菜单里 */
  body.has-subnav .view { margin-left: 0; }
  .view { padding: 22px 16px 48px; }
  .userchip .who { display: none; }
}

/* ---------------- 组件 ---------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: rgba(120, 120, 128, .12); color: var(--text); padding: 9px 18px; border-radius: 980px; cursor: pointer; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s, transform .1s; white-space: nowrap; box-shadow: none; }
.btn:hover { background: rgba(120, 120, 128, .2); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); color: #fff; }
.btn-danger { background: rgba(120, 120, 128, .12); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 5px 13px; font-size: 12.5px; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; transition: background .15s; }
.icon-btn:hover { background: rgba(0, 0, 0, .05); color: var(--text); }

.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 22px; }
.card-hd { display: flex; align-items: center; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line-2); }
.card-hd h3 { font-size: 17px; letter-spacing: -.02em; }
.card-hd .sub { color: var(--muted); font-size: 12.5px; }
.card-hd .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-bd { padding: 24px; }
.card-bd.tight { padding: 0; }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

.kpi { background: var(--panel); border: none; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .v { font-size: 36px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); border-radius: 0 4px 4px 0; }
.kpi.ok .bar { background: var(--ok); } .kpi.warn .bar { background: var(--warn); } .kpi.danger .bar { background: var(--danger); }

/* 概览：去卡片化大标题 */
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.hero .attr { margin-top: 4px; font-size: 13px; }

/* 概览：单卡数据带（4 项，细分隔线） */
.stat-strip .card-bd { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 10px 26px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line-2); }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .v { font-size: 32px; font-weight: 600; letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .d { font-size: 12px; color: var(--primary); margin-top: 3px; min-height: 15px; }
@media (max-width: 760px) {
  .stat-strip .card-bd { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .stat:nth-child(3) { border-left: none; }
  .hero h1 { font-size: 26px; }
}

/* ================= Overview 紧凑模式（只作用于 dashboard 页） ================= */
.view[data-page="dashboard"] .hero { margin: 2px 0 0; }
.view[data-page="dashboard"] .hero h1 { font-size: 21px; font-weight: 650; }
.view[data-page="dashboard"] .hero .attr { margin-top: 2px; font-size: 12px; }
.view[data-page="dashboard"] .hero .chips .btn { padding: 6px 12px; font-size: 12px; }
.view[data-page="dashboard"] .mt16 { margin-top: 18px; }
.view[data-page="dashboard"] .notice-card { margin-bottom: 18px; border-radius: 12px; }
.view[data-page="dashboard"] .notice-card .card-bd { padding: 10px 16px; }
.view[data-page="dashboard"] .notice-body { margin-top: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.55; }
.view[data-page="dashboard"] .stat-strip .card-bd { padding: 4px 10px; }
.view[data-page="dashboard"] .stat { padding: 6px 18px; }
.view[data-page="dashboard"] .stat .k { font-size: 11.5px; }
.view[data-page="dashboard"] .stat .v { font-size: 23px; margin-top: 1px; }
.view[data-page="dashboard"] .stat .d { font-size: 11px; margin-top: 1px; min-height: 12px; }
.view[data-page="dashboard"] .grid.g2 { gap: 18px; }
.view[data-page="dashboard"] .card { border-radius: 12px; }
.view[data-page="dashboard"] .card-hd { padding: 11px 16px 9px; }
.view[data-page="dashboard"] .card-hd h3 { font-size: 14.5px; }
.view[data-page="dashboard"] .card-bd { padding: 14px 16px; }
.view[data-page="dashboard"] .card-bd.tight { padding: 0; }
.view[data-page="dashboard"] table.table { font-size: 12.5px; }
.view[data-page="dashboard"] table.table td { padding: 8px 10px; }

/* Overview 待办看板行 */
.todo-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.todo-row:last-child { border-bottom: none; }
.todo-row:hover { background: var(--panel-2); }
.todo-main { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 8px; }
.todo-main b { font-size: 13px; }
.todo-main .attr { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-date { font-size: 11.5px; flex: none; }
.todo-note { font-size: 11.5px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--danger); }
.todo-empty { padding: 18px 16px; color: var(--muted); font-size: 12.5px; }

/* 装机列表：设备构成徽章（整套系统 vs 仅镜体） */
.eq-td { white-space: nowrap; }
.eq-badge { padding: 2px 9px; font-size: 11px; margin-right: 4px; }
.eq-badge:last-child { margin-right: 0; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
table.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
/* 医院名等长文本：优先给足宽度，超长才单行截断，避免列内换行撑乱表格 */
table.table td .hosp-link { display: inline-block; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
table.table td.hosp-td { min-width: 200px; }
table.table td .hosp-name { display: inline-block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* 全宽数据页：紧凑排版 + 单元格单行，尽量免横向滚动 */
.view-wide table.table { font-size: 12.6px; }
.view-wide table.table th { padding: 9px 7px; font-size: 10.6px; letter-spacing: .02em; }
.view-wide table.table td { padding: 10px 7px; white-space: nowrap; }
.view-wide table.table td.attr, .view-wide table.table td.wrap { white-space: normal; }
.view-wide table.table td.t-actions .btn { padding: 5px 9px; font-size: 12px; }
.view-wide .btn-sm { padding: 6px 12px; font-size: 12.5px; }
table.table tbody tr:hover { background: var(--panel-2); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
/* 可排序表头 */
table.table th.th-sort { cursor: pointer; user-select: none; }
table.table th.th-sort:hover { color: var(--primary); }
table.table th.th-sort .sort-arrow { margin-left: 4px; font-size: 10px; opacity: .45; }
table.table th.th-sort.active { color: var(--primary); }
table.table th.th-sort.active .sort-arrow { opacity: 1; }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions .btn + .btn { margin-left: 6px; }
/* 表格操作列：白底描边 + 微阴影，明确是可点按钮 */
.t-actions .btn { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); color: var(--text-2); font-weight: 600; }
.t-actions .btn:hover { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.t-actions .btn.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(30, 90, 70, .35); }
.t-actions .btn.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.t-actions .btn.btn-danger { background: #fff; border-color: rgba(211, 59, 59, .45); color: var(--danger); }
.t-actions .btn.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 0; }
.pager-btns { display: flex; gap: 4px; align-items: center; }
.pager-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 12.5px; cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s, background .15s; }
.pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-gap { color: var(--muted); padding: 0 2px; }
/* 全宽数据页：操作列冻结在右侧，其余列横向滚动 */
.view-wide .table-wrap th:last-child,
.view-wide .table-wrap td.t-actions {
  position: sticky; right: 0; z-index: 2; background: #fff;
  box-shadow: -10px 0 14px -12px rgba(0, 0, 0, .35);
}
.view-wide .table-wrap tbody tr:hover td.t-actions { background: var(--panel-2); }
.view-wide .table-wrap tr.ng-row td.t-actions { background: var(--danger-bg); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 980px; font-size: 11.5px; font-weight: 600; background: #f0f0f3; color: #48484c; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: #1e6b41; }
.badge.warn { background: var(--warn-bg); color: #96610d; }
.badge.danger { background: var(--danger-bg); color: #b32d2d; }
.badge.info { background: var(--primary-bg); color: var(--primary-d); }
.badge.dim { background: #f0f0f3; color: #86868b; }

.form-grid { display: grid; gap: 18px 16px; grid-template-columns: repeat(2, minmax(0,1fr)); counter-reset: formsec; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { grid-column: 1 / -1; counter-increment: formsec; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border: none; border-radius: 12px; background: linear-gradient(90deg, rgba(164, 214, 51, .16) 0%, rgba(11, 61, 46, .06) 55%, transparent 100%); }
.form-sec:first-child { margin-top: 0; }
.form-sec span { font-size: 15.5px; font-weight: 700; letter-spacing: .02em; color: var(--primary); display: flex; align-items: center; gap: 10px; padding-bottom: 0; }
.form-sec span::before { content: counter(formsec, decimal-leading-zero); width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; flex: none; box-shadow: 0 2px 6px rgba(11, 61, 46, .3); }
/* 装机单：设备分组（处理器/光源/镜体，多行动态添加） */
.unit-group { grid-column: 1 / -1; border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px 16px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); transition: box-shadow .18s; }
.unit-group:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .06); }
.unit-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.unit-name { font-size: 13.5px; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.unit-rows { display: grid; gap: 8px; }
.unit-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 8px; align-items: center; animation: fadeUp .2s ease; }
/* 可搜索型号选择框 */
.combo { position: relative; min-width: 0; }
.combo-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; max-height: 260px; overflow-y: auto; display: none; background: #fff; border-radius: 14px; padding: 5px; box-shadow: 0 12px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .05); }
.combo.open .combo-list { display: block; }
.combo-item { padding: 8px 11px; border-radius: 9px; font-size: 13px; font-family: 'SF Mono', ui-monospace, Consolas, monospace; cursor: pointer; transition: background .12s; }
.combo-item b { color: var(--primary); font-weight: 700; }
.combo-item:hover, .combo-item.cur { background: rgba(166, 206, 57, .22); }
.combo-empty { padding: 10px 11px; font-size: 12.5px; color: var(--muted); }
.auto-filled { outline: 2px solid rgba(166, 206, 57, .85) !important; outline-offset: 0; border-radius: 10px; }
.combo-group { padding: 8px 11px 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.combo-sub { color: var(--muted); font-size: 11.5px; font-family: inherit; }
.country-combo .combo-input { width: 100%; }
.country-combo .combo-item { font-family: inherit; }
.unit-row [data-rm] { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; }
.unit-view { display: grid; gap: 6px; }
.unit-view-row { display: flex; align-items: center; gap: 10px; }
@media (max-width: 720px) { .unit-row { grid-template-columns: 1fr 1fr auto; } }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; font-size: 13px; }
.field > span { color: var(--text-2); font-weight: 600; font-size: 12px; letter-spacing: .03em; }
.field > span .req { color: var(--danger); }
/* 统一表单控件：浅填充 + 细边框，边界清晰 */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=button]):not([type=submit]):not([type=hidden]):not([type=color]):not([type=range]), select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid rgba(120, 120, 128, .35); border-radius: 10px; background: rgba(120, 120, 128, .06); outline: none; transition: border-color .18s, box-shadow .18s, background .18s; font-size: 13.5px; color: var(--text);
}
input:hover, select:hover, textarea:hover { border-color: rgba(120, 120, 128, .55); background: rgba(120, 120, 128, .08); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(166, 206, 57, .22), 0 1px 2px rgba(0, 0, 0, .04); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled, textarea:disabled { background: rgba(120, 120, 128, .05); color: var(--text-2); cursor: not-allowed; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; cursor: pointer; }
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.hint { color: var(--muted); font-size: 12px; }
.hosp-link { color: var(--primary); cursor: pointer; text-decoration: none; border-bottom: 1px dashed rgba(30, 90, 70, .4); }
.hosp-link:hover { border-bottom-style: solid; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.search { position: relative; }
.search input { padding-left: 32px !important; border-radius: 980px; }
/* 工具栏搜索框：聚焦反馈弱化，避免厚重光环 */
.search input:focus { box-shadow: 0 0 0 3px rgba(166, 206, 57, .15); border-color: rgba(30, 90, 70, .5); background: #fff; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 15px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--muted); font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-size: 34px; opacity: .4; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: none; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 980px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: background .15s, color .15s; }
.chip:hover { background: var(--panel-2); }
.chip.active { background: var(--primary); box-shadow: none; color: #fff; font-weight: 600; }
.attr { color: var(--muted); font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }
.strong { font-weight: 600; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 22px; } .mt24 { margin-top: 28px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

.toast-root { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 120; }
.toast { background: rgba(29, 29, 31, .92); backdrop-filter: blur(12px); color: #f5f5f7; padding: 12px 18px; border-radius: 980px; font-size: 13px; box-shadow: 0 12px 40px rgba(0, 0, 0, .24); max-width: 380px; animation: pop .18s ease-out; }
.toast.err { background: rgba(157, 39, 38, .95); }
.toast.ok { background: rgba(30, 90, 70, .95); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .48); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 100; padding: 24px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; box-shadow: 0 32px 80px rgba(0, 0, 0, .3); width: min(720px, 100%); max-height: 92vh; display: flex; flex-direction: column; animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal.wide { width: min(980px, 100%); }
.modal-hd { padding: 20px 24px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-hd h3 { font-size: 18px; letter-spacing: -.02em; }
.modal-hd .close { margin-left: auto; }
.modal-bd { padding: 22px 24px; overflow-y: auto; }
.modal-ft { padding: 16px 24px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; background: var(--panel-2); border-radius: 0 0 20px 20px; }

.lang-switch { display: flex; gap: 2px; background: rgba(120, 120, 128, .12); border-radius: 980px; padding: 2px; }
.lang-switch button { border: none; background: transparent; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--muted); border-radius: 980px; transition: background .15s, color .15s; }
.topnav .lang-switch { background: rgba(255, 255, 255, .1); }
.topnav .lang-switch button { color: rgba(245, 245, 247, .68); }
.topnav .lang-switch button.active { background: rgba(255, 255, 255, .92); color: #1d1d1f; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.role-pill { font-size: 11.5px; font-weight: 600; padding: 3px 11px; border-radius: 980px; background: var(--primary-bg); color: var(--primary-d); }

.timeline { display: grid; gap: 0; }
.timeline .tl { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.timeline .tl:last-child { border-bottom: none; }
.timeline .tl .t { color: var(--muted); font-size: 12.5px; }

.chart { width: 100%; height: auto; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

.checklist { display: grid; gap: 8px; }
.chk-row { display: grid; grid-template-columns: 1.1fr auto 1.5fr; gap: 10px; align-items: center; padding: 9px 12px; border: none; border-radius: var(--radius-sm); background: var(--panel-2); }
.chk-row .nm { font-size: 13px; }
.chk-row .res { display: flex; gap: 4px; }
.chk-row .res button { border: none; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-radius: 980px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; transition: background .15s; }
.chk-row .res button.ok.on { background: var(--ok); box-shadow: none; color: #fff; }
.chk-row .res button.ng.on { background: var(--danger); box-shadow: none; color: #fff; }
.chk-row.ng { box-shadow: inset 0 0 0 1px rgba(211, 59, 59, .35); background: var(--danger-bg); }
.table tr.ng-row td { background: var(--danger-bg); }
@media (max-width: 720px) { .chk-row { grid-template-columns: 1fr; } }

.catalog { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); }
.part { border: none; border-radius: var(--radius); background: #fff; padding: 0; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); overflow: hidden; }
.part > *:not(.part-img) { padding: 0 16px; }
.part > *:last-child { padding-bottom: 16px; }
.part h4 { font-size: 14.5px; line-height: 1.4; letter-spacing: -.01em; }
.part .code { font-size: 11.5px; color: var(--muted); }
.part .price { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.part .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.part .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.part .foot input { width: 62px !important; text-align: center; }
.part-img { border-radius: 0; overflow: hidden; background: var(--panel-2); border: none; position: relative; }
.part-img img { width: 100%; height: 170px; object-fit: cover; display: block; transition: transform .25s ease; }
.part-img:hover img { transform: scale(1.04); }
.part-img-empty { height: 170px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); font-size: 11.5px; background: var(--panel-2); }
.part-img-empty svg { opacity: .35; }
.part-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); display: block; }
.part-thumb.clickable, .part-img[data-zoom] { cursor: zoom-in; }
.notice-card { border-left: 4px solid var(--accent); margin-bottom: 30px; }
.notice-hd { display: flex; align-items: center; gap: 8px; }
.notice-ico { font-size: 18px; }
.notice-body { margin-top: 10px; padding: 14px 16px; background: var(--accent-bg); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.7; white-space: normal; }
.model-picker { border: none; border-radius: var(--radius-sm); background: var(--panel-2); padding: 10px; }
.model-picker .search { margin-bottom: 8px; }
.model-picker-list { max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line-2); }
.mp-group { font-size: 12px; color: var(--muted); padding: 8px 4px 4px; font-weight: 600; letter-spacing: .02em; }
.mp-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px 3px 7px; margin: 0 6px 4px 0; border: none; box-shadow: inset 0 0 0 1px var(--line); border-radius: 980px; cursor: pointer; font-size: 12px; background: #fff; transition: background .15s; }
.mp-item:has(input:checked) { box-shadow: none; background: var(--primary); color: #fff; }
.mp-item input { accent-color: var(--primary); }
.part-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; background: var(--panel-2); }

.cart-line { display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "thumb info amt" "thumb qty del"; gap: 5px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.cart-thumb { grid-area: thumb; }
.cart-thumb .part-thumb { width: 38px; height: 38px; }
.cart-info { grid-area: info; min-width: 0; word-break: break-word; }
.cart-amt { grid-area: amt; justify-self: end; font-variant-numeric: tabular-nums; }
.cart-qty { grid-area: qty; }
.cart-qty input { width: 66px !important; text-align: center; }
.cart-del { grid-area: del; justify-self: end; }
.t-thumb { padding: 3px 0 !important; }
.t-thumb .part-thumb { width: 36px; height: 36px; }
.part-zoom { display: grid; gap: 16px; }
.part-zoom img { width: 100%; border-radius: 12px; display: block; }
.part-zoom-cap { margin-top: 6px; font-size: 12px; color: var(--muted); }
.cart-total { display: flex; justify-content: flex-end; gap: 18px; padding-top: 12px; font-size: 14px; }

.media-card { display: grid; grid-template-columns: 82px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.media-card:last-child { border-bottom: none; }
.media-thumb { width: 82px; height: 56px; border-radius: 10px; background: linear-gradient(135deg, #eaf3ee, #f5f9ea); display: grid; place-items: center; color: var(--primary-d); font-size: 20px; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-title.link { cursor: pointer; color: var(--primary); }
.media-title.link:hover { text-decoration: underline; }
.tag-badge { cursor: pointer; margin-right: 4px; }
.tag-badge:hover { opacity: .8; }
.chip.tag-chip { border-style: dashed; }
/* 筛选下拉（分类/标签多时不挤版面） */
.flt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.flt-item { display: flex; align-items: center; gap: 8px; }
.flt-sel { min-width: 160px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-bg, #fff); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gap8 { gap: 8px; }
.vis-block { display: contents; }
.video-frame { width: 100%; aspect-ratio: 16/9; background: var(--ink); border-radius: 12px; overflow: hidden; }
.video-frame video, .video-frame iframe { width: 100%; height: 100%; border: none; display: block; }

/* 应用内 PDF 阅读器（全屏连续滚动，无下载入口） */
.pdf-full { position: fixed; inset: 0; z-index: 999; background: #2b2f36; display: flex; flex-direction: column; }
.pdf-tb { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card-bg, #fff); border-bottom: 1px solid var(--line-2, #e5e5e5); }
.pdf-tb .btn { min-width: 34px; }
.pdf-title { font-weight: 650; margin-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.pdf-gap { flex: 1; }
.pdf-ind { min-width: 64px; text-align: center; color: var(--ink-3, #888); font-size: 12px; }
.pdf-stage2 { flex: 1; overflow: auto; padding: 16px 0; }
.pdf-page { position: relative; width: fit-content; margin: 0 auto 16px; }
.pdf-ph { min-width: 300px; min-height: 400px; display: grid; place-items: center; color: rgba(255,255,255,.5); font-size: 13px; }
.pdf-canvas { display: block; background: #fff; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.pdf-loading { color: #fff; padding: 60px 0; font-size: 13px; text-align: center; }
.pdf-wm { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); overflow: hidden; }
.pdf-wm span { display: grid; place-items: center; font-size: 15px; font-weight: 500; color: rgba(90, 90, 90, .32); transform: rotate(-28deg); white-space: nowrap; user-select: none; }

.quiz-q { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.quiz-q .stem { font-size: 14.5px; font-weight: 600; margin-bottom: 10px; letter-spacing: -.01em; }
.quiz-opt { display: flex; gap: 9px; align-items: flex-start; padding: 8px 12px; border: none; border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; font-size: 13.5px; background: var(--panel-2); transition: background .15s; }
.quiz-opt:hover { background: #f0f0f3; }
.quiz-opt.sel { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-bg); }
.quiz-opt.right { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-bg); }
.quiz-opt.wrong { box-shadow: inset 0 0 0 2px var(--danger); background: var(--danger-bg); }
.quiz-opt input { margin-top: 3px; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.exam-timer.low { color: var(--danger); }

.sig-canvas { border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #fff; width: 100%; height: 130px; touch-action: none; cursor: crosshair; }
.print-only { display: none; }

@media print {
  .topnav, .toolbar, .card-hd .right, .t-actions, .no-print { display: none !important; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
  .print-only { display: block; }
}

/* ===== 机型多选筛选（配件目录） ===== */
.msel { position: relative; }
.msel-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 300px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); padding: 10px; }
.msel-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.msel-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.msel-seg button { border: none; background: #fff; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); font-family: inherit; }
.msel-seg button.active { background: var(--primary); color: #fff; }
.msel-list { max-height: 300px; overflow-y: auto; }
.msel-g { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 8px 4px 2px; }
.msel-item { display: flex; gap: 7px; align-items: center; padding: 4px 6px; font-size: 12.5px; cursor: pointer; border-radius: 6px; }
.msel-item:hover { background: var(--panel-2); }
