/* ------------------------------------------------------------------
   Steam 连接 — fufuwow.cn
   ------------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --bg: #070d14;
  --bg-2: #0b141f;
  --panel: rgba(23, 38, 57, 0.74);
  --panel-solid: #16283c;
  --line: rgba(102, 192, 244, 0.16);
  --line-strong: rgba(102, 192, 244, 0.32);
  --text: #e7f0f8;
  --muted: #8aa4bd;
  --accent: #66c0f4;
  --accent-2: #8ed9ff;
  --ok: #5fe3a1;
  --err: #ff8a80;
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 20px 56px;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(37, 99, 141, 0.55) 0%, transparent 65%),
    radial-gradient(760px 480px at 92% 4%, rgba(16, 78, 116, 0.45) 0%, transparent 62%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 46%, #05090e 100%);
  background-attachment: fixed;
}

.aurora {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 62vh;
  background:
    radial-gradient(closest-side, rgba(102, 192, 244, 0.18), transparent 70%) 18% 30% / 46% 64% no-repeat,
    radial-gradient(closest-side, rgba(95, 227, 161, 0.10), transparent 70%) 78% 12% / 40% 56% no-repeat;
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

.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;
}

/* ---------------- 头部 ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 0 4px;
}

.brand__logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #04121c;
  background: linear-gradient(150deg, var(--accent-2), #3f9fd8 60%, #2b7fb5);
  box-shadow: 0 10px 26px rgba(102, 192, 244, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand__logo svg { width: 26px; height: 26px; }

.brand__text h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand__dot { color: var(--line-strong); font-weight: 400; }

.brand__domain {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
}

.brand__text p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.card--sub { padding: 20px 22px; }

.card--sub > h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
  color: #cfe3f2;
  letter-spacing: 0.3px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #cfe3f2;
}

/* ---------------- 表单 ---------------- */

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 14px 16px;
  align-items: start;
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: #a8c2d8;
  letter-spacing: 0.4px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: rgba(6, 17, 27, 0.72);
  border: 1px solid rgba(102, 192, 244, 0.2);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#target { font-family: var(--mono); letter-spacing: 0.2px; }
#port { font-family: var(--mono); text-align: center; }

.field input::placeholder { color: #5b7692; }

.field input:hover { border-color: rgba(102, 192, 244, 0.34); }

.field input:focus-visible,
.field input:focus {
  border-color: var(--accent);
  background: rgba(6, 17, 27, 0.9);
  box-shadow: 0 0 0 3px rgba(102, 192, 244, 0.16);
}

.hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #6f8aa3;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  background: rgba(102, 192, 244, 0.09);
  border: 1px solid rgba(102, 192, 244, 0.24);
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn svg { width: 17px; height: 17px; }

.btn:hover { background: rgba(102, 192, 244, 0.16); border-color: rgba(102, 192, 244, 0.4); }

.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  color: #04121c;
  background: linear-gradient(180deg, var(--accent-2), #4aa8e0 70%, #3b96cf);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 22px rgba(74, 168, 224, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #a6e4ff, #58b3e9 70%, #45a0d8);
  box-shadow: 0 10px 26px rgba(74, 168, 224, 0.42);
}

.btn--sm {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 9px;
}

/* 主按钮是真实链接，地址长的时候不撑破布局 */
#btn-connect { max-width: 100%; }

#btn-connect span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint code {
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 0.94em;
  color: var(--accent-2);
  background: rgba(102, 192, 244, 0.1);
  border-radius: 4px;
}

/* 主按钮在没填地址时不至于看起来像坏掉 */
#btn-connect[href="#"] { cursor: pointer; }

.btn--ghost {
  background: transparent;
  border-color: rgba(138, 164, 189, 0.24);
  color: var(--muted);
}

.btn--ghost:hover { color: var(--text); background: rgba(138, 164, 189, 0.1); }

.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------------- 提示条 ---------------- */

.message {
  margin-top: 16px;
  padding: 11px 14px;
  font-size: 13.5px;
  border-radius: 10px;
  border: 1px solid transparent;
  line-height: 1.55;
  animation: fade 0.18s ease;
}

.message[data-type="error"] {
  color: #ffc9c4;
  background: rgba(255, 96, 84, 0.1);
  border-color: rgba(255, 138, 128, 0.34);
}

.message[data-type="success"] {
  color: #b9f2d5;
  background: rgba(95, 227, 161, 0.09);
  border-color: rgba(95, 227, 161, 0.28);
}

.message[data-type="info"] {
  color: #c6e0f2;
  background: rgba(102, 192, 244, 0.09);
  border-color: rgba(102, 192, 244, 0.26);
}

.message strong { font-weight: 650; }

.message code { font-family: var(--mono); font-size: 0.94em; }

/* ---------------- 结果块 ---------------- */

.result {
  margin-top: 16px;
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 17, 27, 0.55);
  animation: fade 0.2s ease;
}

.result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.result__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #93aec6;
}

.badge {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
  color: var(--accent);
  background: rgba(102, 192, 244, 0.12);
  border: 1px solid rgba(102, 192, 244, 0.26);
  border-radius: 999px;
}

.result__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.result__row + .result__row { margin-top: 10px; }

.result code#result-uri {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(102, 192, 244, 0.16);
  border-radius: 9px;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------------- 服务器信息 ---------------- */

.server {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px dashed rgba(102, 192, 244, 0.26);
  background: rgba(102, 192, 244, 0.05);
  font-size: 13.5px;
  animation: fade 0.2s ease;
}

.server__name {
  font-weight: 650;
  color: #d8ecfa;
  word-break: break-word;
}

.server__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.server__grid b { color: #cfe3f2; font-weight: 600; }

.server__note { color: var(--muted); font-size: 12.5px; }

/* ---------------- 历史记录 ---------------- */

.history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history__item { display: flex; }

.history__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #bcd6ea;
  background: rgba(6, 17, 27, 0.6);
  border: 1px solid rgba(102, 192, 244, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.history__btn:hover {
  color: #fff;
  background: rgba(102, 192, 244, 0.14);
  border-color: rgba(102, 192, 244, 0.4);
}

.history__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.history__btn svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: 0.7; }

/* ---------------- 折叠说明 ---------------- */

details {
  border-top: 1px solid rgba(102, 192, 244, 0.1);
  padding: 11px 0 3px;
}

details:first-of-type { border-top: none; }

summary {
  font-size: 13.5px;
  font-weight: 600;
  color: #c3dced;
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--accent);
  border-bottom: 1.6px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
  margin-left: 2px;
}

details[open] > summary::before { transform: rotate(45deg); }

summary:hover { color: #fff; }

details > *:not(summary) { animation: fade 0.18s ease; }

.steps, .plain-list {
  margin: 8px 0 4px;
  padding-left: 20px;
  font-size: 13.5px;
  color: #a9c3d8;
}

.steps li, .plain-list li { margin: 4px 0; }

.plain-list { list-style: none; padding-left: 2px; }

.plain-list code, details p code, .steps code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-2);
  background: rgba(102, 192, 244, 0.1);
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

details p {
  margin: 8px 0 4px;
  font-size: 13.5px;
  color: #a9c3d8;
  line-height: 1.65;
}

.cmd { display: grid; gap: 8px; margin: 10px 0 6px; }

.cmd__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cmd__os {
  flex: 0 0 62px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.3px;
  color: #7d99b2;
  text-transform: uppercase;
}

.cmd code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: #cfe6f6;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(102, 192, 244, 0.12);
  border-radius: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 页脚 ---------------- */

.footer {
  margin-top: 26px;
  text-align: center;
  font-size: 12.5px;
  color: #5f7a92;
  line-height: 1.7;
}

.footer p { margin: 2px 0; }

.footer__note { font-size: 11.5px; color: #4a6076; }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(6px);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #04121c;
  background: linear-gradient(180deg, var(--accent-2), #4aa8e0);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 50;
}

.toast[data-show="1"] { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fade {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 620px) {
  body { padding: 22px 14px 40px; }
  .brand { gap: 11px; margin-bottom: 16px; }
  .brand__logo { width: 40px; height: 40px; border-radius: 12px; }
  .brand__logo svg { width: 22px; height: 22px; }
  .brand__text h1 { font-size: 17.5px; }
  .brand__domain { font-size: 13px; }
  .brand__text p { font-size: 12.5px; }
  .card { padding: 18px 16px; }
  .form { grid-template-columns: 1fr; gap: 12px; }
  .field--port { max-width: 148px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .result__row { flex-wrap: wrap; }
  .result code#result-uri { flex-basis: 100%; }
  .cmd__item { flex-direction: column; align-items: stretch; gap: 4px; }
  .cmd__os { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
