/* 导航站前台样式 —— 自适应 PC / 移动端 */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: var(--max-w, 1180px);
  margin: 0 auto;
  padding: 0 20px;
}

.page-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body.pattern-grid .page-pattern {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .55;
}
body.pattern-dots .page-pattern {
  background-image: radial-gradient(color-mix(in srgb, var(--border) 90%, transparent) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  opacity: .6;
}
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}

.topbar, .tagline-bar, .main-wrap, .site-footer, .bookmark-bar { position: relative; z-index: 1; }

/* 顶部渐变栏 */
.topbar {
  background: linear-gradient(118deg, var(--header-from), var(--header-to));
  color: #fff;
}
body.header-sticky .topbar {
  position: sticky;
  top: 0;
  z-index: 60;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.brand-logo, .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: 0 0 auto;
}
.brand-logo { object-fit: cover; background: rgba(255,255,255,.16); }
.brand-mark {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: .5px; line-height: 1.25; white-space: nowrap; }
.brand-text small { font-size: 11px; opacity: .8; line-height: 1.4; white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  opacity: .88;
  transition: opacity .2s;
}
.topnav a:hover { opacity: 1; }
.topnav-cta {
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.17);
  border: 1px solid rgba(255,255,255,.42);
  font-weight: 600;
  opacity: 1 !important;
}
.nav-toggle { display: none; }

/* 副标题条 */
.tagline-bar {
  background: var(--tagline-bg);
  color: rgba(255,255,255,.93);
  text-align: center;
  font-size: 12px;
  letter-spacing: 1.8px;
  padding: 8px 12px;
}
body.theme-dark_gold .tagline-bar { color: var(--primary); letter-spacing: 2.5px; }

.main-wrap { padding-top: 18px; }

/* 公告 */
.announce {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.announce-label {
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}
.announce-marquee {
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-duration, 30s) linear infinite;
}
.marquee-track span {
  font-size: 12.5px;
  color: var(--muted);
  padding-right: 90px;
  white-space: nowrap;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.announce-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.announce-more { flex: 0 0 auto; font-size: 12px; color: var(--primary); text-decoration: none; }

/* 主图 */
.hero {
  display: block;
  margin-top: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  isolation: isolate;
}
.hero-media {
  position: relative;
  height: var(--hero-h, 320px);
  background: linear-gradient(120deg, var(--header-from), var(--secondary));
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-placeholder {
  height: 100%;
  background: linear-gradient(120deg, var(--header-from), var(--header-to));
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,0));
  pointer-events: none;
}
.hero-content {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 46%;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.hero-content h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.3; }
.hero-content p { margin: 0 0 14px; font-size: 13.5px; opacity: .9; }
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}

/* 分类标签 */
.tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 42px;
  margin: 26px 0 4px;
}
.tab {
  position: relative;
  background: none;
  border: 0;
  padding: 8px 2px 14px;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 700; }
.tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 26px;
  height: 4px;
  margin-left: -13px;
  border-radius: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform .25s;
}
.tab.active::after { transform: scaleX(1); }
body.theme-dark_gold .tab.active { color: var(--primary); }

/* 应用网格 */
.app-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols-pc, 4), minmax(0, 1fr));
  gap: 20px 10px;
  margin-top: 12px;
}
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px 12px;
  border-radius: var(--radius-sm);
  min-width: 0;
}
.app-icon-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto;
}
.app-icon {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  display: block;
  object-fit: cover;
}
.icon-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 1px;
}
.app-icon-img {
  position: absolute;
  inset: 0;
  background: var(--surface);
}
.app-icon-img.is-broken { display: none; }
.app-icon-wrap { transition: transform .25s ease; }
body.effects-lift .app-card:hover .app-icon-wrap {
  transform: translateY(-4px) scale(1.04);
}
body.effects-lift .app-card:hover .app-icon-img { box-shadow: 0 10px 24px rgba(0,0,0,.16); }

.app-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.badge-primary { background: var(--primary); }
.badge-blue { background: #3b82f6; }
.badge-orange { background: #f59e0b; }
.badge-green { background: #22c55e; }
.badge-purple { background: #a855f7; }
.badge-gray { background: #94a3b8; }

.app-name {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.app-desc {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 31px;
  padding: 0 15px;
  margin-top: 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s, background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
}
.dl-btn:active { transform: scale(.96); }
.btn-outline {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, transparent);
  background: transparent;
}
.btn-outline:hover { background: var(--primary); color: var(--on-primary); }
.btn-soft {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-color: transparent;
}
.btn-soft:hover { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.btn-solid {
  color: var(--on-primary);
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  border-color: transparent;
}
body.effects-glow .rec-btn,
body.effects-glow .app-grid .dl-btn.btn-solid {
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 34%, transparent);
}
.rec-btn { min-width: 92px; height: 36px; font-size: 13px; margin-top: 0; }

/* 暗黑金主题卡片（参考图3） */
body.theme-dark_gold .app-card {
  background: linear-gradient(180deg, #151515, #0c0c0c);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 8px 14px;
}
body.theme-dark_gold .app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  pointer-events: none;
}
body.theme-dark_gold .app-icon-img { border: 1px solid #3a2f18; }
body.theme-dark_gold .dl-btn.btn-outline { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
body.theme-dark_gold .dl-btn.btn-solid { background: linear-gradient(120deg, #f6c453, #dfa017); }
body.theme-dark_gold .announce { background: #12110c; border-color: var(--border); }

/* 推广图 */
.promo {
  display: block;
  margin-top: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  line-height: 0;
}
.promo img {
  width: 100%;
  height: var(--promo-h, 240px);
  object-fit: cover;
  display: block;
}

/* 下载推荐 */
.recommend { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}
body.theme-dark_gold .section-head h2 { color: var(--primary); letter-spacing: 1px; }
.section-head p { margin: 0; font-size: 12px; color: var(--muted); }

.recommend-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.recommend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
}
body.effects-lift .recommend-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rec-icon-wrap { position: relative; width: 54px; height: 54px; flex: 0 0 auto; }
.rec-icon { width: 100%; height: 100%; border-radius: 13px; object-fit: cover; display: block; }
.rec-icon-img { position: absolute; inset: 0; background: var(--surface); }
.rec-icon-img.is-broken { display: none; }
.rec-icon.icon-fallback { font-size: 20px; }
.rec-body { flex: 1; min-width: 0; }
.rec-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rec-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 500;
  color: #fff;
}
.tag-pink { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.tag-blue { background: #e3efff; color: #1f6fd0; }
.tag-orange { background: #fff0dc; color: #c9760a; }
.tag-green { background: #e2f8ec; color: #0f9d58; }
.tag-purple { background: #f0e8ff; color: #7c3aed; }
.tag-gray { background: #eef0f5; color: #626a80; }
body.theme-dark_gold .tag-blue { background: rgba(59,130,246,.16); color: #7db6ff; }
body.theme-dark_gold .tag-orange { background: rgba(245,158,11,.16); color: #ffc861; }
body.theme-dark_gold .tag-green { background: rgba(34,197,94,.15); color: #5ee0a0; }
body.theme-dark_gold .tag-purple { background: rgba(168,85,247,.16); color: #c79bff; }
body.theme-dark_gold .tag-gray { background: rgba(148,163,184,.15); color: #b7c0d0; }
.rec-desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
body.recommend-grid-mode .recommend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 页脚 */
.site-footer {
  margin-top: 42px;
  padding: 26px 0 92px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.footer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.site-footer p { margin: 4px 0; }
.footer-icp { opacity: .75; }

/* 底部书签条 */
.bookmark-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 26px rgba(20, 20, 30, .12);
  padding-bottom: env(safe-area-inset-bottom);
}
.bookmark-inner {
  max-width: var(--max-w, 1180px);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 46px;
  position: relative;
}
.bookmark-icon { color: var(--primary); font-size: 16px; }
.bookmark-text {
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bookmark-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
html.bookmark-hidden .bookmark-bar { display: none; }
html.bookmark-hidden .site-footer { padding-bottom: 32px; }
@media (min-width: 901px) {
  body.bookmark-mobile-only .bookmark-bar { display: none; }
  body.bookmark-mobile-only .site-footer { padding-bottom: 32px; }
}

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translate(-50%, 10px);
  z-index: 120;
  background: rgba(18, 18, 24, .92);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 分栏数量 */
body.cols-pc-2 { --cols-pc: 2; }
body.cols-pc-3 { --cols-pc: 3; }
body.cols-pc-4 { --cols-pc: 4; }
body.cols-pc-5 { --cols-pc: 5; }
body.cols-pc-6 { --cols-pc: 6; }
body.cols-m-2 { --cols-m: 2; }
body.cols-m-3 { --cols-m: 3; }
body.cols-m-4 { --cols-m: 4; }

/* 入场动效 */
body.effects-reveal .reveal {
  opacity: 0;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1);
  will-change: opacity, transform;
}
body.reveal-fade-up .reveal { transform: translateY(18px); }
body.reveal-zoom .reveal { transform: scale(.96); }
body.reveal-slide .reveal { transform: translateX(-20px); }
body.effects-reveal .reveal.reveal-in { opacity: 1; transform: none; }

/* 移动端导航 */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform .2s, opacity .2s;
  }
  .topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 20px 16px;
    background: linear-gradient(160deg, var(--header-from), var(--header-to));
    box-shadow: 0 14px 26px rgba(20, 20, 30, .18);
  }
  .topbar { position: relative; }
  body.header-sticky .topbar { position: sticky; }
  .topbar.nav-open .topnav { display: flex; }
  .topnav a { padding: 9px 4px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .topnav-cta { text-align: center; margin-top: 8px; padding: 10px; border-bottom: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .topbar-inner { height: 56px; gap: 10px; }
  .brand-logo, .brand-mark { width: 33px; height: 33px; border-radius: 9px; }
  .brand-text strong { font-size: 15px; }
  .brand-text small { font-size: 10px; }
  .tagline-bar { font-size: 10px; letter-spacing: 1px; padding: 6px 10px; }
  .main-wrap { padding-top: 12px; }
  .announce { padding: 6px 12px 6px 6px; gap: 8px; border-radius: 14px; }
  .announce-label { font-size: 11px; padding: 3px 9px; }
  .announce-text, .marquee-track span { font-size: 11.5px; }
  .hero { margin-top: 12px; }
  .hero-media { height: var(--hero-hm, 160px); }
  .hero-content { left: 18px; max-width: 68%; }
  .hero-content h2 { font-size: 19px; margin-bottom: 4px; }
  .hero-content p { font-size: 11.5px; margin-bottom: 8px; }
  .hero-btn { height: 30px; padding: 0 14px; font-size: 11.5px; }
  .tabs { gap: 26px; margin: 18px 0 2px; overflow-x: auto; justify-content: flex-start; padding: 0 4px; }
  .tab { font-size: 13.5px; padding: 6px 2px 11px; flex: 0 0 auto; }
  .app-grid {
    grid-template-columns: repeat(var(--cols-m, 4), minmax(0, 1fr));
    gap: 16px 4px;
    margin-top: 8px;
  }
  .app-card { padding: 8px 2px 8px; }
  .app-icon-wrap { width: 58px; height: 58px; }
  .app-icon { border-radius: 13px; }
  .app-name { font-size: 12px; margin-top: 7px; }
  .app-desc { display: none; }
  .dl-btn { min-width: 66px; height: 27px; padding: 0 11px; font-size: 11px; margin-top: 7px; }
  .rec-btn { min-width: 74px; height: 31px; font-size: 12px; margin-top: 0; }
  .app-badge { font-size: 9px; padding: 3px 6px; top: -5px; right: -6px; }
  body.theme-dark_gold .app-card { padding: 12px 4px 10px; }
  .promo { margin-top: 18px; }
  .promo img { height: var(--promo-hm, 140px); }
  .recommend { margin-top: 24px; }
  .section-head h2 { font-size: 17px; }
  .section-head p { font-size: 11px; }
  .recommend-list { gap: 10px; margin-top: 12px; }
  .recommend-item { padding: 10px 11px; gap: 10px; border-radius: 12px; }
  .rec-icon-wrap { width: 44px; height: 44px; }
  .rec-icon { border-radius: 10px; }
  .rec-title-row h3 { font-size: 13.5px; }
  .tag { font-size: 9px; padding: 3px 6px; }
  .rec-desc { font-size: 11.5px; -webkit-line-clamp: 2; }
  body.recommend-grid-mode .recommend-list { grid-template-columns: 1fr; }
  .site-footer { padding: 20px 0 84px; margin-top: 28px; font-size: 11px; }
  .bookmark-inner { height: 48px; padding: 0 40px; }
  .bookmark-text { font-size: 12.5px; }
  .toast { bottom: 72px; font-size: 12px; }
}

@media (max-width: 360px) {
  .app-icon-wrap { width: 52px; height: 52px; }
  .dl-btn { min-width: 60px; font-size: 10.5px; }
  .brand-text small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee-track { animation-duration: 99999s; }
}
