/* 49 主题 · 首页（375 基准，仅在 tokens.css 变量内取色/间距/字号/圆角） */

/* ---------- 顶部品牌栏 ---------- */
.t49-brand {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  padding: var(--space-10);
  padding-top: max(var(--space-10), env(safe-area-inset-top, 0px));
  background: var(--color-bg-card);
  border-bottom: 0.5px solid var(--color-divider);
}
.t49-brand__row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
.t49-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-8);
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  font-size: var(--font-size-13);
  font-weight: 600;
  letter-spacing: 0;
}
.t49-brand__name {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-16);
  font-weight: 600;
  color: var(--color-text-primary);
}
.t49-brand__badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-4);
  background: var(--color-ball-green-soft);
  color: var(--color-primary);
  font-size: var(--font-size-12);
}
.t49-brand__search {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 32px;
  padding: 0 var(--space-10);
  border-radius: var(--radius-16);
  background: var(--color-bg-input);
  color: var(--color-text-placeholder);
  font-size: var(--font-size-13);
}
.t49-brand__search svg {
  flex: none;
}
/* 真输入框（替换原来的静态文字） */
.t49-brand__search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: var(--font-size-13);
  color: var(--color-text-primary);
  -webkit-appearance: none;
  appearance: none;
}
.t49-brand__search-input::placeholder { color: var(--color-text-placeholder-strong); }
.t49-brand__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.t49-brand__search-btn { background: transparent; border: 0; }
.t49-brand__search-btn {
  flex: none;
  color: var(--color-primary);
  font-weight: 500;
}

/* ---------- 公告跑马灯（沿用 .t49-marquee 外壳） ---------- */
.t49-marquee__tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--font-size-12);
}
.t49-marquee__track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
/* 双副本 + -50% 位移，首屏即可见并无缝循环 */
.t49-marquee__inner {
  display: inline-flex;
  white-space: nowrap;
  animation: t49-marquee-roll 26s linear infinite;
}
.t49-marquee__text {
  display: inline-block;
  flex: none;
  overflow: visible;
  padding-right: var(--space-30);
  white-space: nowrap;
  text-overflow: clip;
}
.t49-marquee__inner:hover {
  animation-play-state: paused;
}
@keyframes t49-marquee-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .t49-marquee__inner { animation: none; }
}

/* ---------- Banner ---------- */
.t49-banner--ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
}
.t49-banner__ph-txt {
  font-size: var(--font-size-20);
  font-weight: 600;
}
.t49-banner__ph-sub {
  font-size: var(--font-size-12);
  opacity: 0.75;
}

/* ---------- 开奖快讯 ---------- */
.t49-live__hd-left {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
.t49-live__dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: t49-live-pulse 1.6s var(--ease-standard) infinite;
}
@keyframes t49-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.t49-live__sub {
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t49-live__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}
.t49-live__period {
  font-size: var(--font-size-13);
  color: var(--color-text-secondary);
}
.t49-live__period b {
  font-size: var(--font-size-17);
  color: var(--color-text-primary);
}
.t49-live__cd {
  margin-left: auto;
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
}
.t49-live__cd b {
  font-size: var(--font-size-13);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
}
.t49-live__balls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-10) 0;
}
.t49-live__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
.t49-live__label {
  font-size: var(--font-size-12);
  line-height: 1;
  color: var(--color-text-tertiary);
}
.t49-live__label--star {
  color: var(--color-primary);
  font-weight: 600;
}
.t49-live__plus {
  flex: none;
  padding-top: var(--space-10);
  font-size: var(--font-size-13);
  color: var(--color-text-placeholder);
}
.t49-live__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-10);
  padding-top: var(--space-10);
  border-top: 0.5px solid var(--color-divider);
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
}
.t49-live__next {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t49-live__next b {
  color: var(--color-text-secondary);
}
.t49-live__more {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-primary);
  font-size: var(--font-size-12);
}

/* ---------- 开奖快讯 · 彩种切换（tab 均分一行，不换行不横滑） ---------- */
.t49-live__tabs {
  display: flex;
  align-items: stretch;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}
.t49-live__tab {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 44px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-8);
  background: var(--color-bg-card);
  box-shadow: inset 0 0 0 1px var(--color-divider);
  color: var(--color-text-secondary);
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}
.t49-live__tab-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-13);
  font-weight: 500;
  color: var(--color-text-secondary);
}
.t49-live__tab-time {
  font-size: var(--font-size-12);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-tertiary);
}
.t49-live__tab.is-active {
  background: var(--color-primary);
  box-shadow: none;
}
.t49-live__tab.is-active .t49-live__tab-name {
  color: var(--color-text-inverse);
  font-weight: 600;
}
.t49-live__tab.is-active .t49-live__tab-time {
  color: var(--color-text-inverse);
  opacity: 0.8;
}
.t49-live__tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.t49-live__panels {
  position: relative;
}
.t49-live__panel[hidden] {
  display: none;
}
.t49-live__panel.is-active {
  animation: t49-live-fade var(--dur-base) var(--ease-standard);
}
@keyframes t49-live-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 快捷宫格（沿用 .t49-grid 5 列） ---------- */
.t49-grid__ico {
  background: var(--color-ball-green-soft);
  color: var(--color-primary);
  font-weight: 600;
}
.t49-grid__txt {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-12);
  color: var(--color-text-secondary);
}

/* ---------- 区块标题右侧「更多」 ---------- */
.t49-section__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
}
.t49-section__more svg {
  width: 12px;
  height: 12px;
}

/* ---------- 资料精选 ---------- */
.t49-picks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-10);
  padding: var(--space-10);
}
.t49-section__issue {
  margin-left: 8px;
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.t49-pick {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-10);
  border-radius: var(--radius-8);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-card);
}
.t49-pick__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-width: 0;
}
.t49-pick__title {
  min-width: 0;
  font-size: var(--font-size-14);
  font-weight: 600;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t49-pick__line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  min-height: calc(2 * 1.4em);   /* 内容一行/两行都占同样高度，六张卡不再参差 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-12);
  line-height: 1.4;
  color: var(--color-text-secondary);
  word-break: break-all;
}

/* ---------- 高手帖 ---------- */
.t49-posts {
  margin: var(--space-10);
  border-radius: var(--radius-8);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.t49-post {
  display: flex;
  align-items: flex-start;
  gap: var(--space-10);
  padding: var(--space-10) var(--space-15);
  border-bottom: 0.5px solid var(--color-divider);
}
.t49-post:last-child {
  border-bottom: 0;
}
.t49-post__avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-ball-green-soft);
  color: var(--color-primary);
  font-size: var(--font-size-13);
  font-weight: 600;
}
.t49-post__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.t49-post__top {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
.t49-post__author {
  flex: none;
  max-width: 60%;
  font-size: var(--font-size-14);
  font-weight: 600;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t49-post__sub {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
}
.t49-post__rate {
  flex: none;
  font-size: var(--font-size-12);
  color: var(--color-rank-1);
  letter-spacing: 0;
}
.t49-post__body {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
/* 分类标签保持右对齐成一列；预测内容过长时先省略，避免把标签挤出卡片 */
.t49-post__pred { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t49-post__body .t49-tag { flex: none; }
.t49-post__issue {
  flex: none;
  font-size: var(--font-size-12);
  color: var(--color-text-tertiary);
}
.t49-post__pred {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-14);
  font-weight: 600;
  color: var(--color-danger);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t49-post__arrow {
  flex: none;
  align-self: center;
  display: inline-flex;
  color: var(--color-text-placeholder);
}

/* ---------- 底部声明 ---------- */
.t49-footnote {
  margin: 0;
  padding: var(--space-10) var(--space-15) var(--space-20);
  text-align: center;
  font-size: var(--font-size-12);
  line-height: 1.6;
  color: var(--color-text-tertiary);
}

/* ---------- 首页 8 宫格（4 列 × 2 行，图标对齐发现页） ---------- */
.t49-home__entry .t49-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-15) 0;
  padding: var(--space-15) var(--space-10);
}
.t49-home__entry .t49-grid__item {
  gap: 6px;
  font-size: var(--font-size-12);
  color: var(--color-text-secondary);
}
.t49-home__entry .t49-grid__ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: none;
  padding: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.t49-home__entry .t49-grid__ico img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
/* 没有位图的模块沿用同款圆形渐变底 + 白色线性图标 */
.t49-home__entry .t49-grid__ico--green {
  background: linear-gradient(135deg, #07C160 0%, #05A050 100%);
  color: var(--color-text-inverse);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .28), inset 0 -2px 6px rgba(0, 0, 0, .14);
}
.t49-home__entry .t49-grid__ico--orange {
  background: linear-gradient(135deg, #FF8A3D 0%, #E8590C 100%);
  color: var(--color-text-inverse);
}
.t49-home__entry .t49-grid__ico--green svg,
.t49-home__entry .t49-grid__ico--orange svg,
.t49-home__entry .t49-grid__ico--blue svg { width: 22px; height: 22px; }
/* 走势图：蓝色渐变底（选择器层级需与 green/orange 一致，否则被 background:none 覆盖） */
.t49-home__entry .t49-grid__ico--blue {
  background: linear-gradient(135deg, #4FACFE 0%, #2B7BF3 100%);
  color: var(--color-text-inverse);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .28), inset 0 -2px 6px rgba(0, 0, 0, .14);
}

/* ---------- 首页图库精选（3 列竖版缩略） ---------- */
.t49-hg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-10) 8px;
  padding: var(--space-10) var(--space-10) 0;
}
.t49-hg__card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.t49-hg__pic {
  display: block;
  border-radius: var(--radius-8);
  overflow: hidden;
  background: var(--color-bg-subtle);
  aspect-ratio: 3 / 4;
}
.t49-hg__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.t49-hg__name { font-size: var(--font-size-12); color: var(--color-text-secondary); }

/* ---------- 彩种切换动效 ---------- */
.t49-live__tab {
  position: relative;
  overflow: hidden;
  transition:
    background-color var(--dur-base) var(--ease-standard),
    color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}
.t49-live__tab:active { transform: scale(0.97); }
.t49-live__ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  opacity: 0.85;
  pointer-events: none;
  animation: t49-live-ripple 0.55s var(--ease-decelerate) forwards;
}
@keyframes t49-live-ripple {
  to { transform: scale(1); opacity: 0; }
}
/* 面板切换：淡入 + 轻微上移 */
.t49-live__panel:not([hidden]) {
  animation: t49-live-panel-in 0.26s var(--ease-standard);
}
@keyframes t49-live-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .t49-live__ripple { display: none; }
  .t49-live__panel:not([hidden]) { animation: none; }
  .t49-live__tab { transition: none; }
}
