
:root {
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  color: #202936;
  background: #f5f6f8;
  letter-spacing: 0;
  --blue: #356cff;
  --blue-dark: #2457df;
  --text: #202936;
  --muted: #687380;
  --line: #e1e5eb;
  --soft: #f3f4f7;
  --red: #b42318;
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; background: #f5f6f8; }
body { margin: 0; }
.topbar {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  color: var(--text);
  background: #f5f6f8;
  border-bottom: 1px solid var(--line);
}
.brand { min-width: 230px; display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 2px; font-size: 11px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { color: #121923; font-size: 16px; font-weight: 600; }
.brand small { margin-top: 1px; color: #88929e; font-size: 10px; }
.topbar nav { min-height: 50px; display: flex; align-self: stretch; gap: 0; flex: 1; overflow-x: auto; }
.topbar nav a { display: flex; align-items: center; padding: 0 15px; color: #53606d; border-top: 2px solid transparent; text-decoration: none; font-size: 12px; white-space: nowrap; }
.topbar nav a:hover { color: var(--blue); background: #fafbff; }
.topbar nav a.active { color: var(--blue); background: #fff; border-top-color: var(--blue); font-weight: 600; }
.button { min-height: 33px; padding: 0 14px; border: 1px solid transparent; border-radius: 2px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { color: #4b5664; background: #fff; border-color: #d7dce3; }
.button.secondary:hover { color: var(--blue); border-color: #aebde8; }
#account-button { flex: 0 0 auto; }
.icon-button { width: 33px; height: 33px; flex: 0 0 33px; padding: 0; color: #566170; background: #fff; border: 1px solid #d7dce3; border-radius: 2px; font-size: 18px; cursor: pointer; }
.icon-button:hover { color: var(--blue); border-color: #aebde8; }
main { max-width: 1500px; margin: 0 auto; padding: 10px 22px 42px; }
.view { min-height: calc(100vh - 62px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 15px; padding: 8px 2px 0; }
.page-heading h1 { margin: 3px 0 0; color: #222b36; font-size: 22px; font-weight: 600; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 650; }
.filters { display: flex; align-items: center; gap: 8px; }
select, input { min-height: 33px; padding: 6px 10px; color: #27313d; background: #fff; border: 1px solid #b8c2cc; border-radius: 2px; font: inherit; font-size: 12px; outline: none; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(53,108,255,.12); }
.filters select { min-width: 108px; }
.node-grid, .plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.node-card, .plan-card { padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 2px; }
.node-card:hover, .plan-card:hover { border-color: #b9c8f4; box-shadow: 0 4px 12px rgba(40,62,100,.06); }
.node-card header, .plan-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.node-card h2, .plan-card h2 { margin: 0; color: #25303b; font-size: 15px; font-weight: 600; }
.node-card .route { margin-top: 4px; color: #8a949f; font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0; }
.tag, .status { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; color: #53606d; background: #f1f3f6; border-radius: 2px; font-size: 11px; }
.tag.udp, .status.good { color: #18794e; background: #e9f7ef; }
.status.pending { color: #9a6500; background: #fff6dd; }
.status.bad { color: #a9362b; background: #feeceb; }
.node-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.node-stats span, .metric-row span { display: block; color: var(--muted); font-size: 11px; }
.node-stats strong { display: block; margin-top: 4px; color: #263342; font-size: 14px; font-weight: 600; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; }
.price { color: #263342; }
.price strong { font-size: 19px; font-weight: 650; }
.price small { color: var(--muted); font-size: 11px; }
.plan-card ul { display: grid; gap: 7px; padding: 0; margin: 15px 0; color: #5f6b78; font-size: 12px; list-style: none; }
.plan-card li { padding-left: 14px; position: relative; }
.plan-card li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; background: var(--blue); border-radius: 50%; }
.balance-chip { min-height: 33px; padding: 0 12px; color: var(--blue); background: #eef3ff; border: 1px solid #b9c8f4; border-radius: 2px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.balance-chip:hover { color: #fff; background: var(--blue); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; margin-bottom: 15px; color: #42506a; background: #eef3ff; border: 1px solid #b9c8f4; font-size: 12px; line-height: 1.6; }
.notice strong { color: #2d4f9c; white-space: nowrap; }
.notice span { color: #57657a; }
.table-section { margin-top: 22px; }
.table-section > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.table-section h2 { margin: 0; color: #29333f; font-size: 15px; font-weight: 600; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid #e5eaee; font-size: 12px; }
th { color: #556270; background: var(--soft); font-size: 11px; font-weight: 600; }
tbody tr:hover { background: #f9fbff; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: #fff; }
.metric-row article { min-height: 84px; padding: 17px 18px; border-right: 1px solid var(--line); }
.metric-row article:last-child { border-right: 0; }
.metric-row strong { display: block; margin-top: 7px; color: #202c3b; font-size: 21px; font-weight: 600; }
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.empty { padding: 46px 20px; margin: 0; color: #7a8794; text-align: center; background: #fff; border: 1px solid var(--line); }
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; background: #fff; border: 1px solid #d5dbe3; border-radius: 3px; box-shadow: 0 24px 70px rgba(23,32,42,.32); }
dialog::backdrop { background: rgba(23,32,42,.68); }
dialog form, dialog > header, dialog > p, dialog > .secret-row { margin: 0; padding-right: 23px; padding-left: 23px; }
dialog form { padding-bottom: 22px; }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 17px; padding-bottom: 14px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; color: #27313d; font-size: 17px; font-weight: 600; }
.close { width: 30px; height: 30px; padding: 0; color: #7a8490; background: transparent; border: 0; font-size: 24px; line-height: 1; cursor: pointer; }
.close:hover { color: var(--blue); }
label { display: grid; gap: 6px; margin: 11px 0; color: #4c5865; font-size: 12px; font-weight: 600; }
.inline { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { min-height: auto; width: 16px; height: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.auth-dialog { width: min(440px, calc(100vw - 28px)); overflow: auto; border-top: 3px solid var(--blue); }
.auth-dialog .auth-panel { position: relative; width: 100%; padding: 28px 30px 25px; background: #fff; }
.auth-dialog .auth-close { position: absolute; top: 13px; right: 16px; }
.auth-dialog .auth-section-label { margin: 0 0 8px; padding: 0; color: var(--blue-dark); font-size: 12px; font-weight: 500; }
.auth-dialog h2 { color: #17202a; font-size: 25px; font-weight: 700; line-height: 1.35; }
.auth-dialog .auth-caption { margin: 8px 0 23px; padding: 0; color: #7a8794; font-size: 12px; line-height: 1.6; }
.auth-fields { min-width: 0; }
.auth-dialog .auth-fields label { display: block; margin: 14px 0 6px; color: #43515f; font-size: 12px; font-weight: 400; }
.auth-dialog .auth-fields label:first-child { margin-top: 0; }
.auth-dialog .auth-fields input { width: 100%; height: 46px; min-width: 0; padding: 0 12px; color: #25313e; background: #fff; border: 1px solid #cbd4df; border-radius: 3px; font-size: 13px; }
.auth-dialog .auth-fields input::placeholder { color: #a0aab5; }
.auth-dialog .auth-fields input:focus { border-color: var(--blue-dark); box-shadow: 0 0 0 3px rgba(36,87,223,.12); }
.code-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.auth-dialog .code-row .secondary { height: 46px; min-height: 46px; color: var(--blue-dark); background: #f5f8ff; border-color: #aebeea; border-radius: 3px; white-space: nowrap; }
.auth-dialog .code-row .secondary:hover { color: #1744bb; background: #e9efff; }
.auth-dialog .form-error { min-height: 0; margin: 12px 0 0; padding: 9px 11px; color: #a4342a; background: #fff4f2; border-left: 3px solid #d65245; font-size: 12px; }
.auth-dialog .form-error:empty { display: none; }
.auth-dialog .auth-submit { width: 100%; height: 46px; min-height: 46px; margin-top: 18px; border-radius: 3px; font-size: 13px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.auth-links button { padding: 0; color: var(--blue-dark); background: transparent; border: 0; font: inherit; font-size: 12px; cursor: pointer; }
.auth-links button:hover { color: #1744bb; text-decoration: underline; }
.auth-links-single { justify-content: flex-start; }
.selection, .fee-preview { padding: 11px !important; color: #43536a; background: #f3f6fb; border: 1px solid #d9e2f5; border-radius: 2px; }
.secret-row { display: flex; gap: 9px; padding-bottom: 22px !important; }
.secret-row code { flex: 1; min-width: 0; padding: 10px; color: #27313d; background: #f3f4f7; overflow-wrap: anywhere; font-family: Consolas, monospace; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; padding: 11px 15px; color: #fff; background: #27313d; border-radius: 2px; box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 12px; }
.toast.error { background: #a9362b; }
[hidden] { display: none !important; }
@media (max-width: 850px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 9px 14px; }
  .brand { min-width: 0; flex: 1; }
  .topbar nav { order: 3; width: 100%; min-height: 38px; }
  .topbar nav a { min-height: 38px; padding: 0 12px; }
  main { padding: 10px 14px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters select { flex: 1; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-row article:nth-child(2n) { border-right: 0; }
  .metric-row article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .notice { display: block; }
  .notice span { display: block; margin-top: 5px; }
}
@media (max-width: 520px) {
  .brand small { display: none; }
  .node-grid, .plan-grid { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: 1fr; }
  .metric-row article, .metric-row article:nth-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-row article:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .card-footer { align-items: flex-start; flex-direction: column; }
  .card-footer .button { width: 100%; }
  .auth-dialog .auth-panel { padding: 25px 22px 22px; }
  .auth-dialog h2 { font-size: 23px; }
  .code-row { grid-template-columns: 1fr; }
  .auth-dialog .code-row .secondary { width: 100%; }
}
