/* public/assets/css/life/doubao-saver.css */

.db-workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    margin-bottom: 40px;
    align-items: flex-start;
}

.db-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    overflow: hidden;
}

.db-panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.01);
}

.db-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.db-panel-body {
    padding: 24px;
}

/* =========================================================
   左侧：参数配置台
   ========================================================= */
.db-sidebar {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.db-form-group { display: flex; flex-direction: column; margin-bottom: 16px; min-width: 0;}
.db-form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

.db-textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; font-family: monospace;
    outline: none; transition: 0.2s; box-sizing: border-box; resize: vertical; line-height: 1.5;
}
.db-textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0, 102, 204), 0.1); }

.db-btn-primary, .db-btn-success {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    color: white; border: none; border-radius: 8px;
    padding: 14px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s;
}
.db-btn-primary { background: var(--primary-color); box-shadow: 0 4px 10px rgba(var(--primary-rgb, 0, 102, 204), 0.2); }
.db-btn-success { background: #10b981; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); }
.db-btn-primary:hover, .db-btn-success:hover { transform: translateY(-2px); opacity: 0.9; }
.db-btn-primary:disabled, .db-btn-success:disabled { transform: none; opacity: 0.5; cursor: not-allowed; }

.db-divider { border: none; border-top: 1px dashed var(--border-color); margin: 24px 0; }
.db-sub-heading { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin: 0 0 16px 0; }

.db-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.db-btn-secondary {
    padding: 10px; background: var(--bg-body); border: 1px solid var(--border-color);
    color: var(--text-main); border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.db-btn-secondary:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* 下载进度条 */
.db-progress-container { margin-top: 16px; background: var(--bg-body); border-radius: 8px; padding: 12px; border: 1px solid var(--border-color); }
.db-progress-bar { width: 100%; height: 6px; background: rgba(0,0,0,0.05); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.db-progress-fill { height: 100%; width: 0%; background: #10b981; transition: width 0.2s linear; }
.db-progress-text { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-align: right; font-family: monospace;}

/* =========================================================
   右侧：媒体网格预览区
   ========================================================= */
.db-main-content {
    flex: 2;
    min-width: 0;
}

/* 状态指示器 */
.db-status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 50px; font-size: 0.85rem; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-idle { background: rgba(100, 116, 139, 0.1); color: #64748b; }
.status-idle .status-dot { background: #64748b; }
.status-working { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.status-working .status-dot { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; animation: dbPulse 1s infinite;}
.status-success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-success .status-dot { background: #10b981; }
.status-error { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-error .status-dot { background: #ef4444; }
@keyframes dbPulse { 0% { opacity: 1;} 50% { opacity: 0.4;} 100% { opacity: 1;} }

/* 空状态 */
.db-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; padding: 40px; text-align: center; }
.db-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; filter: grayscale(1); }
.db-empty-state p { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; max-width: 300px; line-height: 1.6;}

/* 媒体网格架构 */
.db-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* 卡片样式 */
.db-media-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.db-media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.db-media-card.selected {
    border-color: var(--primary-color);
}

.db-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.db-media-card:hover .db-media-img {
    transform: scale(1.05);
}

/* 视频角标 */
.db-video-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

/* 复选框遮罩层 */
.db-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.2s;
}

.db-media-card:hover .db-card-overlay, .db-media-card.selected .db-card-overlay {
    opacity: 1;
}

/* 定制 Checkbox */
.db-checkbox-container {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
}
.db-checkbox-container input { display: none; }
.db-checkmark {
    position: absolute; top: 0; left: 0; height: 24px; width: 24px;
    background-color: rgba(255,255,255,0.8); border-radius: 6px; transition: 0.2s; border: 2px solid transparent;
}
.db-checkbox-container input:checked ~ .db-checkmark { background-color: var(--primary-color); }
.db-checkmark:after {
    content: ""; position: absolute; display: none;
    left: 8px; top: 4px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.db-checkbox-container input:checked ~ .db-checkmark:after { display: block; }

/* 暗黑模式适配 */
[data-theme="dark"] .db-panel-header { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .db-textarea, [data-theme="dark"] .db-btn-secondary { background: #0f172a; border-color: #334155; color: #f8fafc; }
[data-theme="dark"] .db-media-card { background: #1e293b; }

/* =========================================================
   SEO 内容强化网格
   ========================================================= */
.tool-seo-content { margin-top: 50px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 40px; }
.tool-seo-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 20px; color: var(--text-main); }
.seo-intro-section { margin-bottom: 40px; }
.seo-lead-text { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px;}
.seo-sub-heading { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--text-main); border-left: 4px solid var(--primary-color); padding-left: 12px;}
.seo-feature-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.seo-feature-card { background: var(--bg-body); border: 1px solid var(--border-color); padding: 24px; border-radius: 12px; transition: all 0.3s ease; }
.seo-feature-card:hover { border-color: var(--primary-color); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 102, 204, 0.08); }
.seo-feature-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.seo-icon { width: 40px; height: 40px; color: var(--primary-color); background: rgba(var(--primary-rgb, 0, 102, 204), 0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.seo-icon svg { width: 20px; height: 20px; }
.seo-feature-card h3 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text-main); }
.seo-feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

[data-theme="dark"] .tool-seo-content { background: var(--bg-surface); }
[data-theme="dark"] .seo-feature-card { background: #0f172a; border-color: #334155; }

/* 移动端完美折叠 */
@media (max-width: 900px) {
    .db-sidebar { max-width: 100%; }
    .seo-feature-grid-3 { grid-template-columns: 1fr; }
    .db-media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 12px; gap: 12px;}
}