/* ===== 主容器 ===== */
#layout {
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top center, #1e2360 0%, #0b0f30 45%, #060a1f 100%);
  position: relative;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

/* ===== 顶部导航栏 ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: relative;
  z-index: 10;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a2f6b 0%, #4a3580 100%);
  border: 1px solid rgba(232, 192, 106, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.brand-logo-svg { width: 32px; height: 32px; }
.brand-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; justify-content: center; }
.brand-name {
  font-size: 20px; font-weight: 700; letter-spacing: 1px; line-height: 1.2;
  background: linear-gradient(to bottom, #ffffff 0%, #d0d8ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-domain { font-size: 12px; color: rgba(255,255,255,0.55); letter-spacing: 1.5px; margin-top: 2px; font-weight: 600; }
.notice-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  border-radius: 20px; border: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(232, 192, 106, 0.35);
  transition: transform 0.15s;
}
.notice-btn:active { transform: scale(0.95); }
.notice-icon { width: 16px; height: 16px; color: #3a2e10; }
.notice-text { font-size: 13px; font-weight: 700; color: #3a2e10; }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(232, 192, 106, 0.35);
  transition: transform 0.15s;
}
.share-btn:active { transform: scale(0.92); }
.share-icon { width: 18px; height: 18px; color: #3a2e10; }

/* ===== Banner 横幅 ===== */
.banner-wrap { padding: 6px 16px 0; }
.banner { position: relative; width: 100%; height: 180px; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.banner-img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }

/* ===== 跑马灯公告 ===== */
.noticecontent.smallInfo { margin: 16px 16px 0; padding: 0; display: flex; align-items: center; border-radius: 0; background: transparent; border: none; }
.noticecontent .notice-left, .noticecontent .icon-notice { display: none !important; }
.noticect { flex: 1; min-width: 0; overflow: hidden; height: 22px; }
.marquee-container { width: 100%; overflow: hidden; height: 22px; }
.marquee-wrap { width: 100%; overflow: hidden; position: relative; height: 22px; }
.marquee-content {
  display: inline-block; white-space: nowrap; visibility: visible; will-change: transform;
  padding-left: 100%; height: 22px; line-height: 22px;
  animation: marqueeScroll 80s linear infinite;
  font-size: 14px; color: rgba(255,255,255,0.85); letter-spacing: 0.5px; font-weight: 500;
}
.marquee-content > span {
  display: inline-block; width: 2643px; height: 22px; line-height: 22px; vertical-align: top;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% + 2643px)); }
}
.marquee-container:hover .marquee-content { animation-play-state: paused; }

/* ===== 卡片跑马灯 ===== */
.card-marquee {
  margin: 14px 0 0; padding: 0 14px; overflow: hidden; position: relative;
  width: 100%; box-sizing: border-box;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: grab;
}
.card-marquee.dragging { cursor: grabbing; }
.card-marquee-track {
  display: inline-flex; gap: 8px; width: max-content; will-change: transform;
  padding-left: 100%; box-sizing: border-box;
  animation: cardMarquee 30s linear infinite;
}
.card-marquee:hover .card-marquee-track { animation-play-state: paused; }
.card-marquee-track.paused { animation-play-state: paused !important; }
.card-item {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  position: relative; overflow: hidden; padding: 0; box-sizing: border-box;
  box-shadow: 0 3px 10px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.15);
  pointer-events: none;
}
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-item-1 { background: radial-gradient(circle at 35% 30%, #F2B049 0%, #D86428 55%, #B8381D 100%); }
.card-item-2 { background: radial-gradient(circle at 35% 30%, #A78BFA 0%, #6B35D4 55%, #3B1E75 100%); }
.card-item-3 { background: radial-gradient(circle at 35% 30%, #F59E0B 0%, #C8353C 55%, #7F1D1D 100%); }
.card-info { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.card-title { font-size: 9px; font-weight: 800; letter-spacing: 0; line-height: 1.1; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.35); padding: 0 4px; }
@keyframes cardMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% + 216px)); }
}

/* ===== 推广区 ===== */
.promo-section { margin: 18px 14px 0; padding: 0; display: flex; gap: 10px; align-items: stretch; }
.promo-cats {
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; width: 64px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 4px 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}
.promo-cats::-webkit-scrollbar { display: none; }
.promo-cat {
  flex-shrink: 0; padding: 10px 4px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; cursor: pointer; text-align: center; white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.18s;
  line-height: 1.2; position: relative;
  transform: perspective(500px) rotateX(10deg); transform-origin: center bottom;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.5),
    0 5px 14px rgba(0,0,0,0.35),
    -1px 0 3px rgba(0,0,0,0.25),
    1px 0 3px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -2px 4px rgba(0,0,0,0.25);
}
.promo-cat::before {
  content: ''; position: absolute; top: 0; left: 6px; right: 6px; height: 1.5px;
  background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.18) 25%, rgba(255,255,255,0.32) 50%, rgba(255,255,255,0.18) 75%, transparent 100%);
  border-radius: 2px; pointer-events: none; z-index: 2;
}
.promo-cat::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.35) 100%);
  border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;
  pointer-events: none; z-index: 1;
}
.promo-cat:active { transform: perspective(500px) rotateX(10deg) scale(0.94); }
.promo-cat.active {
  color: #3a2e10;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.10) 22%, rgba(255,255,255,0) 45%),
    linear-gradient(135deg, #F5D98A 0%, #E8C06A 50%, #B8903E 100%);
  border-color: rgba(138, 106, 34, 0.7);
  transform: perspective(500px) rotateX(10deg); transform-origin: center bottom;
  box-shadow:
    0 3px 10px rgba(184, 144, 62, 0.45),
    0 7px 20px rgba(138, 106, 34, 0.35),
    -1.5px 0 4px rgba(90, 64, 21, 0.25),
    1.5px 0 4px rgba(90, 64, 21, 0.25),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 6px rgba(90, 64, 21, 0.35);
}
.promo-cat.active::before {
  height: 2px;
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 230, 0.55) 20%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 230, 0.55) 80%, transparent 100%);
}
.promo-cat.active::after {
  height: 5px;
  background: linear-gradient(to bottom, transparent 0%, rgba(90, 64, 21, 0.5) 100%);
}
.promo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.promo-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.promo-title-text { flex-shrink: 0; font-size: 16px; font-weight: 700; color: #fff; position: relative; padding-left: 12px; }
.promo-title-text::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #F5D98A, #B8903E);
}
.promo-title-more { font-size: 12px; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.promo-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; overflow: hidden; transition: transform 0.2s; }
.promo-card:active { transform: scale(0.96); }
.promo-card-img { width: 100%; height: 90px; object-fit: cover; display: block; border-radius: 14px; }
.promo-card-name { font-size: 13px; font-weight: 600; color: #fff; padding: 6px 8px 0; }
.promo-card-desc { font-size: 10px; color: rgba(255,255,255,0.45); padding: 2px 8px 8px; line-height: 1.3; }

/* ===== 主内容占位区 ===== */
.main-content { flex: 1; padding: 20px 16px; position: relative; }
.bg-decor { position: absolute; left: 0; right: 0; bottom: 0; height: 260px; pointer-events: none; }
.bg-decor::before {
  content: ''; position: absolute; left: -40px; bottom: 0; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(100, 80, 200, 0.25) 0%, transparent 65%);
  filter: blur(8px);
}
.bg-decor::after {
  content: ''; position: absolute; right: -50px; bottom: 40px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(60, 120, 220, 0.2) 0%, transparent 65%);
  filter: blur(8px);
}
