/* ========================================================================
 * 漫剧工作流 · 提示词工程中心样式
 * ====================================================================== */

/* 覆盖 drama-v2-modal 默认宽度，提示词中心需要更宽 */
.pc-modal-overlay .drama-v2-modal {
    width: 92vw; max-width: 1280px; height: 86vh; max-height: 900px;
    padding: 0; overflow: hidden; display: flex; flex-direction: column;
    background: #1e2028; color: #e8e8e8;
    border: 1px solid #2a2d36;
}
.drama-v2-prompt-center { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* header */
.pc-header {
    display: flex; align-items: center; gap: 18px;
    padding: 14px 22px; border-bottom: 1px solid #2a2d36;
    background: linear-gradient(90deg, #262935 0%, #1e2028 100%);
    flex-shrink: 0;
}
.pc-title {
    font-size: 16px; font-weight: 600; color: #fff;
    display: flex; align-items: center; gap: 8px;
}
.pc-title i { color: #4c9eff; }
.pc-scope-switch {
    margin-left: auto; display: flex; gap: 0;
    background: #15171d; border: 1px solid #2a2d36; border-radius: 8px; padding: 3px;
}
.pc-scope-btn {
    background: transparent; border: none; color: #8c8c8c;
    font-size: 13px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.15s;
}
.pc-scope-btn:hover { color: #e8e8e8; }
.pc-scope-btn.active {
    background: #4c9eff; color: #fff;
}
.pc-scope-btn.disabled {
    opacity: .45; cursor: not-allowed;
}
.pc-close {
    background: transparent; border: none; color: #8c8c8c;
    width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
    font-size: 16px; transition: all 0.15s;
}
.pc-close:hover { background: #30333d; color: #fff; }

/* body */
.pc-body {
    flex: 1; display: grid; grid-template-columns: 300px 1fr;
    min-height: 0; overflow: hidden;
}

/* sidebar */
.pc-sidebar {
    background: #181a20; border-right: 1px solid #2a2d36;
    overflow-y: auto; padding: 14px 10px 30px;
}
.pc-sidebar-intro {
    font-size: 12px; color: #8c8c8c; padding: 8px 10px;
    background: rgba(76,158,255,0.06); border-radius: 6px;
    margin-bottom: 14px; line-height: 1.5;
}
.pc-sidebar-intro i { color: #4c9eff; margin-right: 4px; }
.pc-group { margin-bottom: 18px; }
.pc-group-title {
    font-size: 11px; color: #8c8c8c; text-transform: uppercase;
    padding: 4px 10px; letter-spacing: 1px; font-weight: 600;
}
.pc-item {
    padding: 10px 12px; border-radius: 7px; cursor: pointer;
    margin-top: 3px; transition: all 0.15s;
    position: relative;
}
.pc-item:hover { background: #22252e; }
.pc-item.selected {
    background: rgba(76,158,255,0.15);
    box-shadow: inset 3px 0 0 #4c9eff;
}
.pc-item-name {
    font-size: 13px; color: #e8e8e8; font-weight: 500; margin-bottom: 3px;
}
.pc-item-desc {
    font-size: 11px; color: #8c8c8c; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pc-item-flag {
    position: absolute; top: 10px; right: 10px;
    font-size: 10px; background: #faad14; color: #fff;
    padding: 1px 6px; border-radius: 8px;
}

/* main */
.pc-main {
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    background: #1e2028;
}
.pc-main-head {
    display: flex; align-items: flex-start; padding: 18px 24px 12px;
    border-bottom: 1px solid #2a2d36; flex-shrink: 0;
    gap: 16px;
}
.pc-main-head > div:first-child { flex: 1; min-width: 0; }
.pc-main-title { font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.pc-main-desc {
    font-size: 12px; color: #8c8c8c; line-height: 1.6;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pc-source-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 10px;
    background: #30333d; color: #bfbfbf;
}
.pc-source-default { background: #30333d; color: #8c8c8c; }
.pc-source-global  { background: rgba(76,158,255,0.2); color: #4c9eff; }
.pc-source-project { background: rgba(82,196,26,0.2); color: #7dcc4c; }

.pc-main-toolbar {
    display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.pc-count-chip {
    background: #4c9eff; color: #fff; font-size: 10px;
    padding: 1px 6px; border-radius: 8px; margin-left: 4px;
}

/* vars */
.pc-vars {
    padding: 12px 24px; background: #181a20; border-bottom: 1px solid #2a2d36;
    flex-shrink: 0;
}
.pc-vars-title { font-size: 11px; color: #8c8c8c; margin-bottom: 6px; }
.pc-vars-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-var-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #262935; padding: 3px 10px; border-radius: 14px;
    font-size: 12px; border: 1px solid #2a2d36;
}
.pc-var-chip code {
    color: #4c9eff; background: rgba(76,158,255,0.1);
    padding: 1px 5px; border-radius: 4px; font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
}
.pc-var-chip span { color: #bfbfbf; font-size: 11px; }

/* editor */
.pc-editor-grid {
    flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: #2a2d36; min-height: 0; overflow: hidden;
}
.pc-editor-col { display: flex; flex-direction: column; background: #1e2028; min-height: 0; }
.pc-editor-label {
    padding: 10px 18px; font-size: 12px; color: #bfbfbf; font-weight: 600;
    background: #22252e; border-bottom: 1px solid #2a2d36;
    display: flex; align-items: center; gap: 8px;
}
.pc-editor-label i { color: #4c9eff; }
.pc-editor-hint {
    font-size: 11px; color: #8c8c8c; font-weight: normal; margin-left: auto;
}
.pc-editor {
    flex: 1; min-height: 0;
    background: #15171d; color: #e8e8e8;
    border: none; padding: 16px 20px; resize: none;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    font-size: 13px; line-height: 1.65;
    outline: none;
}
.pc-editor:focus { background: #181a20; }

/* history */
.pc-history {
    padding: 18px 24px; overflow-y: auto; max-height: 360px;
    border-top: 1px solid #2a2d36; background: #181a20;
    flex-shrink: 0;
}
.pc-section-title {
    font-size: 13px; color: #e8e8e8; font-weight: 600;
    display: flex; align-items: center; margin-bottom: 12px;
}
.pc-version {
    background: #22252e; border: 1px solid #2a2d36; border-radius: 8px;
    padding: 12px 14px; margin-bottom: 10px;
}
.pc-version.active { border-color: #4c9eff; }
.pc-version-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pc-version-name { font-size: 13px; color: #fff; font-weight: 500; }
.pc-version-badge {
    background: #4c9eff; color: #fff; font-size: 10px;
    padding: 1px 7px; border-radius: 8px;
}
.pc-version-time { margin-left: auto; font-size: 11px; color: #8c8c8c; }
.pc-version-note { font-size: 12px; color: #bfbfbf; margin-bottom: 6px; }
.pc-version-detail { margin-top: 6px; }
.pc-version-detail summary {
    cursor: pointer; font-size: 12px; color: #4c9eff; outline: none;
    user-select: none; padding: 4px 0;
}
.pc-version-block { margin-top: 6px; }
.pc-version-block b { font-size: 11px; color: #8c8c8c; display: block; margin-bottom: 3px; }
.pc-version-block pre {
    background: #15171d; color: #bfbfbf; padding: 8px 10px;
    border-radius: 5px; font-size: 11px; max-height: 140px;
    overflow: auto; white-space: pre-wrap; word-break: break-all;
    margin: 0;
}
.pc-version-actions { margin-top: 8px; display: flex; gap: 6px; }

.pc-empty {
    text-align: center; padding: 24px; color: #8c8c8c; font-size: 12px;
    border: 1px dashed #2a2d36; border-radius: 8px;
}

/* 复用 drama-v2-mini-btn/drama-v2-btn 的暗色适配 */
.drama-v2-prompt-center .drama-v2-mini-btn {
    background: #262935; color: #e8e8e8; border: 1px solid #2a2d36;
}
.drama-v2-prompt-center .drama-v2-mini-btn:hover {
    background: #30333d; border-color: #4c9eff;
}
.drama-v2-prompt-center .drama-v2-btn:disabled {
    opacity: .45; cursor: not-allowed;
}
