/**
 * prompt-generator.css - AI视频反推提示词工具样式
 */

.tool-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}
.tool-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.05); }

.main-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: #f1f4f9;
    border-radius: 12px;
    border: none;
}
.main-tab {
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
}
.main-tab:hover { color: #2d3748; background: #f7fafc; }
.main-tab.active { background: #4a6cf7; color: #fff; box-shadow: 0 2px 8px rgba(74,108,247,0.2); }
.main-tab i { margin-right: 6px; }

.main-panel { display: none; animation: fadeIn 0.3s ease; }
.main-panel.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.upload-area {
    border: 2px dashed #d2dce8;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.upload-area:hover { border-color: #4a6cf7; background: #f0f5ff; }
.upload-area.dragover { border-color: #4a6cf7; background: #e8edfc; }
.upload-area .icon { font-size: 40px; color: #4a6cf7; margin-bottom: 8px; }
.upload-area .title { font-size: 15px; font-weight: 600; color: #1a202c; }
.upload-area .hint { font-size: 13px; color: #a0aec0; margin-top: 4px; }
.upload-area .size { font-size: 12px; color: #a0aec0; background: #edf2f7; padding: 2px 12px; border-radius: 20px; display: inline-block; margin-top: 6px; }
.upload-area input[type="file"] { display: none; }
.upload-area .file-selected { display: none; margin-top: 8px; font-size: 13px; color: #4a6cf7; font-weight: 500; }
.upload-area.has-file .file-selected { display: block; }
.upload-area.has-file .icon, .upload-area.has-file .title, .upload-area.has-file .hint, .upload-area.has-file .size { display: none; }

.link-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    background: #f7fafc;
    transition: border-color 0.2s;
}
.link-input-group:focus-within { border-color: #4a6cf7; background: #fff; }
.link-input-group input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
    min-width: 0;
}
.link-input-group .btn-parse {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.25s;
    white-space: nowrap;
}
.link-input-group .btn-parse:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(124,58,237,0.25); }

.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 14px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    margin: 16px 0;
}
.settings-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.settings-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
}
.settings-group .options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.settings-group .option-btn {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: #f1f4f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.settings-group .option-btn:hover { background: #e2e8f0; }
.settings-group .option-btn.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 2px 8px rgba(74,108,247,0.2);
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #4a6cf7, #6a8cff);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(74,108,247,0.25);
}
.btn-start:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(74,108,247,0.35); }
.btn-start:disabled { opacity:0.6; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-start .ri-loader-4-line { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-wrap {
    display: none;
    margin-top: 16px;
    background: #f7fafc;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}
.progress-wrap.active { display: block; }
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin: 4px 0;
}
.progress-bar .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a6cf7, #6a8cff);
    border-radius: 6px;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 13px;
    color: #4a5568;
    display: flex;
    justify-content: space-between;
}
.progress-text .status { font-weight: 500; }
.progress-text .percent { color: #4a6cf7; font-weight: 600; }

.result-box {
    display: none;
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #eef2f6;
    padding: 18px 22px;
    max-height: 500px;
    overflow-y: auto;
}
.result-box.active { display: block; }
.result-box .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.result-box .result-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 8px;
}
.result-box .result-header h4 i { color: #4a6cf7; }
.result-box .result-content {
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.result-box .result-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.result-box .result-actions button {
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.result-box .result-actions .btn-copy { background: #4a6cf7; color: #fff; }
.result-box .result-actions .btn-copy:hover { background: #3a5cd9; }
.result-box .result-actions .btn-download { background: #38a169; color: #fff; }
.result-box .result-actions .btn-download:hover { background: #2f855a; }

.image-upload-area {
    border: 2px dashed #d2dce8;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #f8fafc;
}
.image-upload-area:hover { border-color: #4a6cf7; background: #f0f5ff; }
.image-upload-area input[type="file"] { display: none; }
.image-upload-area .icon { font-size: 32px; color: #4a6cf7; }
.image-upload-area .title { font-size: 15px; font-weight: 600; color: #1a202c; margin-top: 4px; }
.image-upload-area .hint { font-size: 13px; color: #a0aec0; }
.image-result-wrapper { display: none; margin-top: 16px; }
.image-result-wrapper.active { display: block; }
.image-result-wrapper .preview img { max-height: 180px; border-radius: 8px; border: 1px solid #e2e8f0; }
.image-result-wrapper .prompt-box { margin-top: 12px; }
.image-result-wrapper .prompt-box .prompt-text {
    background: #f7fafc;
    padding: 12px 16px;
    border-radius: 8px;
    min-height: 60px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.image-result-wrapper .prompt-box .copy-btn {
    float: right;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
.image-result-wrapper .prompt-box .copy-btn:hover { background: #f0f5ff; border-color: #4a6cf7; }

/* ===== 案例演示 ===== */
.case-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f2f5;
}
.case-section .case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.case-section .case-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 10px;
}
.case-section .case-header h2 i { color: #4a6cf7; }
.case-section .case-header .case-badge {
    font-size: 12px;
    color: #4a6cf7;
    background: #f0f5ff;
    padding: 2px 14px;
    border-radius: 30px;
    font-weight: 500;
}
.case-section .case-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 16px;
    line-height: 1.6;
}

.case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.case-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.case-right {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    padding: 16px 20px;
    max-height: 590px;
    overflow-y: auto;
}

.case-source {
    font-size: 13px;
    color: #718096;
    background: #f0f5ff;
    padding: 8px 14px;
    border-radius: 8px;
    border-left: 3px solid #4a6cf7;
}
.case-source strong { color: #1a202c; }

/* 视频竖屏包装 */
.case-video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    aspect-ratio: 9 / 16;
    max-height: 400px;
    width: 100%;
    max-width: 280px;
}
.case-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.case-video-label {
    font-size: 12px;
    color: #a0aec0;
    text-align: center;
    margin-top: 6px;
}

/* 左侧内容布局：视频 + 卡片并排 */
.case-left-content {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    align-items: stretch;
    flex-wrap: wrap;
}
.case-left-content .video-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.case-left-content .cards-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 140px;
}

/* 卡片样式增强 */
.case-flow-item {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
    transition: 0.2s;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.case-flow-item:hover {
    border-color: #4a6cf7;
    box-shadow: 0 2px 8px rgba(74,108,247,0.06);
}
.case-flow-item .step-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.case-flow-item .step-label { font-size: 13px; font-weight: 600; color: #1a202c; }
.case-flow-item .step-desc { font-size: 12px; color: #718096; line-height: 1.4; margin-top: 2px; }

.case-right .case-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.case-right .case-prompt-header .title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}
.case-right .case-prompt-header .btn-copy-prompt {
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #4a6cf7;
    background: #f0f5ff;
    border: 1px solid #e0e8f5;
    cursor: pointer;
    transition: 0.2s;
}
.case-right .case-prompt-header .btn-copy-prompt:hover {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}
.case-right .case-prompt-content {
    font-size: 13px;
    line-height: 1.8;
    color: #2d3748;
}
.case-right .case-prompt-content .highlight { color: #4a6cf7; font-weight: 500; }
.case-right .case-prompt-content .tag {
    display: inline-block;
    background: #edf2f7;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #4a5568;
    margin: 2px 0;
}

.case-secondary {
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #eef2f6;
    padding: 14px 18px;
}
.case-secondary .sec-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.case-secondary .sec-desc {
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
}

.case-footer {
    margin-top: 12px;
    font-size: 12px;
    color: #a0aec0;
    text-align: center;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
}

/* ===== 折叠展开 ===== */
.collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 6px;
}
.collapsible-header:hover {
    background: rgba(74, 108, 247, 0.06);
}
.collapsible-header .collapse-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: #4a6cf7;
}
.collapsible-header .collapse-icon.collapsed {
    transform: rotate(-90deg);
}
.collapsible-header .collapse-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
}
.collapsible-body {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 0;
    opacity: 0;
    padding: 0 4px;
}
.collapsible-body.open {
    max-height: 2000px;
    opacity: 1;
    padding: 4px 4px 8px;
}

/* ===== 暗色模式 ===== */
body.dark-mode .tool-card { background: #16213e; border-color: #2a3a5a; }
body.dark-mode .main-tabs { background: #2a3a5a; }
body.dark-mode .main-tab { color: #a0aec0; }
body.dark-mode .main-tab:hover { color: #e2e8f0; background: #2a3a5a; }
body.dark-mode .main-tab.active { background: #4a6cf7; color: #fff; }
body.dark-mode .upload-area { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .upload-area:hover { border-color: #4a6cf7; background: #1e2a4a; }
body.dark-mode .upload-area .title { color: #e2e8f0; }
body.dark-mode .upload-area .hint { color: #888; }
body.dark-mode .upload-area .size { background: #2a3a5a; color: #888; }
body.dark-mode .link-input-group { background: #2a3a5a; border-color: #3a4a6a; }
body.dark-mode .link-input-group:focus-within { border-color: #4a6cf7; background: #1a2a4a; }
body.dark-mode .link-input-group input { background: transparent; color: #cbd5e0; }
body.dark-mode .settings-row { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .settings-group label { color: #cbd5e0; }
body.dark-mode .settings-group .option-btn { background: #2a3a5a; color: #a0aec0; }
body.dark-mode .settings-group .option-btn.active { background: #4a6cf7; color: #fff; }
body.dark-mode .progress-wrap { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .progress-text { color: #cbd5e0; }
body.dark-mode .result-box { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .result-box .result-content { color: #cbd5e0; }
body.dark-mode .result-box .result-header h4 { color: #e2e8f0; }
body.dark-mode .image-upload-area { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .image-upload-area .title { color: #e2e8f0; }
body.dark-mode .image-result-wrapper .prompt-box .prompt-text { background: #2a3a5a; border-color: #3a4a6a; color: #cbd5e0; }
body.dark-mode .image-result-wrapper .prompt-box .copy-btn { background: #2a3a5a; border-color: #3a4a6a; color: #cbd5e0; }
body.dark-mode .image-result-wrapper .prompt-box .copy-btn:hover { background: #3a4a6a; border-color: #4a6cf7; }

body.dark-mode .case-section { border-top-color: #2a2a4a; }
body.dark-mode .case-section .case-header h2 { color: #e2e8f0; }
body.dark-mode .case-section .case-subtitle { color: #a0aec0; }
body.dark-mode .case-right { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .case-right .case-prompt-header .title { color: #e2e8f0; }
body.dark-mode .case-right .case-prompt-content { color: #cbd5e0; }
body.dark-mode .case-source { background: #1a2a4a; color: #a0aec0; }
body.dark-mode .case-source strong { color: #e2e8f0; }
body.dark-mode .case-flow-item { background: #16213e; border-color: #2a3a5a; }
body.dark-mode .case-flow-item .step-label { color: #e2e8f0; }
body.dark-mode .case-flow-item .step-desc { color: #a0aec0; }
body.dark-mode .case-secondary { background: #1a2a4a; border-color: #2a3a5a; }
body.dark-mode .case-secondary .sec-title { color: #e2e8f0; }
body.dark-mode .case-secondary .sec-desc { color: #a0aec0; }
body.dark-mode .case-footer { border-top-color: #2a2a4a; color: #718096; }
body.dark-mode .case-right .case-prompt-header .btn-copy-prompt { background: #2a3a5a; border-color: #3a4a6a; color: #6a8cff; }
body.dark-mode .case-right .case-prompt-header .btn-copy-prompt:hover { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }
body.dark-mode .case-right .case-prompt-content .tag { background: #2a3a5a; color: #a0aec0; }
body.dark-mode .collapsible-header .collapse-title { color: #e2e8f0; }
body.dark-mode .collapsible-header:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .case-video-wrapper { background: #0a0a1a; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .tool-card { padding: 16px; }
    .main-tab { font-size: 14px; padding: 6px 16px; }
    .settings-row { flex-direction: column; gap: 10px; }
    .settings-group { flex-wrap: wrap; }
    .btn-start { width: 100%; justify-content: center; padding: 12px 20px; font-size: 16px; }
    .link-input-group { flex-wrap: wrap; }
    .link-input-group input { flex: 1 1 100%; }
    .link-input-group .btn-parse { flex: 1; justify-content: center; }
    .upload-area { min-height: 120px; padding: 20px; }
    .case-grid { grid-template-columns: 1fr; }
    .case-right { max-height: 300px; }
    .case-left-content { flex-direction: column; align-items: center; }
    .case-video-wrapper { max-width: 200px; max-height: 350px; }
    .case-left-content .cards-col { width: 100%; }
}
@media (max-width: 480px) {
    .main-tab { font-size: 13px; padding: 4px 12px; }
    .settings-group .option-btn { font-size: 12px; padding: 3px 10px; }
    .case-video-wrapper { max-width: 160px; max-height: 280px; }
}