:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #eef4ff;
  --text: #192333;
  --muted: #5f6b7a;
  --line: #dde5ee;
  --brand: #0b63ce;
  --brand-dark: #074faa;
  --green: #0f9f6e;
  --amber: #b66a00;
  --shadow: 0 16px 40px rgba(25, 35, 51, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(11, 99, 206, .10), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #eef3f8 100%);
}

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

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  border: 1px solid rgba(221, 229, 238, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  width: min(520px, 100%);
  height: auto;
  max-height: 108px;
  object-fit: contain;
  object-position: left center;
  margin: -12px 0;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #cbe8d9;
  border-radius: 999px;
  color: #057246;
  background: #eaf8f0;
  white-space: nowrap;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 340px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

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

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.filter-button.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.site-card {
  display: flex;
  flex-direction: column;
  min-height: 292px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 24px rgba(25, 35, 51, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.site-card:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 99, 206, .35);
  box-shadow: 0 18px 36px rgba(25, 35, 51, .10);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--brand);
  background: var(--panel-strong);
  font-size: 18px;
}

.tag {
  max-width: 128px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #3d597a;
  background: #edf3f9;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card h2 {
  margin: 18px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.description {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.url {
  display: block;
  margin-top: 13px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.meta-row span {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #44546a;
  background: #f7fafc;
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.primary-action,
.copy-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.primary-action {
  color: #fff;
  background: var(--brand);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--brand-dark);
}

.copy-action {
  color: var(--brand-dark);
  background: #fff;
  border-color: #cbd8e8;
}

.copy-action:hover,
.copy-action:focus-visible {
  border-color: var(--brand);
}

.empty-state {
  padding: 56px 20px;
  border: 1px dashed #c7d3e0;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .68);
  text-align: center;
}

.empty-state i {
  color: var(--brand);
  font-size: 34px;
}

.empty-state h2 {
  margin: 16px 0 6px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(25, 35, 51, .94);
  box-shadow: 0 12px 26px rgba(25, 35, 51, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero {
    padding: 22px;
  }

  .brand-logo {
    max-height: 82px;
    margin: -8px 0;
  }

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

  .card-actions {
    grid-template-columns: 1fr;
  }

  .filter-button {
    flex: 1 1 auto;
  }
}
