:root {
  --bg: #eef3f8;
  --bg-deep: #e2ebf4;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel2: #f3f7fb;
  --ink: #0f1c2a;
  --muted: #5a6d82;
  --line: #c8d5e4;
  --line-strong: #a8bdd4;
  --accent: #0d9488;
  --accent-bright: #14b8a6;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-ink: #042f2e;
  --meta: #64788f;
  --font: "Avenir Next", "PingFang TC", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", Menlo, Monaco, monospace;
  --shadow: 0 10px 28px rgba(15, 40, 70, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 40, 70, 0.05);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 6% -12%, rgba(45, 212, 191, 0.22) 0%, transparent 58%),
    radial-gradient(780px 440px at 100% 0%, rgba(56, 140, 220, 0.16) 0%, transparent 52%),
    radial-gradient(600px 380px at 50% 110%, rgba(13, 148, 136, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 38%, var(--bg-deep) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      rgba(100, 130, 160, 0.045) 47px,
      rgba(100, 130, 160, 0.045) 48px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(100, 130, 160, 0.045) 47px,
      rgba(100, 130, 160, 0.045) 48px
    );
  background-attachment: fixed;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}
h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #0b1a2b 0%, #0f766e 55%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.hero-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .hero-link { grid-template-columns: 1fr; }
}

.link-card, .pkg, .legacy, .flow {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
}
.link-card .k {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.02em;
}
.qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: fit-content;
  margin: 0 auto 12px;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.08);
}
.qr-fallback {
  margin: 0;
  max-width: 168px;
  padding: 24px 8px;
  color: #475569;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.4;
}
.hint { margin: 0; color: var(--muted); font-size: 0.78rem; text-align: center; }
.device-badge {
  margin: 10px 0 0;
  text-align: center;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
}
.detect-note {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}
.pkg.is-detected {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(240, 253, 250, 0.92) 100%);
}

.flow {
  margin: 0;
  padding: 18px 18px 18px 38px;
  color: var(--ink);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}
.flow li { margin: 6px 0; }
.flow li::marker { color: var(--accent-bright); font-weight: 700; }

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #132536;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.pkg {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 168px;
}
.pkg-top {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pkg h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #102033;
}
.pkg p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 2.9em;
}
.pkg strong { color: var(--ink); }
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  align-items: stretch;
}
.actions .btn:only-child {
  grid-column: 1 / -1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn.primary {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
}
.btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}
.btn.primary:hover {
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.34);
}

.legacy { margin-top: 22px; }
.legacy p, .legacy li { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.legacy ul { margin: 8px 0 0; padding-left: 1.2em; }
.legacy code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  color: #1e3a5f;
}

footer {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}
