/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    background: #fff;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部标题 */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #2774c7;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    color: #2774c7;
    font-weight: normal;
}

.header .subtitle {
    color: #999;
    font-size: 13px;
    margin-top: 5px;
}

/* 期数选择区 */
.issue-bar {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fc 100%);
    border: 1px solid #d4e7f7;
    border-radius: 8px;
    margin-bottom: 15px;
}

.issue-bar label {
    color: #2774c7;
    font-weight: 500;
    margin-right: 12px;
    font-size: 14px;
}

.issue-bar select {
    padding: 8px 35px 8px 12px;
    border: 1px solid #b8d4ed;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232774c7' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.2s;
}

.issue-bar select:hover {
    border-color: #2774c7;
}

.issue-bar select:focus {
    border-color: #2774c7;
    box-shadow: 0 0 0 3px rgba(39, 116, 199, 0.15);
}

.issue-bar .time-info {
    margin-left: auto;
    color: #1a5dad;
    font-size: 13px;
}

/* 统计信息 */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    margin-bottom: 15px;
    font-size: 13px;
}

.stats-bar .stat-item {
    margin: 0 25px;
}

.stats-bar .stat-label {
    color: #666;
}

.stats-bar .stat-value {
    color: #c00;
    font-weight: bold;
    margin-left: 5px;
}

/* 比赛表格 */
.match-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d4e7f7;
}

.match-table th {
    background: #e8f4fc;
    color: #2774c7;
    font-weight: normal;
    padding: 12px 8px;
    border: 1px solid #d4e7f7;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

.match-table td {
    padding: 12px 8px;
    border: 1px solid #e5e5e5;
    text-align: center;
    vertical-align: middle;
}

.match-table tbody tr:hover {
    background: #f5faff;
}

/* 序号列 */
.match-table .col-index {
    width: 60px;
    font-weight: bold;
    color: #2774c7;
}

/* 联赛列 */
.match-table .col-league {
    width: 80px;
    color: #2774c7;
}

/* 时间列 */
.match-table .col-time {
    width: 100px;
    color: #666;
}

/* 球队列 */
.match-table .col-teams {
    text-align: center;
    vertical-align: middle;
    padding: 12px 15px;
}

.match-table td.col-teams {
    display: table-cell;
}

.match-table td.col-teams > span {
    display: inline-block;
    vertical-align: middle;
}

.match-table .team-home {
    color: #c00;
    font-weight: bold;
    width: 80px;
    text-align: right;
}

.match-table .team-vs {
    color: #999;
    width: 40px;
    text-align: center;
}

.match-table .team-away {
    color: #2774c7;
    width: 80px;
    text-align: left;
}

/* 选项列 */
.match-table .col-option {
    width: 90px;
    vertical-align: middle;
    white-space: nowrap;
}

/* 选项按钮 */
.option-cell {
    display: block;
    width: 100%;
    height: 100%;
}

.option-btn {
    width: 100%;
    height: 40px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-table td.col-option {
    padding: 0;
}

.option-btn:hover {
    border-color: #2774c7;
    color: #2774c7;
}

/* 胜选中 */
.option-btn.win.selected {
    background: #c00;
    border-color: #c00;
    color: #fff;
}

/* 平选中 */
.option-btn.draw.selected {
    background: #2774c7;
    border-color: #2774c7;
    color: #fff;
}

/* 负选中 */
.option-btn.lose.selected {
    background: #080;
    border-color: #080;
    color: #fff;
}

/* 操作按钮区 */
.action-bar {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-top: none;
    gap: 15px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #c00;
    color: #fff;
}

.btn-primary:hover {
    background: #a00;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    border-color: #999;
    color: #333;
}

.btn-lucky {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 300% 300%;
    color: #fff;
    border: none;
    font-weight: bold;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-lucky:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-lucky:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.action-bar .tips {
    margin-left: auto;
    color: #999;
    font-size: 12px;
}

/* 快捷选择 */
.quick-select {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.quick-select a {
    color: #2774c7;
    text-decoration: none;
    cursor: pointer;
}

.quick-select a:hover {
    text-decoration: underline;
}

/* 弹窗遮罩 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 50px 20px;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f8f8;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: normal;
    color: #333;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 小型弹窗 */
.modal-small {
    max-width: 400px;
}

/* 转几表单 */
.zhuanji-form {
    text-align: center;
}

.zhuanji-info {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.zhuanji-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.zhuanji-input-group label {
    font-size: 16px;
    color: #333;
}

.zhuanji-input-group input {
    width: 80px;
    height: 40px;
    font-size: 20px;
    text-align: center;
    border: 2px solid #2774c7;
    border-radius: 6px;
    outline: none;
}

.zhuanji-input-group input:focus {
    border-color: #1a5fa8;
    box-shadow: 0 0 0 3px rgba(39, 116, 199, 0.2);
}

.zhuanji-preview {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    min-height: 20px;
}

.zhuanji-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.zhuanji-buttons .btn {
    min-width: 100px;
}

/* 结果统计 */
.result-summary {
    display: flex;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    margin-bottom: 15px;
}

.summary-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-right: 1px solid #e5e5e5;
}

.summary-item:last-child {
    border-right: none;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #c00;
}

.summary-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.download-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-download {
    background: linear-gradient(135deg, #28a745, #20c997, #17a2b8, #28a745);
    background-size: 300% 300%;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-download:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.5);
}

/* 结果表格 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    font-size: 12px;
}

.result-table th {
    background: #f0f0f0;
    padding: 10px;
    border: 1px solid #e5e5e5;
    font-weight: normal;
    color: #333;
    text-align: center;
    vertical-align: middle;
}

.result-table td {
    padding: 10px;
    border: 1px solid #e5e5e5;
    text-align: center;
    vertical-align: middle;
}

.result-table tr:nth-child(even) {
    background: #fafafa;
}

.result-table tr:hover {
    background: #f5f5f5;
}

/* 组合详情居中 */
.result-table td[style*="text-align:left"] {
    text-align: center !important;
}

/* 结果标签 */
.result-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
    margin: 1px;
}

.result-tag.win {
    background: #ffeaea;
    color: #c00;
}

.result-tag.draw {
    background: #e6f4ff;
    color: #2774c7;
}

.result-tag.lose {
    background: #e6ffe6;
    color: #080;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e5e5e5;
    border-top-color: #2774c7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .issue-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .issue-bar .time-info {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .match-table {
        font-size: 12px;
    }

    .match-table th,
    .match-table td {
        padding: 8px 5px;
    }

    .match-table .col-index {
        width: 40px;
    }

    .match-table .col-league {
        width: 60px;
    }

    .match-table .col-time {
        width: 80px;
    }

    .match-table .col-option {
        width: 60px;
    }

    .option-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .action-bar {
        flex-wrap: wrap;
    }

    .action-bar .tips {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .modal-content {
        margin: 10px;
    }

    .result-summary {
        flex-wrap: wrap;
    }

    .summary-item {
        min-width: 50%;
        border-bottom: 1px solid #e5e5e5;
    }
}

@media (max-width: 480px) {
    .match-table .col-time {
        display: none;
    }

    .match-table .col-league {
        width: 50px;
        font-size: 11px;
    }

    .match-table .col-teams {
        font-size: 11px;
    }

    .match-table .team-vs {
        margin: 0 3px;
    }
}
