/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    color: #333;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ===== Header 头部 ===== */
.header {
    background: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #f0f0f0;
}

.header-backup {
    background: linear-gradient(135deg, #17c45b, #24c85c);
    color: #fff;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    min-width: 72px;
}

.header-backup .url { font-weight: bold; font-size: 12px; }

.header-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

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

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: #666;
}

.header-action i { font-size: 18px; margin-bottom: 2px; font-style: normal; }

/* ===== Banner 轮播 ===== */
.banner-wrap {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.banner-slider {
    display: flex;
    transition: transform 0.4s ease;
}

.banner-slide {
    min-width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.banner-slide.slide-1 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffeaa7 100%);
}

.banner-slide.slide-2 {
    background: linear-gradient(135deg, #17c45b 0%, #a8e6cf 100%);
}

.banner-content {
    text-align: center;
    color: #fff;
}

.banner-content .icon { font-size: 36px; margin-bottom: 8px; }

.banner-content h3 {
    font-size: 16px;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.banner-content p { font-size: 12px; opacity: 0.9; }

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
}

.banner-dots span.active { background: #fff; width: 16px; border-radius: 3px; }

/* ===== 公告滚动 ===== */
.announcement {
    background: #fff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

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

.announcement-text {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ===== 彩种切换 ===== */
.lottery-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
}

.lottery-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.lottery-tab.active {
    background: #17c45b;
    color: #fff;
}

.lottery-tab .name { font-size: 15px; font-weight: bold; }

.lottery-tab .date { font-size: 11px; margin-top: 4px; opacity: 0.85; }

/* ===== 开奖信息 ===== */
.lottery-result {
    margin: 0 12px 12px;
    border: 1px solid #17c45b;
    border-radius: 8px;
    background: #fff;
    position: relative;
    padding: 16px 12px 12px;
}

.lottery-result .live-tag {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: #17c45b;
    color: #fff;
    font-size: 11px;
    padding: 2px 16px;
    border-radius: 0 0 8px 8px;
}

.lottery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 14px;
    font-size: 12px;
}

.lottery-meta .issue { color: #17c45b; font-weight: bold; }

.lottery-meta .countdown { color: #ff4d4f; }

.lottery-meta .history { color: #17c45b; }

.lottery-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ball-item { text-align: center; }

.ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin: 0 auto;
}

.ball.red { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.ball.blue { background: linear-gradient(135deg, #4834d4, #686de0); }
.ball.green { background: linear-gradient(135deg, #17c45b, #6ab04c); }

.ball-label {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.ball-plus {
    font-size: 20px;
    color: #ccc;
    margin: 0 2px;
    align-self: flex-start;
    margin-top: 8px;
}

.lottery-next {
    text-align: center;
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

/* ===== 快捷导航 ===== */
.quick-links {
    background: #fff;
    padding: 12px;
    margin-bottom: 8px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.quick-link-item {
    background: #f8f8f8;
    border-radius: 6px;
    padding: 10px 4px;
    text-align: center;
    font-size: 12px;
    color: #555;
    transition: background 0.2s;
}

.quick-link-item:active { background: #eee; }

/* ===== 功能列表 ===== */
.function-grid {
    background: #fff;
    padding: 16px 12px;
    margin-bottom: 8px;
}

.function-grid-inner {
    display: flex;
    justify-content: space-around;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.function-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

.function-item span { font-size: 11px; color: #666; }

/* ===== 小功能 ===== */
.small-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.small-feature {
    background: #fff;
    border-radius: 8px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.small-feature .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f0faf4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.small-feature .info h4 { font-size: 13px; color: #333; margin-bottom: 4px; }
.small-feature .info p { font-size: 11px; color: #999; }

/* ===== 系列内容 ===== */
.series-list {
    background: #fff;
    padding: 12px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid #17c45b;
}

.series-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.series-item:last-child { border-bottom: none; }

.series-cover {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    background: linear-gradient(135deg, #17c45b33, #17c45b11);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.series-info { flex: 1; min-width: 0; }

.series-info h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-info p {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-info .views {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: 65px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    font-style: normal;
}

.nav-item.active { color: #17c45b; }

.center-btn {
    position: relative;
    margin-top: -38px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.center-btn .circle {
    width: 62px;
    height: 62px;
    background: #24c85c;
    border-radius: 50%;
    border: 5px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}

.center-btn span {
    margin-top: 5px;
    font-size: 12px;
    color: #333;
}

.badge {
    position: absolute;
    top: 0;
    right: -3px;
    width: 20px;
    height: 20px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
