/* ============================================================
   page.css — 三个子页（码牌 / 开奖结果 / 挑码）的样式
   来源：109014 旧站 z-mp.php / z-zh.php / z-tm.php 的内联样式，
   原样搬出来合并，按页面分了区块，互不干扰。
   ============================================================ */

/* ================= 公共骨架 =================
   ⚠ reset 必须用 * （特异度 0）。写成 body.pg * 会压过下面所有 .class 规则，
     把 td 的 padding、容器的 12px 边距全部清掉——旧站就是普通 * 重置。 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pg {
    font-family: 'Microsoft YaHei', 'Segoe UI', 'PingFang SC', Arial, sans-serif;
    background: #f0f0f0;
    min-height: 100vh;
}

.page-shell {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
    background: #f0f0f0;
    min-height: 100vh;
    padding: 12px;
    padding-bottom: 80px;
}

/* 返回主页按钮（三页共用） */
.back-home-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2e8b57, #1a5a3a);
    color: #ffd700;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.back-home-btn:active {
    transform: translateX(-50%) scale(0.96);
}

/* ================= 码牌页 ================= */
.mapai-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mapai-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.mapai-img {
    width: 100%;
    height: auto;
    display: block;
}

.page-header {
    background: linear-gradient(135deg, #2e8b57, #1a5a3a);
    padding: 15px 20px;
    border-radius: 20px 20px 0 0;
    margin-bottom: 10px;
}

.page-header h1 {
    font-size: 20px;
    color: #ffd700;
    text-align: center;
}

/* ================= 开奖结果页 ================= */
.lottery-card {
    background: #fff;
    border-radius: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.lottery-header {
    background: linear-gradient(135deg, #2e8b57, #1a5a3a);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lottery-name  { font-size: 16px; font-weight: bold; color: #ffd700; }
.lottery-issue { font-size: 15px; font-weight: bold; color: #ffd700; }
.lottery-time  { font-size: 14px; font-weight: bold; color: rgba(255, 215, 0, 0.8); }

.lottery-numbers {
    padding: 15px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lottery-numbers .ball { text-align: center; width: 13%; }

.lottery-numbers .ball-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.lottery-numbers .ball-circle .number-bg {
    position: absolute;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    z-index: 1;
    top: 4px;
    left: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.3);
}

.lottery-numbers .ball-circle .number-text {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: -1px;
}

.lottery-numbers .ball-circle::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 4px;
    width: 11px;
    height: 4px;
    background: white;
    border-radius: 60%;
    transform: rotate(-50deg);
    z-index: 3;
}

.ball-circle.red   { background: radial-gradient(circle at 35% 30%, #ff6666, #cc0000); }
.ball-circle.blue  { background: radial-gradient(circle at 35% 30%, #6688ff, #0044cc); }
.ball-circle.green { background: radial-gradient(circle at 35% 30%, #66ff88, #00aa44); }

.ball-info {
    font-size: 13px;
    font-weight: bold;
    margin-top: 5px;
    white-space: nowrap;
}

.ball-info.red   { color: #cc0000; }
.ball-info.blue  { color: #0044cc; }
.ball-info.green { color: #00aa44; }

.plus-separator {
    font-size: 22px;
    font-weight: bold;
    color: #999;
    margin-bottom: 20px;
}

.no-data-msg {
    width: 100%;
    text-align: center;
    color: #999;
    padding: 10px 0;
}

/* ================= 挑码页 ================= */
.tiaoma-header {
    background: linear-gradient(135deg, #2e8b57, #1a5a3a);
    padding: 12px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tiaoma-header h1 {
    font-size: 18px;
    color: #ffd700;
    margin: 0;
}

.header-actions { display: flex; gap: 15px; }

.header-actions span {
    cursor: pointer;
    font-size: 13px;
    color: #ffd700;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s;
}

.header-actions span:hover { background: rgba(255, 255, 255, 0.15); }

.tiaoma-page {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin: 0;
}

.tiaoma-page .content-wrapper { padding: 15px; }

.result-area {
    margin-bottom: 15px;
    background: #fafafa;
    border-radius: 14px;
    min-height: 100px;
}

.result-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 15px;
}

.tiaoma-page .ball { text-align: center; transition: all 0.3s ease; }

.tiaoma-page .ball.animating {
    animation: drawNumber 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes drawNumber {
    0%   { opacity: 0; transform: scale(0.2) rotate(-180deg); }
    40%  { opacity: 1; transform: scale(1.1) rotate(0deg); }
    70%  { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.tiaoma-page .ball.highlight { animation: glowPulse 0.5s ease-in-out 2; }

@keyframes glowPulse {
    0%   { filter: drop-shadow(0 0 0 rgba(46, 204, 113, 0.7)); }
    50%  { filter: drop-shadow(0 0 15px rgba(46, 204, 113, 0.9)); }
    100% { filter: drop-shadow(0 0 0 rgba(46, 204, 113, 0)); }
}

.tiaoma-page .ball-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: visible;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tiaoma-page .ball-circle:active { transform: scale(0.96); }

.tiaoma-page .ball-circle .number-bg {
    position: absolute;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    z-index: 1;
    top: 4px;
    left: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.3);
}

.tiaoma-page .ball-circle .number-text {
    position: relative;
    z-index: 2;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-top: -2px;
    margin-left: -2px;
}

.tiaoma-page .ball-circle.red {
    background: radial-gradient(circle at 35% 30%, #ff6666, #cc0000);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.tiaoma-page .ball-circle.blue {
    background: radial-gradient(circle at 35% 30%, #6688ff, #0044cc);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.tiaoma-page .ball-circle.green {
    background: radial-gradient(circle at 35% 30%, #66ff88, #00aa44);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.tiaoma-page .ball-circle::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 2px;
    width: 12px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: rotate(-50deg);
    z-index: 3;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

.tiaoma-page .no-data {
    text-align: center;
    color: #999;
    padding: 20px;
    width: 100%;
}

.sel-content { overflow-x: auto; }

.sel-table {
    width: 100%;
    border-collapse: collapse;
}

.sel-table td {
    padding: 6px;
    text-align: center;
    border: 1px solid #e8e8e8;
}

.sel-cell {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    background: #f5f5f5;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.sel-cell.active {
    background: #2e8b57;
    color: #fff;
    box-shadow: 0 2px 6px rgba(46, 139, 86, 0.3);
}

.sel-cell:hover { background: #e0e0e0; }
.sel-cell.active:hover { background: #2e8b57; }

.tr-wei-first td, .tr-wei td {
    border: 1px solid #e8e8e8;
    width: 18%;
}

.tr-wei-first td:last-child, .tr-wei td:last-child { width: 10%; }

.tiaoma-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.tiaoma-toast.show { transform: translateX(-50%) translateY(0); }

/* ================= 小屏适配 ================= */
@media (max-width: 600px) {
    .page-shell { padding: 10px; padding-bottom: 80px; }
    .page-header h1 { font-size: 18px; }
    .lottery-header { padding: 8px 10px; }
    .lottery-name  { font-size: 15px; }
    .lottery-issue { font-size: 14px; }
    .lottery-time  { font-size: 12px; }
    .lottery-numbers .ball-circle { width: 38px; height: 38px; }
    .lottery-numbers .ball-circle .number-bg { width: 26px; height: 26px; top: 3px; left: 3px; }
    .lottery-numbers .ball-circle .number-text { font-size: 16px; }
    .ball-info { font-size: 12px; }
    .plus-separator { font-size: 18px; margin-bottom: 16px; }

    .tiaoma-header h1 { font-size: 16px; }
    .header-actions span { font-size: 12px; }
    .back-home-btn { padding: 8px 20px; font-size: 12px; }
    .sel-cell { padding: 6px 8px; font-size: 11px; }
    .tiaoma-page .ball-circle { width: 36px; height: 36px; }
    .tiaoma-page .ball-circle .number-bg { width: 26px; height: 26px; top: 3px; left: 2px; }
    .tiaoma-page .ball-circle .number-text { font-size: 14px; margin-top: -1px; margin-left: -1px; }
    .result-content { gap: 8px; }
    .tr-wei-first td, .tr-wei td { padding: 4px; }
}
