/* IVF/ICSI妊娠预测工具 - 样式表 */

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

/* 变量定义 */
:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --secondary-color: #757575;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #f44336;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

/* 页面基础 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页头 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: white;
    position: relative;
}

.back-button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) translateX(-2px);
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* 响应式布局 */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 区块标题 */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* 输入区域 */
.input-section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

/* 表单组 */
.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group .unit {
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 4px;
}

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

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group input.error {
    border-color: var(--danger-color);
    background-color: #ffebee;
}

.range-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
    background-color: #616161;
}

.icon {
    width: 18px;
    height: 18px;
}

/* 结果区域 */
.result-section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.result-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* 占位符 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 概率显示 */
.probability-display {
    text-align: center;
    margin: 20px 0;
}

.probability-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.probability-unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.probability-label {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 进度条 */
.progress-container {
    margin: 24px 0;
}

.progress-bar {
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #64B5F6);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-fill.low-risk {
    background: linear-gradient(90deg, var(--success-color), #81C784);
}

.progress-fill.medium-risk {
    background: linear-gradient(90deg, var(--warning-color), #FFB74D);
}

.progress-fill.high-risk {
    background: linear-gradient(90deg, var(--danger-color), #EF5350);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 风险评估 */
.risk-assessment {
    text-align: center;
    margin: 24px 0;
    padding: 16px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.risk-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.risk-badge.low-risk {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.risk-badge.medium-risk {
    background-color: #FFF3E0;
    color: #EF6C00;
}

.risk-badge.high-risk {
    background-color: #FFEBEE;
    color: #C62828;
}

.risk-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 临床建议 */
.clinical-advice {
    margin-top: 24px;
    padding: 16px;
    background-color: #E3F2FD;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.clinical-advice h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.clinical-advice p {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    margin-top: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.disclaimer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    justify-content: center;
}

.warning-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--warning-color);
}

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

.result-content {
    animation: fadeIn 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 20px 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .input-section,
    .result-section {
        padding: 16px;
    }
    
    .probability-value {
        font-size: 3rem;
    }
    
    .button-group {
        flex-direction: column;
    }
}
