:root {
  --bg-0: #090d1a;
  --bg-1: #0e1528;
  --bg-2: #121f38;
  --card: rgba(13, 24, 45, 0.94);
  --card-2: rgba(10, 18, 34, 0.95);
  --line: rgba(145, 174, 230, 0.24);
  --text-main: #e8eefc;
  --text-sub: #9fb4dd;
  --text-dim: #7ea0dd;
  --accent: #8fd0ff;
  --accent-2: #67b7ff;
  --danger: #ff8a9a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.public-theme {
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 10% 10%, #1a2748 0%, var(--bg-1) 38%, var(--bg-0) 100%);
  color: var(--text-main);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #b8e6ff;
}

.pg-header {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pg-brand-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.pg-brand-title {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.pg-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pg-nav a {
  border: 1px solid rgba(126, 160, 221, 0.35);
  background: rgba(14, 27, 52, 0.7);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: #c9daff;
}

.pg-nav a.active {
  color: #ffffff;
  border-color: rgba(77, 158, 255, 0.7);
  background: linear-gradient(135deg, rgba(26, 83, 173, 0.9), rgba(17, 128, 203, 0.85));
}

.pg-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 6px 18px 24px;
  display: grid;
  gap: 12px;
}

.section-head {
  display: grid;
  gap: 6px;
}

.section-kicker {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  color: #f4f8ff;
}

.section-subtitle {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.hint {
  color: var(--text-sub);
  font-size: 13px;
}

.table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(9, 16, 32, 0.78);
  color: var(--text-main);
}

.table th,
.table td,
.detail-table th,
.detail-table td {
  border: 1px solid rgba(147, 169, 206, 0.22);
  padding: 8px;
  vertical-align: top;
  font-size: 13px;
}

.table th,
.detail-table th {
  width: 180px;
  background: rgba(83, 121, 199, 0.26);
  color: #eaf2ff;
  text-align: left;
}

.flat-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.public-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.public-home-link {
  border: 1px solid rgba(145, 174, 230, 0.3);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(12, 24, 46, 0.95), rgba(8, 15, 29, 0.95));
  display: grid;
  gap: 4px;
  color: #e4eeff;
}

.public-home-link strong {
  font-size: 16px;
}

.sm-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.sm-filter label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.sm-filter input[type="text"],
.sm-filter input[type="number"] {
  background: rgba(8, 17, 33, 0.82);
  border: 1px solid rgba(145, 174, 230, 0.35);
  color: #eff5ff;
  border-radius: 8px;
  padding: 6px 8px;
}

.sm-filter input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.sm-filter button,
.btn {
  background: linear-gradient(135deg, #1973d8, #1598c9);
  border: 1px solid rgba(136, 197, 255, 0.72);
  color: white;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.sm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
}

.sm-viewport {
  position: relative;
  min-height: 74vh;
  border-radius: 12px;
  border: 1px solid rgba(145, 174, 230, 0.3);
  overflow: hidden;
  background: #0f172a;
}

.sm-viewport .grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

#siteGraphForceView {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sm-viewport .tooltip {
  position: absolute;
  z-index: 8;
  display: none;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.4;
  color: #edf4ff;
  background: rgba(7, 13, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 320px;
}

.sm-layer-view {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 24px 18px 34px;
  background: rgba(17, 24, 39, 0.78);
  color: #e5eefc;
  display: none;
}

.sm-side {
  border: 1px solid rgba(145, 174, 230, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(12, 24, 46, 0.95), rgba(8, 15, 29, 0.95));
  padding: 12px;
}

.sm-side h3 {
  margin-top: 0;
}

.sm-actions {
  margin-top: 8px;
}

.code-block {
  border: 1px solid rgba(141, 173, 229, 0.28);
  border-radius: 10px;
  background: rgba(7, 13, 26, 0.9);
  color: #dbe9ff;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.site-mock-layer-wrap {
  display: grid;
  gap: 12px;
}

.site-mock-layer {
  border: 1px solid rgba(145, 174, 230, 0.25);
  border-radius: 10px;
  background: rgba(9, 17, 33, 0.7);
  padding: 10px;
}

.site-mock-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.site-mock-layer-title {
  font-weight: 700;
}

.site-mock-layer-desc {
  font-size: 12px;
  color: #b8cae8;
}

.site-mock-layer-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.site-mock-node-card {
  border: 1px solid rgba(145, 174, 230, 0.2);
  border-radius: 9px;
  padding: 9px;
  background: rgba(12, 22, 43, 0.9);
  cursor: pointer;
  display: grid;
  gap: 8px;
}

.site-mock-node-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-mock-dot {
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.site-mock-node-name {
  font-weight: 600;
}

.site-mock-node-mini {
  color: #b9cae8;
  font-size: 12px;
  line-height: 1.55;
}

.site-mock-links-mini {
  font-size: 12px;
  color: #a6c4ec;
  line-height: 1.45;
  min-height: 20px;
}

.site-mock-detail-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 12px;
}

.public-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

.public-breadcrumb span,
.public-breadcrumb a {
  display: inline-flex;
  align-items: center;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.section-block h3 {
  margin: 0 0 8px;
}

.section-block p {
  margin: 0;
}

.detail-link-list {
  display: grid;
  gap: 8px;
}

.cg-note-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(139, 194, 255, 0.85);
  background: linear-gradient(135deg, #195ec6, #12a2d9);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(18, 127, 205, 0.38);
}

.cg-note-panel {
  position: fixed;
  right: 20px;
  bottom: 78px;
  z-index: 1000;
  width: min(360px, calc(100vw - 30px));
  background: linear-gradient(180deg, rgba(12, 24, 46, 0.98), rgba(8, 15, 29, 0.98));
  border: 1px solid rgba(145, 174, 230, 0.35);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(18, 26, 40, 0.2);
  padding: 10px;
  color: var(--text-main);
}

.cg-note-panel[hidden] {
  display: none !important;
}

.cg-note-head {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 14px;
}

.cg-note-panel textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(7, 13, 26, 0.9);
  border: 1px solid rgba(145, 174, 230, 0.35);
  color: #eff5ff;
}

.cg-note-actions {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cg-note-status {
  font-size: 12px;
  color: var(--text-sub);
}

@media (max-width: 1100px) {
  .sm-layout {
    grid-template-columns: 1fr;
  }
}
