/* Gateway — 境外站点导航 */

:root {
  --bg: #0a0e15;
  --bg-2: #0d1420;
  --card: rgba(255, 255, 255, 0.042);
  --card-hover: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --txt: #e9eef7;
  --dim: #8b97aa;
  --accent: #5b8cff;
  --accent-2: #8b5cff;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
  --radius: 15px;
}

[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #e9eff8;
  --card: rgba(255, 255, 255, 0.9);
  --card-hover: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.2);
  --txt: #101725;
  --dim: #5c6879;
  --shadow: 0 14px 34px -20px rgba(15, 23, 42, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(680px 420px at 50% -8%, rgba(91, 140, 255, 0.2), transparent 70%),
    radial-gradient(560px 380px at 85% 8%, rgba(139, 92, 255, 0.14), transparent 72%),
    radial-gradient(520px 360px at 8% 12%, rgba(56, 189, 248, 0.1), transparent 70%);
}

[data-theme="light"] .bg-glow {
  background:
    radial-gradient(680px 420px at 50% -8%, rgba(91, 140, 255, 0.22), transparent 70%),
    radial-gradient(560px 380px at 85% 8%, rgba(139, 92, 255, 0.14), transparent 72%);
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- hero ---------- */

.hero { padding: 62px 0 26px; text-align: center; }

.hero-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--accent) 8%, var(--accent-2) 62%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon-btn {
  position: absolute;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, transform 0.18s;
}
.icon-btn:hover { color: var(--txt); border-color: var(--line-strong); transform: rotate(-18deg); }

.sub {
  margin: 12px 0 26px;
  font-size: 14.5px;
  color: var(--dim);
}

/* ---------- search ---------- */

.searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
  padding: 7px 7px 7px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(12px);
}

.searchbar:focus-within {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.13), var(--shadow);
  background: var(--card-hover);
}

.search-ico { flex: none; color: var(--dim); }

.searchbar input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  font-size: 15.5px;
  color: var(--txt);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: inherit;
}
.searchbar input::placeholder { color: var(--dim); }
.searchbar input::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.5); }

kbd {
  flex: none;
  min-width: 22px;
  padding: 2px 6px;
  font: 600 11px/1.4 ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--dim);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.searchbar button {
  flex: none;
  padding: 10px 22px;
  font: 600 14.5px/1 inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.18s, transform 0.18s;
}
.searchbar button:hover { filter: brightness(1.1); }
.searchbar button:active { transform: scale(0.97); }

.engine-row {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--dim);
}
.engine-row .sep { margin: 0 8px; opacity: 0.5; }
.engine-row code {
  padding: 1px 5px;
  font: 600 11.5px ui-monospace, Consolas, monospace;
  color: var(--txt);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
}

/* ---------- 顶部主入口 ---------- */

.feature {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  padding: 24px 28px;
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(112deg, #5b8cff 0%, #8b5cff 52%, #38bdf8 100%);
  box-shadow: 0 22px 48px -22px rgba(91, 140, 255, 0.95);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px 180px at 84% 4%, rgba(255, 255, 255, 0.38), transparent 72%);
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -22px rgba(91, 140, 255, 1);
}

.feature:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.feature-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  font-size: 26px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.feature-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.feature-text strong {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.feature-text small {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
}

.feature-go {
  position: relative;
  z-index: 1;
  margin-left: auto;
  flex: none;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background 0.18s;
}

.feature:hover .feature-go {
  background: rgba(255, 255, 255, 0.34);
}

/* ---------- toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 34px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 7px 15px;
  font: 500 13px/1.2 inherit;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.chip:hover { color: var(--txt); border-color: var(--line-strong); }
.chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(91, 140, 255, 0.9);
}

.chip .n {
  margin-left: 6px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  opacity: 0.62;
}

.count {
  font-size: 12.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 11px;
  padding-bottom: 20px;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.card:hover {
  background: var(--card-hover);
  border-color: rgba(91, 140, 255, 0.42);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.9);
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font: 700 16px/1 inherit;
  color: #fff;
  background: var(--c, #5b8cff);
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.meta { flex: 1; min-width: 0; }

.meta strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  flex: none;
  font-size: 13px;
  color: var(--dim);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.18s, transform 0.18s;
}
.card:hover .arrow { opacity: 1; transform: translate(0, 0); }

.empty {
  padding: 54px 0;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
}

/* ---------- footer ---------- */

footer {
  padding: 46px 20px 40px;
  text-align: center;
  font-size: 12.5px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  margin-top: 26px;
}
footer p { margin: 5px 0; }
footer .tiny { font-size: 11.5px; opacity: 0.7; }

::selection { background: rgba(91, 140, 255, 0.35); }

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  .hero { padding: 40px 0 18px; }
  .wrap { padding: 0 15px; }
  .feature {
    margin-top: 20px;
    padding: 16px 18px;
    gap: 12px;
    border-radius: 16px;
  }
  .feature-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 13px; }
  .feature-text strong { font-size: 18px; }
  .feature-text small { font-size: 11.5px; line-height: 1.35; }
  .feature-go { display: none; }
  .sub { margin-bottom: 20px; font-size: 13.5px; }
  .searchbar { padding: 6px 6px 6px 15px; gap: 9px; }
  .searchbar button { padding: 9px 16px; font-size: 13.5px; }
  kbd { display: none; }
  .engine-row { display: none; }
  .toolbar { margin-top: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card { padding: 10px; gap: 9px; }
  .tile { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .meta strong { font-size: 13px; }
  .meta small { display: none; }
  .arrow { display: none; }
}

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