:root {
  --ink: #151a22;
  --muted: #69717f;
  --paper: #ffffff;
  --soft: #f3f6fa;
  --line: #dfe5ed;
  --dark: #10151d;
  --blue: #2d6cdf;
  --cyan: #62d5ee;
  --green: #74c69d;
  --orange: #f1a85b;
  --max: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  min-height: 360px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 18%, rgba(98, 213, 238, 0.34), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(116, 198, 157, 0.22), transparent 30%),
    linear-gradient(135deg, #10151d, #1e2a3a);
}

.top-nav {
  width: min(var(--max), calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 28px rgba(45, 108, 223, 0.35);
}

.top-nav a:hover {
  color: #fff;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.language-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.language-switch button.is-active {
  background: #fff;
  color: var(--dark);
}

.hero-copy {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding: 42px 0 76px;
  text-align: center;
}

.hero-copy p,
.site-info p,
.preview-window header p {
  margin: 0;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.15rem, 3.65vw, 3.7rem);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: nowrap;
  white-space: nowrap;
}

html[data-language="zh"] .hero-copy h1 {
  font-size: clamp(2.2rem, 4.25vw, 5.1rem);
}

.hero-copy span {
  max-width: 720px;
  justify-self: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.toolbar {
  width: min(var(--max), calc(100% - 32px));
  min-height: 78px;
  margin: -38px auto 24px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(223, 229, 237, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 80px rgba(16, 21, 29, 0.12);
  backdrop-filter: blur(16px);
}

.search-box {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.search-box span {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-box span::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  transform: rotate(45deg);
  background: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.toolbar-meta {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 999px;
  background: #10151d;
  color: #fff;
  white-space: nowrap;
}

.toolbar-meta strong {
  color: var(--cyan);
  font-size: 1.35rem;
}

.toolbar-meta span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  font-weight: 750;
}

.service-note {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(98, 213, 238, 0.12), rgba(45, 108, 223, 0.06)),
    #fff;
  box-shadow: 0 18px 54px rgba(16, 21, 29, 0.07);
}

.service-note p,
.service-note h2,
.service-note span {
  margin: 0;
}

.service-note p {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #10151d;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.service-note h2 {
  font-size: clamp(1.2rem, 2.3vw, 1.9rem);
  line-height: 1.1;
}

.service-note span {
  justify-self: end;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.site-grid {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.site-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(16, 21, 29, 0.08);
}

.site-card[hidden] {
  display: none;
}

.site-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(45, 108, 223, 0.16), rgba(98, 213, 238, 0.16)),
    #dfe5ed;
}

.site-thumb img {
  height: 100%;
  object-fit: cover;
  transition:
    transform 360ms ease,
    filter 200ms ease;
}

.site-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.36));
  opacity: 0;
  transition: opacity 180ms ease;
}

.site-thumb span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.site-card:hover .site-thumb img {
  transform: scale(1.04);
  filter: saturate(1.08);
}

.site-card:hover .site-thumb::after,
.site-card:hover .site-thumb span {
  opacity: 1;
  transform: translateY(0);
}

.site-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}

.site-info h2 {
  margin: 3px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.08;
}

.site-url {
  flex: 0 0 auto;
  max-width: 45%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.site-actions button,
.site-actions a,
.preview-visit,
.preview-close {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.site-actions button {
  background: var(--soft);
  color: var(--ink);
}

.site-actions button:hover {
  background: #e7edf5;
}

.site-actions a,
.preview-visit {
  background: var(--blue);
  color: #fff;
}

.site-actions a:hover,
.preview-visit:hover {
  background: #2159c4;
}

.empty-card {
  min-height: 370px;
  display: grid;
  place-items: center;
  padding: 30px;
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.52)),
    radial-gradient(circle at 30% 20%, rgba(98, 213, 238, 0.2), transparent 28%);
  text-align: center;
}

.empty-card span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #10151d;
  color: var(--cyan);
  font-weight: 900;
}

.empty-card h2 {
  margin: 0 0 8px;
}

.empty-card p {
  margin: 0;
  color: var(--muted);
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 14, 20, 0.72);
}

.preview-modal[hidden] {
  display: none;
}

.preview-window {
  width: min(1180px, 100%);
  height: min(780px, 92vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.4);
}

.preview-window header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.preview-window h2 {
  margin: 2px 0 0;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-close {
  width: 42px;
  padding: 0;
  background: #10151d;
  color: #fff;
}

.preview-close:hover {
  background: #2a3340;
}

.iframe-wrap {
  position: relative;
  min-height: 0;
  background: #111821;
}

.iframe-wrap iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.preview-fallback {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 21, 29, 0.86);
  color: #fff;
  backdrop-filter: blur(12px);
}

.preview-fallback span {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 980px) {
  .hero-copy h1 {
    font-size: clamp(2.9rem, 9vw, 5.3rem);
    text-wrap: wrap;
    white-space: normal;
  }

  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .toolbar-meta {
    justify-content: center;
  }

  .service-note {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .service-note span {
    justify-self: start;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .top-nav {
    width: calc(100% - 24px);
    min-height: 66px;
  }

  .language-switch {
    grid-template-columns: repeat(2, 48px);
    margin-left: auto;
  }

  .hero-copy {
    width: calc(100% - 24px);
    padding: 34px 0 66px;
  }

  .hero-copy h1 {
    font-size: clamp(1.55rem, 7.6vw, 2.45rem);
    max-width: 100%;
    text-wrap: wrap;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-language="zh"] .hero-copy h1 {
    font-size: clamp(1.72rem, 6.1vw, 2.4rem);
    text-wrap: wrap;
    white-space: normal;
  }

  .toolbar,
  .site-grid,
  .service-note {
    width: calc(100% - 24px);
  }

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

  .site-info {
    display: grid;
  }

  .site-url {
    max-width: 100%;
  }

  .preview-modal {
    padding: 10px;
  }

  .preview-window {
    height: 94vh;
    border-radius: 14px;
  }

  .preview-window header {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-controls {
    width: 100%;
  }

  .preview-visit {
    flex: 1;
  }
}
