/* ===== CSS 变量 ===== */
:root {
    --primary: #4361ee;
    --primary-dark: #3f37c9;
    --success: #4caf50;
    --success-dark: #2e7d32;
    --danger: #f44336;
    --danger-dark: #c62828;
    --warning: #ff9800;
    --warning-dark: #f57c00;
    --purple: #9c27b0;
    --purple-dark: #7b1fa2;
    --teal: #009688;
    --gray-50: #fafafa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #5a6268;
    --gray-800: #495057;
    --gray-900: #212529;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* ===== 基础重置 ===== */
* {margin: 0;padding: 0;box-sizing: border-box;}

/* ===== 页面基础 ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 30px;
}

/* ===== 页面头部 ===== */
.page-header {
    text-align: center;
    padding: 25px 20px;
    color: white;
}
.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* ===== 页面容器 ===== */
.page-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ===== 卡片 ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(67, 97, 238, 0.4);
}
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.4);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(244, 67, 54, 0.4);
}
.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(255, 152, 0, 0.4);
}
.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-purple {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(156, 39, 176, 0.4);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn:active {transform: translateY(0);}

/* ===== 按钮组 ===== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ===== 输入行内 ===== */
.input-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.input-inline input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

/* ===== 表格 ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.table th, .table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}
.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}
.table tr:hover {background: var(--gray-50);}

/* ===== 固定返回按钮 ===== */
.back-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
}

/* ===== 游戏网格 ===== */
.game-container {
    max-width: 500px;
    margin: 0 auto;
}
.game-grid {
    display: grid;
    gap: 8px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 15px;
    box-shadow: var(--shadow-md);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .page-header h1 {font-size: 1.5rem;}
    .card {padding: 18px;}
    .btn {padding: 8px 16px;font-size: 0.9rem;}
}

/* ===== 单选网格 ===== */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}
.radio-item:hover {border-color: var(--primary);}
.radio-item input {display: none;}
.radio-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(67,97,238,0.1) 0%, rgba(63,55,201,0.1) 100%);
}
.radio-item.selected .radio-label {color: var(--primary);font-weight: 600;}
.radio-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.2rem;
}
.radio-label {font-size: 0.95rem;color: var(--gray-800);}

/* ===== 复选框包装 ===== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}
.checkbox-wrapper:hover {background: var(--gray-200);}
.checkbox-wrapper input {
    width: 22px;
    height: 22px;
    accent-color: var(--primary);
    cursor: pointer;
}
.checkbox-wrapper span {
    font-size: 1rem;
    color: var(--gray-800);
}
