*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
p,
ul,
ol,
li,
figure {
  margin: 0;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

:root {
  --background: #ffffff;
  --foreground: #111111;
  --card: #ffffff;
  --card-foreground: #111111;
  --primary: #111111;
  --primary-foreground: #ffffff;
  --secondary: #f5f5f5;
  --secondary-foreground: #111111;
  --muted: #f5f5f5;
  --muted-foreground: #666666;
  --border: #e5e5e5;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 18px rgba(0, 0, 0, 0.1);
  --tag-border: 2px dashed #111111;
}

[data-theme="dark"] {
  --background: #000000;
  --foreground: #ffffff;
  --card: #0a0a0a;
  --card-foreground: #ffffff;
  --primary: #fafafa;
  --primary-foreground: #111111;
  --secondary: #1a1a1a;
  --secondary-foreground: #ffffff;
  --muted: #1a1a1a;
  --muted-foreground: #aaaaaa;
  --border: #2a2a2a;
  --tag-border: 2px dashed #ffffff;
}

body {
  min-height: 100vh;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(128, 128, 128, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128, 128, 128, 0.08) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}

.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .site-header {
  background: rgba(0, 0, 0, 0.82);
}

.site-header-inner {
  max-width: 1280px;
  height: 60px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.25;
  margin-top: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-content {
  flex: 1;
  padding: 18px 0 24px;
}

.content-stack > * + * {
  margin-top: 12px;
}

.hero-banner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform 0.45s ease;
}

.hero-slide {
  min-width: 100%;
  flex: 0 0 100%;
}

.hero-slide a {
  display: block;
  width: 100%;
}

.hero-slide img {
  width: 100%;
  display: block;
  border-radius: 14px;
  object-fit: cover;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border: none;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-dot.active {
  width: 18px;
  border-radius: 999px;
  background: #ffffff;
}

.top-banner {
  border-radius: 14px;
}

.top-banner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.top-banner-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-banner-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-banner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.top-banner-logo {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.top-banner-logo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.top-banner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.top-banner-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
  text-align: center;
  max-width: 88px;
  word-break: break-word;
}

.notice-bar {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notice-icon {
  width: 36px;
  min-width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
}

.notice-text {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.notice-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: noticeScroll 13s linear infinite;
}

.notice-track span {
  display: inline-block;
  padding-right: 60px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

@keyframes noticeScroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.section-block + .section-block {
  margin-top: 16px;
}

.category-wrap {
  position: relative;
  padding-top: 42px;
}

.section-tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--foreground);
  background: var(--background);
  border: var(--tag-border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.nav-card {
  background: var(--secondary);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1;
  transition: all 0.2s ease;
  min-height: unset;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nav-card.first-card {
  margin-top: 0;
}

.nav-card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.nav-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.25;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.nav-card-subtitle {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 4px;
  margin-bottom: 8px;
  line-height: 1.25;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 26px;
}

.nav-card-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
  line-height: 1;
}

.nav-card-btn:hover {
  opacity: 0.92;
}

.site-footer {
  background: var(--secondary);
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.footer-text {
  text-align: center;
  font-size: 11px;
  color: var(--muted-foreground);
}

/* 加载层 */
.link-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

[data-theme="dark"] .link-loader {
  background: rgba(0, 0, 0, 0.94);
}

.link-loader.show {
  display: flex;
}

.link-loader-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.link-loader-cover {
  width: 160px;
  height: 160px;
  max-width: 46vw;
  margin: 0 auto 28px;
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  background: #f3f4f6;
}

.link-loader-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 26px;
  line-height: 1.5;
}

.link-loader-bar {
  width: 100%;
  height: 14px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.link-loader-progress {
  width: 0%;
  height: 100%;
  background: #e1261c;
  border-radius: 999px;
  transition: width 0.18s linear;
}

.link-loader-percent {
  margin-top: 24px;
  font-size: 18px;
  color: #666666;
  font-weight: 500;
}

.link-loader-cancel {
  margin: 26px auto 0;
  width: 180px;
  max-width: 80%;
  height: 54px;
  border: none;
  border-radius: 16px;
  background: #d9dce3;
  color: #344054;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.link-loader-cancel:hover {
  opacity: 0.95;
}

/* 平板及以下 */
@media (max-width: 768px) {
  .brand-title {
    font-size: 17px;
  }

  .brand-subtitle {
    font-size: 10px;
    margin-top: 6px;
  }

  .container {
    padding: 0 10px;
  }

  .main-content {
    padding: 14px 0 20px;
  }

  .content-stack > * + * {
    margin-top: 10px;
  }

  .hero-slide img {
    border-radius: 12px;
  }

  .top-banner-logo {
    width: 64px;
    height: 64px;
    border-radius: 10px;
  }

  .top-banner-title {
    font-size: 11px;
    max-width: 64px;
  }

  .notice-bar {
    height: 30px;
  }

  .notice-icon {
    width: 32px;
    min-width: 32px;
  }

  .notice-text {
    height: 30px;
  }

  .notice-track span {
    font-size: 11px;
    padding-right: 50px;
  }

  .category-wrap {
    padding-top: 38px;
  }

  .section-tag {
    font-size: 11px;
    padding: 4px 10px;
    min-height: 28px;
    border-radius: 9px;
  }

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

  .nav-card {
    padding: 10px 6px 8px;
    min-height: unset;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
  }

  .nav-card.first-card {
    margin-top: 0;
  }

  .nav-card-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
    border-radius: 10px;
  }

  .nav-card-title {
    font-size: 11px;
    min-height: 28px;
  }

  .nav-card-subtitle {
    font-size: 9px;
    min-height: 22px;
    margin-bottom: 6px;
  }

  .nav-card-btn {
    min-height: 30px;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 10px;
  }

  .link-loader-title {
    font-size: 16px;
  }

  .link-loader-percent {
    font-size: 16px;
  }

  .link-loader-cancel {
    height: 50px;
    font-size: 16px;
  }
}

/* 手机极致紧凑 */
@media (max-width: 480px) {
  .site-header {
    height: 52px;
  }

  .site-header-inner {
    height: 52px;
    padding: 0 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    height: 44px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 9px;
    margin-top: 5px;
  }

  .container {
    padding: 0 8px;
  }

  .main-content {
    padding: 12px 0 18px;
  }

  .content-stack > * + * {
    margin-top: 8px;
  }

  .hero-slide img {
    border-radius: 10px;
  }

  .hero-dots {
    bottom: 8px;
    gap: 5px;
    padding: 5px 8px;
  }

  .hero-dot {
    width: 7px;
    height: 7px;
  }

  .hero-dot.active {
    width: 16px;
  }

  .top-banner-grid {
    gap: 4px;
  }

  .top-banner-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  .top-banner-title {
    font-size: 10px;
    max-width: 48px;
  }

  .notice-bar {
    height: 28px;
    border-radius: 8px;
  }

  .notice-icon {
    width: 28px;
    min-width: 28px;
  }

  .notice-icon svg {
    width: 14px;
    height: 14px;
  }

  .notice-text {
    height: 28px;
  }

  .notice-track span {
    font-size: 10px;
    padding-right: 40px;
  }

  .section-block + .section-block {
    margin-top: 12px;
  }

  .category-wrap {
    padding-top: 34px;
  }

  .section-tag {
    font-size: 10px;
    padding: 3px 9px;
    min-height: 24px;
    border-radius: 8px;
  }

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

  .nav-card {
    padding: 8px 5px 6px;
    min-height: unset;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
  }

  .nav-card.first-card {
    margin-top: 0;
  }

  .nav-card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 4px;
    border-radius: 8px;
  }

  .nav-card-title {
    font-size: 10px;
    line-height: 1.15;
    min-height: 24px;
  }

  .nav-card-subtitle {
    font-size: 8px;
    line-height: 1.1;
    min-height: 18px;
    margin-top: 2px;
    margin-bottom: 5px;
  }

  .nav-card-btn {
    min-height: 26px;
    font-size: 9px;
    padding: 3px 4px;
    border-radius: 8px;
  }

  .site-footer {
    padding: 10px 0;
  }

  .footer-text {
    font-size: 10px;
  }

  .link-loader-cover {
    width: 130px;
    height: 130px;
    margin-bottom: 22px;
    border-radius: 18px;
  }

  .link-loader-title {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .link-loader-bar {
    height: 12px;
  }

  .link-loader-percent {
    margin-top: 20px;
    font-size: 15px;
  }

  .link-loader-cancel {
    margin-top: 22px;
    width: 150px;
    height: 46px;
    font-size: 15px;
    border-radius: 14px;
  }
}