:root {
  --bg: #f4f6f9;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --ink: #14211d;
  --muted: #68736f;
  --line: rgba(20, 33, 29, 0.1);
  --green: #19a66b;
  --green-dark: #0d7e4f;
  --green-soft: #e8f7f0;
  --blue: #4773e6;
  --amber: #d28a24;
  --red: #cf4f4f;
  --shadow: 0 28px 70px rgba(34, 55, 48, 0.1);
  --radius: 26px;
  font-family:
    Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)),
    radial-gradient(circle at 8% 0%, #e0e9ff 0, transparent 34%),
    radial-gradient(circle at 94% 20%, #dff4e9 0, transparent 32%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(71, 115, 230, 0.22);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
}

.ambient-one {
  top: 25%;
  right: -140px;
  width: 380px;
  height: 380px;
  background: rgba(141, 226, 184, 0.2);
}

.ambient-two {
  bottom: -220px;
  left: 22%;
  width: 520px;
  height: 520px;
  background: rgba(207, 175, 255, 0.12);
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.topbar,
.brand,
.topbar-actions,
.primary-button,
.icon-button,
.status-panel,
.card-heading,
.ip-row,
.card-footer,
.health-line,
.text-button,
.direct-ip-row,
.direct-meta,
.route-visual,
.route-node,
.page-footer,
.modal-heading,
.modal-actions,
.secondary-button,
.ghost-button {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 72px;
}

.brand {
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(25, 166, 107, 0.2);
  border-radius: 15px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(23, 99, 70, 0.08);
}

.brand-mark svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: #89918e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-actions {
  gap: 10px;
}

.last-checked {
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.settings-button,
.copy-icon,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 22px rgba(20, 33, 29, 0.15);
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-refreshing .primary-button svg {
  animation: spin 900ms linear infinite;
}

.icon-button {
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.settings-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 7px;
  padding: 0 12px;
  border-radius: 12px;
  color: #66716d;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.settings-button:hover {
  color: var(--ink);
  background: rgba(20, 33, 29, 0.055);
}

.icon-button svg,
.settings-button svg,
.copy-icon svg,
.text-button svg,
.route-node svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(500px, 1.18fr);
  align-items: center;
  gap: 76px;
  margin-bottom: 34px;
}

.eyebrow,
.section-label {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-copy h1 {
  margin: 16px 0 20px;
  font-size: clamp(40px, 4.15vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero-copy h1 span {
  color: var(--green);
}

.hero-copy p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.status-panel {
  position: relative;
  min-height: 210px;
  gap: 26px;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(25, 166, 107, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(239, 250, 245, 0.88)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.status-panel::after {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(25, 166, 107, 0.09);
  content: "";
}

.status-orbit {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  place-items: center;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(25, 166, 107, 0.28);
  border-radius: 50%;
}

.is-loading .orbit-ring {
  animation: spin 4s linear infinite;
}

.orbit-core {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.55);
}

.status-icon {
  display: none;
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-loading .status-icon-loading,
.is-success .status-icon-success,
.is-warning .status-icon-warning,
.is-error .status-icon-warning {
  display: block;
}

.is-loading .status-icon-loading {
  animation: spin 1s linear infinite;
}

.is-warning .orbit-core {
  color: var(--amber);
  background: #fff5e5;
}

.is-warning .mode-badge {
  color: #9b6416;
  border-color: rgba(210, 138, 36, 0.2);
  background: #fff5e5;
}

.is-error .orbit-core {
  color: var(--red);
  background: #fff0f0;
}

.is-error .mode-badge {
  color: var(--red);
  border-color: rgba(207, 79, 79, 0.18);
  background: #fff0f0;
}

.status-copy {
  position: relative;
  z-index: 1;
  flex: 1;
}

.status-kicker {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.status-copy h2 {
  margin: 9px 0 8px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.status-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.mode-badge,
.provider-badge,
.mini-status {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(25, 166, 107, 0.14);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(232, 247, 240, 0.76);
  font-size: 11px;
  font-weight: 700;
}

.mode-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 1;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
  align-items: start;
  gap: 22px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(36, 51, 45, 0.07);
  backdrop-filter: blur(18px);
}

.proxy-card {
  padding: 30px;
}

.card-heading {
  justify-content: space-between;
  gap: 20px;
}

.card-heading h2 {
  margin: 7px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.card-heading.compact h2 {
  font-size: 17px;
}

.provider-badge {
  color: #5f6b67;
  background: #f4f6f5;
  border-color: var(--line);
  font-weight: 600;
}

.ip-block {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 52px 0 42px;
}

.flag-tile {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(20, 33, 29, 0.08);
  border-radius: 22px;
  color: var(--green-dark);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(232, 247, 240, 0.78));
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ip-label {
  display: block;
  margin-bottom: 7px;
  color: #8a938f;
  font-size: 11px;
  font-weight: 650;
}

.ip-row {
  min-width: 0;
  gap: 10px;
}

.ip-value {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 650;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #6d7773;
  background: transparent;
}

.copy-icon:hover:not(:disabled) {
  color: var(--green-dark);
  background: var(--green-soft);
}

.copy-icon:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.location-line {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.details-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 16px;
}

.details-list div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 249, 0.6);
}

.details-list dt {
  margin-bottom: 7px;
  color: #8a938f;
  font-size: 10px;
}

.details-list dd {
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-footer {
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.health-line {
  min-width: 0;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.health-line i,
.privacy-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8b0ad;
}

.health-line i.ok,
.privacy-dot {
  background: #35c881;
  box-shadow: 0 0 0 4px rgba(53, 200, 129, 0.1);
}

.health-line i.error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(207, 79, 79, 0.1);
}

.text-button {
  flex: 0 0 auto;
  gap: 3px;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-button:disabled {
  cursor: not-allowed;
  color: #a8b0ad;
}

.text-button svg {
  width: 16px;
}

.side-stack {
  display: grid;
  gap: 22px;
}

.direct-card,
.route-card {
  padding: 26px;
}

.mini-status {
  padding: 6px 9px;
  color: #6d7773;
  background: #f4f6f5;
  border-color: var(--line);
}

.mini-status.ok {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: rgba(25, 166, 107, 0.14);
}

.mini-status.error {
  color: var(--red);
  background: #fff0f0;
  border-color: rgba(207, 79, 79, 0.14);
}

.direct-ip-row {
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 12px;
}

.direct-ip-row strong {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.direct-meta {
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}

.helper-text,
.route-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #7b8581;
  font-size: 11px;
  line-height: 1.7;
}

.route-visual {
  justify-content: center;
  margin: 26px 0 18px;
}

.route-node {
  flex: 0 0 auto;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
}

.route-node.accent {
  color: var(--green-dark);
}

.node-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.76);
}

.route-node.accent .node-icon {
  border-color: rgba(25, 166, 107, 0.18);
  background: var(--green-soft);
}

.route-node small {
  font-size: 9px;
  font-weight: 700;
}

.route-line {
  position: relative;
  width: 112px;
  height: 1px;
  margin: 0 12px 22px;
  overflow: hidden;
  background: #dfe5e2;
}

.route-line i {
  position: absolute;
  top: -1px;
  left: -20px;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  animation: routePulse 1.8s ease-in-out infinite;
}

.route-note {
  min-height: 60px;
  margin-top: 0;
}

.secondary-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
  gap: 8px;
  margin-top: 18px;
  border: 1px solid rgba(25, 166, 107, 0.16);
  border-radius: 13px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 700;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page-footer {
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 0 4px;
  color: #8a938f;
  font-size: 10px;
}

.page-footer p {
  margin: 0;
}

.page-footer p:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-dot {
  width: 6px;
  height: 6px;
}

.modal {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(13, 25, 21, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(13, 25, 21, 0.25);
}

.modal-heading {
  justify-content: space-between;
  margin-bottom: 26px;
}

.modal-heading h2 {
  margin: 7px 0 0;
  font-size: 22px;
}

.field {
  display: block;
  margin-top: 20px;
}

.field > span {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #f8faf9;
}

.field small {
  display: block;
  margin-top: 7px;
  color: #8a938f;
  font-size: 10px;
  line-height: 1.5;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

.ghost-button {
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.raw-modal pre {
  max-height: 52vh;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 14px;
  color: #d7f9e8;
  background: #14211d;
  font: 12px/1.65 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(20, 33, 29, 0.92);
  box-shadow: 0 12px 32px rgba(20, 33, 29, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes routePulse {
  0% {
    left: -20px;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 112px;
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    margin-bottom: 50px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-copy {
    max-width: 650px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .proxy-card {
    min-height: auto;
  }

  .side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1160px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 42px;
  }

  .last-checked {
    display: none;
  }

  .primary-button span {
    display: none;
  }

  .topbar .primary-button {
    width: 44px;
    padding: 0;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .settings-button {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
  }

  .settings-button span {
    display: none;
  }

  .status-panel {
    align-items: flex-start;
    min-height: 0;
    padding: 26px 22px;
  }

  .status-orbit {
    width: 70px;
    height: 70px;
  }

  .orbit-core {
    width: 50px;
    height: 50px;
  }

  .status-icon {
    width: 23px;
  }

  .status-copy h2 {
    font-size: 20px;
  }

  .mode-badge {
    display: none;
  }

  .proxy-card,
  .direct-card,
  .route-card {
    padding: 22px;
  }

  .ip-block {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    margin: 38px 0 32px;
  }

  .flag-tile {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 15px;
  }

  .ip-value {
    font-size: 23px;
  }

  .details-list {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    line-height: 1.6;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }
}

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