/* 全国血透中心总部管理系统 公共样式 */
/* 字号规范 注释12 正文14 标题16 大屏数值另定 */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: transparent; }
input, select { font-family: inherit; outline: none; }
table { border-collapse: collapse; width: 100%; }

/* ============= 深色驾驶舱主题 ============= */
body.theme-dark {
  background: linear-gradient(135deg, #0a1428 0%, #0f1b3d 50%, #0a1428 100%);
  color: #cfe2ff;
  min-height: 100vh;
  overflow-x: hidden;
}

body.theme-dark .nav-top {
  background: rgba(8, 16, 40, 0.85);
  border-bottom: 1px solid rgba(0, 200, 255, 0.2);
  box-shadow: 0 2px 12px rgba(0, 200, 255, 0.08);
  backdrop-filter: blur(6px);
}
body.theme-dark .nav-top .nav-title { color: #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
body.theme-dark .nav-top .nav-menu a { color: #8aa8d6; }
body.theme-dark .nav-top .nav-menu a:hover,
body.theme-dark .nav-top .nav-menu a.active { color: #00e5ff; background: rgba(0, 229, 255, 0.1); }

body.theme-dark .panel {
  background: linear-gradient(180deg, rgba(15, 30, 65, 0.85) 0%, rgba(8, 18, 45, 0.85) 100%);
  border: 1px solid rgba(0, 200, 255, 0.18);
  box-shadow: 0 0 20px rgba(0, 100, 200, 0.15) inset, 0 2px 8px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}
body.theme-dark .panel-title {
  font-size: 16px;
  color: #00e5ff;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 200, 255, 0.15);
  display: flex; align-items: center; justify-content: space-between;
}
body.theme-dark .panel-title::before {
  content: ""; display: inline-block; width: 3px; height: 14px;
  background: #00e5ff; margin-right: 8px; box-shadow: 0 0 8px #00e5ff;
}
body.theme-dark .panel-body { padding: 12px 16px; }

body.theme-dark .kpi-card {
  background: linear-gradient(135deg, rgba(20, 40, 80, 0.6) 0%, rgba(10, 25, 55, 0.6) 100%);
  border: 1px solid rgba(0, 200, 255, 0.25);
  border-radius: 6px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
}
body.theme-dark .kpi-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
}
body.theme-dark .kpi-label { font-size: 12px; color: #8aa8d6; margin-bottom: 6px; }
body.theme-dark .kpi-value { font-size: 28px; color: #fff; font-weight: 600; line-height: 1.2; font-family: "Microsoft YaHei", "DIN", monospace; }
body.theme-dark .kpi-unit { font-size: 12px; color: #8aa8d6; margin-left: 4px; }
body.theme-dark .kpi-sub { font-size: 12px; color: #8aa8d6; margin-top: 4px; }
body.theme-dark .kpi-sub .up { color: #00ff9d; }
body.theme-dark .kpi-sub .down { color: #ff5b73; }

body.theme-dark table.data-table { font-size: 14px; color: #cfe2ff; }
body.theme-dark table.data-table th {
  background: rgba(0, 200, 255, 0.08); color: #00e5ff; font-weight: 500;
  text-align: left; padding: 8px 12px; border-bottom: 1px solid rgba(0, 200, 255, 0.2);
}
body.theme-dark table.data-table td { padding: 8px 12px; border-bottom: 1px solid rgba(0, 200, 255, 0.08); }
body.theme-dark table.data-table tr:hover td { background: rgba(0, 200, 255, 0.05); }
body.theme-dark table.data-table a { color: #00e5ff; }

/* 告警翻牌轮播 深色背景适用 */
.alert-carousel {
  position: relative;
  background: linear-gradient(90deg, rgba(255, 90, 90, 0.18) 0%, rgba(255, 150, 50, 0.10) 100%);
  border: 1px solid rgba(255, 90, 90, 0.35);
  border-radius: 6px;
  height: 68px;
  overflow: hidden;
  cursor: pointer;
}
.alert-carousel .ac-stage { position: relative; height: 100%; }
.alert-carousel .ac-slide {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  padding: 0 18px 0 14px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.alert-carousel .ac-slide.active { opacity: 1; transform: translateY(0); }
.alert-carousel .ac-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  background: rgba(255, 91, 115, 0.3);
  border: 1px solid rgba(255, 91, 115, 0.6);
}
.alert-carousel .ac-slide.lv-warn .ac-icon { background: rgba(255, 180, 50, 0.3); border-color: rgba(255, 180, 50, 0.6); }
.alert-carousel .ac-slide.lv-info .ac-icon { background: rgba(0, 200, 255, 0.25); border-color: rgba(0, 200, 255, 0.6); }
.alert-carousel .ac-body { min-width: 0; }
.alert-carousel .ac-head { font-size: 12px; color: #ffd4d4; margin-bottom: 3px; }
.alert-carousel .ac-head .lv-tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: rgba(255, 91, 115, 0.3); color: #fff;
  border: 1px solid rgba(255, 91, 115, 0.6);
  font-size: 11px; font-weight: 600; margin-right: 8px;
}
.alert-carousel .ac-slide.lv-warn .ac-head .lv-tag { background: rgba(255, 180, 50, 0.3); border-color: rgba(255, 180, 50, 0.6); }
.alert-carousel .ac-slide.lv-info .ac-head .lv-tag { background: rgba(0, 200, 255, 0.25); border-color: rgba(0, 200, 255, 0.6); }
.alert-carousel .ac-head .ac-sep { margin: 0 6px; color: rgba(255, 255, 255, 0.4); }
.alert-carousel .ac-head .ac-center { color: #fff; font-weight: 500; }
.alert-carousel .ac-text {
  color: #fff; font-size: 15px; font-weight: 500; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alert-carousel .ac-meta {
  font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-top: 1px;
}
.alert-carousel .ac-meta .ac-link { color: #00e5ff; }
.alert-carousel .ac-counter {
  font-family: "Microsoft YaHei", monospace;
  font-size: 12px; color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.2); padding: 4px 10px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.alert-carousel .ac-progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: rgba(255, 255, 255, 0.08);
}
.alert-carousel .ac-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff5b73, #ffb432);
  transition: width 0.2s linear;
}

/* ============= 浅色后台主题 ============= */
body.theme-light {
  background: #f0f3f8;
  color: #2c3e50;
  min-height: 100vh;
}

body.theme-light .nav-top {
  background: #fff;
  border-bottom: 1px solid #e1e6ed;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.theme-light .nav-top .nav-title { color: #1e6fdb; }
body.theme-light .nav-top .nav-menu a { color: #5a6a7e; }
body.theme-light .nav-top .nav-menu a:hover,
body.theme-light .nav-top .nav-menu a.active { color: #1e6fdb; background: rgba(30, 111, 219, 0.08); }

body.theme-light .container { max-width: 1880px; margin: 0 auto; padding: 16px 20px; }

body.theme-light .panel {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.theme-light .panel-title {
  font-size: 16px; color: #2c3e50;
  padding: 12px 18px; border-bottom: 1px solid #eef1f5;
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
body.theme-light .panel-title::before {
  content: ""; display: inline-block; width: 3px; height: 14px;
  background: #1e6fdb; margin-right: 8px; border-radius: 2px;
}
body.theme-light .panel-body { padding: 14px 18px; }

body.theme-light .kpi-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 6px;
  padding: 14px 18px;
}
body.theme-light .kpi-label { font-size: 12px; color: #8a96a6; margin-bottom: 6px; }
body.theme-light .kpi-value { font-size: 24px; color: #2c3e50; font-weight: 600; line-height: 1.2; }
body.theme-light .kpi-unit { font-size: 12px; color: #8a96a6; margin-left: 4px; font-weight: 400; }
body.theme-light .kpi-sub { font-size: 12px; color: #8a96a6; margin-top: 6px; }
body.theme-light .kpi-sub .up { color: #2ca97e; }
body.theme-light .kpi-sub .down { color: #d9534f; }

body.theme-light table.data-table { font-size: 14px; color: #2c3e50; }
body.theme-light table.data-table th {
  background: #f5f7fa; color: #5a6a7e; font-weight: 500;
  text-align: left; padding: 10px 14px; border-bottom: 1px solid #e6ebf2;
}
body.theme-light table.data-table td { padding: 10px 14px; border-bottom: 1px solid #eef1f5; }
body.theme-light table.data-table tr:hover td { background: #f7faff; }
body.theme-light table.data-table a { color: #1e6fdb; }

body.theme-light .btn {
  display: inline-block; padding: 6px 14px; font-size: 14px;
  border: 1px solid #d0d6df; background: #fff; color: #2c3e50;
  border-radius: 4px; cursor: pointer;
}
body.theme-light .btn:hover { border-color: #1e6fdb; color: #1e6fdb; }
body.theme-light .btn-primary { background: #1e6fdb; color: #fff; border-color: #1e6fdb; }
body.theme-light .btn-primary:hover { background: #1860c0; color: #fff; }

body.theme-light .form-input, body.theme-light .form-select {
  height: 32px; padding: 0 10px; border: 1px solid #d0d6df; border-radius: 4px;
  background: #fff; color: #2c3e50; font-size: 14px;
}
body.theme-light .form-input:focus, body.theme-light .form-select:focus { border-color: #1e6fdb; }

/* ============= 公共导航栏 ============= */
.nav-top {
  height: 56px;
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.nav-top .nav-title { font-size: 16px; font-weight: 600; margin-right: 36px; letter-spacing: 1px; }
.nav-top .nav-menu { display: flex; gap: 4px; flex: 1; }
.nav-top .nav-menu a { font-size: 14px; padding: 6px 14px; border-radius: 4px; transition: all 0.15s; }
.nav-top .nav-info { font-size: 12px; color: inherit; opacity: 0.7; }
.nav-top .nav-info .time { margin-left: 12px; }

/* ============= 公共状态徽章 ============= */
.badge {
  display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 10px; line-height: 18px;
}
.badge-normal  { background: rgba(44, 169, 126, 0.15); color: #2ca97e; border: 1px solid rgba(44, 169, 126, 0.3); }
.badge-warning { background: rgba(255, 165, 50, 0.15); color: #e08a2b; border: 1px solid rgba(255, 165, 50, 0.3); }
.badge-alert   { background: rgba(217, 83, 79, 0.15); color: #d9534f; border: 1px solid rgba(217, 83, 79, 0.3); }
.badge-info    { background: rgba(30, 111, 219, 0.15); color: #1e6fdb; border: 1px solid rgba(30, 111, 219, 0.3); }
.badge-offline { background: rgba(140, 140, 140, 0.15); color: #888;    border: 1px solid rgba(140, 140, 140, 0.3); }

/* 深色背景下徽章稍调整 */
body.theme-dark .badge-normal  { background: rgba(0, 255, 157, 0.12); color: #00ff9d; border-color: rgba(0, 255, 157, 0.4); }
body.theme-dark .badge-warning { background: rgba(255, 180, 50, 0.12); color: #ffb432; border-color: rgba(255, 180, 50, 0.4); }
body.theme-dark .badge-alert   { background: rgba(255, 91, 115, 0.12); color: #ff5b73; border-color: rgba(255, 91, 115, 0.4); }
body.theme-dark .badge-info    { background: rgba(0, 200, 255, 0.12);  color: #00e5ff; border-color: rgba(0, 200, 255, 0.4); }

/* ============= 网格布局工具类 ============= */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-mute-light { color: #8a96a6; }
.text-mute-dark { color: #8aa8d6; }

/* ============= 面包屑 ============= */
.breadcrumb { font-size: 12px; color: #8a96a6; margin-bottom: 12px; }
.breadcrumb a { color: #1e6fdb; }
.breadcrumb span.sep { margin: 0 6px; color: #c4ccd6; }

/* ============= 滚动条 ============= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
body.theme-dark ::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.2); }
