/* 性激素工具医学风格CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f7fafc;
    color: #2d3748;
    line-height: 1.5;
    font-size: 14px;
    padding: 12px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 10px;
}

/* 头部 */
.header {
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 8px;
    text-align: center;
}

.header p {
    color: #718096;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.warning {
    background-color: #fffaf0;
    border-left: 3px solid #d69e2e;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #744210;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 12px;
    background: none;
    border: none;
    font-size: 14px;
    color: #718096;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-align: center;
}

.tab:hover {
    color: #2c5282;
}

.tab.active {
    color: #2c5282;
    border-bottom-color: #2c5282;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

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

/* 面板 */
.panel {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 16px;
}

.panel h2 {
    font-size: 16px;
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

/* 表单 */
.input-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.reference-range {
    font-size: 12px;
    color: #718096;
    font-weight: normal;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    background-color: #ffffff;
}

.input-row input:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 1px #2c5282;
}

.unit {
    min-width: 50px;
    color: #718096;
    font-size: 13px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    width: 16px;
    height: 16px;
}

.checkbox-group label {
    font-weight: normal;
    color: #718096;
    font-size: 13px;
}

/* 按钮 */
.btn {
    padding: 8px 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: #2c5282;
    color: white;
    border-color: #2c5282;
}

.btn-primary:hover {
    background-color: #2b6cb0;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
    border-color: #cbd5e0;
}

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

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* 模式网格 */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.pattern-card {
    border: 1px solid #e2e8f0;
    padding: 12px;
    background-color: #ffffff;
    cursor: pointer;
}

.pattern-card:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.pattern-card.active {
    border-color: #2c5282;
    background-color: #ebf8ff;
}

.pattern-title {
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 6px;
    font-size: 14px;
}

.pattern-desc {
    color: #718096;
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pattern-values {
    font-size: 11px;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    background-color: #f7fafc;
    padding: 4px 6px;
    line-height: 1.3;
}

/* 结果容器 */
.result-container {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-top: 16px;
    display: none;
}

.result-container.show {
    display: block;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c5282;
}

.result-status {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 0;
}

.status-normal {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-warning {
    background-color: #feebc8;
    color: #744210;
}

.status-danger {
    background-color: #fed7d7;
    color: #742a2a;
}

/* 结果网格 */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.result-item {
    padding: 12px;
    background-color: #f7fafc;
    border-left: 3px solid #2c5282;
    font-size: 13px;
}

.result-item h4 {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    font-size: 13px;
}

.interpretation-note {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    font-style: italic;
}

/* 解读和建议 */
.interpretation {
    background-color: #ebf8ff;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #bee3f8;
}

.interpretation h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 10px;
}

.recommendations {
    background-color: #fffaf0;
    padding: 16px;
    border: 1px solid #feebc8;
}

.recommendations h3 {
    font-size: 14px;
    font-weight: 600;
    color: #744210;
    margin-bottom: 10px;
}

/* 表格 */
.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 16px;
}

.reference-table th,
.reference-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.reference-table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2c5282;
}

.reference-table tr:hover {
    background-color: #f7fafc;
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2c5282;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 12px;
}

.back-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2c5282;
    color: white;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #2c5282;
}

.back-link:hover {
    background-color: #2b6cb0;
}

.disclaimer {
    background-color: #fffaf0;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid #feebc8;
    font-size: 12px;
    color: #744210;
}

/* 警告框 */
.alert-danger {
    background-color: #fed7d7;
    color: #742a2a;
    padding: 10px 12px;
    margin: 10px 0;
    border-left: 3px solid #e53e3e;
}

.alert-warning {
    background-color: #feebc8;
    color: #744210;
    padding: 10px 12px;
    margin: 10px 0;
    border-left: 3px solid #d69e2e;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pattern-grid {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* 表格横向滚动条 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 16px;
    }
    
    .table-responsive table {
        min-width: 600px; /* 确保表格最小宽度，触发滚动 */
    }
}