/* 天天乐 — 公共样式（PC + H5 自适应） */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: rgb(0, 132, 255);
  --primary-red: rgb(255, 6, 6);
  --primary-green: rgb(0, 186, 0);
  --bg-page: #f3f3f3;
  --bg-card: #fff;
  --accent-orange: #ff440b;
  --max-width: 750px;
  --ball-size: 40px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; vertical-align: middle; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* 页面容器：H5 全宽，PC 居中限宽 */
.app-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  padding-bottom: 70px;
}

.app-wrap--no-tabbar { padding-bottom: 0; }

/* 顶部标签栏 */
.top-tags {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0;
  background: #03a9f4;
}
.top-tags__item {
  padding: 2px 12px;
  font-size: 12px;
  color: #fff;
  background: #d57b3b;
  border-radius: 12px;
  white-space: nowrap;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  margin: 10px;
  border: 2px solid var(--primary);
  border-radius: 2px;
}
.card--plain { border: none; }

.card__title {
  margin: 5px;
  padding: 5px 10px;
  text-align: center;
  font-size: 14px;
  color: #fff;
  background: var(--primary);
}

.card__body { padding: 10px; word-wrap: break-word; }
.card__body img { max-width: 100%; height: auto; }

/* 公告 */
.notice-bar {
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 12px;
  background: #fff;
  color: #333;
  font-size: 13px;
}
.notice-bar__inner {
  display: inline-block;
  animation: notice-scroll 20s linear infinite;
}
@keyframes notice-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* 快捷导航 */
.nav-grid {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  background: #fff;
  margin: 10px;
  border-radius: 2px;
}
.nav-grid__item {
  width: 70px;
  text-align: center;
  cursor: pointer;
}
.nav-grid__icon {
  width: 50px;
  height: 50px;
  display: block;
  margin: 0 auto 5px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-grid__label { font-size: 12px; color: #333; }

/* Tab 切换 */
.card-tabs {
  border-bottom: 2px solid var(--primary);
}
.tab-list {
  display: flex;
  list-style: none;
}
.tab-list__item {
  flex: 1;
  text-align: center;
  line-height: 28px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab-list__item.is-active {
  color: #fff;
}

/* 开奖区头部 */
.lottery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 4px;
}
.lottery-header__title { font-weight: bold; margin-right: 4px; }
.lottery-header__num { color: red; font-weight: bold; margin: 0 4px; }
.lottery-header__link { color: red; font-weight: bold; cursor: pointer; font-size: 14px; }
.lottery-header__countdown { font-size: 14px; font-weight: bold; color: #333; font-variant-numeric: tabular-nums; }

.lottery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-top: 8px;
}
.lottery-footer__num { color: red; font-weight: bold; margin: 0 4px; }
.lottery-footer__refresh {
  background: linear-gradient(to top, #c10000, red);
  font-size: 12px;
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
}

/* 球号行 */
.ball-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
}
.ball-row__item { display: flex; align-items: center; }
.ball-row__plus { color: red; font-weight: bold; font-size: 16px; }

/* 圆形球 */
.ball-circle { text-align: center; width: var(--ball-size); }
.ball-circle__top {
  width: var(--ball-size);
  height: var(--ball-size);
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ball-circle__shine {
  position: absolute;
  width: 75%;
  height: 75%;
  left: 10%;
  top: 5%;
  background: #fff;
  border-radius: 50%;
  opacity: 0.85;
  pointer-events: none;
}
.ball-circle__num { position: relative; z-index: 1; }
.ball-circle__bottom {
  font-weight: bold;
  font-size: 10px;
  margin-top: 2px;
  white-space: nowrap;
}
.ball-circle--empty .ball-circle__top { background: #ddd !important; }

/* 直播开奖中状态 */
.ball-circle--drawing .ball-circle__top {
  background: linear-gradient(135deg, #ffb74d, #ff9800) !important;
  animation: ball-drawing-pulse 1.2s ease-in-out infinite;
}
.ball-circle--drawing .ball-circle__num {
  font-size: 11px;
  letter-spacing: 1px;
  color: #fff;
  z-index: 1;
  position: relative;
}
.ball-circle--drawing .ball-circle__bottom {
  color: #ff5722;
  font-size: 10px;
}
@keyframes ball-drawing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.96); }
}

/* 方块球（历史） */
.ball-block {
  text-align: center;
  width: 44px;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
}
.ball-block__top {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  line-height: 28px;
  min-height: 28px;
}
.ball-block__bottom {
  font-weight: bold;
  font-size: 10px;
  line-height: 1.4;
  padding: 2px 0;
}

/* 底部 Tab 栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: 56px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  padding: 4px 0;
}
.tabbar__item:hover { color: var(--primary); }
.tabbar__icon { width: 22px; height: 22px; margin-bottom: 2px; }
.tabbar__item--center { flex: 0 0 72px; }
.tabbar__center-icon {
  min-width: 56px;
  height: 40px;
  padding: 0 10px;
  margin-top: -20px;
  border-radius: 20px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,132,255,0.4);
}

/* 导航栏（子页面） */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  background: #ddd;
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar__left, .navbar__right { cursor: pointer; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.navbar__title { font-size: 16px; font-weight: bold; flex: 1; text-align: center; }
.navbar__year-btn {
  font-size: 12px;
  font-weight: bold;
  background: #fff;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
}

/* 历史列表 */
.history-list { margin: 0 6px; background: #fff; padding: 6px; }
.history-row { margin-bottom: 12px; }
.history-row__title { font-size: 14px; color: #777; margin: 4px 0; }

/* 号码属性 */
.attr-layout {
  display: flex;
  min-height: calc(100vh - 44px);
  background: #fff;
}
.attr-sidebar {
  width: 25%;
  min-width: 80px;
  max-width: 120px;
  border-right: 1px solid #f3f3f3;
  overflow-y: auto;
}
.attr-sidebar__item {
  line-height: 44px;
  text-align: center;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f9f9f9;
}
.attr-sidebar__item.is-active { background: #d96b34; color: #fff; }
.attr-content {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  line-height: 36px;
  font-size: 14px;
}
.attr-content__label { color: #f1592a; margin-right: 10px; }

/* 挑码助手 */
.tmzs-result {
  min-height: 200px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.tmzs-result .ball-circle { --ball-size: 36px; }

.tmzs-toolbar {
  display: flex;
  background: var(--accent-orange);
  color: #fff;
  height: 44px;
  font-size: 16px;
}
.tmzs-toolbar__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tmzs-toolbar__btn:hover { background: rgba(0,0,0,0.1); }

.filter-grid { padding: 5px; }
.filter-row {
  display: flex;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
}
.filter-row:last-child { border-bottom: none; }
.filter-col {
  flex: 1;
  min-width: 0;
  border-right: 1px solid #ccc;
  padding: 5px;
}
.filter-col:last-child { border-right: none; }
.filter-col--full { flex: 1 1 100%; border-right: none; }
.filter-col--bo { flex: 0 0 60px; display: block; }
.filter-col--bo .filter-btn { display: block; width: 100%; margin: 5px 0; }

.filter-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-btn {
  min-width: 48px;
  text-align: center;
  line-height: 28px;
  background: #f3f3f3;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  padding: 0 6px;
  cursor: pointer;
}
.filter-btn.is-active { background: var(--accent-orange); color: #fff; border-color: var(--accent-orange); }

/* 右侧漂浮资料导航 */
.art-float-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: 52px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.art-float-nav__title {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  padding: 8px 4px;
  line-height: 1.3;
  writing-mode: horizontal-tb;
}
.art-float-nav__list {
  display: flex;
  flex-direction: column;
}
.art-float-nav__item {
  display: block;
  width: 100%;
  padding: 10px 4px;
  font-size: 12px;
  color: #333;
  text-align: center;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #eee;
  background: #fff;
  transition: background 0.2s, color 0.2s;
}
.art-float-nav__item:last-child { border-bottom: none; }
.art-float-nav__item:hover { background: #f0f7ff; color: var(--primary); }
.art-float-nav__item.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: bold;
}

/* 宽屏：导航贴在内容区右侧外沿 */
@media (min-width: 820px) {
  .art-float-nav {
    right: calc(50% - var(--max-width) / 2 - 64px);
  }
}

/* 中等屏幕：贴右边缘 */
@media (min-width: 768px) and (max-width: 819px) {
  .art-float-nav {
    right: 8px;
  }
}

/* 手机：右下角、底部 Tab 上方 */
@media (max-width: 767px) {
  .art-float-nav {
    top: auto;
    bottom: 72px;
    transform: none;
    right: 6px;
    width: 48px;
  }
  .art-float-nav__title { font-size: 10px; padding: 6px 2px; }
  .art-float-nav__item { font-size: 11px; padding: 8px 2px; }
}

/* PC 适配 */
@media (min-width: 768px) {
  :root { --ball-size: 48px; }
  html { font-size: 18px; }
  .app-wrap { box-shadow: 0 0 20px rgba(0,0,0,0.08); }
  .nav-grid__item { width: 90px; }
  .nav-grid__icon { width: 56px; height: 56px; }
  .ball-block { width: 52px; }
  .ball-block__top { line-height: 34px; min-height: 34px; font-size: 16px; }
  .filter-btn { min-width: 56px; font-size: 13px; }
}

@media (max-width: 360px) {
  :root { --ball-size: 34px; }
  .tab-list__item { font-size: 12px; }
  .ball-block { width: 38px; }
}
