/* 图神经网络对抗攻击防御与检测系统 — 控制台样式 */
:root {
  --bg: #0b1220;
  --panel: #111a2c;
  --panel2: #16203a;
  --line: #23304d;
  --text: #dbe4f5;
  --muted: #7c8db0;
  --accent: #38bdf8;
  --good: #34d399;
  --warn: #f87171;
  --gold: #fbbf24;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
}
.layout { display: flex; min-height: 100vh; }

/* 侧栏 */
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9, #34d399);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #04121f; font-weight: bold;
}
.brand-name { font-size: 13px; font-weight: 600; line-height: 1.45; }
.brand-ver { font-size: 11px; color: var(--muted); margin-top: 2px; }
nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  color: var(--muted); text-decoration: none; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; transition: all .15s;
}
.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(56,189,248,.16), transparent);
  color: var(--accent); border-left: 3px solid var(--accent);
}
.sidebar-foot { font-size: 11px; color: var(--muted); line-height: 1.8; }
.sidebar-foot span { color: var(--accent); }

/* 主区 */
.main { flex: 1; padding: 24px 30px 40px; position: relative; }
.topbar h1 { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.panel[hidden] { display: none; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px;
}
.card.wide { width: 100%; }
.card h3 { font-size: 15px; margin-bottom: 12px; color: var(--text); }
.muted { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat-card .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-card .v { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-card.good .v { color: var(--good); }
.stat-card.warn .v { color: var(--warn); }
.stat-card.gold .v { color: var(--gold); }

.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.module {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 5px; transition: border-color .15s;
}
.module:hover { border-color: var(--accent); }
.module b { font-size: 14px; }
.module span { font-size: 12px; color: var(--muted); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; margin-bottom: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form-grid select, .form-grid input[type=number] {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none;
}
.form-grid select:focus, .form-grid input:focus { border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.chk-row { flex-direction: row !important; align-items: center; gap: 12px !important; }
.chk { display: flex; align-items: center; gap: 4px; color: var(--text); font-size: 13px; }
.chk input { accent-color: var(--accent); }
.btn {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 22px; border-radius: 8px; font-size: 14px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, #0284c7, #059669); border: none; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表格与结果 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tbl tr:hover td { background: rgba(56,189,248,.04); }
.result h4 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 6px; }
.metric { background: var(--panel2); border-radius: 10px; padding: 12px 14px; }
.metric .k { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.metric .v { font-size: 20px; font-weight: 700; }
.v.up { color: var(--good); }
.v.down { color: var(--warn); }
.v.flat { color: var(--accent); }
.curve-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-top: 10px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; margin-right: 6px; }
.tag.b { background: rgba(56,189,248,.15); color: var(--accent); }
.tag.g { background: rgba(52,211,153,.15); color: var(--good); }
.tag.r { background: rgba(248,113,113,.15); color: var(--warn); }

.ds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ds-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.ds-card h4 { font-size: 15px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.ds-card .row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: var(--muted); }
.ds-card .row b { color: var(--text); }
.ds-card .bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 10px; overflow: hidden; display: flex; }

.taskbar {
  position: sticky; bottom: 14px; margin-top: 18px;
  background: var(--panel2); border: 1px solid var(--accent);
  border-radius: 10px; padding: 10px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; width: fit-content;
}
.spin {
  width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  animation: rot 0.8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.bar-seg { height: 100%; }
