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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #f5f7fa;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ============ 头部 ============ */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 36px 32px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.header .subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: 8px;
}

.header .desc {
    font-size: 14px;
    opacity: 0.8;
}

/* ============ 网格布局 ============ */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    padding: 28px;
}

@media (max-width: 960px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ 表单区 ============ */
.form-section,
.result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section h2 {
    font-size: 20px;
    color: #2c3e50;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
    margin-bottom: 8px;
}

.form-group {
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}

.form-group:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 12px;
}

.form-group .hint {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 400;
}

input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    color: #2c3e50;
    background: #fafbfc;
    transition: all 0.2s;
}

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

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"][type=number] {
    -moz-appearance: textfield;
}

/* ============ 单选按钮组 ============ */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

#killip-group {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 480px) {
    #killip-group {
        grid-template-columns: 1fr;
    }
}

.radio-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f5f7fa;
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
    min-height: 60px;
}

.radio-label strong {
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 2px;
}

.radio-label small {
    font-size: 12px;
    color: #7f8c8d;
}

.radio-option:hover .radio-label {
    background: #eef2f7;
    border-color: #c5d0e0;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.radio-option input[type="radio"]:checked + .radio-label strong,
.radio-option input[type="radio"]:checked + .radio-label small {
    color: white;
}

/* ============ 单项得分显示 ============ */
.score-display {
    margin-top: 12px;
    padding: 6px 14px;
    background: #f0f3f8;
    color: #6c7a89;
    border-radius: 6px;
    font-size: 13px;
    display: inline-block;
    font-weight: 600;
}

.score-display.has-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ============ 按钮 ============ */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #e0e6ed;
    color: #34495e;
}

.btn-secondary:hover {
    background: #c5d0e0;
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ============ 结果卡片 ============ */
.result-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

.result-card h2 {
    font-size: 20px;
    color: #2c3e50;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
    margin-bottom: 20px;
}

.total-score {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecf3 100%);
    border-radius: 10px;
    margin-bottom: 16px;
}

.total-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-value {
    font-size: 56px;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.total-range {
    font-size: 12px;
    color: #95a5a6;
}

.risk-level {
    text-align: center;
    padding: 18px;
    background: #f8f9fb;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 4px solid #95a5a6;
    transition: all 0.3s;
}

.risk-level.low {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
}

.risk-level.medium {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: #ffc107;
}

.risk-level.high {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
}

.risk-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.risk-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.risk-level.low .risk-value { color: #28a745; }
.risk-level.medium .risk-value { color: #d39e00; }
.risk-level.high .risk-value { color: #dc3545; }

.mortality-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.mortality-item {
    background: #f8f9fb;
    padding: 14px 12px;
    border-radius: 10px;
    text-align: center;
}

.mortality-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.mortality-value {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    font-variant-numeric: tabular-nums;
}

.recommendation {
    background: #f0f4f8;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #667eea;
}

.recommendation h3 {
    font-size: 14px;
    color: #34495e;
    margin-bottom: 8px;
}

.recommendation p {
    font-size: 13px;
    color: #5a6c7d;
    line-height: 1.6;
}

/* ============ 信息卡片 ============ */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.info-card h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e6ed;
}

.info-card p {
    font-size: 13px;
    color: #5a6c7d;
    margin-bottom: 10px;
    line-height: 1.6;
}

.info-card ul {
    list-style: none;
    margin: 10px 0;
}

.info-card li {
    font-size: 13px;
    color: #5a6c7d;
    padding: 4px 0;
    border-bottom: 1px dashed #e0e6ed;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li strong {
    color: #2c3e50;
}

/* ============ 页脚 ============ */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 24px 32px;
    text-align: center;
    font-size: 12px;
    line-height: 1.7;
}

.footer p {
    margin-bottom: 8px;
}

.footer p:last-child {
    margin-bottom: 0;
}

.footer .disclaimer {
    color: #f39c12;
    font-weight: 600;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #4a5a6a;
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }
    .header {
        padding: 24px 16px;
    }
    .header h1 {
        font-size: 24px;
    }
    .main-grid {
        padding: 16px;
        gap: 16px;
    }
    .form-group {
        padding: 14px 16px;
    }
    .total-value {
        font-size: 44px;
    }
    .risk-value {
        font-size: 20px;
    }
}
