/* ============ 天龙十部 Demo · 暗黑科技风主题 ============ */
:root {
  --bg: #0a0f1e;
  --bg2: #0d1530;
  --panel: rgba(19, 30, 58, .82);
  --panel-border: rgba(0, 212, 255, .18);
  --cyan: #00d4ff;
  --cyan-dim: rgba(0, 212, 255, .55);
  --gold: #ffc53d;
  --green: #52e0a8;
  --red: #ff5b6a;
  --orange: #ff9c40;
  --purple: #8f7bff;
  --text: #d7e4f5;
  --text-dim: #7c8db0;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(0, 90, 170, .25), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(90, 40, 170, .18), transparent),
    linear-gradient(rgba(10, 15, 30, .4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 15, 30, .4) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, .25); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--cyan); text-decoration: none; }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 232px; flex-shrink: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 21, 48, .96), rgba(10, 15, 30, .96));
  border-right: 1px solid var(--panel-border);
}
.logo {
  padding: 20px 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--panel-border);
}
.logo-badge {
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #0090ff, #00e5ff);
  color: #04101f; font-weight: 800; font-size: 15px;
  box-shadow: 0 0 18px rgba(0, 212, 255, .5);
}
.logo h1 { font-size: 16px; letter-spacing: 1px; }
.logo p { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; margin-top: 2px; }
.menu { flex: 1; overflow-y: auto; padding: 12px 10px; }
.menu-group { font-size: 11px; color: var(--text-dim); padding: 12px 10px 6px; letter-spacing: 2px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 2px 0;
  border-radius: 8px; color: var(--text-dim); cursor: pointer; position: relative;
  transition: all .18s;
}
.menu-item .mi { width: 20px; text-align: center; font-size: 15px; }
.menu-item:hover { color: var(--text); background: rgba(0, 212, 255, .07); }
.menu-item.active {
  color: var(--cyan); background: linear-gradient(90deg, rgba(0, 212, 255, .16), rgba(0, 212, 255, .02));
  box-shadow: inset 2px 0 0 var(--cyan);
}
.menu-item .badge {
  margin-left: auto; font-size: 10px; padding: 1px 7px; border-radius: 10px;
  background: rgba(255, 91, 106, .18); color: var(--red); border: 1px solid rgba(255, 91, 106, .35);
}
.menu-item .badge.gold { background: rgba(255, 197, 61, .15); color: var(--gold); border-color: rgba(255, 197, 61, .35); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--panel-border); font-size: 11px; color: var(--text-dim); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 0 22px; border-bottom: 1px solid var(--panel-border);
  background: rgba(13, 21, 48, .75); backdrop-filter: blur(8px);
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .page-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.top-pill {
  font-size: 12px; padding: 5px 12px; border-radius: 14px;
  border: 1px solid var(--panel-border); color: var(--text-dim); display: flex; align-items: center; gap: 6px;
}
.top-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.top-pill.warn .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple), var(--cyan)); color: #fff; font-weight: 700; font-size: 12px;
}
.logout-btn { cursor: pointer; color: var(--text-dim); font-size: 12px; border: 1px solid var(--panel-border); padding: 5px 10px; border-radius: 6px; }
.logout-btn:hover { color: var(--red); border-color: var(--red); }

.content { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ---------- 面板 / 卡片 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
}
.panel-title {
  font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ""; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), transparent);
}
.panel-title .extra { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-dim); }
.grid { display: grid; gap: 16px; }
.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-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1400px) { .grid-6 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* KPI 卡 */
.kpi {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; }
.kpi .k-value { font-size: 26px; font-weight: 700; margin-top: 8px; font-family: "DIN Alternate", "Bahnschrift", var(--font); }
.kpi .k-value small { font-size: 12px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.kpi .k-trend { font-size: 11px; margin-top: 6px; }
.kpi .k-trend.up { color: var(--green); }
.kpi .k-trend.down { color: var(--red); }
.kpi .glow { position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; filter: blur(30px); opacity: .35; }

/* ---------- 表格 ---------- */
table.tl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tl-table th {
  text-align: left; padding: 10px 12px; color: var(--text-dim); font-weight: 500; font-size: 12px;
  border-bottom: 1px solid var(--panel-border); white-space: nowrap;
  background: rgba(0, 212, 255, .04);
}
.tl-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.tl-table tbody tr { transition: background .15s; }
.tl-table tbody tr:hover { background: rgba(0, 212, 255, .05); }
.tl-table .num { font-family: "Bahnschrift", var(--font); }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; border: 1px solid; white-space: nowrap; }
.tag.cyan { color: var(--cyan); border-color: rgba(0, 212, 255, .4); background: rgba(0, 212, 255, .1); }
.tag.green { color: var(--green); border-color: rgba(82, 224, 168, .4); background: rgba(82, 224, 168, .1); }
.tag.red { color: var(--red); border-color: rgba(255, 91, 106, .4); background: rgba(255, 91, 106, .1); }
.tag.gold { color: var(--gold); border-color: rgba(255, 197, 61, .4); background: rgba(255, 197, 61, .1); }
.tag.orange { color: var(--orange); border-color: rgba(255, 156, 64, .4); background: rgba(255, 156, 64, .1); }
.tag.purple { color: var(--purple); border-color: rgba(143, 123, 255, .4); background: rgba(143, 123, 255, .1); }
.tag.gray { color: var(--text-dim); border-color: rgba(124, 141, 176, .4); background: rgba(124, 141, 176, .1); }

/* 进度条 */
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0090ff, var(--cyan)); box-shadow: 0 0 8px var(--cyan-dim); }
.progress.red > i { background: linear-gradient(90deg, #d4384d, var(--red)); box-shadow: 0 0 8px rgba(255, 91, 106, .5); }
.progress.gold > i { background: linear-gradient(90deg, #d4a017, var(--gold)); }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px;
  border: 1px solid var(--panel-border); background: rgba(0, 212, 255, .08); color: var(--cyan);
  font-size: 12px; cursor: pointer; transition: all .15s; font-family: var(--font);
}
.btn:hover { background: rgba(0, 212, 255, .18); box-shadow: 0 0 12px rgba(0, 212, 255, .25); }
.btn.primary { background: linear-gradient(135deg, #0090ff, #00c8ff); color: #04101f; font-weight: 600; border: none; }
.btn.danger { color: var(--red); background: rgba(255, 91, 106, .08); border-color: rgba(255, 91, 106, .3); }
.btn.danger:hover { background: rgba(255, 91, 106, .2); }
.btn.gold { color: var(--gold); background: rgba(255, 197, 61, .08); border-color: rgba(255, 197, 61, .3); }
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.sm { padding: 4px 10px; font-size: 11px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.form-row { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.form-item { flex: 1; min-width: 180px; }
.form-item label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; border-radius: 7px; font-size: 13px; color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--panel-border);
  outline: none; font-family: var(--font); transition: border .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0, 212, 255, .12); }
.select option { background: var(--bg2); color: var(--text); }
.textarea { min-height: 70px; resize: vertical; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 8, 18, .7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; animation: fadeIn .18s;
}
.modal {
  width: 640px; max-width: 92vw; max-height: 86vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--panel-border); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 0 60px rgba(0, 212, 255, .12); animation: slideUp .2s;
}
.modal h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.modal h3::before { content: ""; width: 4px; height: 14px; background: var(--cyan); border-radius: 2px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } }

/* Toast */
.toast-wrap { position: fixed; top: 70px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 11px 18px; border-radius: 9px; font-size: 13px; min-width: 240px;
  background: var(--bg2); border: 1px solid var(--cyan-dim); color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5); animation: slideIn .22s;
}
.toast.ok { border-color: rgba(82, 224, 168, .5); }
.toast.err { border-color: rgba(255, 91, 106, .5); }
.toast.warn { border-color: rgba(255, 197, 61, .5); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

/* ---------- 图表容器 ---------- */
.chart { width: 100%; height: 300px; }
.chart.sm { height: 220px; }
.chart.lg { height: 380px; }

/* 模块导航卡（主页） */
.mod-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
}
.mod-card:hover { transform: translateY(-3px); border-color: var(--cyan-dim); box-shadow: 0 8px 30px rgba(0, 212, 255, .15); }
.mod-card .mc-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 19px;
  background: rgba(0, 212, 255, .1); border: 1px solid var(--panel-border); margin-bottom: 10px;
}
.mod-card h4 { font-size: 14px; }
.mod-card p { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
.mod-card .mc-num {
  position: absolute; right: 12px; top: 10px; font-size: 24px; font-weight: 800;
  color: rgba(0, 212, 255, .12); font-family: "Bahnschrift", var(--font);
}
.mod-card .mc-health { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); }

/* 时间轴 / 步骤 */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.step::before {
  content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 1px;
  background: linear-gradient(180deg, var(--cyan-dim), transparent);
}
.step:last-child::before { display: none; }
.step .s-dot {
  width: 23px; height: 23px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; border: 1px solid var(--cyan-dim); color: var(--cyan);
  background: var(--bg2);
}
.step.done .s-dot { background: var(--cyan); color: #04101f; box-shadow: 0 0 10px var(--cyan-dim); }
.step.blocked .s-dot { border-color: var(--red); color: var(--red); }
.step .s-body { flex: 1; }
.step .s-body h5 { font-size: 13px; }
.step .s-body p { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.6; }

/* 描述列表 */
.desc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; font-size: 13px; }
.desc .d-item { display: flex; gap: 8px; }
.desc .d-item .d-label { color: var(--text-dim); flex-shrink: 0; }
.desc .d-item .d-value { color: var(--text); }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-input { width: 220px; }

/* 登录页 */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.login-box {
  width: 400px; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 40px 38px; box-shadow: 0 0 80px rgba(0, 212, 255, .1);
  animation: slideUp .3s;
}
.login-box .logo { border: none; padding: 0; justify-content: center; margin-bottom: 8px; }
.login-sub { text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 28px; letter-spacing: 1px; }
.login-box .form-item { margin-bottom: 16px; }
.login-btn { width: 100%; padding: 11px; font-size: 14px; justify-content: center; }
.login-tip { text-align: center; font-size: 11px; color: var(--text-dim); margin-top: 16px; }
.login-ten { display: flex; justify-content: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.login-ten span { font-size: 10px; color: var(--text-dim); border: 1px solid var(--panel-border); padding: 2px 8px; border-radius: 8px; }

/* 预警横幅 */
.alert-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 9px;
  font-size: 12px; margin-bottom: 16px; border: 1px solid;
}
.alert-banner.red { color: var(--red); border-color: rgba(255, 91, 106, .35); background: rgba(255, 91, 106, .07); }
.alert-banner.gold { color: var(--gold); border-color: rgba(255, 197, 61, .35); background: rgba(255, 197, 61, .07); }
.alert-banner.cyan { color: var(--cyan); border-color: rgba(0, 212, 255, .35); background: rgba(0, 212, 255, .07); }

/* 空状态 */
.empty { text-align: center; padding: 40px 0; color: var(--text-dim); font-size: 12px; }
