/* ============================================================
   AI 方案设计工具专属样式
   来源：原 aigj/ai_plan.php 内联 <style>，2026-08-11 外置为可缓存文件
   ============================================================ */
/* ===== AI设计工具专属样式 ===== */
:root {
    --ai-purple: #2c80ff;
    --ai-purple-dark: #1a5fcc;
    --ai-purple-light: #eaf2ff;
    --ai-blue: var(--primary);
    --ai-gradient: linear-gradient(135deg, var(--primary), #1a5fd4);
}

/* 主布局 */
.design-wrap {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--column-gap, 24px);
    align-items: start;
    margin-top: var(--module-gap) !important;
}
/* 大屏（≥1200px）*/
@media (min-width: 1200px) {
    .design-wrap { grid-template-columns: 400px 1fr; gap: calc(var(--column-gap, 24px) + 4px); }
}
/* 中等屏幕（900px~1199px）*/
@media (max-width: 1199px) and (min-width: 901px) {
    .design-wrap { grid-template-columns: 320px 1fr; gap: 16px; }
}
/* 移动端（≤900px）*/
@media (max-width: 900px) {
    .design-wrap { grid-template-columns: 1fr; gap: 16px; }
}

/* 卡片通用 */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200, var(--gray-200));
    
    box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,0.1));
    overflow: hidden;
}

/* ===== 左侧控制面板 ===== */
.control-panel { padding: 0; }
.panel-header {
    background: var(--ai-gradient);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.panel-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.panel-header .panel-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.2);
    
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}

.panel-body { padding: 22px; }

/* 模式切换 */
.mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--gray-100);
    
    padding: 4px;
    margin-bottom: 20px;
}
.mode-tab {
    padding: 9px 0;
    text-align: center;
    
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border: none; background: transparent;
}
.mode-tab.active {
    background: white;
    color: var(--ai-purple);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 表单区域 */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-label .tip {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* 下拉选择 */
.form-select, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e5e7eb;
    
    font-size: 0.92rem;
    color: #1f2937;
    background: #fafafa;
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}
.form-select:focus, .form-textarea:focus {
    border-color: var(--ai-purple);
    background: var(--white);
}
.form-textarea {
    resize: vertical;
    min-height: 90px;
}

/* 风格选择 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.style-chip {
    padding: 8px 6px;
    text-align: center;
    border: 2px solid #e5e7eb;
    
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}
.style-chip:hover { border-color: var(--ai-purple); color: var(--ai-purple); background: var(--primary-light); }
.style-chip.selected {
    border-color: var(--ai-purple);
    background: var(--ai-purple-light);
    color: var(--ai-purple);
    font-weight: 600;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #d1d5db;
    
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fafafa;
}
.upload-zone:hover {
    border-color: var(--ai-purple);
    background: var(--primary-light);
}
.upload-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 2.5rem; color: var(--ai-purple); opacity: 0.7; margin-bottom: 10px; }
.upload-text { font-size: 0.88rem; color: #6b7280; line-height: 1.6; }
.upload-text strong { color: var(--ai-purple); }
.upload-preview {
    max-width: 100%;
    
    margin-top: 12px;
    display: none;
}

/* 生成按钮 */
.btn-generate {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    background: var(--ai-gradient);
    color: white;
    border: none;
    
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 20px;
}
.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}
.btn-generate:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.btn-generate .btn-shine {
    animation: pulse-shine 1.5s infinite;
}
@keyframes pulse-shine {
    0%,100% { opacity:1; } 50% { opacity:0.5; }
}

/* ===== 右侧结果区 ===== */
.result-panel { }
.result-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}
.result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex; align-items: center; gap: 8px;
}
.result-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.btn-action {
    padding: 7px 14px;
    
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
    border: none;
}
.btn-dl { background: var(--success-50); color: #166534; }
.btn-dl:hover { background: #bbf7d0; }
.btn-regen { background: var(--ai-purple-light); color: var(--ai-purple); }
.btn-regen:hover { background: #cfe0ff; }

/* 生成状态 */
.result-body { padding: 24px; min-height: 480px; }

/* 空状态 */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 400px; text-align: center; color: #9ca3af;
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: #6b7280; }
.empty-state p { font-size: 0.88rem; line-height: 1.6; max-width: 320px; }

/* 生成进度 */
.generating-state {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    min-height: 400px; text-align: center;
}
.gen-icon-wrap {
    width: 80px; height: 80px;
    background: var(--ai-gradient);
    
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: white;
    margin: 0 auto 20px;
    animation: spin-glow 2s linear infinite;
}
@keyframes spin-glow {
    0% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); transform:rotate(0deg);}
    50% { box-shadow: 0 0 30px 10px rgba(124,58,237,0.15);}
    100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.0); transform:rotate(360deg);}
}
.progress-bar-wrap {
    width: 260px;
    height: 6px;
    background: #e5e7eb;
    
    overflow: hidden;
    margin: 20px auto 0;
}
.progress-bar-fill {
    height: 100%;
    background: var(--ai-gradient);
    width: 0%;
    transition: width 0.3s;
    
}

/* 结果图片 */
.result-image {
    width: 100%;
    
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: block;
}
