/**
 * 电子病历表单样式
 * 易医扁鹊 - 三驾马车平台
 * Version: 1.0
 */

/* ============================================ */
/* 弹窗容器 */
/* ============================================ */
.medical-record-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.medical-record-modal.active {
    display: flex;
}

/* 遮罩层 */
.medical-record-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

/* 主容器 */
.medical-record-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================ */
/* 弹窗头部 */
/* ============================================ */
.medical-record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.medical-record-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-medical::before {
    content: "📋";
    font-size: 28px;
}

.medical-record-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.medical-record-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================ */
/* 进度条 - 🔧 隐藏进度条 */
/* ============================================ */
.medical-record-progress {
    display: none !important;
}

/* ============================================ */
/* 完整度条 */
/* ============================================ */
.completeness-bar {
    padding: 20px 32px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e0e0e0;
}

.completeness-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.completeness-value {
    color: #667eea;
}

.completeness-progress {
    width: 100%;
    height: 12px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.completeness-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.completeness-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.completeness-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* ============================================ */
/* 表单内容区域 */
/* ============================================ */
.medical-record-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* 滚动条样式 */
.medical-record-content::-webkit-scrollbar {
    width: 8px;
}

.medical-record-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.medical-record-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.medical-record-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* 步骤容器 - 🔧 改为全部显示 */
.form-step {
    display: block !important;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid #e0e0e0;
}

.form-step:last-child {
    border-bottom: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* ============================================ */
/* 表单元素 */
/* ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group.required label::after {
    content: " *";
    color: #ff6b6b;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.error-message {
    display: block;
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 4px;
    min-height: 18px;
}

/* 标签按钮组 */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.tag-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tag-btn.selected {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
}

.radio-label span {
    font-size: 14px;
    color: #333;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: #333;
}

/* 女性专项提示 */
.female-only-notice {
    text-align: center;
    padding: 60px 20px;
}

.female-only-notice svg {
    margin-bottom: 20px;
}

.female-only-notice h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 12px;
}

.female-only-notice p {
    font-size: 14px;
    color: #666;
}

/* ============================================ */
/* 底部按钮 - 🔧 只显示保存按钮 */
/* ============================================ */
.medical-record-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* 🔧 隐藏上一步/下一步/跳过按钮 */
#prevStepBtn,
#nextStepBtn,
#skipStepBtn {
    display: none !important;
}

/* 🔧 强制显示保存按钮 */
#submitBtn {
    display: inline-block !important;
}

.btn-primary,
.btn-secondary,
.btn-skip {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f5f7ff;
}

.btn-skip {
    background: transparent;
    color: #999;
    border: 2px solid #e0e0e0;
}

.btn-skip:hover {
    color: #667eea;
    border-color: #667eea;
}

/* ============================================ */
/* 响应式设计 */
/* ============================================ */
@media (max-width: 768px) {
    .medical-record-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .medical-record-header {
        padding: 20px 20px;
    }

    .medical-record-title {
        font-size: 20px;
    }

    .medical-record-progress {
        padding: 16px 20px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-label {
        font-size: 12px;
    }

    .completeness-bar {
        padding: 16px 20px;
    }

    .medical-record-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step-title {
        font-size: 18px;
    }

    .step-desc {
        font-size: 13px;
    }

    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 12px;
    }

    .medical-record-footer {
        padding: 16px 20px;
        flex-wrap: wrap;
    }

    .btn-primary,
    .btn-secondary,
    .btn-skip {
        padding: 10px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .medical-record-progress {
        padding: 12px 16px;
    }

    .step-label {
        display: none;
    }

    .progress-line {
        margin-bottom: 0;
    }

    .completeness-bar {
        padding: 12px 16px;
    }

    .medical-record-content {
        padding: 16px;
    }

    .medical-record-footer {
        gap: 8px;
    }

    .btn-skip {
        order: -1;
        width: 100%;
    }
}

/* ============================================ */
/* 加载动画 */
/* ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================ */
/* 辅助类 */
/* ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ============================================ */
/* 个人中心病历卡片样式 */
/* ============================================ */
.medical-record-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.medical-record-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.medical-record-card .card-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.medical-record-card .record-status {
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 14px;
}

.medical-record-card .card-body {
    padding: 24px;
}

.completeness-info {
    margin-bottom: 20px;
}

.completeness-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.completeness-percentage {
    font-weight: 600;
    color: #667eea;
}

.completeness-bar-small {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.completeness-fill-small {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.completeness-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.record-actions {
    display: flex;
    gap: 12px;
}

.btn-edit-record,
.btn-view-record {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-edit-record {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-edit-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-view-record {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-view-record:hover {
    background: #f5f7ff;
}

.medical-record-card .card-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.record-tip {
    margin: 0;
    font-size: 13px;
    color: #666;
}

