* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-primary: #00b050;
    --green-dark: #009040;
    --red-accent: #e74c3c;
    --red-dark: #c0392b;
    --gray-page: #f0f0f0;
    --gray-bg: #f5f5f5;
    --gray-tab: #f5f5f5;
    --gray-border: #e0e0e0;
    --gray-text: #666;
    --blue-tag: #3498db;
    --green-light: #e8f7ef;
    --green-border: #b8dfc8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--gray-page);
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.page-wrap {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

/* 顶栏：白底 + 居中标题，绿色仅用于公告按钮 */
.site-header {
    display: grid;
    grid-template-columns: 72px 1fr 72px;
    align-items: center;
    padding: 11px 10px;
    background: #fff;
    border-bottom: 1px solid var(--gray-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    justify-self: start;
    min-width: 0;
}

.site-logo {
    height: 34px;
    width: auto;
    display: block;
}

.site-title {
    grid-column: 2;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.btn-announce {
    justify-self: end;
    padding: 6px 12px;
    background: var(--green-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.btn-announce:active {
    background: var(--green-dark);
}

/* 轮播 */
.carousel-wrap {
    position: relative;
    background: #ddd;
}

.carousel-viewport {
    overflow: hidden;
    width: 100%;
    aspect-ratio: 750 / 280;
    touch-action: pan-y;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.carousel-slide a {
    display: block;
    height: 100%;
}

.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

.carousel-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.carousel-dots .dot.active {
    background: #fff;
}

/* 彩种 Tab：经典灰底 inactive + 绿色 active */
.lottery-tabs {
    display: flex;
    padding: 8px 10px;
    gap: 6px;
    background: #fff;
}

.tab-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 4px;
    background: var(--gray-tab);
    color: #333;
    font-size: 13px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--green-primary);
    color: #fff;
}

.tab-panel {
    display: none;
    padding: 0 10px 10px;
}

.tab-panel.active {
    display: block;
}

/* 开奖卡片：白底，外框绿色 */
.draw-card {
    border: 1px solid var(--green-primary);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.draw-card-head {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    background: #fff;
}

.draw-title {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.countdown {
    color: var(--green-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.history-link {
    color: var(--red-accent);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.draw-card-body {
    padding: 12px 8px;
    background: #fff;
}

.draw-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: var(--gray-text);
    background: #fff;
}

.next-draw-info {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.next-draw-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.countdown-label {
    font-size: 11px;
    color: #999;
    font-weight: normal;
}

.empty-tip {
    padding: 30px;
    text-align: center;
    color: #999;
}

/* 六合彩球体：足球纹样式 */
.balls-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 4px 0;
}

.ball-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 46px;
    flex-shrink: 0;
}

.lottery-ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: center / contain no-repeat;
    flex-shrink: 0;
}

.ball-red.lottery-ball {
    background-image: url('../images/balls/ball-red.svg');
}

.ball-blue.lottery-ball {
    background-image: url('../images/balls/ball-blue.svg');
}

.ball-green.lottery-ball {
    background-image: url('../images/balls/ball-green.svg');
}

.lottery-ball-num {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    line-height: 1;
    position: relative;
    z-index: 1;
    user-select: none;
}

/* 球号下方标签：生肖黑色，五行按配色 */
.ball-tag {
    margin-top: 4px;
    font-size: 11px;
    background: transparent;
    color: #333;
    padding: 0;
    border: none;
    border-radius: 0;
    white-space: nowrap;
    text-align: center;
    line-height: 1.3;
    box-shadow: none;
}

.ball-tag .el-water { color: #2980b9; }
.ball-tag .el-fire { color: #e74c3c; }
.ball-tag .el-earth { color: #b8860b; }
.ball-tag .el-metal { color: #d4a017; }
.ball-tag .el-wood { color: #27ae60; }

.ball-plus {
    align-self: center;
    font-size: 20px;
    font-weight: 700;
    color: #999;
    margin: 0 1px;
    padding-top: 6px;
    flex-shrink: 0;
}

.el-water { color: #3498db; }
.el-fire { color: #e74c3c; }
.el-earth { color: #d4a017; }
.el-metal { color: #f1c40f; }
.el-wood { color: #27ae60; }

/* 第三方链接 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 10px;
    background: #fff;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: var(--gray-tab);
    border: none;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    text-align: center;
    min-height: 40px;
    line-height: 1.3;
}

.link-btn:active {
    background: #ebebeb;
    color: #222;
}

/* 图库：瀑布流两列，避免等高网格产生空白 */
.gallery-section {
    background: #fff;
}

.gallery-grid {
    column-count: 2;
    column-gap: 5px;
    padding: 0 10px 8px;
}

.gallery-load-wrap {
    padding: 4px 10px 16px;
    text-align: center;
    background: #fff;
}

.btn-gallery-load {
    display: inline-block;
    min-width: 140px;
    padding: 10px 24px;
    background: #fff;
    color: var(--green-primary);
    border: 1px solid var(--green-primary);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-gallery-load:active:not(:disabled) {
    background: var(--green-light, #e8f7ef);
}

.btn-gallery-load:disabled {
    opacity: 0.65;
    cursor: wait;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 5px;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
}

.gallery-thumb {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
    vertical-align: top;
}

.gallery-thumb:active {
    opacity: 0.85;
}

/* 图库大图预览 */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 48px 12px 12px;
}

.lightbox.show {
    display: flex;
}

.lightbox-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:active {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-inner {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-inner img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    border-radius: 4px;
}

/* 公告弹窗：仅标题栏保留绿色 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--green-primary);
    font-weight: 600;
}

.modal-head-title {
    color: #fff;
    font-size: 16px;
    text-align: center;
    width: 100%;
}

.modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
    background: #fff;
}

.announce-modal-body {
    display: flex;
    flex-direction: column;
}

.announce-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.announce-track {
    display: flex;
    transition: transform 0.35s ease;
    will-change: transform;
}

.announce-slide {
    flex: 0 0 100%;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    max-height: 50vh;
    overflow-y: auto;
}

.announce-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px 12px;
    border-top: 1px solid #eee;
}

.announce-counter {
    font-size: 12px;
    color: #999;
    padding-top: 10px;
}

.announce-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.announce-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.announce-dot.active {
    background: var(--green-primary);
}

.modal-foot {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid #eee;
    background: #fff;
}

.btn-modal {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-modal-ok {
    background: var(--green-primary);
    color: #fff;
}

.btn-modal-ok:active {
    background: var(--green-dark);
}

.btn-modal-dismiss {
    background: var(--gray-tab);
    color: #666;
}

.btn-modal-dismiss:active {
    background: #ddd;
}

.announce-item {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.announce-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.announce-text {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
}

.announce-img {
    max-width: 100%;
    border-radius: 4px;
    display: block;
}

.text-muted {
    color: #999;
}
