/* AIPlay home date selector — fixed-center combination wheel. */

body.home-view-active {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body.home-view-active #app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

body.home-view-active .home-container {
  display: flex;
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(var(--nav-height) + 3px + env(safe-area-inset-bottom, 0px));
}

body.home-view-active .home-hero,
body.home-view-active .region-selector { flex: none; }

body.home-view-active .home-split {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 国家按钮悬浮在卡片区上方，不再占用卡片空间 */
body.home-view-active .region-selector {
  position: static;
  z-index: 8;
  margin: -18px 12px 0;
  padding: 3px 0 3px;
  border: 0;
}

/* 首页整体比例：广告位加高、Hero 顶部内边距收紧 */
body.home-view-active .home-hero {
  padding: 8px 10px 24px;
}
body.home-view-active .home-ad-slide {
  min-height: 118px;
}

body.home-view-active .home-split .cards-area {
  position: absolute;
  inset: 0;
  padding: 12px 8px 28px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: auto; /* 纵向整区滚动、横向行内滚动均原生 1:1 跟手 */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.home-view-active .cards-area::-webkit-scrollbar { display: none; }

body.home-view-active .cards-edge-spacer {
  width: 1px;
  height: 0;
  min-height: 0;
  flex: none;
  pointer-events: none;
}

body.home-view-active .cards-row {
  position: relative;
  inset: auto;
  box-sizing: border-box;
  transform: none;
  pointer-events: auto;
  transform-origin: center;
}

/* 热门组：暖色描边 + 淡暖色底，突出 3 日热门身份 */
body.home-view-active .cards-row.hot-row {
  border: 1px solid rgba(255, 138, 76, .6);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 122, 51, .24), rgba(255, 190, 96, .12));
  padding: 8px;
  margin: 0 auto 6px;
  width: calc(100% - 4px);
  min-height: 0; /* 热榜框跟随卡片内容，等边距包裹 */
}
body.home-view-active .cards-row.hot-row .cards-row-label {
  color: rgba(255, 175, 96, .95) !important;
  font-weight: 800;
}

/* 名称与使用量叠加到封面图片底部，释放下方空间、放大卡片 */
body:not(.cms-mode) .cards-row-scroll .glass-card {
  position: relative;
}
body:not(.cms-mode) .cards-row-scroll .glass-card .glass-card-body {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 14px 6px 5px;
  border-radius: 0 0 11px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, .76), rgba(0, 0, 0, .2) 55%, transparent);
  pointer-events: none;
}
body:not(.cms-mode) .cards-row-scroll .glass-card-name {
  color: #fff;
  font-size: .6rem;
  line-height: 1.1;
  font-weight: 700;
}
body:not(.cms-mode) .cards-row-scroll .glass-card-stats {
  color: rgba(255, 255, 255, .78);
  font-size: .5rem;
  line-height: 1.1;
}

body.home-view-active + footer,
body.home-view-active footer { display: none; }

body:not(.cms-mode) .day-selector {
  perspective: 420px;
  position: absolute;
  z-index: 6;
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 40px;
  min-width: 40px;
  height: auto;
  border: 0;
  border-radius: 18px;
  background: rgba(8, 10, 12, .62);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .05);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 1.5s linear, background-color 1.5s linear;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 滚动中：只淡入不补帧（不再过渡 backdrop-filter，避免滚动时持续重绘） */
body:not(.cms-mode) .day-selector.moving {
  opacity: 1;
  transition: opacity 1s cubic-bezier(.22, 1, .36, 1);
}

body:not(.cms-mode) .day-selector-focus {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 5px;
  width: 30px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  background: rgba(255, 255, 255, .065);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.16);
  transform: translateY(-50%);
  pointer-events: none;
  transition: background-color 180ms cubic-bezier(.22,1,.36,1), box-shadow 180ms cubic-bezier(.22,1,.36,1);
}

body:not(.cms-mode) .day-selector:not(.moving) .day-selector-focus {
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -1px 0 rgba(0,0,0,.15);
}

body:not(.cms-mode) .day-selector::before,
body:not(.cms-mode) .day-selector::after {
  content: '';
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 30%;
  pointer-events: none;
  display: none;
}
body:not(.cms-mode) .day-selector::before { top: 0; background: linear-gradient(#000 12%, rgba(0, 0, 0, .78), transparent); }
body:not(.cms-mode) .day-selector::after { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .78), #000 88%); }

body:not(.cms-mode) .day-selector-items {
  position: absolute;
  z-index: 2;
  inset: 50% 0 auto;
  height: 0;
}

body:not(.cms-mode) .day-item,
body:not(.cms-mode) .day-item.active {
  position: absolute;
  top: -22px;
  left: 1px;
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  opacity: .2;
  color: rgba(245, 245, 245, .92);
  background: transparent;
  box-shadow: none;
  transform: translate3d(0,0,0);
  filter: none;
  transform-origin: center;
  transition: color 140ms cubic-bezier(.22,1,.36,1);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

body:not(.cms-mode) .day-item.active {
  color: rgba(255, 255, 255, .98);
  background: transparent;
}

body:not(.cms-mode) .day-item:active { background: transparent; }
body:not(.cms-mode) .day-item:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .55);
  outline-offset: -5px;
}

body:not(.cms-mode) .day-item-label,
body:not(.cms-mode) .day-item.active .day-item-label {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  box-sizing: border-box;
  border-radius: 0;
  opacity: 1;
  color: inherit;
  background: transparent;
  box-shadow: none;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "PingFang SC", sans-serif;
  font-size: .68rem;
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

body:not(.cms-mode) .day-item.active .day-item-label::after { display: none; }

/* Retire every visual from the former wheel/temperature control. */
body:not(.cms-mode) .day-wheel,
body:not(.cms-mode) .day-wheel-items,
body:not(.cms-mode) .day-slider-track,
body:not(.cms-mode) .day-slider-fill,
body:not(.cms-mode) .day-wheel-mask,
body:not(.cms-mode) .day-wheel-frame,
body:not(.cms-mode) .day-item-dot { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  body:not(.cms-mode) .day-selector-focus,
  body:not(.cms-mode) .day-item { transition: none !important; }
}
