/* 双色球预测工具样式 */

:root {
    --primary-color: #e74c3c;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #bdc3c7;
    --red-ball-color: #e74c3c;
    --blue-ball-color: #3498db;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--dark-color);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--light-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 内容区域 */
.main-content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
}

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

/* 预测页面 */
.prediction-panel {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.control-section, .result-section {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
}

.control-section h3, .result-section h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group select,
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

.filters input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: #95a5a6;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 预测结果 */
.results-container {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    padding: 50px 20px;
}

.prediction-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.prediction-number {
    font-weight: bold;
    color: #7f8c8d;
    min-width: 30px;
}

.balls-container {
    display: flex;
    gap: 8px;
    flex: 1;
}

.ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.ball.red {
    background: linear-gradient(135deg, var(--red-ball-color), #c0392b);
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
}

.ball.blue {
    background: linear-gradient(135deg, var(--blue-ball-color), #2980b9);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.prediction-actions {
    display: flex;
    gap: 5px;
}

.prediction-algorithm {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-left: 10px;
    padding: 2px 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-color);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 快速统计 */
.quick-stats {
    margin-top: 20px;
}

.quick-stats h3 {
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-card {
    background: var(--light-color);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h4 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.number-list {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.number-list .ball {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

/* 统计页面 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
}

.chart-container h3 {
    margin-bottom: 15px;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

/* 历史数据页面 */
.history-panel {
    padding: 20px;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    width: 200px;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
}

.data-table th {
    background: var(--light-color);
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* 历史数据表格样式 */
#history-table th:nth-child(1),
#history-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

#history-table th:nth-child(2),
#history-table td:nth-child(2) {
    width: 150px;
    text-align: center;
}

#history-table th:nth-child(3),
#history-table td:nth-child(3) {
    width: 60px;
    text-align: center;
}

#history-table th:nth-child(4),
#history-table td:nth-child(4) {
    width: 250px;
    text-align: center;
}

#history-table th:nth-child(5),
#history-table td:nth-child(5) {
    width: 80px;
    text-align: center;
}

/* 我的预测表格样式 */
#saved-table th:nth-child(1),
#saved-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

#saved-table th:nth-child(2),
#saved-table td:nth-child(2) {
    width: 150px;
    text-align: center;
}

#saved-table th:nth-child(3),
#saved-table td:nth-child(3) {
    width: 60px;
    text-align: center;
}

#saved-table th:nth-child(4),
#saved-table td:nth-child(4) {
    width: 100px;
    text-align: center;
}

#saved-table th:nth-child(5),
#saved-table td:nth-child(5) {
    width: 220px;
    text-align: center;
}

#saved-table th:nth-child(6),
#saved-table td:nth-child(6) {
    width: 80px;
    text-align: center;
}

#saved-table th:nth-child(7),
#saved-table td:nth-child(7) {
    width: 60px;
    text-align: center;
    vertical-align: middle;
}

.table-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    min-height: 30px;
}

/* 历史数据表格的特殊样式 */
#history-table .table-balls {
    flex-wrap: nowrap;
}

.table-balls .ball {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

#page-info {
    color: #7f8c8d;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .prediction-panel {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: none;
        min-width: 100px;
    }
}

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

.prediction-item {
    animation: fadeIn 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 自定义弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    overflow: hidden;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px 20px;
    text-align: center;
}

.modal-body p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-color);
    line-height: 1.5;
}

.modal-footer {
    padding: 20px;
    background: var(--light-color);
    text-align: center;
}

.modal-footer .btn {
    margin: 0;
    min-width: 120px;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 120px;
    margin: 0;
}

/* 一键生成时的样式 */
.control-section.one-click-mode .form-group:first-child,
.control-section.one-click-mode .form-group:nth-child(2) {
    display: none;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

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

.login-form h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-form h2 {
    color: var(--dark-color);
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 500;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.login-form .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.btn-block {
    width: 100%;
    margin: 0;
    padding: 14px;
    font-size: 1.1rem;
}

.login-tips {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: left;
}

.login-tips p {
    margin: 5px 0;
}

/* 登录状态显示 */
.login-status {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.98);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 100;
}

.login-status .username {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.login-status .logout-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.login-status .logout-btn:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
}

.login-status .logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}
