/* 福彩3D彩票分析平台 - 主样式表 */

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --border: #ddd;
    --bg: #f5f6fa;
    --white: #ffffff;
    --text: #333;
    --text-light: #888;
    --red: #e74c3c;
    --blue: #3498db;
    --green: #27ae60;
    --orange: #f39c12;
}

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--primary); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ===== 顶部导航 ===== */
.header {
    background: linear-gradient(135deg, var(--dark) 0%, #34495e 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--warning); }
.nav-menu { display: flex; gap: 5px; }
.nav-menu a {
    color: rgba(255,255,255,0.85);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.header-right .btn-login {
    background: var(--primary);
    color: white;
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 14px;
}
.user-menu { position: relative; }
.user-menu-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 160px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
    z-index: 100;
}
.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.user-dropdown a:hover { background: #f8f9fa; color: var(--primary); }
.user-menu:hover .user-dropdown { display: block; }

/* ===== 开奖信息栏 ===== */
.lottery-bar {
    background: white;
    border-bottom: 2px solid var(--primary);
    padding: 15px 0;
}
.lottery-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
.lottery-info { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.period-info { font-size: 15px; }
.period-info strong { color: var(--primary); font-size: 18px; }
.numbers-display { display: flex; gap: 8px; }
.number-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: var(--primary);
    box-shadow: 0 3px 8px rgba(231,76,60,0.4);
}
.number-ball.bai { background: #e74c3c; }
.number-ball.shi { background: #3498db; }
.number-ball.ge { background: #27ae60; }
.lottery-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); }
.lottery-meta span { color: var(--text); font-weight: bold; }
.countdown-box {
    background: var(--dark);
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    text-align: center;
}
.countdown-box .label { font-size: 12px; opacity: 0.8; }
.countdown-box .time { font-size: 22px; font-weight: bold; color: var(--warning); }

/* ===== 公告栏 ===== */
.notice-bar {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 10px 0;
    font-size: 14px;
}
.notice-bar .container { display: flex; align-items: center; gap: 10px; }
.notice-label {
    background: var(--warning);
    color: white;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}
.notice-content { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ===== 通用卡片 ===== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* ===== 功能入口 ===== */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 20px;
}
.quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 10px;
    background: #fafbfc;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #eee;
}
.quick-nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.quick-nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}
.quick-nav-item .label { font-size: 14px; font-weight: 500; }

/* ===== 历史开奖表格 ===== */
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.history-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
.history-table tr:hover td { background: #f8f9fa; }
.history-table .num-cell { display: flex; gap: 4px; justify-content: center; }
.history-table .num-sm {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: bold; color: white;
    background: var(--primary);
}
.sum-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}
.sum-badge.big { background: #ffeaea; color: var(--red); }
.sum-badge.small { background: #e8f5e9; color: var(--green); }

/* ===== 走势图 ===== */
.trend-chart-container { padding: 15px; overflow-x: auto; }
.trend-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 800px; }
.trend-table th {
    background: var(--dark);
    color: white;
    padding: 8px 6px;
    text-align: center;
    position: sticky;
    top: 0;
}
.trend-table td {
    padding: 6px 6px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
.trend-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold;
}
.trend-num.hit { background: var(--primary); color: white; }
.trend-num.miss { background: #f0f0f0; color: #999; }
.trend-table tr:hover td { background: #f8f9fa; }

/* ===== 分析面板 ===== */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.analysis-item {
    background: #fafbfc;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #eee;
}
.analysis-item .label { font-size: 13px; color: var(--text-light); margin-bottom: 5px; }
.analysis-item .value { font-size: 20px; font-weight: bold; color: var(--dark); }
.analysis-item .value.red { color: var(--red); }
.analysis-item .value.blue { color: var(--blue); }
.analysis-item .sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }

/* ===== 推荐号卡片 ===== */
.recommend-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.recommend-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}
.recommend-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.recommend-card .type { font-size: 12px; opacity: 0.8; }
.recommend-card .title { font-size: 16px; font-weight: bold; margin: 5px 0; }
.recommend-card .numbers {
    display: flex; gap: 8px; margin: 10px 0;
}
.recommend-card .num-big {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: bold;
}
.recommend-card .meta { font-size: 12px; opacity: 0.7; }

/* ===== 下注面板 ===== */
.bet-panel { }
.play-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--primary);
    flex-wrap: wrap;
}
.play-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.play-tab:hover { color: var(--primary); }
.play-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: bold;
}
.bet-area { padding: 20px; }
.bet-numbers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.bet-num-btn {
    width: 44px; height: 44px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.bet-num-btn:hover { border-color: var(--primary); color: var(--primary); }
.bet-num-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.bet-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.bet-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    width: 120px;
}
.bet-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.bet-btn-primary { background: var(--primary); color: white; }
.bet-btn-primary:hover { background: var(--primary-dark); }
.bet-btn-secondary { background: #eee; color: var(--text); }
.bet-summary {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}
.bet-summary .row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.bet-summary .total { font-size: 18px; font-weight: bold; color: var(--red); }

/* ===== 后台管理 ===== */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: var(--dark);
    color: white;
    flex-shrink: 0;
}
.admin-sidebar .logo-area {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
    font-weight: bold;
}
.admin-nav { padding: 10px 0; }
.admin-nav-group { margin-bottom: 10px; }
.admin-nav-title {
    padding: 8px 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary);
}
.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-content { flex: 1; padding: 30px; overflow-y: auto; }
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 15px;
}
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
}
.stat-info .num { font-size: 24px; font-weight: bold; }
.stat-info .label { font-size: 13px; color: var(--text-light); }

/* ===== 表格通用 ===== */
.data-table { width: 100%; border-collapse: collapse; background: white; font-size: 14px; }
.data-table th {
    background: #f8f9fa;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}
.data-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.data-table tr:hover td { background: #f8f9fa; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}
.badge-success { background: #e8f5e9; color: var(--success); }
.badge-warning { background: #fff8e1; color: var(--warning); }
.badge-danger { background: #ffeaea; color: var(--danger); }
.badge-info { background: #e3f2fd; color: var(--secondary); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--secondary); outline: none; }
.form-select { 
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: white;
}
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 5px; justify-content: center; padding: 20px; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
}
.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== 页脚 ===== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
}
.footer a { color: rgba(255,255,255,0.8); }

/* ===== 汉堡菜单按钮 ===== */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 22px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}
.menu-toggle:hover { background: rgba(255,255,255,0.15); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    /* 导航 */
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; position: relative; }
    .menu-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        padding: 10px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 999;
    }
    .nav-menu.show { display: flex; }
    .nav-menu a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .nav-menu a.active { background: rgba(255,255,255,0.15); }

    /* 开奖信息栏 */
    .lottery-bar-inner { flex-direction: column; align-items: stretch; gap: 12px; }
    .lottery-info { flex-direction: column; gap: 10px; }
    .lottery-meta { flex-wrap: wrap; gap: 10px 15px; }
    .numbers-display { justify-content: center; }
    .number-ball { width: 44px; height: 44px; font-size: 20px; }
    .countdown-box { align-self: center; width: 100%; }

    /* 功能入口 */
    .quick-nav { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 15px; }
    .quick-nav-icon { width: 42px; height: 42px; font-size: 20px; }
    .quick-nav-item { padding: 15px 8px; }

    /* 双列grid堆叠 */
    .analysis-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .analysis-item { padding: 12px; }
    .analysis-item .value { font-size: 16px; }

    /* 推荐卡片 */
    .recommend-cards { grid-template-columns: 1fr; }
    .recommend-card .numbers { flex-wrap: wrap; }
    .recommend-card .num-big { width: 40px; height: 36px; font-size: 18px; }

    /* 走势图Tab */
    .trend-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .trend-tab { white-space: nowrap; flex-shrink: 0; }

    /* 走势表滚动 */
    .trend-chart-container { -webkit-overflow-scrolling: touch; }

    /* 表格 */
    .history-table { font-size: 12px; }
    .history-table th, .history-table td { padding: 8px 5px; }
    .history-table .num-sm { width: 24px; height: 24px; font-size: 11px; }

    /* 页面内联grid（index/analysis/recommend等） */
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* 按钮 */
    .bet-btn { padding: 10px 18px; font-size: 14px; }

    /* 后台 */
    .admin-sidebar { width: 0; overflow: hidden; }
    .admin-content { padding: 15px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    .quick-nav { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
    .analysis-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .number-ball { width: 38px; height: 38px; font-size: 18px; }
    .recommend-card .num-big { width: 36px; height: 32px; font-size: 16px; }
    .card { margin-bottom: 12px; }
    .card-header { padding: 12px 15px; }
    .card-header h3 { font-size: 14px; }
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== 投注面板新增样式 ===== */
.play-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.play-tab {
    padding: 7px 14px; border: 1px solid #ddd; border-radius: 6px;
    cursor: pointer; font-size: 13px; white-space: nowrap; transition: all .2s;
}
.play-tab:hover { background: #e8e8e8; }
.play-tab.active { background: #e74c3c; color: #fff; border-color: #e74c3c; }

.sub-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; }
.sub-tab {
    padding: 5px 10px; background: #f8f8f8; border: 1px solid #eee;
    border-radius: 4px; cursor: pointer; font-size: 12px; white-space: nowrap;
}
.sub-tab:hover { background: #eee; }
.sub-tab.active { background: #3498db; color: #fff; border-color: #3498db; }

.play-desc { font-size: 12px; color: #888; margin-bottom: 8px; padding: 6px 10px; background: #fafafa; border-radius: 4px; }
.play-desc strong { color: #e74c3c; }

.select-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.select-row .label { min-width: 50px; color: #666; font-weight: normal; font-size: 12px; }

.odds-display { font-size: 12px; color: #e74c3c; font-weight: bold; margin-top: 4px; }
.dan-select { display: inline-flex; gap: 4px; margin-bottom: 8px; }
.dan-select .bet-num-btn { min-width: 36px; font-size: 13px; }
