:root {
  color-scheme: dark;
  --ink: #eff8ff;
  --muted: #93aabd;
  --line: rgba(176, 215, 235, 0.14);
  --panel: rgba(8, 28, 43, 0.82);
  --panel-strong: rgba(12, 38, 56, 0.96);
  --cyan: #31d9c3;
  --blue: #4f8cff;
  --navy: #071827;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--navy); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(25, 154, 166, 0.16), transparent 34rem),
    radial-gradient(circle at 88% 35%, rgba(52, 98, 195, 0.14), transparent 30rem),
    linear-gradient(145deg, #06131f 0%, #071c2b 48%, #081521 100%);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .18; pointer-events: none; }
.ambientOne { width: 22rem; height: 22rem; background: #23c6a6; left: -9rem; top: 32%; }
.ambientTwo { width: 26rem; height: 26rem; background: #3d66ef; right: -12rem; top: 5%; }

.shell { width: min(880px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 46px; position: relative; z-index: 1; }

.hero { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 750; letter-spacing: .14em; text-decoration: none; }
.brandMark { width: 32px; height: 32px; position: relative; display: inline-block; transform: rotate(-35deg); }
.brandMark i { position: absolute; left: 4px; width: 24px; height: 6px; border-radius: 10px; background: linear-gradient(90deg, #3fd7bd, #5b8cff); }
.brandMark i:nth-child(1) { top: 4px; }
.brandMark i:nth-child(2) { top: 13px; width: 19px; }
.brandMark i:nth-child(3) { top: 22px; width: 13px; }
.secureBadge { color: #a8c4d4; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.secureBadge span { color: #48dab3; font-size: 10px; filter: drop-shadow(0 0 6px #36c9a3); }

.panel {
  background: linear-gradient(145deg, rgba(10, 34, 51, .96), rgba(7, 24, 37, .92));
  border: 1px solid rgba(161, 211, 234, .16);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 46px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .03);
  backdrop-filter: blur(18px);
}

.panelIntro { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.eyebrow { margin: 0 0 9px; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: .19em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 6vw, 42px); letter-spacing: -.04em; }
.panelIntro > div > p:last-child { max-width: 590px; margin-bottom: 0; color: var(--muted); line-height: 1.75; font-size: 15px; }
.nodePill { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(73, 216, 181, .2); border-radius: 999px; background: rgba(35, 126, 112, .12); color: #a9d7ce; font-size: 12px; }
.nodePill span { width: 7px; height: 7px; border-radius: 50%; background: #47d7b1; box-shadow: 0 0 10px #47d7b1; }
.nodePill strong { color: #e5fff9; }

.urlBox { margin-top: 30px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(3, 16, 25, .44); }
.urlLabel { margin: 0 0 9px 2px; color: #a8becb; font-size: 12px; font-weight: 650; }
.urlRow { display: flex; align-items: center; gap: 8px; }
.urlRow input { width: 100%; min-width: 0; height: 50px; padding: 0 15px; border: 1px solid rgba(170, 214, 233, .14); border-radius: 12px; outline: none; background: rgba(5, 21, 32, .82); color: #d5e8f2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; text-overflow: ellipsis; }
.urlRow input:focus { border-color: rgba(49, 217, 195, .48); box-shadow: 0 0 0 3px rgba(49, 217, 195, .08); }
.iconButton { flex: 0 0 50px; height: 50px; border: 1px solid var(--line); border-radius: 12px; background: rgba(24, 54, 72, .55); cursor: pointer; }
.iconButton:hover { background: rgba(38, 76, 96, .7); }
.iconButton svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.primaryActions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 12px; }
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 12px; border: 0; font-weight: 700; cursor: pointer; transition: transform .16s ease, filter .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.button:active { transform: translateY(0); }
.button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.buttonPrimary { background: linear-gradient(120deg, #18cbb0, #25aeaa); color: #03251f; box-shadow: 0 10px 24px rgba(29, 191, 167, .13); }
.buttonSecondary { color: #c7dbe6; border: 1px solid rgba(150, 196, 218, .18); background: rgba(50, 78, 97, .56); }

.sectionTitle { display: flex; align-items: center; justify-content: space-between; margin: 30px 2px 14px; }
.sectionTitle span { font-weight: 720; }
.sectionTitle p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.stepTag { padding: 6px 10px; border-radius: 999px; color: #8ce8d5; background: rgba(35, 196, 162, .1); font-size: 11px; font-weight: 650 !important; }

.clientGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clientCard { min-height: 76px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; text-align: left; background: rgba(15, 42, 58, .68); cursor: pointer; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.clientCard:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(104, 181, 218, .36); background: rgba(22, 54, 73, .8); }
.clientCard:disabled { cursor: wait; opacity: .52; }
.clientIcon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; color: white; box-shadow: inset 0 1px rgba(255,255,255,.18); }
.clientCard strong, .clientCard small { display: block; }
.clientCard strong { font-size: 14px; }
.clientCard small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.clientCard i { font-style: normal; color: #87dfcd; font-size: 12px; }
.clash .clientIcon { background: linear-gradient(145deg, #1d4b83, #337ac1); }
.shadowrocket .clientIcon { background: linear-gradient(145deg, #4c89ff, #2752d1); }
.surge .clientIcon { background: linear-gradient(145deg, #252938, #596172); }
.quantumult .clientIcon { background: linear-gradient(145deg, #6d58cb, #413b9c); }
.stash .clientIcon { background: linear-gradient(145deg, #10b7a2, #087a78); }
.stash { grid-column: 1 / -1; }

.tutorialToggle { width: 100%; min-height: 57px; margin-top: 18px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(54, 186, 201, .2); border-radius: 14px; background: linear-gradient(90deg, rgba(23, 135, 145, .24), rgba(37, 83, 126, .2)); cursor: pointer; }
.tutorialToggle > span { display: flex; align-items: center; gap: 10px; font-weight: 680; }
.tutorialToggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tutorialToggle .chevron { transition: transform .2s ease; }
.tutorialToggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.tutorial { margin-top: 18px; padding-top: 28px; border-top: 1px solid var(--line); }
.tutorial[hidden] { display: none; }
.tutorialHeader h2 { margin-bottom: 20px; font-size: 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.steps li { display: grid; grid-template-columns: 38px 1fr; gap: 13px; padding: 15px; border-radius: 14px; background: rgba(4, 20, 31, .46); }
.steps li > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #79e7d3; background: rgba(39, 196, 167, .12); font-weight: 750; }
.steps strong { font-size: 14px; }
.steps p { margin: 5px 0 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.guideGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.guideGrid article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(18, 43, 58, .48); }
.guideGrid h3, .troubleshoot h3 { margin-bottom: 7px; font-size: 14px; }
.guideGrid p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.troubleshoot { margin-top: 15px; padding: 17px; border-radius: 14px; background: rgba(44, 67, 82, .36); }
.troubleshoot ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }

footer { margin-top: 20px; text-align: center; color: #607d8e; font-size: 11px; }

.qrDialog { width: min(420px, calc(100% - 28px)); padding: 30px; color: var(--ink); border: 1px solid rgba(164, 217, 236, .22); border-radius: 22px; background: #0b2435; box-shadow: 0 30px 90px rgba(0,0,0,.6); text-align: center; }
.qrDialog::backdrop { background: rgba(1, 9, 14, .72); backdrop-filter: blur(7px); }
.qrDialog h2 { margin-bottom: 9px; }
.qrDialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; font-size: 12px; }
.dialogClose { position: absolute; right: 14px; top: 11px; border: 0; background: none; color: #a9bfcb; font-size: 26px; cursor: pointer; }
.qrCanvas { width: 238px; height: 238px; margin: 20px auto; padding: 12px; display: grid; place-items: center; border-radius: 16px; background: white; }
.qrCanvas img, .qrCanvas canvas { max-width: 100%; height: auto; }
.qrDialog .button { width: 100%; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 18px); padding: 11px 16px; border: 1px solid rgba(116, 229, 204, .24); border-radius: 999px; background: rgba(5, 31, 39, .94); color: #cffff5; box-shadow: 0 14px 40px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid rgba(72, 222, 194, .55); outline-offset: 3px; }

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 880px); padding-top: 17px; }
  .secureBadge { display: none; }
  .panel { border-radius: 22px; }
  .panelIntro { display: block; }
  .nodePill { width: max-content; margin-top: 16px; }
  .primaryActions, .clientGrid, .guideGrid { grid-template-columns: 1fr; }
  .stash { grid-column: auto; }
  .clientCard { min-height: 71px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
