:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --canvas: #f3f4f6;
  --success: #059669;
  --danger: #dc2626;
  --warning-bg: #fffbea;
  --warning-line: #f6e7b0;
  --page-max: 1360px;
  --page-gutter: clamp(24px, 4vw, 64px);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--canvas);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.page-width { width: min(var(--page-max), calc(100% - var(--page-gutter))); margin-inline: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { background: var(--surface); }
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--accent); }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: 25px; font-weight: 650; letter-spacing: -.5px; }
.brand small { margin-top: 5px; color: #4f7db8; font-size: 11px; letter-spacing: .8px; }
.mobile-menu-toggle { display: none; }

.main-nav { background: var(--accent); border-bottom: 1px solid #1e4fc0; }
.nav-scroll { display: flex; align-items: stretch; min-height: 58px; overflow-x: auto; scrollbar-width: thin; }
.main-nav a {
  min-width: 112px;
  padding: 0 22px;
  display: grid;
  place-items: center;
  color: #dbeafe;
  border-bottom: 4px solid transparent;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.main-nav a:active { transform: scale(.98); }
.main-nav a.active { color: #fff; background: rgba(255,255,255,.12); border-bottom-color: #dbeafe; }

.notice {
  min-height: 50px;
  margin-top: 12px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b42318;
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
}
.notice svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.notice a { margin-left: 8px; color: var(--accent); font-weight: 600; }

.portal-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1040px) minmax(260px, 280px);
  justify-content: center;
  align-items: start;
  gap: 22px;
}
.main-column, .sidebar { min-width: 0; }
.main-column { width: 100%; max-width: 1040px; justify-self: center; }
.sidebar { display: grid; gap: 18px; }
.content-panel, .side-panel { background: var(--surface); border: 1px solid #edf0f4; }
.panel-heading {
  min-height: 76px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h1, .panel-heading h2 { margin: 0; color: #26364d; font-size: 25px; font-weight: 560; letter-spacing: -.3px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); }
.centered-heading { justify-content: center; text-align: center; }

.proxy-introduction { padding: 18px 22px 20px; background: var(--surface); border: 1px solid #edf0f4; }
.proxy-scope-tabs { display: flex; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); }
.proxy-scope-tabs a { position: relative; padding: 0 0 11px; color: #475569; font-size: 22px; font-weight: 560; transition: color 160ms ease, transform 120ms ease; }
.proxy-scope-tabs a:hover { color: var(--accent); }
.proxy-scope-tabs a:active { transform: scale(.98); }
.proxy-scope-tabs a.active { color: var(--accent); }
.proxy-scope-tabs a.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); }
.proxy-intro-row { padding-top: 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; }
.proxy-intro-copy h1 { margin: 0 0 8px; color: #26364d; font-size: 18px; font-weight: 600; }
.proxy-intro-copy p { max-width: 76ch; margin: 5px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.proxy-intro-actions { display: flex; align-items: center; gap: 10px; }
.proxy-warning { margin-top: 14px; padding: 18px 22px; color: #fff; background: var(--accent); border: 1px solid var(--accent-hover); }
.proxy-warning-title { display: flex; align-items: center; gap: 9px; }
.proxy-warning-title svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.proxy-warning ul { margin: 8px 0 0 28px; padding: 0; }
.proxy-warning li { margin-top: 5px; line-height: 1.7; }
.proxy-list-panel { margin-top: 14px; }

.side-panel h2 {
  min-height: 50px;
  margin: 0;
  padding: 13px 15px;
  display: grid;
  place-items: center;
  color: #475569;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 550;
}
.side-body { min-height: 76px; padding: 13px 15px; display: grid; gap: 5px; align-content: center; }
.side-body strong { color: #1e293b; font-size: 15px; }
.promo-body {
  min-height: 242px;
  padding: 25px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: #17408b;
  border: 12px solid #eef4ff;
}
.promo-kicker { color: #bfdbfe; letter-spacing: .14em; }
.promo-body strong { margin-top: 8px; font-size: clamp(19px, 2vw, 28px); }
.promo-body p { max-width: 30ch; margin: 10px 0 18px; color: #dbeafe; }
.button-light { color: #173a73 !important; background: #fbbf24 !important; border-color: #fbbf24 !important; }

.stat-list { margin: 0; padding: 8px 15px; }
.stat-list div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px dashed var(--line); }
.stat-list div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; color: #0891b2; font-weight: 650; }
.side-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 15px; }
.side-links a { padding: 8px 5px; color: #475569; }
.side-links a:hover { color: var(--accent); }
.seo-location-grid { padding: 9px 14px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seo-location-grid a { min-width: 0; padding: 8px 5px; display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #475569; border-bottom: 1px dashed var(--line); }
.seo-location-grid a:hover { color: var(--accent); }
.seo-location-grid span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-location-grid small { color: #94a3b8; font-size: 11px; }

.button {
  min-height: 38px;
  padding: 8px 18px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .12s ease;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button:active { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-secondary { color: #475569; background: #fff; border-color: var(--line-strong); }
.button-secondary:hover { color: var(--accent); background: var(--accent-soft); border-color: #93c5fd; }

label { display: grid; gap: 6px; color: #475569; }
label > span { font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #94a3b8; }

.filter-bar {
  padding: 12px 15px;
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(170px, 1fr) auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.proxy-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.checkbox-label { min-height: 38px; display: flex; align-items: center; gap: 7px; }
.checkbox-label input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.checkbox-label > span { font-size: 14px; }

.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: #64748b; background: #f8fafc; font-weight: 550; }
.data-table th.sortable-heading { padding: 0; }
.sort-button { width: 100%; min-height: 42px; padding: 11px 12px; display: inline-flex; align-items: center; gap: 6px; color: inherit; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; transition: color 160ms ease, background-color 160ms ease, transform 120ms ease; }
.sort-button:hover { color: var(--accent); background: #eff6ff; }
.sort-button:active { transform: scale(.98); }
.sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sort-icon { width: 10px; height: 14px; flex: 0 0 auto; fill: currentColor; }
.sort-icon path { opacity: .2; transition: opacity 160ms ease; }
.sort-button[data-direction="asc"] .sort-up, .sort-button[data-direction="desc"] .sort-down { opacity: 1; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table td { color: #475569; }
.data-table .proxy-ip { color: #1e293b; font-weight: 600; }
.proxy-ip-copy { padding: 0; color: inherit; background: transparent; border: 0; font: inherit; font-weight: inherit; cursor: pointer; transition: color 160ms ease, transform 120ms ease; }
.proxy-ip-copy:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.proxy-ip-copy:active { transform: scale(.98); }
.proxy-ip-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.proxy-list-panel .data-table { min-width: 1038px; table-layout: fixed; font-size: 13px; }
.proxy-list-panel .data-table th, .proxy-list-panel .data-table td { padding: 9px 6px; text-align: center; vertical-align: middle; }
.proxy-list-panel .data-table td { overflow: hidden; text-overflow: ellipsis; }
.proxy-list-panel .data-table td:nth-child(7) { overflow: visible; text-overflow: clip; font-variant-numeric: tabular-nums; }
.proxy-list-panel .sort-button { min-height: 40px; padding: 9px 6px; justify-content: center; gap: 4px; text-align: center; }
.proxy-list-panel .sort-button span { flex: 0 0 auto; white-space: nowrap; }
.proxy-list-panel .data-table th:nth-child(1) { width: 140px; }
.proxy-list-panel .data-table th:nth-child(2) { width: 64px; }
.proxy-list-panel .data-table th:nth-child(3) { width: 80px; }
.proxy-list-panel .data-table th:nth-child(4) { width: 76px; }
.proxy-list-panel .data-table th:nth-child(5) { width: 130px; }
.proxy-list-panel .data-table th:nth-child(6) { width: 96px; }
.proxy-list-panel .data-table th:nth-child(7) { width: 170px; }
.proxy-list-panel .data-table th:nth-child(8) { width: 138px; }
.proxy-list-panel .data-table th:nth-child(9) { width: 144px; }
.protocol-tag { padding: 2px 7px; color: var(--accent); background: var(--accent-soft); border: 1px solid #bfdbfe; font-size: 12px; }
.speed-fast { color: var(--success); }
.copy-row { padding: 4px 8px; color: var(--accent); background: #fff; border: 1px solid #bfdbfe; cursor: pointer; }
.copy-row:active { transform: scale(.98); }
.table-loading { padding: 34px; color: var(--muted); text-align: center; }
.empty-state, .error-state { padding: 35px 18px; text-align: center; }
.error-state { color: var(--danger); background: #fff7f7; }
.pagination { min-height: 62px; padding: 10px 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pagination > div { display: flex; gap: 5px; }
.page-button { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: #475569; background: #fff; border: 1px solid var(--line-strong); text-decoration: none; cursor: pointer; }
.page-button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.pagination > span { margin-left: 8px; color: var(--muted); }
.proxy-list-meta { min-height: 58px; padding: 9px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.proxy-list-meta-bottom { border-top: 1px solid var(--line); border-bottom: 0; }
.proxy-list-meta p { margin: 0; color: #475569; white-space: nowrap; }
.proxy-list-meta p strong { margin: 0 3px; color: #d97706; }
.proxy-list-meta .pagination { min-height: auto; padding: 0; justify-content: flex-end; }
.proxy-list-meta .page-summary { display: none; }

.tool-form { padding: 22px 18px; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.compact-grid { grid-template-columns: minmax(140px, .45fr) minmax(260px, 1.55fr); }
.span-2 { grid-column: 1 / -1; }
.form-actions { margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.form-message { min-height: 22px; margin: 10px 0 0; color: var(--muted); }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.inline-tip { margin-top: 14px; padding: 10px 13px; color: #475569; background: #f8fafc; border-left: 4px solid #14b8a6; }
.output-label { margin-top: 16px; }

.result-panel { margin: 18px; border: 1px solid var(--line); }
.result-panel header { min-height: 48px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; border-bottom: 1px solid var(--line); }
.result-panel h2 { margin: 0; font-size: 15px; }
.result-textarea { min-height: 360px; border: 0; border-radius: 0; }
.docs-section, .distribution-block, .article-content { padding: 20px 18px; }
.docs-section h2, .distribution-block h2, .article-content h2 { margin: 0 0 13px; text-align: center; color: #334155; font-size: 17px; }
.endpoint-list { border-top: 1px solid var(--line); }
.endpoint-list article { padding: 14px 0; display: grid; grid-template-columns: 150px 1fr; gap: 18px; border-bottom: 1px solid var(--line); }
.endpoint-list code { color: var(--accent); font-weight: 650; }
.endpoint-list strong { color: #334155; }
.endpoint-list p { margin: 3px 0 0; color: var(--muted); }
.distribution-block + .distribution-block { border-top: 1px solid var(--line); }
.distribution-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.distribution-item { min-height: 44px; padding: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.distribution-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.distribution-item strong { color: #0891b2; }
.check-result { margin: 18px; padding: 18px; border: 1px solid var(--line); }
.check-result.success { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.check-result.failure { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.check-result dl { margin: 10px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.check-result dl div { padding: 8px; background: rgba(255,255,255,.65); }
.check-result dt { font-size: 12px; opacity: .75; }
.check-result dd { margin: 3px 0 0; font-weight: 650; }
.result-table-wrap { margin-top: 18px; border-top: 1px solid var(--line); }
.article-content { max-width: 850px; margin: 0 auto; padding-block: 26px 40px; }
.article-content h2 { margin-top: 22px; text-align: left; }
.article-content p { color: #526176; line-height: 1.85; }

.site-footer { margin-top: 46px; padding: 25px 0; color: #64748b; background: #f8fafc; border-top: 1px solid var(--line); text-align: center; }
.site-footer strong { margin-right: 10px; color: #475569; }
.site-footer p { max-width: 900px; margin: 16px auto 0; padding-top: 15px; border-top: 1px solid var(--line); font-size: 12px; }
.skeleton-text { animation: fade 1.2s ease-in-out infinite alternate; }
@keyframes fade { from { opacity: .45; } to { opacity: 1; } }

@media (max-width: 1400px) {
  .portal-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-location-panel { grid-column: 1 / -1; }
  .promo-body { min-height: 220px; }
}

@media (max-width: 900px) {
  .filter-bar, .proxy-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .distribution-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  :root { --page-gutter: 28px; }
  .topbar { min-height: 66px; }
  .brand-mark { width: 43px; height: 43px; }
  .brand strong { font-size: 20px; }
  html.js-enabled .mobile-menu-toggle { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--accent); background: var(--surface); border: 1px solid #bfdbfe; border-radius: 4px; cursor: pointer; transition: color 160ms ease, background-color 160ms ease, transform 120ms ease; }
  .mobile-menu-toggle:hover { background: var(--accent-soft); }
  .mobile-menu-toggle:active { transform: scale(.98); }
  .mobile-menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mobile-menu-toggle .menu-icon-close { display: none; }
  .mobile-menu-toggle[aria-expanded="true"] .menu-icon-lines { display: none; }
  .mobile-menu-toggle[aria-expanded="true"] .menu-icon-close { display: block; }
  .main-nav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(15, 23, 42, .08); }
  html.js-enabled .main-nav:not(.is-open) { display: none; }
  .nav-scroll { min-height: auto; padding-block: 8px 12px; display: grid; overflow: visible; }
  .main-nav a { min-width: 0; min-height: 48px; padding: 0 14px; display: flex; justify-content: flex-start; color: #475569; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a:hover { color: var(--accent); background: var(--accent-soft); }
  .main-nav a.active { color: var(--accent); background: var(--accent-soft); border-bottom-color: var(--line); border-left-color: var(--accent); }
  .notice { align-items: flex-start; flex-wrap: wrap; }
  .notice a { margin-left: 28px; }
  .portal-grid { margin-top: 14px; grid-template-columns: 1fr; gap: 14px; }
  .sidebar { grid-template-columns: 1fr; }
  .seo-location-panel { grid-column: auto; }
  .promo-panel { display: none; }
  .filter-bar, .proxy-filter-grid, .form-grid, .compact-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .span-2 { grid-column: auto; }
  .distribution-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-result dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { align-items: flex-start; }
  .panel-heading h1 { font-size: 22px; }
  .panel-heading h2 { font-size: 22px; }
  .centered-heading { align-items: center; }
  .pagination { flex-wrap: wrap; }
  .pagination > div { order: 3; width: 100%; justify-content: center; }
  .proxy-intro-row { grid-template-columns: 1fr; }
  .proxy-intro-actions { justify-content: flex-start; }
  .proxy-list-meta { align-items: flex-start; flex-direction: column; }
  .proxy-list-meta .pagination { width: 100%; justify-content: flex-start; }
  .proxy-list-meta .pagination > div { justify-content: flex-start; }
  .filter-actions { display: flex; align-items: stretch; }
  .filter-actions .button { min-height: 44px; flex: 1 1 0; }
  input, select, textarea { min-height: 44px; }
  .page-button { min-width: 42px; height: 42px; }
  .proxy-list-panel .data-table th:first-child, .proxy-list-panel .data-table td:first-child { width: min(45vw, 180px); max-width: min(45vw, 180px); position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  .proxy-list-panel .data-table th:first-child { z-index: 2; background: #f8fafc; }
  .proxy-list-panel .data-table td:first-child { background: var(--surface); }
  .proxy-list-panel .data-table tbody tr:hover td:first-child { background: #f8fbff; }
  .proxy-list-panel .proxy-ip-copy { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
}

@media (max-width: 460px) {
  :root { --page-gutter: 20px; }
  .distribution-list { grid-template-columns: 1fr; }
  .side-links { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .endpoint-list article { grid-template-columns: 1fr; gap: 4px; }
  .proxy-introduction { padding: 15px; }
  .proxy-scope-tabs { gap: 20px; }
  .proxy-scope-tabs a { font-size: 18px; }
  .proxy-intro-actions { align-items: stretch; flex-direction: column; }
  .proxy-intro-actions .button { width: 100%; text-align: center; }
  .proxy-warning { padding: 16px; }
  .proxy-warning ul { margin-left: 20px; }
  .seo-location-grid { grid-template-columns: 1fr; }
  .filter-actions { flex-direction: column; }
  .proxy-list-meta p { white-space: normal; }
}

@media (pointer: coarse) {
  .button, .sort-button, .proxy-ip-copy, .page-button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
