* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  color: #1b2a41;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3fa 100%);
}
.app { max-width: 980px; margin: 0 auto; padding: 16px 14px 84px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
h1 { margin: 0; font-size: clamp(1.25rem, 3.2vw, 1.9rem); }
h2 { margin: 0 0 10px; font-size: 1.1rem; }
h3 { margin: 0 0 10px; font-size: 1rem; }
p { margin: 4px 0 0; color: #50617a; }

.card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(35, 64, 110, 0.06);
  margin-bottom: 12px;
}
.auth-card { max-width: 460px; margin: 20px auto; }

label { display: block; margin-bottom: 10px; font-size: 0.92rem; color: #44556d; }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d5dfec;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fbfdff;
}
textarea { resize: vertical; min-height: 74px; }

button {
  border: 0;
  background: #1d5fd1;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.93rem;
  cursor: pointer;
}
button:hover { filter: brightness(0.96); }
button.warn { background: #d16b1d; }
button.danger { background: #c73636; }
button.ghost { background: #eef3fb; color: #27415f; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #ffffffcc;
  border: 1px solid #e4ebf6;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 12px;
  position: sticky;
  top: 8px;
  backdrop-filter: blur(6px);
  z-index: 5;
}
.tab { background: transparent; color: #3e536f; }
.tab.active { background: #1d5fd1; color: #fff; }

.pane { display: none; }
.pane.active { display: block; }

.mini-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.mini { background: #edf2fb; color: #355274; }
.mini.active { background: #1d5fd1; color: #fff; }

.list { display: grid; gap: 10px; }
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e7edf7;
  border-radius: 12px;
}
.nodes-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.nodes-table th,
.nodes-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}
.nodes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faff;
  color: #5a6f88;
}
.nodes-table .sub {
  color: #7287a0;
  font-size: 0.78rem;
  margin-top: 2px;
}
.nodes-table .actions {
  display: flex;
  gap: 6px;
}

.table-head {
  display: none;
}
.row {
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border: 1px solid #e7edf7;
  border-radius: 12px;
  padding: 10px;
  background: #fcfdff;
}
.row.node { grid-template-columns: 48px 56px 1.5fr 1fr 90px 80px; }
.row.node.compact { grid-template-columns: 36px 48px 1.5fr 1fr 90px 80px; }
.table-head.compact { grid-template-columns: 36px 48px 1.5fr 1fr 90px 80px; }
.row .grow p { margin: 2px 0 0; font-size: 0.82rem; color: #5f728b; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar.grid2 > * { flex: 1 1 220px; }
.toolbar.grid3 > * { flex: 1 1 180px; }
.grid2 {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hint { color: #667a93; font-size: 0.9rem; min-height: 18px; }
.stats { margin: 0; padding-left: 18px; color: #415977; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 28, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 20;
}
.modal-card {
  width: min(820px, 100%);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e0e8f2;
  padding: 14px;
}

.modal-card .toolbar:last-child {
  position: sticky;
  bottom: -14px;
  background: #fff;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #eef2f7;
}

@media (max-width: 780px) {
  .app { padding: 12px 10px 92px; }
  .topbar { align-items: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .modal-card {
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .table-head { display: none; }
  .row { grid-template-columns: 1fr; }
  .row.node { grid-template-columns: 1fr; }
  .tabs {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    box-shadow: 0 10px 25px rgba(25, 52, 97, 0.2);
  }
  button { min-height: 44px; }
}


.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(20, 34, 56, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 30;
}
#confirmText,#promptText { color:#4f6278; margin: 0 0 10px; }
