/* 全局重置 - 精准匹配浏览器默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

html, body {
    max-width: 750px; /* PC端最大宽度，复刻移动端视觉 */
    min-height: 100vh;
    background-color: #f8f8f8;
    color: #333;
    font-size: 14px;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
    padding-top: 24px; /* 统一顶部内边距 */
}

/* 外层容器 - 全端居中 */
.page-container {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    max-width: 750px;
    padding: 0;
}

/* 顶部导航栏 */
.header {
    width: 100%;
    height: 48px;
    background-color: #5aa1f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top {
    position: fixed;
    z-index: 99;
    height: 48px;
    width: 100%;
    max-width: 750px;
    background: #5aa1f5;
    text-align: center;
}

.header h1 {
    color: #ffffff;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    line-height: 48px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: center;
    margin: 0 10px;
}

/* 返回按钮样式 */
.back-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: rgba(255,255,250,0.2);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.back-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

.header .refresh-btn {
    background-color: #0059ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: clamp(13px, 3vw, 14px);
    cursor: pointer;
    transition: background-color 0.2s;
    height: 32px;
    line-height: 18px;
}

.header .refresh-btn:hover {
    background-color: #0089e5;
}

.header .logo-box {

    width: 100%;
    max-width: 720px;
}

.header .logo .logo-img {
    width: 188px;
    display: block;
}
.header .logo {
    position: relative;
    float: left;
    margin-left: 0px;
}
.header .bank {
    position: relative;
    float: right;
    width: 65px;
}
.header .bank img {
    display: block;
    width: 60px;
}

/* ============== 新增：筛选栏通用样式 ============== */
.filter-title {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: bold;
    color: #ff0000;
    margin-right: 8px;
    flex-shrink: 0;
    line-height: 42px;
}

.filter-title-sort{
    font-size: clamp(15px, 3vw, 18px);
    font-weight: bold;
}

/* 重置按钮样式 */
.reset-btn {
    width: auto !important;
    height: 28px !important;
    padding: 0 5px !important;
    display: flex;
    justify-content: center;
    align-items: center !important;
    border-radius: 4px !important;
    background-color: #5aa1f5 !important;
    color: #fff !important;
    /*font-size: 13px !important;*/
    font-weight: 501 !important;
}
.reset-btn:hover {
    background-color: #5aa1f5 !important;
}

/* ============== 位置筛选栏 - 修复吸顶 + 收紧间距 ============== */
.loc-filter {
    width: 100%;
    background-color: #ffffcc;
    padding: 5px 10px; /* 缩小上下内边距 */
    display: flex;
    flex-wrap: wrap;
    gap: clamp(5px, 2vw, 14px);
    /*margin: 0 0 2px 0; !* 极小底部间距 *!*/
    position: sticky;
    top: 48px;  /*固定在导航栏下方，永不消失 */
    z-index: 98;
    border-bottom: 1px solid #eeeeee;
    align-items: center;
    margin-top: 2px;
}

.loc-item {
    white-space: nowrap;
    width: 32px;
    height: 28px;
    border-radius: 4px;
    /*background-color: #e6e6e6;*/
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 510;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ccc;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.loc-item.active {
    background-color: #ec6337;
    color: #fff;
    font-weight: bold;
    border-color: #ec6337;
}

/* 生肖筛选栏 - 修复吸顶 + 收紧间距 ============== */
.zodiac-filter {
    width: 100%;
    background-color: #ffffcc;
    padding: 5px 10px; /* 缩小上下内边距 */
    display: flex;
    flex-wrap: wrap;
    gap: clamp(5px, 2vw, 14px);
    /*margin: 0 0 2px 0; !* 极小底部间距 *!*/
    position: sticky;
    top: 101px;  /*紧贴位置栏 */
    z-index: 97;
    border-bottom: 1px solid #eeeeee;
    align-items: center;
}

.zodiac-item {
    width: 32px;
    height: 28px;
    /*border-radius: 50%;*/
    border-radius: 4px;
    /*background-color: #e6e6e6;*/
    display: flex;
    /*margin-left: clamp(5px, 2vw, 14px);*/
    justify-content: center;
    align-items: center;
    font-size: 15px;
    font-weight: 510;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    /*border: 1px solid transparent;*/
    border: 1px solid #ccc;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.zodiac-item.active {
    background-color: #ec6337;
    color: #fff;
    font-weight: bold;
    border-color: #ec6337;
    z-index: 10;
}

/* 开奖记录容器 - 缩小顶部间距 */
.record-container {
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    padding-top: 2px; /* 极致缩小顶部间距 */
    padding-bottom: 20px;
}

/* 标题+年份选择栏 */
.wave-trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px;
}

/* 年份选择按钮样式 */
.year-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(16px, 3vw, 20px);
    background-color: #f9f9f9;
    cursor: pointer;
}

.type-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(16px, 3vw, 20px);
    background-color: #f9f9f9;
    cursor: pointer;
}

.sort-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(16px, 3vw, 20px);
    background-color: #f9f9f9;
    cursor: pointer;
}
.year-select:focus {
    outline: none;
    border-color: #409EFF;
}

.record-list {
    width: 100%;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 10px;
}

ul.clearfix {
    list-style: none;
    width: 100%;
}

ul.clearfix li {
    margin-bottom: 15px;
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}

ul.clearfix li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

dt {
    margin-bottom: 8px;
    font-size: clamp(15px, 3vw, 18px);
    /*font-weight: 510;*/
    color: #333;
}

dt b {
    font-size: clamp(15px, 3vw, 18px);
    color: #d80000;
    font-weight: 600;
}

/* 号码球容器 */
dl {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: clamp(4px, 1.5vw, 10px);
    align-items: center;
    padding: clamp(4px, 1vw, 5px) 0;
    width: 100%;
    height: auto;
}

/* 特号样式 */
.te {
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    color: #cbc1c1;
    text-align: center;
    line-height: clamp(20px, 4vw, 24px);
    font-size: clamp(16px, 5vw, 28px);
    font-weight: 800;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 号码球样式 */
.ball {
    min-width: clamp(50px, 10vw, 60px);
    height: auto;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.1s ease;
    overflow: hidden;
    padding: 10px;
}

.ball:hover {
    background-color: #EEEEEE;
}

/* 号码球遮罩样式 */
.ball.covered {
    opacity: 0.1;
    pointer-events: none;
}

.ball.covered::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.ball p {
    text-align: center;
    line-height: 1;
    position: relative;
    z-index: 2;
    min-width: 30px;
}

/* 小球图片+数字样式 */
.ball-color {
    position: relative;
    display: inline-block;
}

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

.ball-num {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-size: clamp(16px, 3vw, 25px);
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.ball b {
    font-size: clamp(13px, 3vw, 18px);
    color: #000000;
    display: block;
    margin-top: 2px;
    font-weight: 700;
    margin-bottom: 2px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 0 15px;
    width: 100%;
}

.pagination-btn {
    min-width: 80px;
    height: 36px;
    background-color: rgb(0, 153, 0);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-btn:hover {
    background-color: rgb(0, 153, 0);
}

.pagination-btn:disabled {
    background-color: #d9d9d9;
    color: #999;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 25px;
    color: #999;
    font-size: 14px;
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 750px) {
    .pagination {
        display: none;
    }

    /* 位置/生肖项适配 */
    .loc-item{
        /*width: calc((100% - 60px) / 8);*/
        /*height: 0;*/
        /*padding-bottom: calc((100% - 60px) / 8);*/
        font-size: 12px;
    }

    .zodiac-item {
        /*width: calc((100% - 60px) / 12);*/
        /*height: 0;*/
        /*padding-bottom: calc((100% - 60px) / 12);*/
        font-size: 12px;
    }

    .loc-item span, .zodiac-item span {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /*.loc-filter, .zodiac-filter {
        padding: 8px 12px;
        gap: 8px;
    }*/

    .record-container {
        padding: 0 8px;
        /*padding-top: 8px;*/
    }

    /* 号码球适配 */
    .ball {
        flex: 1 1 calc((100% - 56px) / 8);
        min-width: calc((100% - 56px) / 8);
        /*height: 0;*/
        padding-bottom: calc((100% - 300px) / 8);
    }
    .ball p {
        /*position: absolute;*/
        /*top: 40%;*/
        /*left: 50%;*/
        /*transform: translate(-50%, -50%);*/
    }
    .ball-img{
        height: auto;
        max-width: 9vw;
    }
}

/* PC端适配 */
@media (min-width: 750px) {
    .record-container{
        padding: 0;
        margin: 0 auto;
    }

    .header {
        padding: 0 20px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }

    /*.loc-filter, .zodiac-filter {
        padding: 10px 20px;
        margin: 0 auto 10px auto;
    }*/

    .loc-item:hover:not(.active), .zodiac-item:hover:not(.active) {
        background-color: #d9d9d9;
    }
}

/* 小屏手机适配 */
@media (max-width: 375px) {
    .loc-item, .zodiac-item {
        width: calc((100% - 50px) / 12);
        padding-bottom: calc((100% - 50px) / 12);
    }
}