/* 文件：css/ai_wenan_tiaojian.css - 修正版（√勾选） */

/* =================================================== */
/* AI文案条件弹窗样式 - 完全套用中医弹窗滑动方案         */
/* 包含：输入框区域 + 选项区域 + 操作按钮                */
/* =================================================== */

/* 弹窗容器 - 完全套用中医弹窗结构 */
.ai-wenan-tiaojian-tanchuang {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10050; /* 高于其他弹窗 */
}

/* 显示状态 */
.ai-wenan-tiaojian-tanchuang.show .ai-wenan-tiaojian-content {
    transform: translateY(0);
    opacity: 1;
}

/* 遮罩层 - 与中医弹窗相同 */
.ai-wenan-tiaojian-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: ai-wenan-fade-in 0.3s ease;
}

@keyframes ai-wenan-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗内容容器 - 滑动方案 */
.ai-wenan-tiaojian-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    background-color: #ffffff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* 标题栏 - 固定顶部 */
.ai-wenan-tiaojian-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.ai-wenan-tiaojian-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1.4;
}

.ai-wenan-tiaojian-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    font-weight: normal;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.ai-wenan-tiaojian-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 内容主体 - 可滑动区域 */
.ai-wenan-tiaojian-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 输入框区域 */
.input-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.label-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* 文案输入框 */
.wenan-input-textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    background-color: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    resize: vertical;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wenan-input-textarea:focus {
    outline: none;
    border-color: #4dabf7;
    background-color: #f8fafc;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

.wenan-input-textarea::placeholder {
    color: #9ca3af;
    opacity: 0.8;
}

.input-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 8px;
    padding-left: 4px;
    font-style: italic;
}

/* 选项区块 */
.option-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 单选按钮选项组 */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    position: relative;
}

.radio-option:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-label {
    font-size: 1rem;
    color: #495057;
    margin-left: 35px; /* 为√预留空间 */
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

/* 🔧 修正：√勾选指示器 */
.radio-option:before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.radio-option:hover:before {
    border-color: #868e96;
}

/* 选中状态：显示√ */
.radio-option:has(input[type="radio"]:checked):before {
    background: #4dabf7;
    border-color: #4dabf7;
}

.radio-option:has(input[type="radio"]:checked):after {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-option:has(input[type="radio"]:checked) {
    background: #e7f5ff;
    border-color: #4dabf7;
    box-shadow: 0 2px 6px rgba(77, 171, 247, 0.15);
}

.radio-option:has(input[type="radio"]:checked) .radio-label {
    color: #1971c2;
    font-weight: 600;
}

/* 两个单选组可以同时选择 - 通过不同的name属性实现 */

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cancel-btn,
.generate-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    letter-spacing: 0.5px;
}

.cancel-btn {
    background: #f1f3f5;
    color: #495057;
    border: 2px solid #dee2e6;
}

.cancel-btn:hover {
    background: #e9ecef;
    color: #343a40;
    border-color: #ced4da;
}

.cancel-btn:active {
    transform: translateY(1px);
}

.generate-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.generate-btn:hover {
    background: linear-gradient(135deg, #0da271 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.generate-btn:disabled {
    background: #c3e6cb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 底部提示 */
.bottom-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #fff3cd;
    border-radius: 12px;
    border: 1px solid #ffecb5;
    margin-top: 20px;
}

.hint-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.hint-text {
    font-size: 0.95rem;
    color: #856404;
    line-height: 1.4;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .ai-wenan-tiaojian-content {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
    
    .ai-wenan-tiaojian-header {
        padding: 16px;
    }
    
    .ai-wenan-tiaojian-title {
        font-size: 1.1rem;
    }
    
    .ai-wenan-tiaojian-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }
    
    .ai-wenan-tiaojian-body {
        padding: 16px;
    }
    
    .input-section,
    .option-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .wenan-input-textarea {
        min-height: 90px;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .radio-option {
        padding: 12px 14px;
    }
    
    .radio-label {
        font-size: 0.95rem;
        margin-left: 32px;
    }
    
    .radio-option:before {
        width: 18px;
        height: 18px;
        left: 14px;
    }
    
    .radio-option:after {
        left: 14px;
        font-size: 13px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
        margin: 24px 0 16px;
    }
    
    .cancel-btn,
    .generate-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .bottom-hint {
        padding: 14px;
    }
    
    .hint-text {
        font-size: 0.9rem;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .ai-wenan-tiaojian-content {
        max-width: 600px;
        max-height: 85vh;
        left: 50%;
        transform: translate(-50%, 100%);
        border-radius: 16px;
    }
    
    .ai-wenan-tiaojian-tanchuang.show .ai-wenan-tiaojian-content {
        transform: translate(-50%, 20px);
    }
}

/* 滚动条样式 */
.ai-wenan-tiaojian-body::-webkit-scrollbar {
    width: 6px;
}

.ai-wenan-tiaojian-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-wenan-tiaojian-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ai-wenan-tiaojian-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 输入框自动调整高度 */
.wenan-input-textarea {
    min-height: 100px;
    max-height: 200px;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .radio-option {
        padding: 16px;
        min-height: 56px;
    }
    
    .cancel-btn,
    .generate-btn {
        min-height: 54px;
    }
    
    .wenan-input-textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
}
/* 文件：css/ai_wenan_tiaojian.css */