/* --- 基本重置和全局样式 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f4f4f4; /* 页面外的背景色 */
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 页面整体布局 (粘性页脚) --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    max-width: 438px;
    margin: 0 auto;
    background-color: #fff; /* 详情页的主背景设为白色 */
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
}

.main-content {
    flex: 1 0 auto;
}

/* --- 头部 --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e53935;
    color: white;
    padding: 0 15px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-back-btn {
    display: flex;
    align-items: center;
    padding: 5px; /* 增大点击区域 */
    margin-left: -5px; /* 抵消padding */
}

.header-back-btn svg {
    width: 24px;
    height: 24px;
}

.header-title {
    font-size: 18px;
    font-weight: 500;
}

.header-dropdown select {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 20px; /* 为箭头留出空间 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5H7z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 20px;
    cursor: pointer;
}

.header-dropdown select option {
    color: black;
    background-color: white;
}

/* --- 开奖信息 --- */
.draw-info-section {
    padding: 20px 15px;
}

.draw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.draw-issue {
    font-size: 16px;
    font-weight: 500;
}

.draw-schedule {
    font-size: 12px;
    color: #999;
}

.draw-numbers {
    display: flex;
    gap: 10px;
}

.ball {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.ball.red {
    background-color: #e53935;
}

/* --- 倒计时 --- */
.countdown-section {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
}

.countdown-label {
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}

.countdown-line {
    flex-grow: 1;
    height: 4px;
    background-color: #e53935;
    border-radius: 2px;
}

.countdown-timer {
    font-size: 18px;
    font-weight: bold;
    color: #e53935;
    flex-shrink: 0;
    min-width: 80px; /* 给一个最小宽度防止跳动 */
    text-align: right;
}

/* --- 内容分割线 --- */
.content-separator {
    height: 10px;
    background-color: #f4f4f4;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* --- 历史开奖 --- */
.history-section {
    padding: 20px 15px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-title {
    position: relative;
    padding-left: 10px;
}

.history-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background-color: #e53935;
    border-radius: 2px;
}

.history-title h2 {
    font-size: 16px;
}

.history-toggle {
    display: flex;
    border: 1px solid #e53935;
    border-radius: 5px;
    overflow: hidden;
}

.toggle-btn {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #fff;
    color: #e53935;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background-color: #e53935;
    color: #fff;
}

/* --- 历史表格 --- */
.history-table {
    font-size: 14px;
    line-height: 1.5; /* 统一行高 */
}

.table-header,
.table-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.table-header {
    color: #999;
    font-size: 12px;
}

.col-time {
    width: 20%;
    text-align: center;
}

.col-issue {
    width: 30%;
    text-align: center;
}

.col-result {
    width: 50%;
    text-align: center;
    display: flex;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s; /* 平滑过渡效果 */
}

/* 统一两种视图的容器样式 */
.result-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; /* 统一使用 gap */
    font-size: 15px; /* 统一字体大小 */
    font-weight: 500; /* 统一字重 */
    letter-spacing: 1px; /* 统一字间距 */
}

/* 单独微调 “大小” 和 “单双” 的样式 */
.stats-form {
    margin-left: 4px;
}

.stats-form span {
    font-weight: 400; /* 让形态文字比总和数字细一点 */
}

.stats-form span.size {
    color: #e53935;
}

.stats-form span.parity {
    color: #333;
}

/* 切换选中效果 */
.table-header .col-result.active,
.table-row .col-result.active {
  
    color: #000 !important; /* 白色字体，!important提高优先级 */
    border-radius: 15px;
   
}

/* 当被选中时，形态文字也变成白色 */
.table-row .col-result.active .stats-form span {
    color: #000 !important;
}