:root {
  --bg: #eef4ff;
  --text: #14213d;
  --muted: #5d6b84;
  --panel: rgba(255, 255, 255, 0.64);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.68);
  --accent: #3578ff;
  --accent-2: #20c997;
  --accent-3: #ff7a59;
  --shadow: 0 24px 70px rgba(52, 78, 132, 0.18);
  --radius: 22px;
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 12%, rgba(53, 120, 255, 0.22), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(32, 201, 151, 0.22), transparent 30%),
    radial-gradient(circle at 70% 88%, rgba(255, 122, 89, 0.18), transparent 26%),
    linear-gradient(135deg, #f7fbff 0%, #e9f2ff 46%, #f7fff8 100%);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(24px);
  box-shadow: 18px 0 55px rgba(63, 95, 140, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 16px;
  color: white;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(53, 120, 255, 0.24);
}

.logo-mark {
  overflow: hidden;
  padding: 4px;
  background: rgba(255, 255, 255, 0.86);
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-right: 4px;
}

.side-nav::-webkit-scrollbar {
  width: 4px;
}

.side-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(53, 120, 255, 0.28);
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #30405f;
  font-size: 14px;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  border-color: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(53, 120, 255, 0.12);
}

.mobile-topbar {
  display: none;
}

.content {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 36px clamp(18px, 3vw, 44px) 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
  align-items: stretch;
  min-height: 320px;
  margin-bottom: 22px;
}

.hero-copy,
.search-panel,
.empty-state,
.link-section {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 30px;
}

.hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-logo {
  display: grid;
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 44px rgba(53, 120, 255, 0.15);
}

.hero-logo img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
}

.hero-copy::after {
  position: absolute;
  right: -70px;
  bottom: -92px;
  width: 230px;
  height: 230px;
  border: 36px solid rgba(53, 120, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 520px;
  font-size: clamp(40px, 4.4vw, 62px);
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
  word-break: keep-all;
}

.hero p:last-child {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.search-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 30px;
}

.engine-tabs,
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.engine-tab,
.quick-tags button,
.search-box button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.engine-tab,
.quick-tags button {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #35445e;
  background: rgba(255, 255, 255, 0.72);
}

.engine-tab:hover,
.quick-tags button:hover,
.search-box button:hover {
  transform: translateY(-1px);
}

.engine-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #6f8cff);
  box-shadow: 0 12px 24px rgba(53, 120, 255, 0.22);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 10px;
  margin: 18px 0 16px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.search-box input:focus {
  border-color: rgba(53, 120, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(53, 120, 255, 0.12);
}

.search-box button {
  min-width: 0;
  border-radius: 18px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 14px 28px rgba(32, 201, 151, 0.2);
}

.empty-state {
  margin-bottom: 22px;
  padding: 22px;
  border-radius: 22px;
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 6px;
  color: var(--muted);
}

.link-section {
  scroll-margin-top: 28px;
  margin-bottom: 22px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.site-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 84px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 10px 30px rgba(75, 99, 135, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-card:hover {
  transform: translateY(-3px);
  border-color: rgba(53, 120, 255, 0.34);
  box-shadow: 0 18px 42px rgba(53, 120, 255, 0.16);
}

.site-card img {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.8);
  object-fit: contain;
}

.site-card div {
  min-width: 0;
}

.site-card strong,
.site-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card strong {
  margin-bottom: 5px;
  font-size: 15px;
}

.site-card span {
  color: var(--muted);
  font-size: 13px;
}

.site-card.hidden,
.link-section.hidden {
  display: none;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  color: white;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 36px rgba(53, 120, 255, 0.24);
  transition: 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.icon-button {
  display: grid;
  gap: 5px;
  width: 44px;
  height: 44px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
}

@media (max-width: 980px) {
  .page-shell {
    display: block;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(22px);
  }

  .brand.compact {
    margin: 0;
  }

  .brand.compact .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
    font-size: 21px;
  }

  .sidebar {
    position: fixed;
    inset: 70px 16px auto 16px;
    height: min(70vh, 620px);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
  }

  .sidebar.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar .brand {
    display: none;
  }

  .side-nav {
    max-height: 100%;
  }

  .content {
    padding-top: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content {
    padding-inline: 12px;
  }

  .hero-copy,
  .search-panel {
    border-radius: 22px;
  }

  .hero-copy {
    padding: 28px 22px;
  }

  .hero-brand {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .hero-logo {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
    border-radius: 20px;
  }

  .hero-logo img {
    width: 56px;
    height: 56px;
    border-radius: 15px;
  }

  .hero h1 {
    max-width: 360px;
    font-size: 40px;
  }

  .hero p:last-child {
    font-size: 15px;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .search-box button {
    height: 50px;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 19px;
  }
}
