:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  --bg: #0b1218;
  --panel: #111c25;
  --field: #0c151c;
  --text: #e8efef;
  --muted: #92a5ae;
  --line: #25333d;
  --accent: #97e3bf;
  --accent-text: #11291e;
  --notice: #172a27;
  --shadow: 0 20px 60px #0002;
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
}
:root[data-theme="light"] {
  --bg: #f5f7f4;
  --panel: #fff;
  --field: #f7f9f7;
  --text: #172d2b;
  --muted: #607671;
  --line: #dce5df;
  --accent: #22785c;
  --accent-text: #fff;
  --notice: #e9f4ed;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
.file-button {
  font: inherit;
}
button,
.file-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.16s,
    transform 0.16s;
}
button:hover,
.file-button:hover {
  background: var(--notice);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 650;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--text);
  max-width: 100%;
  min-width: 0;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  margin: 18px 0 8px;
}
header {
  height: 88px;
  border-bottom: 1px solid var(--line);
  padding: 0 max(24px, calc((100vw - 1256px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -1px;
  font-size: 26px;
}
.brand em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.mark {
  background: var(--accent);
  color: var(--accent-text);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  position: relative;
  font-weight: 650;
  font-size: 30px;
  line-height: 1;
}
.mark > span {
  font-size: 15px;
  position: absolute;
  right: 2px;
  top: 0;
}
.version {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  letter-spacing: 0;
  padding: 2px 5px;
}
.header-actions {
  display: flex;
  gap: 10px;
}
.header-actions select {
  font-size: 13px;
}
main {
  max-width: 1304px;
  margin: auto;
  padding: 0 24px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -1.5px;
  line-height: 1.2;
  margin-bottom: 17px;
  font-weight: 650;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.6px;
  margin-bottom: 9px;
}
h3 {
  font-size: 19px;
  margin-bottom: 12px;
  font-weight: 600;
}
p {
  line-height: 1.75;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 650;
  color: var(--accent);
  margin-bottom: 17px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 48px 0 23px;
}
.intro .muted {
  font-size: 14px;
}
.intro-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.badge {
  font-size: 12px;
  color: var(--accent);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}
.notice {
  padding: 13px 18px;
  background: var(--notice);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 24px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 0 0 34px;
}
.stats article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.stats span {
  font-size: 13px;
  color: var(--muted);
}
.stats strong {
  font-size: 35px;
  font-weight: 550;
  letter-spacing: -1px;
}
.stats small {
  font-size: 11px;
  color: var(--muted);
}
.stats .time {
  font-size: 24px;
  padding-top: 9px;
  padding-bottom: 5px;
  letter-spacing: -0.5px;
}
nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  margin-bottom: 29px;
}
nav button {
  padding: 13px 2px 17px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
}
nav button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.section-heading p {
  font-size: 13px;
  margin: 0;
}
.file-button {
  font-size: 13px;
  display: inline-block;
  margin: 0;
}
.filters {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  background: var(--field);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.tabs button {
  background: transparent;
  border: 0;
  font-size: 13px;
  padding: 8px 14px;
  color: var(--muted);
}
.tabs button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 6px #0001;
}
.filters select {
  font-size: 13px;
  max-width: 200px;
}
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
td {
  font-size: 13px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  font-weight: 550;
  display: block;
  font-size: 14px;
}
td small {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  color: var(--muted);
}
td button {
  font-size: 12px;
  padding: 7px 10px;
  margin-right: 6px;
}
.green {
  color: var(--accent);
}
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
  margin: 16px 0 22px;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  max-width: 580px;
  margin: auto;
}
.empty > span {
  font-size: 40px;
  color: var(--accent);
  display: block;
  margin-bottom: 15px;
}
.empty p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-top: 28px;
}
.sub-card p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
  min-height: 70px;
}
.sub-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sub-card button {
  font-size: 13px;
}
.compact {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}
.compact > div {
  flex: 1;
}
.compact p {
  font-size: 12px;
  margin: 0;
}
.compact h3 {
  font-size: 15px;
}
.compact button {
  font-size: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-grid select {
  width: 100%;
}
.settings-grid p {
  font-size: 13px;
}
.settings-grid button {
  margin-top: 5px;
}
.prose {
  margin-top: 20px;
}
.prose p {
  font-size: 13px;
  color: var(--muted);
}
code {
  font-size: 11px;
  overflow-wrap: anywhere;
  background: var(--field);
  border-radius: 4px;
  padding: 2px 5px;
}
.login {
  max-width: 470px;
  padding: 65px 0 35px;
  margin: auto;
}
.login h1 {
  font-size: 49px;
  line-height: 1.3;
  margin-bottom: 22px;
}
.login > .muted {
  font-size: 15px;
}
.login form {
  margin-top: 32px;
}
.login label {
  margin-top: 0;
}
.login input,
.login button {
  width: 100%;
}
.login button {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}
.login #login-error {
  color: #e88d83;
  font-size: 13px;
  margin: 14px 0 0;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 34px 0 25px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  padding: 14px 22px;
  max-width: calc(100vw - 30px);
  width: max-content;
  z-index: 5;
  font-size: 13px;
  box-shadow: var(--shadow);
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  width: min(460px, calc(100vw - 30px));
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(4px);
}
dialog input {
  width: 100%;
}
dialog .primary {
  margin-top: 24px;
  width: 100%;
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.dialog-title button {
  padding: 2px 9px;
  font-size: 22px;
}
#sample-node {
  font-size: 14px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .intro-actions .badge {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .sub-grid {
    grid-template-columns: 1fr;
  }
  .sub-card p:not(.eyebrow) {
    min-height: 0;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .compact {
    flex-wrap: wrap;
  }
  .compact > div {
    flex-basis: 100%;
  }
  td,
  th {
    padding: 14px;
  }
  .intro {
    padding-top: 35px;
  }
}
@media (max-width: 500px) {
  header {
    padding: 0 16px;
    height: 72px;
  }
  .brand {
    font-size: 21px;
    gap: 8px;
  }
  .version {
    display: none;
  }
  .header-actions select {
    max-width: 110px;
    padding: 8px;
  }
  .header-actions button {
    padding: 8px;
    font-size: 12px;
  }
  main {
    padding: 0 16px;
  }
  .intro {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
  .intro-actions {
    width: 100%;
    margin-bottom: 18px;
  }
  .intro-actions button {
    width: 100%;
  }
  .intro h1 {
    font-size: 35px;
  }
  .stats {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stats article {
    padding: 16px;
  }
  .stats strong {
    font-size: 30px;
  }
  .stats .time {
    font-size: 21px;
  }
  .section-heading {
    flex-wrap: wrap;
  }
  .section-heading .file-button {
    font-size: 12px;
    padding: 8px 12px;
  }
  .filters {
    flex-wrap: wrap;
    gap: 12px;
  }
  .tabs {
    width: 100%;
    justify-content: space-between;
  }
  .tabs button {
    padding: 8px;
    font-size: 12px;
  }
  .filters select {
    width: 100%;
    max-width: none;
  }
  .panel {
    padding: 20px;
  }
  .login {
    padding-top: 40px;
  }
  .login h1 {
    font-size: 44px;
  }
  footer {
    flex-direction: column;
    gap: 8px;
  }
  .hint {
    font-size: 11px;
  }
  nav {
    gap: 24px;
  }
  nav button {
    font-size: 13px;
  }
}
@media (max-width: 600px) {
  .stats #update-caption {
    text-wrap: balance;
    line-height: 1.7;
  }
  table,
  tbody {
    display: block;
    white-space: normal;
  }
  thead {
    display: none;
  }
  tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  tr:last-child {
    border-bottom: 0;
  }
  td {
    border: 0;
    padding: 10px 8px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  td:first-child,
  td:last-child {
    grid-column: 1 / -1;
  }
  td:first-child strong {
    font-size: 16px;
  }
  td:nth-child(2)::before,
  td:nth-child(3)::before,
  td:nth-child(4)::before {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 7px;
  }
  td:nth-child(2)::before {
    content: "官网参考";
  }
  td:nth-child(3)::before {
    content: "客户端实测";
  }
  td:nth-child(4)::before {
    content: "属性来源";
  }
  td:nth-child(4) {
    grid-column: 1 / -1;
  }
  td:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  td:last-child button {
    flex: 1;
    margin: 0;
    padding: 10px;
  }
}

.danger {
  color: #d96868;
  border-color: #d9686877;
}
.security-heading {
  margin-top: 28px;
}
#security-form input {
  width: 100%;
}
#security-events {
  overflow-wrap: anywhere;
}
@media (max-width: 500px) {
  nav {
    gap: 14px;
  }
  nav button {
    font-size: 12px;
  }
  #security-usage td:nth-child(2)::before {
    content: "来源哈希";
  }
  #security-usage td:nth-child(3)::before {
    content: "连接／拒绝";
  }
  #security-usage td:nth-child(4)::before {
    content: "下行／上行MiB";
  }
}

.diagnostics {
  margin: 0 0 24px;
}
.diagnostics summary {
  cursor: pointer;
  font-size: 14px;
}
.diagnostics pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.9 ui-monospace,
    monospace;
  color: var(--muted);
  margin: 16px 0;
}
.diagnostics button {
  font-size: 12px;
}

.batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
}
.batch-choice,
.node-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.batch-choice input,
.node-choice input {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.batch-toolbar small {
  flex-basis: 100%;
}
.node-choice strong {
  min-width: 0;
}
@media (max-width: 600px) {
  .batch-toolbar {
    gap: 10px;
  }
  .batch-toolbar button {
    width: 100%;
  }
}
