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

body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

/* ---------- 登录页样式 ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 32px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 20px 35px -8px rgba(0,0,0,0.2);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 28px;
    color: #0f172a;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    font-size: 16px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.btn-login {
    background: #3b82f6;
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #2563eb;
}

.error-msg {
    color: #dc2626;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------- 主应用布局 ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 24px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #1e293b;
}

.sidebar nav {
    flex: 1;
    margin-top: 20px;
}

.sidebar nav a {
    display: block;
    padding: 12px 24px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
}

.sidebar nav a:hover {
    background: #1e293b;
    color: white;
}

.sidebar nav a.active {
    background: #1e293b;
    color: white;
    border-left: 3px solid #3b82f6;
}

.logout {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}

.logout a {
    color: #f87171;
    text-decoration: none;
    font-size: 14px;
}

.logout a:hover {
    text-decoration: underline;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    overflow-y: auto;
    background: #f1f5f9;
}

/* 仪表盘卡片 */
.dashboard h2 {
    margin-bottom: 24px;
    font-weight: 600;
}

.stats-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 28px 24px;
    flex: 1;
    min-width: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: #3b82f6;
}

.stat-label {
    color: #475569;
    margin-top: 8px;
    font-size: 14px;
}

/* 卡片通用样式 */
.form-card, .result-card, .history-section, .settings-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.field {
    flex: 1;
    min-width: 120px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}

.field input, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    transition: border 0.2s;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
    display: inline-block;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-sm {
    background: #e2e8f0;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: #cbd5e1;
}

/* 选项卡 */
.import-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 8px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #64748b;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom: 2px solid #3b82f6;
    margin-bottom: -1px;
}

.tab-pane {
    margin-top: 16px;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 8px;
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

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

/* 赛果复盘正确/错误标识 */
.correct-badge {
    color: #10b981;
    font-weight: 600;
}

.wrong-badge {
    color: #ef4444;
    font-weight: 600;
}

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

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 24px;
    max-width: 700px;
    width: 90%;
    max-height: 85%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.close {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
}

.close:hover {
    color: #0f172a;
}

/* 分析结果样式 */
.rec-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
}

.analysis-text {
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.analysis-text pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .logo {
        font-size: 0;
        padding: 20px 0;
    }
    .logo:before {
        content: "⚽";
        font-size: 24px;
    }
    .sidebar nav a {
        text-align: center;
        padding: 12px 0;
        font-size: 0;
    }
    .sidebar nav a:before {
        font-size: 20px;
    }
    .logout a {
        font-size: 0;
    }
    .logout a:before {
        content: "🚪";
        font-size: 20px;
    }
    .main-content {
        margin-left: 70px;
        padding: 16px;
    }
    .form-row {
        flex-direction: column;
    }
    .stats-grid {
        flex-direction: column;
    }
}

/* AI学习页面 */
.learn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.control-card, .learn-logs {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    cursor: pointer;
}
.switch-label input {
    width: 40px;
    height: 20px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}
.switch-label input:checked {
    background: #3b82f6;
}
.switch-label input::before {
    content: '';
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.2s;
}
.switch-label input:checked::before {
    left: 22px;
}
.info-note {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}
.logs-list {
    max-height: 500px;
    overflow-y: auto;
}
.log-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
}
.log-time {
    font-size: 12px;
    color: #94a3b8;
}
.log-title {
    font-weight: 600;
    margin: 4px 0;
}
.log-desc {
    font-size: 13px;
    color: #334155;
}
@media (max-width: 768px) {
    .learn-grid {
        grid-template-columns: 1fr;
    }
}