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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.demo-accounts {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.demo-accounts h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.demo-accounts p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* 头部导航 */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-status {
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-status i {
    font-size: 12px;
}



.admin-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.admin-btn:hover {
    background: #1976D2;
}

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: #d32f2f;
}

/* 主要内容区域 */
section {
    background: white;
    margin: 20px 0;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 用户中心 */
.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.stat-item i {
    font-size: 24px;
    color: #667eea;
}

.stat-item .label {
    display: block;
    font-size: 14px;
    color: #666;
}

.stat-item .value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* 开奖结果 */
.result-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.current-result, .next-draw {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.draw-time, .next-time {
    color: #666;
    font-size: 14px;
}

/* 投注区域 */
.betting-container {
    margin-bottom: 30px;
}

.position-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.position {
    text-align: center;
}

.position label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #667eea;
}

.position-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    transition: border-color 0.3s;
}

.position-input:focus {
    outline: none;
    border-color: #667eea;
}

.position-input.error {
    border-color: #dc3545;
}

.bet-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bet-info > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-amount-input input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bet-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.bet-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.bet-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}



/* 投注记录表格 */
.history-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #667eea;
}

tr:hover {
    background: #f8f9fa;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

.status-settled {
    color: #28a745;
    font-weight: bold;
}

.cancel-btn {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.cancel-btn:hover {
    background: #c82333;
}

/* 管理员页面 */
.admin-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 管理员后台开奖数据显示 */
.current-lottery-admin {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.current-lottery-admin h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lottery-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-item .label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
}

.info-item .value {
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
}

.numbers-display {
    display: flex;
    gap: 8px;
}

.numbers-display .number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.nav-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.nav-btn.active {
    background: #667eea;
}

.nav-btn:hover {
    background: #5a6268;
}

.nav-btn.active:hover {
    background: #5a67d8;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
}

/* 下注时间配置样式 */
.betting-time-config {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.betting-time-config h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
}

.input-group input[type="time"] {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input[type="time"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.current-config {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.config-info {
    font-weight: 600;
    color: #555;
}

.config-info span {
    color: #667eea;
    font-weight: 700;
}

.admin-actions {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.action-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #5a67d8;
}

.manual-lottery {
    margin-top: 20px;
}

.manual-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 采集数据显示区域 */
.collected-data {
    margin: 20px 0;
    padding: 20px;
    background: #e8f5e8;
    border: 2px solid #28a745;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.collected-data h3 {
    margin: 0 0 15px 0;
    color: #155724;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.data-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
}

.data-item .label {
    font-weight: bold;
    color: #155724;
    min-width: 80px;
}

.data-item .value {
    color: #333;
    font-weight: 500;
}

.numbers-display {
    display: flex;
    gap: 5px;
}

.numbers-display .number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.manual-inputs input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover {
    color: black;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-container {
        grid-template-columns: 1fr;
    }
    
    .position-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bet-info {
        grid-template-columns: 1fr;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .numbers {
        gap: 5px;
    }
    
    .number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .admin-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .manual-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .manual-inputs input {
        min-width: auto;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    section {
        padding: 20px 15px;
    }
    
    .position-inputs {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .numbers {
        gap: 3px;
    }
    
    .number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease-in;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background-color: #4CAF50;
}

.message.error {
    background-color: #f44336;
}

.message.info {
    background-color: #2196F3;
}