/* 通用工具类 */
.content-auto {
    content-visibility: auto;
}

/* 表单相关样式 */
.form-focus {
    transition: all 0.3s ease;
}
.form-focus:focus {
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}
.form-input:focus {
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

/* 首页表单网格布局 */
.form-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
}

.form-field {
    flex: 1 1 calc(50% - 0.375rem) !important; /* 移动端每行2个 */
    min-width: 0 !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .form-grid {
        gap: 1.5rem !important;
    }
    
    .form-field {
        flex: 1 1 calc(33.333% - 1rem) !important; /* 桌面端每行3个 */
    }
}

/* 首页卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-0.25rem);
}

.gradient-bg {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.9), rgba(16, 185, 129, 0.9));
}

/* 病史采集页面样式 */
.video-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    height: auto;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container img,
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频区域容器 */
.video-area {
    display: flex;
    flex: 1;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    min-height: 200px; /* 确保最小高度 */
}

/* 控制按钮区域 */
.controlbox {
    flex-shrink: 0;
    min-height: 40px;
    z-index: 10;
    position: relative;
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.bubble-left {
    position: relative;
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.75rem;
    border-top-left-radius: 0;
    max-width: 80%;
}

.bubble-left::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1rem;
    transform: translateX(-0.5rem);
    border: 4px solid transparent;
    border-right-color: #f3f4f6;
}

.bubble-right {
    position: relative;
    background-color: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: 0.75rem;
    border-top-right-radius: 0;
    max-width: 80%;
}

.bubble-right::before {
    content: "";
    position: absolute;
    right: 0;
    top: 1rem;
    transform: translateX(0.5rem);
    border: 4px solid transparent;
    border-left-color: rgba(59, 130, 246, 0.1);
}

/* 特别提醒样式增强 */
.warning-banner {
    animation: warning-pulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

@keyframes warning-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
        transform: scale(1.02);
    }
}

.warning-icon {
    animation: shake 1.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* 语音识别加载动画 */
.speech-loading-dots {
    animation: wave 1.4s ease-in-out infinite;
}

.speech-loading-dots:nth-child(2) {
    animation-delay: 0.1s;
}

.speech-loading-dots:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-10px);
    }
}

/* 摄像头关闭提醒动画 */
.camera-off-overlay {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.camera-off-icon {
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* 移动端控制按钮响应式 */
@media (max-width: 394px) {
    .controlbox button span {
        display: none;
    }
}

/* 辅助检查页面样式 */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.upload-area:hover {
    border-color: #3b82f6;
}

.result-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
.result-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 报告页面样式 */
.report-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
}

.report-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.vital-sign {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.vital-sign-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3b82f6;
}

.bg-optimal {
    background-color: #f0fdf4;
    color: #166534;
}

.bg-suboptimal {
    background-color: #fefce8;
    color: #a16207;
}

.bg-poor {
    background-color: #fef2f2;
    color: #991b1b;
}

/* 预约页面样式 */
.doctor-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}
.doctor-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.doctor-card.selected {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.time-slot {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.time-slot:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.time-slot.selected {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.time-slot.disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 500;
}

.step-active {
    background-color: #3b82f6;
    color: white;
}

.step-completed {
    background-color: #10b981;
    color: white;
}

.step-inactive {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* medical-history_2.html 专用样式 */
.video-call-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chat-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.message-bubble {
    max-width: 85%;
    word-wrap: break-word;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.control-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 1);
    color: #333;
}

.control-button:hover {
    transform: scale(1.1);
}

.control-button.active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.control-button.disabled {
    background: rgba(239, 68, 68, 0.8);
    color: white;
}

.video-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-switch:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.patient-video {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.patient-video.main {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

.doctor-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-video.small {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    margin: 2px 0;
    flex-shrink: 0;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { 
    animation-delay: -0.32s; 
}
.typing-dot:nth-child(2) { 
    animation-delay: -0.16s; 
}

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.qa-item {
    transition: all 0.3s ease;
}

.qa-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.edit-mode {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #07c160 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* 自适应问答区域样式 */
#currentQA {
    transition: transform 0.3s ease, height 0.3s ease;
}

/* 滚动条样式 */
#currentQA .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

#currentQA .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#currentQA .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

#currentQA .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 患者回复自适应宽度和高度样式 */
.patient-answer {
    width: fit-content;
    height: auto;
    min-width: 30px;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: break-word;
    hyphens: auto;
    display: inline-block;
    vertical-align: top;
}

/* 确保编辑模式下的textarea也能自适应高度 */
.edit-mode textarea {
    width: 100%;
    height: auto;
    min-height: 60px;
    resize: vertical;
    box-sizing: border-box;
    color: #1f2937 !important;
    font-size: 14px;
    line-height: 1.4;
} 