* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #4CAF50;
    --dark-green: #388E3C;
    --light-green: #81C784;
    --bg-gray: #F5F5F5;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #FFFFFF;
    --border-gray: #E0E0E0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    padding-bottom: 40px;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 16px;
    background-color: var(--white);
    border-top: 1px solid #E0E0E0;
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    flex: 0 0 auto;
}

.backup-url-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    line-height: 0;
}

.backup-gif {
    height: auto;
    max-height: 28px;
    width: auto;
    display: block;
}

.header-center {
    flex: 1;
    text-align: center;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    line-height: 1;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    min-width: 28px;
}

.action-icon {
    color: #333333;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.action-label {
    font-size: 11px;
    color: #333333;
    line-height: 1;
    white-space: nowrap;
}

/* 轮播横幅 */
.banner-section {
    position: relative;
    margin: 0 auto;
    width: 429px;
    height: 177.7px;
    max-width: 100%;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
}

.banner-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.banner-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.banner-slide a{display:block; width:100%; height:100%;}

.banner-slide.active {
    opacity: 1;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-phone {
    display: flex;
    align-items: center;
    gap: 20px;
}

.phone-screen {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
}

.phone-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
}

.phone-url {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.lottery-balls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 14px;
}

.ball.green {
    background-color: var(--primary-green);
}

.ball.red {
    background-color: #F44336;
}

.ball.blue {
    background-color: #2196F3;
}

.ball.pink {
    background-color: #E91E63;
}

.banner-character {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--white);
}

.character-avatar {
    font-size: 60px;
}

.character-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.big-number {
    font-size: 48px;
    font-weight: bold;
    color: var(--white);
}

.character-text {
    font-size: 14px;
    line-height: 1.6;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: var(--white);
}

/* 公告栏 */
.announcement-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background-color: var(--bg-gray);
    margin: 0 16px 12px;
    border-radius: 6px;
    gap: 8px;
}

.announcement-icon {
    font-size: 18px;
    color: #F44336;
    flex-shrink: 0;
}

.announcement-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.announcement-text span {
    display: inline-block;
    transition: transform 0.1s linear;
}

/* 彩票开奖结果 */
.block-lottery {
    margin: 0 16px 16px;
}

.platform-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
    height: 49px;
}

.platform-list li {
    flex: 1;
}

.item-body {
    padding: 6px 0;
    background-color: #F3F5F7;
    border-radius: 6px 6px 0 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    height: 49px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.item-body.act {
    background-color: #07c160;
    color: var(--white);
}

.item-body.act .title,
.item-body.act .time {
    color: var(--white);
}

.item-body .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
    line-height: 1.1;
}

.item-body .title b {
    font-weight: 600;
}

.item-body .time {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1;
}

.border-ws {
    background-color: var(--white);
    border-radius: 0 0 8px 8px;
}

.border-box-body {
    padding: 8px 10px 6px;
    border: 1px solid var(--primary-green);
    border-radius: 6px;
}

.border-box-body-hd {
    margin-bottom: 10px;
}

.van-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.van-row--flex {
    display: flex;
}

.van-row--justify-space-between {
    justify-content: space-between;
}

.van-col {
    flex: 1;
    padding: 0 4px;
}

.van-col--7 {
    flex: 0 0 28%;
    max-width: 28%;
}

.van-col--10 {
    flex: 0 0 44%;
    max-width: 44%;
}

.text-left {
    text-align: left;
    font-size: 13px;
    color: var(--primary-green);
    font-weight: 500;
}

.text-right {
    text-align: right;
    font-size: 14px;
    color: var(--primary-green);
    cursor: pointer;
}

.lottys {
    font-size: 13px;
    color: #F44336;
    align-items: center;
    gap: 3px;
}

.van-count-down {
    color: #F44336;
    font-weight: 500;
}

.border-box-body-bd {
    margin-bottom: 6px;
}

.border-box-body-bd .van-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
}

.border-box-body-bd .van-col {
    flex: 0 0 auto;
    padding: 0;
}

.icon-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 70px;
}

.slot-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    box-sizing: border-box;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
}

.slot-icon::before,
.slot-icon::after { content: none; }

.slot-icon span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 700;
    color: #666666;
    position: relative;
    z-index: 2;
    background: transparent;
    box-shadow: none;
}

.bg-amage-1 .slot-icon { background-image: url('img/redqiu.png'); }
.bg-amage-2 .slot-icon { background-image: url('img/lanqiu.png'); }
.bg-amage-3 .slot-icon { background-image: url('img/lvqiu.png'); }
/* fallback ball image when no mapping available */
.bg-amage-0 .slot-icon { background-image: url('img/wuqiu.png'); }

.slot-text {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
    min-height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.border-box-body-ft {
    text-align: center;
    font-size: 12px;
    color: #F44336;
    padding-top: 4px;
    border-top: 1px solid var(--border-gray);
}

/* 功能按钮网格 */
.features-section {
    margin: 0 12px 5.7px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    height: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.feature-btn {
    padding: 0;
    width: 92px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-gray);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.3s;
}

.feature-btn:active {
    background-color: var(--border-gray);
}

/* 图标网格 */
.icons-section {
    margin: 0 12px 5.7px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-item:active {
    transform: scale(0.95);
}

.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.icon-label {
    font-size: 11px;
    color: var(--text-dark);
    text-align: center;
}

/* 图片库分类 */
.gallery-section {
    margin: 0 12px 5.7px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

.gallery-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--bg-gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* gallery icon style (van-icon-photo look) */
.icon-bg {
    width: 56px;
    height: 56px;
    background-color: #20d497;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.icon-bg--gray {
    background-color: #D9D9D9;
}

.van-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.van-icon-photo {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2' ry='2' fill='none'/><circle cx='9' cy='10' r='2' fill='%23ffffff'/><path d='M21 17l-5-5-4 4-2-2-5 5' /></svg>");
}

/* 按要求：在指定容器内控制图标字号 */
.home .body-image .body-image-hd .icon-bg i {
    font-size: .44rem;
}

/* gallery icons sizing */
.gallery-item .icon-bg i {
    font-size: 1.56rem;
}

.gallery-label {
    font-size: 12px;
    color: var(--text-dark);
    text-align: center;
}

/* 系列筛选按钮 */
.series-section {
    margin: 0 12px 5.7px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

.series-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.series-btn {
    padding: 8px 16px;
    background-color: #07c160;
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.series-btn:active {
    background-color: var(--dark-green);
}

/* 特色内容卡片 */
.featured-section {
    margin: 0 12px 5.7px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

.featured-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.featured-card {
    background-color: var(--bg-gray);
    padding: 14px;
    border-radius: 8px;
    position: relative;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}

.card-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 18px;
    color: var(--primary-green);
}

/* 底部导航样式已移至 components/bottom-nav.css */

/* 响应式设计 */
@media (max-width: 375px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .icons-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 滚动动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease-out;
}

/* 分享弹窗样式 */
.sheet-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999;
}
.share-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.share-sheet .sheet-body {
    width: 100%;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 12px 16px 8px;
    border-top: 1px solid var(--border-gray);
}
.share-sheet .sheet-title {
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 8px;
}
.share-sheet .sheet-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 8px 6px 4px;
}
.share-sheet .sheet-item {
    background: #f7f7f7;
    border: none;
    border-radius: 10px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
}

.share-sheet .sheet-icon { font-size: 24px; }
.share-sheet .sheet-text { font-size: 13px; color: var(--text-dark); }
.share-sheet .sheet-tip { text-align:center; color:#e53935; font-size:12px; padding:6px 0; }
.share-sheet .sheet-cancel { display:block; width:100%; height:40px; border:none; background:#fff; color:#333; border-top:1px solid var(--border-gray); border-radius:0 0 12px 12px; margin-top:4px; }

/* iframe容器样式 */
.iframe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* 当iframe容器显示时隐藏底部导航 */
.iframe-overlay[style*="display: flex"] ~ .bottom-nav,
body:has(.iframe-overlay[style*="display: flex"]) .bottom-nav {
    display: none !important;
}

.iframe-header {
    background-color: var(--white);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-gray);
}

.iframe-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.iframe-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.iframe-close:hover {
    color: var(--text-dark);
}

#contentFrame {
    flex: 1;
    width: 100%;
    border: none;
    background-color: var(--white);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .iframe-overlay {
        top: 0;
    }
    
    .iframe-header {
        height: 44px;
        padding: 0 12px;
    }
    
    .iframe-title {
        font-size: 15px;
    }
}

/* 分页控制样式 */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 20px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #f5f5f5;
    border-color: #4CAF50;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 14px;
    color: #666;
    min-width: 40px;
    text-align: center;
}

/* 更新特色卡片样式 - 2列瀑布流布局 */
.featured-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
    gap: 0;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
}

.featured-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    transition: none;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
}

.featured-card:hover {
    transform: none;
    box-shadow: none;
}

.featured-card-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    background: transparent;
    border: none;
    display: block;
    margin: 0;
    padding: 0;
}

.featured-card-content {
    padding: 5px 2px;
    text-align: center;
    background: transparent;
    position: static;
}

.featured-card-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card-subtitle {
    font-size: 10px;
    color: #999;
    margin: 2px 0 0 0;
    line-height: 1.1;
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.error-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #f44336;
    font-size: 14px;
}

/* 加载更多指示器 */
.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .featured-cards {
        gap: 0;
        padding: 0;
    }
    
    .pagination-controls {
        padding: 0 15px;
    }
    
    .featured-card-content {
        padding: 3px 1px;
    }
    
    .featured-card-title {
        font-size: 11px;
    }
    
    .featured-card-subtitle {
        font-size: 9px;
    }
}

/* 开奖历史图标样式 */
.icon-history {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
}
