/* =========================
   1. 全局设置
========================= */
:root {
  --page-width: 708px;
  --green: #39bd50;
  --red: #ff0808;
  --black: #000;
  --text: #111;
  --muted: #666;
  --border: #e9e9e9;
  --focus: #075bdb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #f1f1f1;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* =========================
   2. 页面容器
========================= */
.page {
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
}

/* =========================
   3. 顶部 Logo
========================= */
.header {
  min-height: 89px;
  padding: 8px 12px;
  background: #1c72ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 7px solid #eee;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  color: #fff;
  font-size: clamp(20px, 6.4vw, 42px);
  font-weight: 900;
  letter-spacing: -1.5px;
  white-space: nowrap;
}

.shield {
  width: auto;
  height: 48px;
  max-width: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-rsn {
  padding: 0 5px 3px;
}

.brand-dot {
  color: #fff;
}

/* =========================
   4. 顶部宣传横幅
========================= */
.banner {
  position: relative;
  width: 100%;
  aspect-ratio: 2.65 / 1;
  overflow: hidden;
  background: radial-gradient(
    ellipse at center,
    #cfe0fc,
    #2374fa 75%
  );
}

.banner img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #ffe37a;
  background: radial-gradient(
    ellipse at center,
    #75501c,
    #17120b 75%
  );
}

.banner-placeholder strong {
  display: block;
  font-size: clamp(24px, 6vw, 48px);
  font-weight: 900;
  text-shadow: 2px 3px #7a1800;
  overflow-wrap: anywhere;
}

.banner-placeholder span {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.banner-dots {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 7px;
  display: flex;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}

.banner-dots span {
  width: 22px;
  height: 3px;
  background: #ffffff80;
}

.banner-dots span.active {
  background: #fff;
}

/* =========================
   5. 内容区与标题
========================= */
.content {
  padding: 36px 25px 22px;
}

.heading {
  margin: 18px 12px 26px;
  font-size: clamp(19px, 3.8vw, 25px);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

/* =========================
   6. 排行榜列表
========================= */
.site-list {
  width: 100%;
}

.site-row {
  min-height: 145px;
  display: grid;
  grid-template-columns: 100px 27px minmax(0, 1fr) 144px;
  align-items: center;
  gap: 7px;
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}

.site-icon {
  width: 101px;
  height: 101px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #ffdf00;
  border-radius: 15px;
  background: #86a6fc;
}

.site-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-placeholder {
  color: #ffdb40;
  font-size: 34px;
  font-weight: 900;
}

.rank {
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.site-info {
  min-width: 0;
  padding-left: 1px;
}

.site-name {
  display: block;
  margin-bottom: 7px;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.site-desc {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.visit {
  min-width: 0;
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 28px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: filter 0.2s ease;
}

.visit.red {
  background: var(--red);
}

.visit:hover {
  filter: brightness(0.92);
}

.visit:active {
  filter: brightness(0.84);
}

.visit:focus-visible,
.site-name:focus-visible,
.social-link:focus-visible,
.brand:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-name:focus-visible,
.social-link:focus-visible,
.brand:focus-visible {
  border-radius: 4px;
}

.empty-message {
  padding: 25px 0;
  color: #777;
  text-align: center;
}

.link-disabled {
  color: #777;
  cursor: not-allowed;
  overflow-wrap: anywhere;
}

/* =========================
   7. 右侧悬浮社交按钮
========================= */
.social {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: calc(50% + 285px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.social-link {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 2px 5px #0003;
  transition: transform 0.2s ease;
}

.social-link:hover {
  transform: scale(1.05);
}

.social-link svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.telegram {
  background: #32a9df;
}

.facebook {
  background: #2867b2;
  font-family: Arial, sans-serif;
  font-size: 36px;
}

.whatsapp {
  background: #38c96b;
}

.x-social {
  background: #171717;
  border: 2px solid #444;
}

/* =========================
   8. 页脚
========================= */
.footer {
  padding: 18px 15px;
  border-top: 1px solid var(--border);
  color: #888;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.footer p {
  margin: 4px 0;
}

/* =========================
   9. 平板
========================= */
@media (max-width: 760px) {
  .page {
    max-width: 100%;
  }

  .social {
    left: auto;
    right: 8px;
    gap: 15px;
  }

  .social-link {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .social-link svg {
    width: 23px;
    height: 23px;
  }

  .content {
    padding: 28px 20px 20px;
  }

  .site-row {
    grid-template-columns:
      minmax(65px, 85px)
      24px
      minmax(0, 1fr)
      minmax(100px, 125px);
    gap: 6px;
  }

  .site-icon {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .site-name {
    font-size: 21px;
  }

  .site-desc {
    font-size: 17px;
  }

  .visit {
    font-size: 14px;
  }
}

/* =========================
   10. 手机
========================= */
@media (max-width: 520px) {
  .header {
    min-height: 70px;
    padding: 6px;
  }

  .brand {
    gap: 3px;
    font-size: clamp(20px, 6.2vw, 33px);
    letter-spacing: -1px;
  }

  .shield {
    width: 38px;
    height: 38px;
  }

  .brand-rsn {
    padding: 1px 3px 3px;
  }

  .banner {
    aspect-ratio: 2.05 / 1;
  }

  .content {
    padding: 22px 12px;
  }

  .heading {
    margin: 15px 5px 20px;
    font-size: 19px;
  }

  .site-row {
    grid-template-columns: 58px 20px minmax(0, 1fr);
    gap: 5px;
    min-height: 0;
    padding: 15px 0;
  }

  .site-icon {
    width: 58px;
    height: 58px;
    border-radius: 10px;
  }

  .icon-placeholder {
    font-size: 22px;
  }

  .rank {
    font-size: 20px;
  }

  .site-name {
    margin-bottom: 5px;
    font-size: 17px;
  }

  .site-desc {
    font-size: 14px;
    line-height: 1.4;
  }

  .visit {
    grid-column: 3;
    justify-self: start;
    min-height: 36px;
    margin-top: 9px;
    padding: 8px 14px;
    font-size: 14px;
  }

  .social {
    top: auto;
    right: 6px;
    bottom: 16px;
    transform: none;
    gap: 10px;
  }

  .social-link {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 21px;
  }

  .social-link svg {
    width: 20px;
    height: 20px;
  }

  .footer {
    padding: 15px 10px;
  }
}

/* 极窄屏幕 */
@media (max-width: 350px) {
  .brand {
    font-size: 19px;
    letter-spacing: -0.8px;
  }

  .shield {
    width: 32px;
    height: 32px;
  }

  .content {
    padding-right: 9px;
    padding-left: 9px;
  }

  .site-row {
    grid-template-columns: 48px 18px minmax(0, 1fr);
    gap: 4px;
  }

  .site-icon {
    width: 48px;
    height: 48px;
  }

  .site-name {
    font-size: 15px;
  }

  .site-desc {
    font-size: 13px;
  }

  .social-link {
    width: 32px;
    height: 32px;
  }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}