/* Architecture-layer UI fixes. Kept separate from the legacy generated stylesheet. */

/* ===== 整窗最小化：面板折叠为一条细栏（点击细栏恢复） ===== */
#avs-mini-bar { display: none; }
body.avs-minimized { width: 64px !important; min-width: 64px !important; max-width: 64px !important; height: 64px !important; min-height: 64px !important; max-height: 64px !important; overflow: hidden !important; padding: 0 !important; }
body.avs-minimized > *:not(#avs-mini-bar) { display: none !important; }
body.avs-minimized #avs-mini-bar { display: flex !important; }

button.feature-card {
    appearance: none;
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
}
.feature-card:focus-visible,
.main-nav-tab:focus-visible,
[role="button"]:focus-visible,
.option-btn:focus-visible,
.library-btn:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-green, #d1fe17) !important;
    outline-offset: 2px;
}
.feature-card:disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.4);
}
.model-empty { color:#888; padding:15px; text-align:center; font-size:13px; }
.hidden { display:none !important; }
.settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.settings-grid label, .media-input-group label { display:grid; gap:5px; min-width:0; color:var(--control-label, #aab4c0); font-size:11px; }
.settings-grid input, .settings-grid select, .media-input-group input, .media-input-group select { width:100%; box-sizing:border-box; }
.media-input-group { margin:10px 0; }
.avs-standard-layout > .video-model-section,
.avs-standard-layout > .audio-model-section,
.avs-standard-layout > .image-model-section { width:100%; box-sizing:border-box; }
.prompt-actions { display:flex; justify-content:flex-end; margin-top:-6px; margin-bottom:12px; }
.prompt-actions .optimize-prompt-btn { width:auto; min-height:32px; padding:6px 12px; font-size:12px; }
.media-input-stack { display:grid; gap:12px; }
.media-input-stack .media-input-group { margin:0; }
.result-actions.avs-result-actions { display:flex; gap:8px; flex-wrap:wrap; }
.result-actions.avs-result-actions > * { flex:1 1 120px; }
.field-hint { color:var(--text-muted, #8b949e); font-size:11px; line-height:1.5; margin-top:6px; }
.model-options .option-btn { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.model-provider { color:var(--text-muted, #888); font-size:11px; }
.model-name { font-size:13px; }
.library-pagination { display:flex; align-items:center; justify-content:center; gap:10px; padding:10px 0; }
.library-pagination button { border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.05); color:inherit; padding:5px 10px; cursor:pointer; }
.library-pagination button:disabled { opacity:.4; cursor:not-allowed; }
.gen-status { margin-left:auto; color:var(--text-muted, #888); font-size:11px; }
@media (max-width: 560px) { .settings-grid { grid-template-columns:1fr; } }
.gen-model { color:var(--text-muted, #888); font-size:11px; }
.gen-close { border:0; background:transparent; color:inherit; font-size:16px; cursor:pointer; }
.gen-progress-track { height:4px; overflow:hidden; background:rgba(255,255,255,.08); }
.gen-progress-bar { height:100%; width:0; background:var(--accent-green, #d1fe17); transition:opacity .15s ease-out; }

#feature-drama-generator .dh-workspace,
#feature-drama-generator .dh-topbar,
#feature-drama-generator .dh-body,
#feature-drama-generator .dh-panel,
#feature-drama-generator .dh-create-right {
    background:var(--panel-bg-inner) !important;
    color:var(--text-primary) !important;
}
#feature-drama-generator .dh-textarea,
#feature-drama-generator .dh-select,
#feature-drama-generator input,
#feature-drama-generator textarea,
#feature-drama-generator select,
#feature-drama-generator .dh-prod-table td textarea,
#feature-drama-generator .dh-prod-table td select,
#feature-drama-generator .dh-table-wrap textarea,
#feature-drama-generator .dh-table-wrap input[type="number"] {
    background:var(--control-bg) !important;
    color:var(--control-text) !important;
    border-color:var(--control-border) !important;
}
#feature-drama-generator option {
    background:var(--dropdown-bg) !important;
    color:var(--text-primary) !important;
}
#feature-drama-generator .dh-panel-title,
#feature-drama-generator .dh-create-label,
#feature-drama-generator .dh-setting label,
#feature-drama-generator .dh-radio-text,
#feature-drama-generator .dh-tab-label {
    color:var(--control-label) !important;
}

@media (max-width: 520px) {
    .app-header { padding-left:10px; padding-right:10px; }
    .logo-text { font-size:14px; }
    .username-display { display:none !important; }
    .main-nav-tabs { overflow-x:auto; justify-content:flex-start; }
    .main-nav-tab { min-width:max-content; padding-left:10px; padding-right:10px; }
    .feature-grid { grid-template-columns:1fr !important; }
    .feature-grid-page, .detail-content { padding-left:10px !important; padding-right:10px !important; }
    .action-buttons, .options-group, .setting-row { flex-wrap:wrap; }
    .action-btn, .option-btn { min-width:0; }
    .dh-create-layout { flex-direction:column !important; }
    .dh-create-right { width:100% !important; max-height:none !important; }
    .dh-style-grid { grid-template-columns:repeat(auto-fill,minmax(105px,1fr)) !important; }
    .modal, .modal-content { width:calc(100vw - 20px) !important; max-width:calc(100vw - 20px) !important; }
    .library-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}

@media (min-width: 521px) and (max-width: 720px) {
    .dh-create-layout { flex-direction:column !important; }
    .dh-create-right { width:100% !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* Generated media and library thumbnails stay compact; double-click opens the full preview. */
.image-result-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
    gap:10px;
    max-height:360px;
    overflow:auto;
    padding:2px;
}
.image-result-item {
    min-width:0;
    background:var(--control-bg,#0b0d12);
    border:1px solid var(--control-border,rgba(255,255,255,.12));
    border-radius:8px;
    overflow:hidden;
}
.image-result-item img {
    display:block;
    width:100%;
    height:132px;
    object-fit:contain;
    background:rgba(0,0,0,.12);
    cursor:zoom-in;
}
.image-result-item-actions { display:flex; gap:5px; padding:6px; }
.image-result-item-actions button { flex:1 1 0; min-width:0; padding:5px 4px; font-size:11px; }
.library-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
    gap:12px;
}
.library-item {
    min-width:0;
    overflow:hidden;
    border:1px solid var(--panel-border,rgba(255,255,255,.1));
    background:var(--panel-bg-inner,rgba(0,0,0,.18));
}
.library-item > .library-media-thumb {
    display:block;
    width:100%;
    height:150px;
    object-fit:contain;
    background:rgba(0,0,0,.16);
    cursor:zoom-in;
}
.library-item > audio { width:calc(100% - 12px); height:42px; margin:54px 6px; cursor:default; }
.preview-modal-overlay.avs-media-preview-overlay { z-index:100000; padding:24px; }
.avs-media-preview-content {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:14px;
    width:min(94vw,1200px);
    max-height:94vh;
    padding:16px;
}
.avs-media-preview-media {
    display:block;
    width:auto;
    max-width:90vw;
    max-height:82vh;
    object-fit:contain;
    background:#000;
}
.avs-media-preview-content audio { width:min(80vw,720px); background:transparent; }
#image-reference-section.required { border-color:var(--accent-green,#d1fe17); }
#image-reference-section.required .settings-title::after { content:'（图生图必须提供至少一张参考图）'; color:var(--accent-green,#d1fe17); font-size:11px; margin-left:6px; }


/* Detail header — no sticky, scrolls with the page */
/* Scheduler panel */
.scheduler-container { max-width: 720px; }
.scheduler-task-item { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.scheduler-task-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.scheduler-task-info { font-size: 11px; color: #8b949e; margin-bottom: 3px; }
.scheduler-task-actions { display: flex; gap: 6px; margin-top: 6px; }
.scheduler-status { font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-right: 4px; }
.scheduler-status.active { background: rgba(209,254,23,0.15); color: #d1fe17; }
.scheduler-status.paused { background: rgba(139,148,158,0.15); color: #8b949e; }
.scheduler-empty { font-size: 12px; color: #8b949e; padding: 20px; text-align: center; }
.scheduler-form-panel { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
#schedulerModal .modal { max-width: 640px; width: 94vw; }
#schedulerModal .modal-body { background: #0d0d1a; }
