/* =========================================================
 * 彩票开奖 - 共享样式（自适应：桌面 + 移动端）
 * ========================================================= */

:root {
    --red: #C42017;
    --red-deep: #7E000F;
    --red-grad: linear-gradient(180deg, #D52E22 0%, #CE281C 45%, #B2120E 100%);
    --blue: #1E88E5;
    --line: #E6E6E6;
    --text: #222;
    --muted: #777;
    --bg: #F3F3F3;
    --radius: 6px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, li { list-style: none; }

img { max-width: 100%; border: 0; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 10px; }

/* ---------------- 顶部黑条 ---------------- */
.topbar {
    background: var(--red-deep);
    color: #eee;
    font-size: 12px;
}

.topbar .container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 32px;
    overflow: hidden;
}

.topbar .announce {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.topbar .announce .marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
}

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

.topbar .fav-links { flex: none; display: flex; gap: 14px; }
.topbar .fav-links a { color: #eee; }
.topbar .fav-links a:hover { color: #fff; }

/* ---------------- LOGO 区 ---------------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 700;
    color: var(--red);
    letter-spacing: 2px;
}

.site-logo:hover { text-decoration: none; }

/* LOGO 图片（替换原文字 LOGO） */
.site-logo .logo-img {
    display: block;
    flex: none;
    height: 46px;
    width: auto;
}

.site-logo .logo-mark { display: none; }

/* 右上角快捷入口（设为首页 / 收藏本站）：桌面端由顶部黑条提供，仅手机端显示 */
.header-links { display: none; }

.view-count {
    text-align: right;
    color: var(--muted);
    font-size: 13px;
}

.view-count strong { color: var(--red); font-size: 18px; padding: 0 2px; }

/* ---------------- 红色导航 ---------------- */
.main-nav { background: var(--red-grad); box-shadow: 0 2px 4px rgba(0,0,0,.15); position: relative; z-index: 100; }

.main-nav .container { padding: 0; }

.nav-menu { display: flex; }

.nav-item { position: relative; }

.nav-item > a {
    display: block;
    color: #fff;
    font-size: 15px;
    padding: 8px 22px;
    white-space: nowrap;
}

.nav-item > a:hover, .nav-item.open > a { background: rgba(126, 0, 15, .55); text-decoration: none; }

.nav-item.has-drop > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: #fff;
    vertical-align: middle;
    margin-top: 2px;
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 130px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 2px solid var(--red);
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
    z-index: 110;
}

.nav-item:hover .sub-menu, .nav-item.open .sub-menu { display: block; }

.sub-menu li + li { border-top: 1px solid #F2F2F2; }

.sub-menu a {
    display: block;
    padding: 9px 16px;
    color: var(--text);
    font-size: 14px;
}

.sub-menu a:hover { background: #FDF3F3; color: var(--red); text-decoration: none; }

/* ---------------- 面包屑 ---------------- */
.crumb { padding: 12px 0 0; color: var(--muted); font-size: 13px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--red); }

/* ---------------- 页面标题 ---------------- */
.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--red);
}

.page-title::before {
    content: "";
    width: 5px;
    height: 22px;
    background: var(--red-grad);
    border-radius: 3px;
}

/* ---------------- 面板 ---------------- */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-head {
    background: linear-gradient(180deg, #FFFDFD, #FBF4F4);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--red-deep);
}

.panel-body { padding: 16px; }

/* ---------------- 开奖球 ---------------- */
.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    color: var(--blue);
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    flex: none;
}

.ball.ball-red { border-color: var(--red); color: var(--red); }
.ball.ball-green { border-color: #43A047; color: #43A047; }

.ball.sm { width: 26px; height: 26px; font-size: 12px; border-width: 1.5px; }

.ball-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 大小 / 单双 文本 */
.tag-red { color: var(--red); font-weight: 600; }
.tag-blue { color: var(--blue); font-weight: 600; }

/* ---------------- 表格通用 ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th, .data-table td {
    border-bottom: 1px solid #EFEFEF;
    text-align: center;
    padding: 9px 8px;
    white-space: nowrap;
}

.data-table thead th {
    background: #FBF4F4;
    color: var(--red-deep);
    font-weight: 700;
    border-bottom: 2px solid #F0D5D5;
}

.data-table tbody tr:nth-child(even) { background: #FCFCFC; }
.data-table tbody tr:hover { background: #FDF6F6; }

/* ---------------- 年份切换 ---------------- */
.year-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }

.year-tabs a {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    background: #fff;
}

.year-tabs a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.year-tabs a.active { background: var(--red-grad); border-color: transparent; color: #fff; }

/* ---------------- 筛选条 ---------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--line);
}

.filter-bar label { color: var(--muted); font-size: 13px; }

.filter-bar select, .filter-bar input[type="date"], .filter-bar input[type="text"] {
    border: 1px solid #DDD;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

.seg {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.seg a {
    padding: 5px 14px;
    color: var(--muted);
    background: #fff;
    font-size: 13px;
}

.seg a + a { border-left: 1px solid var(--line); }
.seg a.active { background: var(--red); color: #fff; }
.seg a:hover { text-decoration: none; color: var(--red); }
.seg a.active:hover { color: #fff; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 7px 18px;
    font-size: 14px;
    cursor: pointer;
    background: var(--red-grad);
    color: #fff;
    transition: opacity .15s;
}

.btn:hover { opacity: .88; }

.btn.btn-outline { background: #fff; border-color: var(--red); color: var(--red); }
.btn.btn-plain { background: #fff; border-color: #CCC; color: #555; }
.btn.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 页脚 ---------------- */
.site-footer {
    background: #fff;
    border-top: 3px solid var(--red);
    margin-top: 30px;
    padding: 22px 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 2;
}

/* ---------------- 加载 / 空 ---------------- */
.loading, .empty {
    text-align: center;
    color: var(--muted);
    padding: 50px 16px;
    font-size: 14px;
}

.empty .empty-ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .35; }

/* ---------------- 返回顶部 ---------------- */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--red-grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 32, 23, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity .25s, transform .25s, visibility .25s;
    z-index: 999;
}

.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { opacity: .9; }

.to-top svg { width: 22px; height: 22px; }

/* ---------------- 轻提示 ---------------- */
.toast-box {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    padding: 10px 18px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 14px;
    text-align: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.toast-box.show { opacity: 1; visibility: visible; }

/* ---------------- 移动端适配 ---------------- */
/* rem 基准：以 375px 设计稿为准，1rem = 100px（26.6667vw），与移动端站点一致 */
@media (max-width: 768px) {
    html { font-size: 26.6667vw; }
}

/* 大屏手机/小平板：限制 rem 上限，避免元素被放得过大 */
@media (min-width: 480px) and (max-width: 768px) {
    html { font-size: 128px; }
}

@media (max-width: 768px) {
    /* 顶部公告条（跑马灯 + 收藏链接）：内容为空，整条隐藏 */
    .topbar { display: none; }

    /* 头部：高度 .64rem，LOGO 高 .35rem 垂直居中 */
    .site-header .container {
        position: relative;
        height: .64rem;
        padding: 0 .1rem;
        align-items: center;
    }
    .site-logo { flex: 1; min-width: 0; }
    .site-logo .logo-img { height: .35rem; }

    /* 右侧最上角：设为首页 / 收藏本站 */
    .header-links {
        display: flex;
        align-items: center;
        position: absolute;
        right: .1rem;
        top: .02rem;
        line-height: .2rem;
        color: #6D6D6D;
    }
    .header-links span {
        font-size: .125rem;
        white-space: nowrap;
        cursor: pointer;
    }
    .header-links .hl-sethome {
        border-right: 1px solid #6D6D6D;
        padding-right: .04rem;
        margin-right: .05rem;
    }

    /* 浏览次数 */
    .view-count { display: none; }

    /* 电脑版红色导航（首页/历史开奖/走势分析）整体隐藏 */
    .main-nav { display: none; }

    /* 页脚在手机上隐藏 */
    .site-footer { display: none; }

    .page-title { font-size: 17px; padding: 12px 0 10px; }

    .ball { width: 30px; height: 30px; font-size: 13px; }
    .data-table th, .data-table td { padding: 7px 6px; font-size: 13px; }

    .to-top { right: 14px; bottom: 18px; width: 42px; height: 42px; }
}
