/*
 * 26下载站统一视觉组件层
 * 设计来源：Open Design / downloadslite-site-atlas
 * 只负责跨页面的视觉语法与旧移动页面迁移，不承载业务数据。
 */
:root {
  --site-bg: var(--atlas-bg, #f3f7fa);
  --site-surface: var(--atlas-surface, #fff);
  --site-surface-soft: var(--atlas-surface-2, #f7fafc);
  --site-text: var(--atlas-ink, #172336);
  --site-muted: var(--atlas-muted, #65758a);
  --site-line: var(--atlas-line, #d9e2ea);
  --site-accent: var(--atlas-accent, #159a83);
  --site-accent-strong: var(--atlas-accent-strong, #087662);
  --site-accent-soft: var(--atlas-accent-soft, #e7f6f2);
  --site-warm: #e87924;
  --site-radius: 16px;
  --site-radius-sm: 10px;
  --site-shadow: var(--atlas-shadow, 0 18px 48px rgba(31, 53, 73, .09));
  --site-display: var(--atlas-display, Georgia, "Noto Serif SC", serif);
  --site-body: var(--atlas-body, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);
  --site-mono: var(--atlas-mono, "Cascadia Code", Consolas, monospace);
}

body.atlas-site {
  background: var(--site-bg);
  color: var(--site-text);
}

body.atlas-site :where(a, button, input) {
  -webkit-tap-highlight-color: transparent;
}

body.atlas-site :where(a, button):focus-visible {
  outline: 3px solid var(--site-accent-soft);
  outline-offset: 2px;
}

/* All public page families use the same panel edge, radius and elevation. */
body.atlas-site :where(
  .home-v5-section,
  .home-v5-insight-panel,
  .home-v5-family-panel,
  .atlas-panel,
  .atlas-section,
  .atlas-page-hero,
  .atlas-detail-card,
  .atlas-download-card,
  .atlas-identity-card,
  .atlas-news-reader,
  .atlas-news-list,
  .m-card-section,
  .m-detail-hero,
  .m-drive-panel,
  .m-catalog-device-note,
  .m-list-container,
  .m-news-container
) {
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: var(--site-surface);
  box-shadow: var(--site-shadow);
}

body.atlas-site :where(
  .home-v5-item,
  .atlas-resource-card,
  .atlas-compact-card,
  .atlas-related-card,
  .m-resource-card,
  .m-compact-card,
  .m-rank-item,
  .m-daily-card,
  .m-album-card,
  .m-app-card
) {
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius-sm);
  background: var(--site-surface-soft);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--site-text) 5%, transparent);
  color: var(--site-text);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

body.atlas-site :where(
  .home-v5-item,
  .atlas-resource-card,
  .atlas-compact-card,
  .atlas-related-card,
  .m-resource-card,
  .m-compact-card,
  .m-rank-item,
  .m-daily-card,
  .m-album-card,
  .m-app-card
):hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--site-accent) 52%, var(--site-line));
  background: var(--site-surface);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--site-text) 10%, transparent);
}

body.atlas-site :where(
  .home-v5-eyebrow,
  .atlas-eyebrow,
  .m-kicker,
  .m-catalog-heading > div > span,
  .m-card-section__head > div > span,
  .m-collection-hero > span
) {
  color: var(--site-accent-strong);
  font: 700 10px/1.35 var(--site-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.atlas-site :where(
  .home-v5-head h2,
  .atlas-section-title,
  .m-catalog-heading h1,
  .m-card-section__head h2,
  .m-list-title,
  .m-news-title,
  .m-collection-hero h1
) {
  color: var(--site-text);
  font-family: var(--site-display);
  font-weight: 700;
  letter-spacing: -.035em;
}

/* Desktop homepage: the lower content uses the same nested-card grammar as the hero. */
body.atlas-home-v5 .home-v5 {
  gap: 22px;
}

body.atlas-home-v5 .home-v5-section {
  overflow: hidden;
}

body.atlas-home-v5 .home-v5-head {
  min-height: 78px;
  border-bottom: 1px solid var(--site-line);
  background: color-mix(in srgb, var(--site-surface) 94%, var(--site-bg));
}

body.atlas-home-v5 .home-v5-body {
  background: var(--site-surface);
}

body.atlas-home-v5 .home-v5-collection-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.atlas-home-v5 .home-v5-family-panel {
  overflow: hidden;
}

body.atlas-home-v5 .home-v5-family-panel header {
  border-bottom: 1px solid var(--site-line);
  background: color-mix(in srgb, var(--site-surface) 94%, var(--site-bg));
}

/* Legacy mobile page families now share the current mobile store system. */
body.mobile-v2-page :where(.m-home-container, .m-daily-updates-container, .m-list-container, .m-news-container) {
  box-sizing: border-box;
  width: min(100% - 24px, 760px);
  margin: 14px auto 26px;
}

body.mobile-v2-page .m-catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 12px;
}

body.mobile-v2-page .m-catalog-heading h1,
body.mobile-v2-page .m-daily-page-title {
  margin: 3px 0 0;
  font: 700 30px/1.08 var(--site-display);
  letter-spacing: -.04em;
}

body.mobile-v2-page :where(.m-ranking-tabs, .m-topic-tabs) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--site-line);
  border-radius: 14px;
  background: var(--site-surface);
  box-shadow: var(--site-shadow);
}

body.mobile-v2-page :where(.m-ranking-tab, .m-topic-tab) {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--site-muted);
  font-weight: 750;
}

body.mobile-v2-page :where(.m-ranking-tab, .m-topic-tab).active {
  background: var(--site-accent-soft);
  color: var(--site-accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--site-accent) 28%, var(--site-line));
}

body.mobile-v2-page :where(.m-ranking-panel, .m-topic-panel) {
  display: none;
  margin-top: 12px;
}

body.mobile-v2-page :where(.m-ranking-panel, .m-topic-panel).active {
  display: block;
}

body.mobile-v2-page :where(.m-subcat-nav, .m-daily-cat-nav) {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

body.mobile-v2-page :where(.m-subcat-nav, .m-daily-cat-nav)::-webkit-scrollbar {
  display: none;
}

body.mobile-v2-page :where(.m-subcat-item, .m-daily-cat-link) {
  min-height: 34px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: var(--site-surface);
  color: var(--site-muted);
  font-size: 12px;
}

body.mobile-v2-page :where(.m-subcat-item, .m-daily-cat-link).active {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
  color: var(--site-accent-strong);
}

body.mobile-v2-page :where(.m-rank-list, .m-daily-grid, .m-app-list, .m-collection-feed) {
  display: grid;
  gap: 9px;
}

body.mobile-v2-page :where(.m-rank-item, .m-daily-card, .m-app-card, .m-album-card) {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 11px;
  padding: 10px;
  text-decoration: none;
}

body.mobile-v2-page .m-rank-item {
  grid-template-columns: 34px 52px minmax(0, 1fr);
}

body.mobile-v2-page .m-rank-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--site-surface);
  color: var(--site-muted);
  font: 700 12px var(--site-mono);
}

body.mobile-v2-page .m-rank-num.rank-top {
  background: var(--site-accent);
  color: #fff;
}

body.mobile-v2-page :where(.m-rank-logo, .m-daily-card-logo, .m-app-logo) {
  overflow: hidden;
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-surface);
}

body.mobile-v2-page .m-rank-logo {
  width: 52px;
  height: 52px;
}

body.mobile-v2-page :where(.m-rank-logo, .m-daily-card-logo, .m-app-logo) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.mobile-v2-page .m-rank-name,
body.mobile-v2-page .m-daily-card-name,
body.mobile-v2-page .m-app-name,
body.mobile-v2-page .m-album-name {
  overflow: hidden;
  color: var(--site-text);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-v2-page :where(.m-rank-dl, .m-daily-card-meta, .m-app-meta, .m-album-desc, .m-album-count) {
  color: var(--site-muted);
  font-size: 11px;
}

body.mobile-v2-page .m-daily-card {
  grid-template-columns: 58px minmax(0, 1fr);
}

body.mobile-v2-page .m-daily-card-logo {
  width: 58px;
  height: 58px;
}

body.mobile-v2-page .m-app-card {
  grid-template-columns: 72px minmax(0, 1fr);
}

body.mobile-v2-page .m-app-logo {
  width: 72px;
  height: 54px;
  object-fit: cover;
}

body.mobile-v2-page .m-collection-hero {
  padding: 22px;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: var(--site-surface);
  box-shadow: var(--site-shadow);
}

body.mobile-v2-page .m-collection-hero p {
  margin: 8px 0 0;
  color: var(--site-muted);
}

body.mobile-v2-page .m-album-card {
  grid-template-columns: 112px minmax(0, 1fr);
}

body.mobile-v2-page .m-album-cover {
  width: 112px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 9px;
  background: var(--site-surface);
}

body.mobile-v2-page .m-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.mobile-v2-page :where(.m-rank-more, .pagination a, .pagination .current, .m-pagination a, .m-pagination .current) {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--site-line);
  border-radius: 10px;
  background: var(--site-surface);
  color: var(--site-accent-strong);
  font-weight: 700;
}

body.mobile-v2-page .m-rank-more {
  width: 100%;
  margin-top: 10px;
}

body.mobile-v2-page :where(.pagination, .m-pagination) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}

body.mobile-news-detail-page .m-news-container {
  padding: 18px;
}

body.mobile-news-detail-page .m-news-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--site-line);
}

body.mobile-news-detail-page .m-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--site-muted);
  font: 11px var(--site-mono);
}

body.mobile-news-detail-page .m-news-content {
  color: var(--site-text);
  font-size: 16px;
  line-height: 1.9;
}

body.mobile-news-detail-page .m-news-content img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: 12px;
}

/* The mobile drawer follows the same nested card system instead of a plain admin list. */
body.mobile-v2-page .m-nav-drop {
  padding: 18px;
  border-right: 1px solid var(--site-line);
  border-radius: 0 24px 24px 0;
  background: var(--site-surface);
}

body.mobile-v2-page .m-navd-brand {
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--site-line);
}

body.mobile-v2-page .m-navd-item {
  min-height: 50px;
  margin: 6px 0;
  padding: 0 14px;
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-surface-soft);
}

body.mobile-v2-page .m-navd-item:hover {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
}

@media (max-width: 768px) {
  /* Compact fallback for a PC-domain link opened in a narrow browser. */
  body.atlas-site .desktop-header {
    display: block;
    width: 100%;
    padding: 0 12px;
  }

  body.atlas-site .desktop-header .atlas-header-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 38px;
    grid-template-rows: 58px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 58px;
    padding: 0;
    border-bottom: 1px solid var(--site-line);
  }

  body.atlas-site .desktop-header .desktop-brand {
    display: inline-flex;
    grid-column: 1;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
    color: var(--site-text);
    font: 750 20px/1 var(--site-display);
    letter-spacing: -.04em;
  }

  body.atlas-site .desktop-header .desktop-brand b {
    color: var(--site-accent);
  }

  body.atlas-site .desktop-header .site-search {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) 34px;
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: var(--site-surface);
    overflow: hidden;
  }

  body.atlas-site .desktop-header .site-search input {
    min-width: 0;
    width: 100%;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--site-text);
    font: 12px/1 var(--site-body);
  }

  body.atlas-site .desktop-header .site-search button,
  body.atlas-site .desktop-header > .atlas-header-top > .header-action-btn {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--site-accent-strong);
  }

  body.atlas-site .desktop-header .site-search svg,
  body.atlas-site .desktop-header > .atlas-header-top > .header-action-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }

  body.atlas-site .desktop-header .desktop-theme-control {
    display: none;
  }

  body.atlas-site .desktop-header > .atlas-header-top > .header-action-btn {
    grid-column: 3;
    margin: 0;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: var(--site-surface);
  }

  body.atlas-site .desktop-primary-nav {
    display: flex;
    width: 100%;
    gap: 18px;
    padding: 0 0 11px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }

  body.atlas-site .desktop-primary-nav::-webkit-scrollbar {
    display: none;
  }

  body.atlas-site .desktop-primary-nav a {
    flex: 0 0 auto;
    color: var(--site-muted);
    font-size: 12px;
    font-weight: 750;
  }

  body.atlas-site .site-breadcrumb {
    width: min(100% - 24px, 760px);
    padding: 10px 0 0;
  }

  body.mobile-v2-page :where(.m-home-container, .m-daily-updates-container, .m-list-container, .m-news-container) {
    width: calc(100% - 24px);
  }
}

@media (max-width: 390px) {
  body.mobile-v2-page :where(.m-home-container, .m-daily-updates-container, .m-list-container, .m-news-container) {
    width: calc(100% - 16px);
  }

  body.mobile-v2-page .m-album-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  body.mobile-v2-page .m-album-cover {
    width: 96px;
  }
}
