/* 全站统一质感增强：深蓝鎏金主题 */
body { background: #15213d !important; }
#layout { background: #15213d; }

/* 顶部与主导航更精致 */
#nav {
  background: linear-gradient(180deg, #d0341f 0%, #a82410 100%) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.35);
}
#menu_nav ul li a {
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  transition: background .18s ease, color .18s ease;
}
#menu_nav ul li.active a, #menu_nav ul li a:hover {
  background: linear-gradient(180deg, #f26a2c 0%, #c8411c 100%) !important;
}

/* 内容盒子质感 */
.mybox {
  border: 1px solid #34497a !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  border-radius: 4px;
  overflow: hidden;
}
.mybox .mybox_title {
  background: linear-gradient(180deg, #2b4070 0%, #1c2c52 100%) !important;
  height: 38px !important;
  border-bottom: 1px solid #3d5590 !important;
}
.mybox .mybox_title div .title {
  color: #ffd54a !important;
  line-height: 22px;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.mybox .mybox_title div .title a { color: #ffd54a !important; }
.mybox .mybox_title div .subtitle,
.mybox .mybox_title div .subtitle a { color: #cfe0ff !important; line-height: 22px; }

/* 通用内容正文区 */
.pm-content {
  color: #dce8ff;
  font-size: 14px;
  line-height: 1.9;
  padding: 26px 30px 34px;
  background: #1e2c51;
}
.pm-content p { margin: 0 0 14px; }
.pm-content strong { color: #ffd54a; }
.pm-content img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.pm-content a { color: #7fb0ff; }
.pm-content a:hover { color: #ffd54a; }

/* 列表行 */
.pm-list { list-style: none; margin: 0; padding: 0; }
.pm-list li {
  border-bottom: 1px dashed #33477a;
  padding: 13px 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background .18s ease, padding-left .18s ease;
}
.pm-list li:hover { background: rgba(255,255,255,.04); padding-left: 12px; }
.pm-list li:last-child { border-bottom: none; }
.pm-list .pm-thumb { width: 108px; height: 68px; object-fit: cover; border-radius: 3px; border: 1px solid #3d5590; background: #16234a; flex-shrink: 0; }
.pm-list .pm-main { flex: 1; min-width: 0; }
.pm-list .pm-main h3 { font-size: 15px; font-weight: normal; margin: 0 0 5px; color: #eaf2ff; }
.pm-list li:hover .pm-main h3 { color: #ffd54a; }
.pm-list .pm-main p { font-size: 12px; color: #9fb4dc; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-list .pm-meta { text-align: right; white-space: nowrap; font-size: 12px; color: #8fa6d4; }
.pm-list .pm-cat { display: inline-block; background: #2c4280; color: #ffd54a; padding: 2px 9px; border-radius: 10px; margin-right: 8px; font-size: 11px; }

/* 文章页 */
.pm-article-head { padding: 24px 30px 18px; border-bottom: 1px solid #33477a; }
.pm-article-head h1 { font-size: 24px; color: #ffd54a; font-weight: normal; margin: 8px 0 10px; letter-spacing: 1px; }
.pm-article-head .pm-meta { font-size: 12px; color: #9fb4dc; }
.pm-article-head .pm-meta span { margin-right: 18px; }
.pm-article-img { text-align: center; padding: 18px 30px 0; }
.pm-article-img img { max-width: 100%; max-height: 420px; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.4); }
.pm-back { display: inline-block; color: #ffd54a; font-size: 13px; }
.pm-back:hover { text-decoration: underline; }

/* 分页 */
.pagination { text-align: center; padding: 18px 0; }
.pagination .pagination { display: inline-block; }
.pagination a, .pagination span { border-color: #3d5590 !important; background: #1e2c51 !important; color: #cfe0ff !important; }
.pagination .active span { background: #a82410 !important; color: #fff !important; }

/* 新聞列表單行省略，避免長標題換行 */
.news_box3 .mybox_content li { overflow: hidden; white-space: nowrap; }
.news_box3 .mybox_content a { display: block; width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#start_time .stime { color: #fff; font-size: 12px; line-height: 22px; }

/* 下期開獎標題固定兩行格式 */
#box_zqtj .mybox_title { height: 48px !important; }
.mybox .mybox_title div .title.next-open-title { font-size: 14px; line-height: 18px; padding: 5px 8px; letter-spacing: 0; white-space: normal; }
.next-open-title .next-open-qihao { color: #ffd54a; margin-right: 6px; font-size: 14px; }
.next-open-title .next-open-date { display: block; color: #cfe0ff; font-weight: normal; font-size: 12px; white-space: nowrap; line-height: 18px; }

/* 等待开奖时的呼吸动画，避免空白 */
.draw-ball.pending {
    opacity: .28 !important;
    filter: grayscale(1) blur(.4px);
    animation: fyBallPulse 1.2s ease-in-out infinite alternate;
}
.draw-money.pending {
    opacity: .24 !important;
    animation: fyMoneyPulse 1.4s ease-in-out infinite alternate;
}
@keyframes fyBallPulse {
    from { transform: scale(.86); opacity: .16; }
    to   { transform: scale(1); opacity: .44; }
}
@keyframes fyMoneyPulse {
    from { opacity: .14; }
    to   { opacity: .38; }
}

/* 开奖详情页：开奖前 2 分钟进入科技感开奖状态（扫描线 + 脉冲） */
.draw-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: border-color .3s ease, box-shadow .3s ease;
}
/* 扫描线层：从上到下循环扫过 */
.draw-stage::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -60px;
  height: 60px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(180deg,
      rgba(0,229,255,0) 0%,
      rgba(0,229,255,.12) 45%,
      rgba(120,240,255,.45) 50%,
      rgba(0,229,255,.12) 55%,
      rgba(0,229,255,0) 100%);
}
.draw-stage.is-drawing {
  border-color: rgba(0,229,255,.55);
  box-shadow: 0 0 18px rgba(0,229,255,.25), inset 0 0 26px rgba(0,229,255,.08);
  animation: fyStagePulse 1.6s ease-in-out infinite alternate;
}
.draw-stage.is-drawing::before {
  opacity: 1;
  animation: fyStageScan 2.4s linear infinite;
}
/* 开奖中等待球：青色发光脉冲，强化科技感 */
.draw-stage.is-drawing .draw-ball.pending {
  border-color: rgba(0,229,255,.7) !important;
  box-shadow: 0 0 10px rgba(0,229,255,.5), inset 0 0 8px rgba(0,229,255,.25);
  animation: fyStageBall 1s ease-in-out infinite alternate;
}
.draw-stage.is-drawing .draw-money.pending {
  text-shadow: 0 0 10px rgba(0,229,255,.6);
}
/* 完成态：金色高亮闪光，全部显示 */
.draw-stage.is-complete {
  border-color: rgba(255,213,74,.75) !important;
  box-shadow: 0 0 24px rgba(255,213,74,.35), inset 0 0 30px rgba(255,213,74,.1) !important;
}
.draw-stage.is-complete::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle at 50% 50%, rgba(255,213,74,.22), rgba(255,213,74,0) 70%);
  animation: fyStageFlash 1s ease-out 1;
}

@keyframes fyStageScan {
  0%   { top: -60px; }
  100% { top: 100%; }
}
@keyframes fyStagePulse {
  from { box-shadow: 0 0 12px rgba(0,229,255,.18), inset 0 0 20px rgba(0,229,255,.05); }
  to   { box-shadow: 0 0 26px rgba(0,229,255,.42), inset 0 0 32px rgba(0,229,255,.14); }
}
@keyframes fyStageBall {
  from { transform: scale(.84); opacity: .2; box-shadow: 0 0 4px rgba(0,229,255,.25); }
  to   { transform: scale(1); opacity: .55; box-shadow: 0 0 14px rgba(0,229,255,.7); }
}
@keyframes fyStageFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* 逐球揭示瞬間：翻轉彈出 + 金光，強化開獎過程的動感 */
.draw-ball.just-revealed {
  animation: fyBallReveal .75s cubic-bezier(.2,1.4,.4,1) 1 !important;
}
@keyframes fyBallReveal {
  0%   { transform: scale(.2) rotateY(-90deg); opacity: 0; filter: brightness(3) drop-shadow(0 0 14px rgba(0,229,255,.9)); }
  55%  { transform: scale(1.35) rotateY(0deg); opacity: 1; filter: brightness(2) drop-shadow(0 0 16px rgba(255,213,74,.95)); }
  78%  { transform: scale(.92); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); }
}
/* 下一個即將揭曉的球：金色呼吸高亮，製造逐球推進感 */
.draw-ball.is-next {
  animation: fyBallNext .9s ease-in-out infinite alternate !important;
}
@keyframes fyBallNext {
  from { filter: brightness(1) drop-shadow(0 0 3px rgba(255,213,74,.35)); }
  to   { filter: brightness(1.7) drop-shadow(0 0 12px rgba(255,213,74,.95)); }
}
/* 金額一次性全部揭曉時的上浮 + 金光 */
.draw-money.just-revealed {
  animation: fyMoneyReveal .7s ease-out 1 !important;
}
@keyframes fyMoneyReveal {
  0%   { transform: translateY(10px); opacity: 0; filter: brightness(2); }
  100% { transform: translateY(0); opacity: 1; filter: brightness(1); }
}

/* 頁面載入瞬間先隱藏號碼與金額，等 JS 完成遮蓋後再顯示，避免刷新時閃出真實號碼 */
[data-open-time]:not(.draw-ready) .draw-ball,
[data-open-time]:not(.draw-ready) .draw-secret {
  visibility: hidden !important;
}
