:root {
  --bg-deep: #060810;
  --bg-card: rgba(18, 24, 38, 0.78);
  --border: rgba(0, 212, 170, 0.2);
  --border-hover: rgba(0, 212, 170, 0.5);
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.14);
  --gold: #d4af37;
  --radius: 14px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --safe-x: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right));
  --tap-min: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: clamp(15px, 2.8vw, 17px);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

.radar-ring {
  position: fixed;
  border: 1px solid rgba(0, 212, 170, 0.08);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.radar-ring--1 {
  width: min(92vw, 680px);
  height: min(92vw, 680px);
  top: -160px;
  right: -100px;
  animation: pulse-soft 8s ease-in-out infinite;
}

.radar-ring--2 {
  width: min(72vw, 480px);
  height: min(72vw, 480px);
  bottom: -80px;
  left: -60px;
  animation: pulse-soft 10s ease-in-out infinite reverse;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.02);
  }
}

.site-header {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) var(--safe-x) 1rem;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 1rem);
  flex-wrap: wrap;
}

.brand-icon {
  display: block;
  width: clamp(44px, 11vw, 52px);
  height: clamp(44px, 11vw, 52px);
  border-radius: 14px;
  object-fit: contain;
  background: rgba(18, 24, 38, 0.5);
  box-shadow: 0 0 28px rgba(0, 212, 170, 0.35);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(105deg, var(--text) 0%, var(--accent) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0.5rem var(--safe-x) max(1.5rem, env(safe-area-inset-bottom));
}

.main-stack {
  width: 100%;
  max-width: min(100%, 440px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.link-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: clamp(12px, 3vw, 16px);
}

.help-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.help-panel__summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0, 212, 170, 0.15);
}

.help-panel__summary::-webkit-details-marker {
  display: none;
}

.help-panel__summary::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.5em;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translateY(-0.15em);
  vertical-align: middle;
  opacity: 0.85;
}

.help-panel[open] .help-panel__summary::before {
  transform: rotate(45deg) translateY(-0.05em);
}

.help-panel__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

.help-panel__src {
  margin: 0.75rem 0 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.help-panel__src a {
  color: var(--accent);
  word-break: break-all;
}

.help-panel__list {
  margin: 0;
  padding: 0 0 0 1.2rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.help-panel__list li {
  margin-bottom: 0.65rem;
}

.help-panel__list li:last-child {
  margin-bottom: 0;
}

.help-panel__list code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  padding: 0.1em 0.25em;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  word-break: break-all;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: max(var(--tap-min), 4.5rem);
  padding: 1rem 0.85rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: rgba(0, 212, 170, 0.2);
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
}

.link-card__label {
  line-height: 1.25;
}

.link-card::after {
  content: attr(data-desc);
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(0.68rem, 2.6vw, 0.75rem);
  font-weight: 400;
  color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
  .link-card:hover,
  .link-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38), 0 0 0 1px var(--accent-dim);
    outline: none;
  }
}

.link-card:active {
  transform: scale(0.98);
}

.copy-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) var(--safe-x)
    max(1rem, env(safe-area-inset-bottom));
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.copy-modal-backdrop--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.copy-modal {
  width: min(100%, 300px);
  padding: 1.35rem 1.25rem 1.25rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-dim);
  transform: scale(0.94);
  transition: transform 0.22s ease;
}

.copy-modal-backdrop--open .copy-modal {
  transform: scale(1);
}

.copy-modal__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: var(--accent);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.45);
}

.copy-modal__icon.copy-modal__icon--warn {
  background: #c9a227;
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.35);
}

.copy-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.copy-modal__ip {
  margin: 0 0 0.65rem;
  font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", monospace;
  font-size: 0.95rem;
  color: var(--accent);
  word-break: break-all;
}

.copy-modal__hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* —— 使用说明页 guide.html —— */
.guide-top {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) var(--safe-x) 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.guide-back {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 0.35rem 0;
  -webkit-tap-highlight-color: rgba(0, 212, 170, 0.2);
}

.guide-back:hover,
.guide-back:focus-visible {
  color: var(--text);
  outline: none;
}

.guide-tag {
  font-size: 0.74rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(18, 24, 38, 0.55);
}

.guide-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0.4rem var(--safe-x) max(1.75rem, env(safe-area-inset-bottom));
}

.guide-hero {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 24, 38, 0.55);
  backdrop-filter: blur(10px);
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.5rem);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.guide-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 4.8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(105deg, var(--text) 0%, var(--accent) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.guide-lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font-size: clamp(0.94rem, 3vw, 1rem);
  line-height: 1.7;
  color: var(--text);
}

.guide-steps li {
  counter-increment: step;
  position: relative;
  margin-bottom: 0.9rem;
  padding: 0.85rem 0.9rem 0.85rem 3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.7);
}

.guide-steps li:last-child {
  margin-bottom: 0;
}

.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(145deg, var(--accent), #2fd6ff);
}

.guide-step-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: var(--text);
}

.guide-steps p {
  margin: 0;
  color: var(--text-muted);
}

.guide-path {
  display: inline;
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.85em;
  padding: 0.12em 0.35em;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 6px;
  word-break: break-all;
}

@media (max-width: 540px) {
  .guide-card {
    padding: 1rem 0.85rem;
  }

  .guide-steps li {
    padding: 0.78rem 0.75rem 0.78rem 2.7rem;
  }

  .guide-steps li::before {
    left: 0.7rem;
    top: 0.76rem;
  }
}
