/* AI图片处理页面 - 使用admin_cases样式 */

/* 导入Tailwind CSS基础样式 */
@import url('	https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css');

/* 自定义样式变量 */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #50E3C2;
    --accent-color: #8E44AD;
    --blue-500: #3B82F6;
    --blue-600: #2563EB;
    --indigo-500: #6366F1;
    --indigo-600: #4F46E5;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 页面布局 - 使用admin_cases样式 */
.page-header {
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--indigo-600) 100%);
    opacity: 0.9;
}

.page-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: white;
    margin: 0;
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* 表单容器 - 使用admin_cases样式 */
.form-wrapper {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.form-wrapper:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* 表单组样式 - 使用admin_cases样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.required {
    color: #EF4444;
    margin-right: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: white;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.form-control:hover {
    box-shadow: var(--shadow-md);
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 文本区域样式 */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* 上传区域样式 */
.upload-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--background-color);
}

.upload-container:hover,
.upload-container.highlight {
    border-color: var(--primary-color);
    background-color: rgba(74, 144, 226, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.hidden {
    display: none;
}

/* 预览区域样式 */
.preview-container {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--background-color);
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.remove-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.remove-image-btn:hover {
    background-color: var(--error-color);
    transform: scale(1.1);
}

/* ========== 手机端导航栏样式 ========== */
.mobile-nav-container {
    display: none; /* 默认隐藏，只在手机端显示 */
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

/* 桌面端隐藏移动端导航栏 */
@media (min-width: 769px) {
    .mobile-nav-container {
        display: none !important;
    }
}

.mobile-nav-wrapper {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.mobile-nav-wrapper:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.mobile-nav-header {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    padding: 1rem;
    text-align: center;
}

.mobile-nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-content {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6B7280;
    text-align: center;
    min-height: 60px;
    justify-content: center;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}

.mobile-nav-item:hover {
    background: #F3F4F6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-nav-item.active {
    background: linear-gradient(135deg, #3B82F6, #4F46E5);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.mobile-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

.mobile-nav-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 按钮样式 - 使用admin_cases样式 */
.primary-btn {
    width: 100%;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--blue-500), var(--indigo-600));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, var(--blue-600), var(--indigo-700));
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px) scale(1.02);
}

.primary-btn:active:not(.disabled) {
    transform: translateY(0) scale(0.98);
}

.primary-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

/* 处理中弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: scale(1);
}

.loading-spinner {
    margin-bottom: 1rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

.modal-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateX(100%);
    transition: var(--transition);
    max-width: 300px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.info {
    background-color: var(--primary-color);
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-wrapper {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .page-header {
        padding: 1.5rem 1rem;
        margin: 0 1rem 2rem 1rem;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .options-group {
        grid-template-columns: 1fr 1fr;
    }
    
    .upload-container {
        padding: 1.5rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .options-group {
        grid-template-columns: 1fr;
    }
    
    .primary-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* 左右布局容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.col-md-6 {
    flex: 1;
    min-width: 0; /* 防止flex子项溢出 */
}

/* 对话容器样式 - 对齐AI图片处理方框 */
.chat-container {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

/* 对话头部 - 使用与页面标题相同的样式 */
.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #3B5CF0;
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    text-align: center;
}

.chat-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.chat-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 对话区域 */
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 欢迎消息 */
.chat-welcome {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.welcome-message {
    text-align: center;
    color: var(--text-secondary);
}

.welcome-message i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.welcome-message p {
    font-size: 1rem;
    margin: 0;
}

/* 对话消息样式 */
.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message.ai {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.chat-message.typing {
    background: #e9ecef;
    color: var(--text-secondary);
    font-style: italic;
}

/* 消息动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 输入区域 */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    resize: none;
    font-family: inherit;
    transition: var(--transition);
    min-height: 44px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.send-btn:disabled {
    background: var(--text-disabled);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== 桌面端样式 ========== */
@media (min-width: 1025px) {
    .mobile-nav {
        display: none;
    }
    
    .row {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }
    
    .col-md-6 {
        flex: 1;
        min-width: 0;
    }
    
    .chat-container {
        height: 600px;
    }
}

/* ========== 平板端样式 ========== */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
    
    .row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .col-md-6 {
        width: 100%;
    }
    
    .chat-container {
        height: 500px;
        max-width: none;
    }
}

/* ========== 移动端样式 ========== */
@media (max-width: 768px) {
    /* 显示手机端导航栏 */
    .mobile-nav-container {
        display: block !important;
    }
    
    /* 隐藏页面标题在移动端 */
    .page-header {
        display: none;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .row {
        gap: 1rem;
        flex-direction: column;
    }
    
    /* 移动端默认隐藏所有section */
    .image-process-section,
    .ai-chat-section {
        display: none;
        width: 100%;
    }
    
    /* 显示当前激活的section */
    .image-process-section.active,
    .ai-chat-section.active {
        display: block;
    }
    
    .chat-container {
        height: 400px;
        max-width: none;
    }
    
    .chat-header {
        padding: 1rem;
        text-align: center;
    }
    
    .chat-header h3 {
        font-size: 1.1rem;
    }
    
    .chat-input-container {
        padding: 0.75rem;
    }
    
    .input-wrapper {
        gap: 0.5rem;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    /* 移动端表单样式调整 */
    .form-wrapper {
        padding: 1.5rem;
        margin: 0;
    }
    
    .upload-container {
        padding: 1.5rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    /* 移动端导航栏优化 */
    .mobile-nav-container {
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }
    
    .mobile-nav-wrapper {
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-header {
        padding: 0.75rem;
    }
    
    .mobile-nav-title {
        font-size: 1rem;
    }
    
    .mobile-nav-content {
        padding: 0.75rem;
        gap: 0.25rem;
    }
    
    .mobile-nav-item {
        padding: 0.75rem 0.5rem;
        min-height: 50px;
        border-radius: 0.375rem;
    }
    
    .mobile-nav-item i {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
    }
    
    .mobile-nav-item span {
        font-size: 0.75rem;
    }
    
    /* 移动端section切换动画 */
    .image-process-section,
    .ai-chat-section {
        transition: all 0.3s ease;
    }
    
    .image-process-section:not(.active),
    .ai-chat-section:not(.active) {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
    }
    
    .image-process-section.active,
    .ai-chat-section.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}
