:root {
  --page-bg: #06101d;
  --card-bg-1: rgba(16, 31, 51, 0.96);
  --card-bg-2: rgba(8, 17, 31, 0.98);
  --border: rgba(120, 150, 180, 0.18);
  --border-strong: rgba(120, 150, 180, 0.24);
  --title: #f5f7fb;
  --text: #dce3ef;
  --muted: #8d98a8;
  --green: #67e38b;
  --cyan: #6ee7ff;
  --gold: #ffd166;
  --red: #ff6b8a;
  --line: rgba(255, 255, 255, 0.08);
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(73, 137, 189, 0.13), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(255, 209, 102, 0.08), transparent 25%),
    linear-gradient(180deg, #071523 0%, var(--page-bg) 100%);
  font-family: var(--body);
}
.grid-overlay { display: none; }
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo { color: var(--gold); font-size: 22px; font-weight: 900; }
.page-tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px; border: 1px solid rgba(255,255,255,.08); border-radius: 24px; background: rgba(255,255,255,.035); }
.page-tab { min-width: 74px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 900; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.page-tab.active { color: #06101d; background: linear-gradient(135deg, var(--cyan), #57d8f1); box-shadow: 0 8px 22px rgba(110,231,255,.18); }
.version-badge { color: #aab4c4; font: 700 14px/1.2 var(--mono); }
.board-shell { max-width: 1480px; margin: 0 auto; padding: 24px 20px 34px; }
.board-section + .board-section { margin-top: 26px; }
.section-title { margin: 0 0 12px 2px; color: rgba(220,227,239,.62); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.pve-header-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.pve-header-actions[hidden] { display: none; }
.header-edit-btn, .header-save-btn { min-width: 54px; min-height: 32px; padding: 0 12px; border: 1px solid rgba(110,231,255,.28); border-radius: 999px; background: rgba(110,231,255,.12); color: var(--cyan); font-size: 12px; font-weight: 950; cursor: pointer; }
.header-save-btn { border-color: rgba(245,200,107,.32); background: rgba(245,200,107,.12); color: var(--gold); }
.header-save-btn:disabled { opacity: .55; cursor: not-allowed; }
.save-state { min-width: 44px; color: var(--muted); font-size: 11px; font-weight: 900; white-space: nowrap; }
.save-state.ok { color: var(--green); }
.save-state.bad { color: var(--red); }
.save-state.pending { color: var(--gold); }
.fetch-alert {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  color: #ffd8df;
  background: rgba(255, 107, 138, .12);
  border: 1px solid rgba(255, 107, 138, .28);
  font-size: 13px;
  font-weight: 900;
}
.fetch-alert[hidden] { display: none; }
.cockpit-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.info-grid { padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.05); }
.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  padding: 10px 16px 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border: 1px solid var(--border);
  box-shadow: 0 18px 45px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
}
.card-sm { flex: 1 1 300px; min-width: 300px; height: 245px; }
.card-md { flex: 1 1 360px; min-width: 360px; height: 390px; }
.card-lg { flex: 1 1 440px; min-width: 440px; height: 390px; border-color: var(--border-strong); }
.metric-card { height: 390px; }
.card-top { display: grid; grid-template-columns: 1fr auto; align-items: start; min-height: 28px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; padding: 0 11px; border-radius: 999px;
  font-size: 11px; font-weight: 900; white-space: nowrap;
  color: var(--green); background: rgba(64, 220, 120, .10); border: 1px solid rgba(103, 227, 139, .35);
}
.status-pill.warning { color: var(--gold); background: rgba(255, 209, 102, .10); border-color: rgba(255, 209, 102, .35); }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; box-shadow: 0 0 12px currentColor; }
.card-hero { text-align: center; padding: 0 0 4px; transform: translateY(-5px); }
.card-number { color: var(--title); font-size: 34px; font-weight: 950; line-height: 1; letter-spacing: .3px; }
.card-name { margin-top: 6px; color: #8e99a8; font-size: 15px; font-weight: 800; line-height: 1.2; }
.card-body { min-width: 0; }
.access-list { display: grid; gap: 8px; }
.access-row {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: 46px; padding: 8px 12px; border-radius: 14px;
  overflow: visible;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.075);
}
.clickable-row { cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.clickable-row:hover, .default-open:hover { border-color: rgba(110,231,255,.32); background: rgba(110,231,255,.06); transform: translateY(-1px); }
.default-open { cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.access-label { color: #8994a4; font-size: 12px; font-weight: 800; }
.access-url { position: relative; display: inline-block; max-width: 100%; overflow: visible; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 13px; line-height: 1.45; font-weight: 900; cursor: copy; border-radius: 8px; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.access-url:hover { text-decoration: underline; text-underline-offset: 3px; }
.access-url.copied { background: rgba(110,231,255,.14); box-shadow: 0 0 0 4px rgba(110,231,255,.06); }
.access-url.copied::after {
  content: "已复制";
  position: absolute;
  right: 0;
  top: -26px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #05202a;
  background: var(--cyan);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  pointer-events: none;
}
.access-url.copy-failed { background: rgba(255,107,138,.14); box-shadow: 0 0 0 4px rgba(255,107,138,.06); }
.access-url.copy-failed::after {
  content: "复制失败";
  position: absolute;
  right: 0;
  top: -26px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}
.access-url.internal { color: var(--cyan); }
.access-url.external { color: var(--gold); }
.access-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mini-btn {
  min-width: 0; height: 38px; padding: 0 8px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.045);
  color: #d7deea; font-size: 12px; font-weight: 800; cursor: pointer;
}
.mini-btn.gold { color: var(--gold); border-color: rgba(255, 209, 102, .24); }
.mini-btn.cyan { color: #032536; border-color: rgba(110,231,255,.3); background: linear-gradient(135deg, #6ee7ff, #57d8f1); }
.metric-extension { margin-top: 7px; }
.section-line { height: 1px; background: var(--line); margin: 9px 0; }
.metric-grid { display: grid; gap: 8px; }
.metric-grid.two { grid-template-columns: 1fr 1fr; }
.metric-grid.one { grid-template-columns: 1fr; }
.metric-box {
  min-width: 0; overflow: hidden; padding: 9px 10px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.075); text-align: left;
}
.copyable-box { position: relative; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.copyable-box:hover { border-color: rgba(110,231,255,.34); background: rgba(110,231,255,.07); transform: translateY(-1px); }
.copyable-box.copied::after {
  content: "已复制";
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #05202a;
  background: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}
.metric-title { color: #909caf; font-size: 12px; font-weight: 800; }
.metric-value { margin-top: 7px; font-size: 13px; line-height: 1.08; font-weight: 950; white-space: nowrap; overflow: visible; }
.metric-value.small { font-size: 12px; }
.metric-value.positive, .positive { color: var(--green); }
.metric-value.negative, .negative { color: var(--red); }
.metric-value.gold, .gold { color: var(--gold); }
.metric-value.cyan, .cyan { color: var(--cyan); }
.metric-desc { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.tone-gold { background: linear-gradient(145deg, rgba(255,209,102,.10), rgba(255,255,255,.04)); }
.tone-cyan { background: linear-gradient(145deg, rgba(110,231,255,.08), rgba(255,255,255,.04)); }
.total-row, .progress-box {
  margin-top: 8px; padding: 9px 10px; border-radius: 12px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.075);
}
.total-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 800; }
.total-row strong { color: var(--text); font-size: 12px; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 900; }
.accent { color: var(--gold); }
.verify-badge { padding: 3px 8px; border-radius: 999px; color: #c9d5e6; background: rgba(120,150,180,.12); border: 1px solid rgba(120,150,180,.18); white-space: nowrap; }
.progress-track { margin-top: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd166, #f7b955); }
.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.store-box { padding: 8px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.075); }
.store-title { color: var(--cyan); font-size: 12px; font-weight: 900; text-align: center; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.store-mini { padding: 5px 6px; border-radius: 9px; background: rgba(0,0,0,.12); text-align: center; }
.store-mini span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.store-mini strong { display: block; margin-top: 2px; color: var(--title); font-size: 12px; font-weight: 900; }
.balance-row { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; }
.balance-row strong { color: var(--green); }
.metric-empty { min-height: 54px; display: grid; place-items: center; padding: 10px; color: var(--muted); font-size: 12px; font-weight: 800; border: 1px dashed rgba(255,255,255,.12); border-radius: 12px; }
.metric-alert {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}
.metric-alert.warn { color: var(--gold); background: rgba(255,209,102,.10); border: 1px solid rgba(255,209,102,.24); }
.metric-alert.bad { color: #ffd8df; background: rgba(255,107,138,.12); border: 1px solid rgba(255,107,138,.28); }

.pve-section + .pve-section { margin-top: 28px; }
.pve-node-access { max-width: 520px; margin: -2px 0 14px; }
.pve-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.pve-card {
  min-width: 0;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16,31,51,.94), rgba(8,17,31,.98));
  border: 1px solid var(--border);
  box-shadow: 0 18px 45px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.035);
}
.pve-card-top, .pve-child-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pve-type { color: var(--cyan); font: 900 12px/1 var(--mono); padding: 5px 9px; border-radius: 999px; background: rgba(110,231,255,.08); border: 1px solid rgba(110,231,255,.16); }
.status-pill.tiny { height: 22px; padding: 0 9px; font-size: 10px; }
.pve-edit-strip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-top: 10px; }
.drag-handle { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--cyan); background: rgba(110,231,255,.08); border: 1px dashed rgba(110,231,255,.28); font-size: 11px; font-weight: 950; cursor: grab; }
.pve-edit-strip button { min-height: 32px; min-width: 44px; border: 1px solid rgba(255,107,138,.22); border-radius: 10px; color: #ffd8df; background: rgba(255,107,138,.08); font-size: 11px; font-weight: 900; cursor: pointer; }
.pve-card.edit-mode, .pve-child-card.edit-mode { cursor: grab; border-color: rgba(110,231,255,.28); }
.pve-card.dragging, .pve-child-card.dragging { opacity: .55; transform: scale(.98); }
.pve-id { margin-top: 12px; color: var(--title); font: 950 34px/1 var(--mono); text-align: center; }
.pve-name { margin-top: 6px; color: #aab4c4; font-size: 15px; font-weight: 900; text-align: center; }
.pve-project { margin: 8px 0 12px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.pve-address-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.075);
}
.pve-address-label { color: #8994a4; font-size: 10px; font-weight: 900; white-space: nowrap; }
.pve-address-value { position: relative; display: block; min-width: 0; max-width: 100%; overflow: visible; white-space: nowrap; text-align: left; padding: 0; border: 0; background: transparent; font: 900 10.5px/1.55 var(--mono); letter-spacing: -0.25px; cursor: copy; border-radius: 8px; }
.pve-address-value.internal { color: var(--cyan); }
.pve-address-value.external { color: var(--gold); }
.pve-address-input { min-width: 0; width: 100%; height: 28px; padding: 0 7px; border: 1px solid rgba(255,255,255,.11); border-radius: 9px; background: rgba(0,0,0,.18); font: 900 10.5px/1 var(--mono); letter-spacing: -0.25px; outline: none; }
.pve-address-input.internal { color: var(--cyan); }
.pve-address-input.external { color: var(--gold); }
.editing-row { cursor: default; }
.pve-address-value.copied { background: rgba(110,231,255,.14); box-shadow: 0 0 0 4px rgba(110,231,255,.06); }
.pve-address-value.copied { overflow: visible; }
.pve-address-value.copied::after { content: "已复制"; position: absolute; right: 0; top: -24px; padding: 3px 8px; border-radius: 999px; color: #05202a; background: var(--cyan); font-family: var(--body); font-size: 10px; font-weight: 900; pointer-events: none; }
.url-health { width: 10px; height: 10px; border-radius: 999px; justify-self: end; background: rgba(141,152,168,.55); box-shadow: 0 0 0 3px rgba(141,152,168,.10); }
.url-health.hidden { display: none; }
.url-health.checking { background: var(--gold); box-shadow: 0 0 0 3px rgba(255,209,102,.10), 0 0 12px rgba(255,209,102,.28); }
.url-health.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(103,227,139,.10), 0 0 12px rgba(103,227,139,.34); }
.url-health.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(255,107,138,.10), 0 0 12px rgba(255,107,138,.34); }
.muted-row { opacity: .72; }
.pve-children-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pve-children-title { color: var(--gold); font-size: 13px; font-weight: 950; letter-spacing: .04em; }
.pve-children-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pve-children-grid.standalone { margin-top: 0; }
.pve-child-card { min-width: 0; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.075); }
.pve-child-name { color: var(--title); font-size: 13px; font-weight: 950; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pve-child-project { margin: 7px 0 9px; color: var(--muted); font-size: 11px; font-weight: 800; }

@media (max-width: 1180px) {
  .pve-grid, .pve-children-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .pve-grid, .pve-children-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .top-bar { padding: 16px 12px 12px; gap: 10px; flex-wrap: wrap; }
  .page-tabs { order: 3; width: 100%; justify-content: center; }
  .board-shell { padding: 18px 12px 24px; }
  .cockpit-grid { gap: 14px; }
  .project-card, .card-sm, .card-md, .card-lg { min-width: 100%; flex-basis: 100%; height: auto; min-height: auto; }
  .metric-grid.two, .store-grid, .pve-grid, .pve-children-grid { grid-template-columns: 1fr; }
  .access-row { grid-template-columns: 68px 1fr; }
  .pve-address-row { grid-template-columns: 54px minmax(0, 1fr) 12px; }
  .access-actions { grid-template-columns: 1fr; }
}
