/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
    background: #f5f5f5;
}

/* ========== 覆盖 jQuery Mobile 默认样式 ========== */
.ui-page {
    max-width: 480px;
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
    padding-bottom: 70px !important;
}
.ui-content {
    padding: 0 !important;
}
.ui-header, .ui-footer {
    border: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.ui-footer-fixed, .ui-footer {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* ========== 顶部导航栏 ========== */
.custom-header {
    background: #fff !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-title {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
    margin: 0;
}
.logo-box {
    background: #22c55e;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
}
.logo-box small {
    font-size: 10px;
    font-weight: normal;
    display: block;
}
.header-icon {
    font-size: 20px;
    color: #4b5563;
}

/* ========== 备用域名区域 ========== */
.domain-section {
    background: linear-gradient(180deg, #16a34a, #22c55e);
    padding: 12px 16px;
}
.domain-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.domain-tag {
    background: #4ade80;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
}
.domain-text {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}
.dot-indicators {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}
.dot.active {
    background: #fff;
}

/* ========== 公告跑马灯 ========== */
.notice-bar {
    background: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.notice-icon {
    color: #ef4444;
    font-size: 18px;
}
.marquee {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}
.marquee-content {
    display: inline-block;
    animation: marquee 15s linear infinite;
    color: #374151;
    font-size: 14px;
}
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========== 选项卡 ========== */
.xianggang {
    background: #fff;
    display: flex;
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    position: relative;
    color: #4b5563;
    transition: none;
}
.tab-title {
    font-size: 18px;
    font-weight: 500;
}
.tab-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}
.tab-active {
    background: linear-gradient(180deg, #16a34a, #15803d);
    color: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.tab-active .tab-sub {
    color: rgba(255,255,255,0.9);
}
.tab-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #22c55e;
}

/* ========== 开奖信息卡片 ========== */
.lottery-card {
    margin: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header > div {
    display: flex;
    align-items: center;
    min-width: 0;
}
.card-title {
    color: #1f2937;
    font-weight: 500;
    white-space: nowrap;
    font-size: 14px;
}
.card-countdown {
    color: #6b7280;
    font-size: 12px;
    margin-left: 6px;
    white-space: nowrap;
}
.card-link {
    color: #16a34a;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.number-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 2px;
}
.number-item {
    text-align: center;
    display: inline-block;
    margin: 0 1px;
    flex: 1;
    max-width: 14%;
}
.number-circle {
    width: clamp(28px, 10vw, 48px);
    height: clamp(28px, 10vw, 48px);
    line-height: clamp(28px, 10vw, 48px);
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(13px, 4.5vw, 20px);
    font-weight: bold;
    color: #333;
    margin: 0 auto;
}
.number-circle.rolling{
    background:#999 !important;
}
.green { color: green; }
.red { color: red; }
.blue { color: blue; }
.number-circle.green { color: green; }
.number-circle.red { color: red; }
.number-circle.blue { color: blue; }
.number-label {
    color: #9ca3af;
    font-size: clamp(9px, 2.5vw, 12px);
    margin-top: 4px;
}
.card-footer {
    text-align: center;
    color: #ef4444;
    font-size: 14px;
}

/* ========== 功能网格 ========== */
.grid-card {
    margin: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.ui-grid-c .ui-block-a,
.ui-grid-c .ui-block-b,
.ui-grid-c .ui-block-c,
.ui-grid-c .ui-block-d {
    padding: 4px;
    width: 25%;
    margin: 0;
    float: left;
}
.grid-item {
    background: #f8f8f8;
    border-radius: 6px;
    padding: 14px 8px;
    text-align: center;
    font-size: 15px;
    color: #333;
}

/* ========== 功能图标区 ========== */
.ui-grid-d .ui-block-a,
.ui-grid-d .ui-block-b,
.ui-grid-d .ui-block-c,
.ui-grid-d .ui-block-d,
.ui-grid-d .ui-block-e {
    padding: 8px 4px;
    width: 20%;
    margin: 0;
    float: left;
}
.icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    position: relative;
}
.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
}
.hot-tag {
    position: absolute;
    top: -4px;
    right: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    padding: 0 4px;
    border-radius: 4px;
    z-index: 2;
}
.bg-green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.bg-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.bg-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.bg-blue-light { background: linear-gradient(135deg, #93c5fd, #3b82f6); }
.bg-purple { background: linear-gradient(135deg, #c084fc, #9333ea); }
.bg-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.bg-blue-dark { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.bg-red-light { background: linear-gradient(135deg, #f87171, #ef4444); }

/* ========== 底部导航 ========== */
.bottom-nav {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    padding: 2px 0;
}
.nav-item.active {
    color: #00b858;
}
.nav-item i {
    font-size: 20px;
    line-height: 1;
}
.nav-item-center {
    flex: 1;
    display: flex;

    flex-direction: column;
    align-items: center;
}
.nav-center-btn {
    width: 48px;
    height: 48px;
    margin-top: -18px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}
.nav-center-text {
    color: #16a34a;
    font-size: 12px;
    margin-top: 2px;
}

/* ========== 通用组件 ========== */
.toast{
    position:fixed;
    left:50%;
    bottom:120px;
    transform:translateX(-50%);
    background:rgba(0,0,0,0.7);
    color:#fff;
    padding:8px 16px;
    border-radius:6px;
    font-size:14px;
    z-index:9999;
    display:none;
}
.toast.show{
    display:block;
}
.loading-text{
    text-align: center;
    padding:24px 0;
    color:#777;
    font-size:15px;
}
.red{
    color:#d62828;
}