/* =================================================== */
/* 中医诊断弹窗专用样式文件 - zhongyi_tanchuang.css    */
/* 创建时间：2024年1月                              */
/* 功能：中医诊断结果弹窗的所有样式                  */
/* =================================================== */

/* ==================== 核心弹窗样式 ==================== */

/* 弹窗遮罩层 - 全屏半透明背景 */
.zhongyi-tanchuang {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* 默认隐藏，JS控制显示 */
    z-index: 1000;
    animation: zhongyi-fade-in 0.3s ease;
}

/* 弹窗内容容器 */
.zhongyi-tanchuang-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

/* ==================== 标题样式 ==================== */

/* 标题栏容器 - 透明背景，仅用于定位 */
.zhongyi-tanchuang-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    pointer-events: none; /* 允许点击穿透到下方内容 */
}

/* 标题文字 - 绿色背景只包裹文字，居中悬浮 */
.zhongyi-tanchuang-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    letter-spacing: 0.5px;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    pointer-events: auto; /* 恢复点击事件 */
    transition: all 0.3s ease;
}

/* 标题悬停效果 */
.zhongyi-tanchuang-title:hover {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* 关闭按钮 - 右侧悬浮 */
.zhongyi-tanchuang-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 1002;
    pointer-events: auto;
}

.zhongyi-tanchuang-close-btn:hover {
    background: white;
    color: #475569;
    transform: scale(1.05);
    border-color: #cbd5e1;
}

.zhongyi-tanchuang-close-btn:active {
    transform: scale(0.95);
}

/* ==================== 内容区域样式 ==================== */

/* 内容主体 - 顶部空间减少 */
.zhongyi-tanchuang-body {
    flex: 1;
    padding: 40px 20px 20px; /* 顶部40px，为悬浮标题留出空间 */
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* 诊断结果卡片容器 */
.zhongyi-jieguo-container {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* 诊断结果文字内容 */
.zhongyi-jieguo-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 重点内容强调 */
.zhongyi-jieguo-text strong {
    color: #059669;
    font-weight: 600;
}

.zhongyi-jieguo-text em {
    color: #f59e0b;
    font-style: italic;
}

/* 诊断结果结束标志 */
.zhongyi-jieguo-end {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px dotted #d1d5db;
    font-style: italic;
}

/* ==================== 按钮区域样式 ==================== */

/* 按钮容器 */
.zhongyi-tanchuang-footer {
    padding: 20px;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* 按钮组布局 */
.zhongyi-btn-group {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮基础样式 */
.zhongyi-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
    flex: 1;
    max-width: 200px;
    position: relative;
    overflow: hidden;
}

/* 按钮悬停效果 */
.zhongyi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* 按钮激活效果 */
.zhongyi-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ==================== 按钮颜色变体 ==================== */

/* 复制结果按钮 - 蓝色系 */
.fuzhi-btn {
    background-color: #3b82f6;
    color: white;
}

.fuzhi-btn:hover {
    background-color: #2563eb;
}

/* 生成诊断书按钮 - 绿色系 */
.zhenduanshu-btn {
    background-color: #10b981;
    color: white;
}

.zhenduanshu-btn:hover {
    background-color: #059669;
}

/* 最简诊断书按钮 - 橙色系 */
.zuijian-btn {
    background-color: #f97316;
    color: white;
}

.zuijian-btn:hover {
    background-color: #ea580c;
}

/* 关闭按钮 - 灰色系 */
.close-btn {
    background-color: #6b7280;
    color: white;
}

.close-btn:hover {
    background-color: #4b5563;
}

/* ==================== 动画效果 ==================== */

/* 淡入动画 */
@keyframes zhongyi-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 上滑动画 */
@keyframes zhongyi-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮波纹效果 */
.zhongyi-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.zhongyi-btn:focus:not(:active)::after {
    animation: zhongyi-ripple 1s ease-out;
}

@keyframes zhongyi-ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
    .zhongyi-tanchuang-header {
        padding: 14px 16px;
    }
    
    .zhongyi-tanchuang-title {
        font-size: 1.1rem;
        padding: 7px 18px;
        border-radius: 18px;
        top: 14px;
    }
    
    .zhongyi-tanchuang-close-btn {
        top: 14px;
        right: 16px;
    }
    
    .zhongyi-tanchuang-body {
        padding: 35px 16px 16px;
    }
    
    .zhongyi-jieguo-container {
        padding: 18px;
        border-radius: 10px;
    }
    
    .zhongyi-jieguo-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .zhongyi-tanchuang-footer {
        padding: 16px;
    }
    
    .zhongyi-btn-group {
        gap: 10px;
    }
    
    .zhongyi-btn {
        min-width: 120px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* 手机设备 (480px以下) */
@media (max-width: 480px) {
    .zhongyi-tanchuang-header {
        padding: 12px 14px;
    }
    
    .zhongyi-tanchuang-title {
        font-size: 1rem;
        padding: 6px 16px;
        border-radius: 16px;
        top: 12px;
    }
    
    .zhongyi-tanchuang-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
        top: 12px;
        right: 14px;
    }
    
    .zhongyi-tanchuang-body {
        padding: 30px 12px 12px;
    }
    
    .zhongyi-jieguo-container {
        padding: 16px;
        border-radius: 8px;
    }
    
    .zhongyi-jieguo-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .zhongyi-jieguo-end {
        font-size: 0.8rem;
        margin-top: 20px;
        padding-top: 16px;
    }
    
    .zhongyi-btn-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .zhongyi-btn {
        min-width: 100%;
        max-width: 100%;
        padding: 12px;
    }
}

/* 小屏幕手机 (360px以下) */
@media (max-width: 360px) {
    .zhongyi-tanchuang-title {
        font-size: 0.95rem;
        padding: 5px 14px;
    }
    
    .zhongyi-jieguo-text {
        font-size: 0.85rem;
    }
    
    .zhongyi-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* 深色模式支持（预留） */
@media (prefers-color-scheme: dark) {
    .zhongyi-tanchuang-content {
        background-color: #1f2937;
    }
    
    .zhongyi-jieguo-container {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .zhongyi-jieguo-text {
        color: #e5e7eb;
    }
    
    .zhongyi-tanchuang-footer {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .zhongyi-tanchuang-close-btn {
        background: #4b5563;
        border-color: #6b7280;
        color: #e5e7eb;
    }
}

/* ==================== 辅助类 ==================== */

/* 隐藏元素 */
.zhongyi-hidden {
    display: none !important;
}

/* 禁用状态 */
.zhongyi-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* 加载状态 */
.zhongyi-loading {
    position: relative;
    color: transparent !important;
}

.zhongyi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: zhongyi-spin 0.8s linear infinite;
}

@keyframes zhongyi-spin {
    to { transform: rotate(360deg); }
}

/* 滚动条美化 */
.zhongyi-tanchuang-body::-webkit-scrollbar {
    width: 6px;
}

.zhongyi-tanchuang-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.zhongyi-tanchuang-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.zhongyi-tanchuang-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}