:root {
  /* 宣纸与白瓷基底色 */
  --paper-base: #f6f8fb;
  --paper-pure: #ffffff;
  
  /* 单线条素描墨线体系 (提高清晰度对比) */
  --line-faint: rgba(15, 23, 42, 0.05);
  --line-subtle: rgba(15, 23, 42, 0.12);
  --line-medium: rgba(15, 23, 42, 0.22);
  --line-dark: #0f172a;
  
  /* 文字可读性强化：深黑主色与高对比度灰 */
  --text-main: #090d16;
  --text-muted: #1e293b;
  --text-dim: #475569;
  --text-faint: #64748b;
  
  /* 流动光影色谱 */
  --flow-cyan: #0284c7;
  --flow-cyan-glow: rgba(2, 132, 199, 0.4);
  --flow-purple: #7c3aed;
  --flow-purple-glow: rgba(124, 58, 237, 0.4);
  --flow-emerald: #059669;
  --flow-emerald-glow: rgba(5, 150, 105, 0.35);
  --flow-rose: #dc2626;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "PingFang SC", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--paper-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* 宣纸微点阵与顶部极光微光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.04) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.ambient-aurora {
  position: fixed;
  top: -12vw;
  left: 20vw;
  width: 60vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(168, 85, 247, 0.04) 50%, transparent 75%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px 80px;
  position: relative;
  z-index: 1;
}

/* 1. 顶部刊头 Header */
.masthead {
  border-bottom: 2px solid var(--line-dark);
  padding-bottom: 18px;
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.masthead-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-origin-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-medium);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.brand-origin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-main);
  box-shadow: 0 0 6px rgba(15, 23, 42, 0.5);
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.1;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--flow-cyan);
  background: rgba(2, 132, 199, 0.09);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 2px 6px;
  border-radius: 3px;
}

.masthead-center {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-subtle);
  padding: 7px 18px;
  border-radius: 6px;
}

.status-chip-live {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot-emerald {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flow-emerald);
  box-shadow: 0 0 8px var(--flow-emerald);
  position: relative;
}

.pulse-dot-emerald::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--flow-emerald);
  animation: pulse-ring 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-line {
  background: #fff;
  border: 1px solid var(--line-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-line:hover {
  border-color: var(--line-medium);
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.btn-line-dark {
  background: var(--text-main);
  color: #fff;
  border-color: var(--text-main);
}

.btn-line-dark:hover {
  background: #1e293b;
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

/* 2. 次级控制栏 */
.sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.view-toggles {
  display: flex;
  border: 1px solid var(--line-subtle);
  background: #fff;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: var(--text-main);
  color: #fff;
  font-weight: 600;
}

.sync-legend {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 3. 抽屉折叠面板 */
.drawer-box {
  border: 1px solid var(--line-medium);
  background: #fff;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  position: relative;
}

.drawer-box::before {
  content: "+";
  position: absolute;
  top: -7px; left: -5px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.drawer-box::after {
  content: "+";
  position: absolute;
  bottom: -7px; right: -5px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.drawer-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.drawer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.input-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 600;
}

.line-input {
  height: 38px;
  background: #fff;
  border: 1px solid var(--line-subtle);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.line-input:focus {
  border-color: var(--flow-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.command-banner {
  background: rgba(15, 23, 42, 0.02);
  border: 1px dashed var(--line-medium);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
}

.command-code {
  color: var(--flow-cyan);
  word-break: break-all;
  font-weight: 600;
}

/* 4. 单线条素描网格卡片 (提高可读性与触控面积) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.sketch-card {
  background: var(--paper-pure);
  border: 1px solid var(--line-subtle);
  padding: 24px 22px 20px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  cursor: pointer; /* 整个卡片可点击进入详情 */
}

.sketch-card::before {
  content: "+";
  position: absolute;
  top: -8px; left: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.sketch-card::after {
  content: "+";
  position: absolute;
  bottom: -8px; right: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.sketch-card:hover {
  border-color: var(--line-medium);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07), 0 0 18px rgba(2, 132, 199, 0.08);
}

/* 卡片头部 */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.card-title-main {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-badges-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 4px;
}

.meta-sep {
  color: var(--line-medium);
}

.status-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flow-emerald);
  box-shadow: 0 0 6px var(--flow-emerald);
}

.status-dot-sm.offline {
  background: var(--flow-rose);
  box-shadow: 0 0 6px var(--flow-rose);
}

/* 指标块与可读性优化 */
.metric-block {
  margin-bottom: 14px;
}

.metric-hdr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.metric-title-txt {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.metric-val-num {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.mono-track {
  width: 100%;
  height: 3px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}

.mono-bar-dark {
  height: 100%;
  background: var(--text-main);
  transition: width 0.3s ease;
}

.mono-bar-dark.alert {
  background: var(--flow-rose);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

/* 三联 Load Average 指标 */
.load-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.025);
  border: 1px solid var(--line-subtle);
  padding: 6px 10px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.load-col {
  display: flex;
  flex-direction: column;
}

.load-lbl {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
}

.load-data {
  font-weight: 700;
  color: var(--text-muted);
}

/* 5. 实时光纤波导管 (保留流动的光影效果) */
.photonic-box {
  border: 1px solid var(--line-subtle);
  background: #fafbfc;
  padding: 12px 14px;
  margin-bottom: 16px;
  position: relative;
}

.photonic-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background: var(--flow-cyan);
}

.photonic-lane {
  display: grid;
  grid-template-columns: 44px 1fr 85px;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.photonic-lane:last-child {
  margin-bottom: 0;
}

.lane-dir {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 600;
}

.lane-wire {
  width: 100%;
  height: 2px;
  background: rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

/* 极光青下行流光束 */
.stream-rx {
  position: absolute;
  left: 0; top: 0; height: 100%; width: 30%;
  background: linear-gradient(90deg, transparent, var(--flow-cyan), #38bdf8);
  box-shadow: 0 0 8px var(--flow-cyan-glow);
  animation: stream-flow 1.8s linear infinite;
}

/* 星际紫上行流光束 */
.stream-tx {
  position: absolute;
  left: 0; top: 0; height: 100%; width: 30%;
  background: linear-gradient(90deg, transparent, var(--flow-purple), #c084fc);
  box-shadow: 0 0 8px var(--flow-purple-glow);
  animation: stream-flow 2.2s linear infinite reverse;
}

@keyframes stream-flow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(450%); }
}

.lane-num {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 6. 系统矩阵 */
.specs-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  border-top: 1px solid var(--line-subtle);
  padding-top: 14px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
}

.spec-k {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.spec-v {
  color: var(--text-muted);
  font-weight: 600;
}

/* 卡片底部操作栏 */
.card-bottom-bar {
  border-top: 1px solid var(--line-subtle);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
}

.card-action-links {
  display: flex;
  gap: 8px;
}

.link-btn {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-subtle);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-weight: 500;
}

.link-btn:hover {
  color: var(--text-main);
  border-color: var(--text-main);
  background: #fff;
}

.link-btn.danger:hover {
  color: var(--flow-rose);
  border-color: var(--flow-rose);
}

/* 7. 紧凑表格视图 */
.table-panel {
  border: 1px solid var(--line-subtle);
  background: var(--paper-pure);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}

.table-monoline {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.table-monoline th {
  text-align: left;
  padding: 13px 18px;
  background: rgba(15, 23, 42, 0.02);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  border-bottom: 1px solid var(--line-subtle);
}

.table-monoline td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text-muted);
  vertical-align: middle;
}

.table-monoline tr:last-child td {
  border-bottom: none;
}

.table-monoline tr:hover td {
  background: rgba(15, 23, 42, 0.02);
  color: var(--text-main);
}

/* 8. 图表与模态 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 860px;
  background: var(--paper-pure);
  border: 1px solid var(--line-medium);
  padding: 28px 32px;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
}

.modal-content::before {
  content: "+";
  position: absolute;
  top: -8px; left: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.modal-content::after {
  content: "+";
  position: absolute;
  bottom: -8px; right: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 17px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-cross {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-subtle);
  background: #fff;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.close-cross:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.chart-area-box {
  width: 100%;
  height: 250px;
  background: #fafbfc;
  border: 1px solid var(--line-subtle);
  padding: 16px 20px;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 218px;
  display: block;
}

/* 9. 登录与设置表单页 */
.login-box {
  max-width: 440px;
  margin: 80px auto 0;
  background: var(--paper-pure);
  border: 1px solid var(--line-medium);
  padding: 38px 34px;
  position: relative;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

.login-box::before {
  content: "+";
  position: absolute;
  top: -8px; left: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

.login-box::after {
  content: "+";
  position: absolute;
  bottom: -8px; right: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--line-medium);
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px 60px;
  }
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .drawer-grid {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}
