/* ===================================================================
   场景调色 (Scene Color Grading) - 专属样式
   主题色：暖琥珀渐变 #f59e0b → 电影紫 #7c3aed
   =================================================================== */

/* ---- CSS 变量 ---- */
:root {
    --cg-primary:       #f59e0b;
    --cg-primary-dark:  #d97706;
    --cg-secondary:     #7c3aed;
    --cg-accent:        #06b6d4;
    --cg-bg:            #faf9f7;
    --cg-surface:       #ffffff;
    --cg-surface2:      #f5f4f0;
    --cg-border:        #e5e7eb;
    --cg-border2:       #d1d5db;
    --cg-text:          #1c1917;
    --cg-text2:         #44403c;
    --cg-text-muted:    #78716c;
    --cg-toolbar-bg:    linear-gradient(100deg, #1c1412 0%, #2d1b00 50%, #150d2e 100%);
    --cg-toolbar-text:  #faf5eb;
    --cg-shadow:        0 2px 12px rgba(0,0,0,.08);
    --cg-shadow-md:     0 4px 24px rgba(0,0,0,.12);
    --cg-radius:        10px;
    --cg-radius-sm:     6px;
    --cg-toolbar-h:     52px;
    --cg-history-w:     220px;
    --cg-input-w:       340px;
}

/* 暗黑模式变量 */
body.dark {
    --cg-bg:        #1a1512;
    --cg-surface:   #241e19;
    --cg-surface2:  #1e1814;
    --cg-border:    #3a332a;
    --cg-border2:   #4a4038;
    --cg-text:      #f5f0eb;
    --cg-text2:     #d6cec5;
    --cg-text-muted:#a09890;
    --cg-shadow:    0 2px 12px rgba(0,0,0,.4);
    --cg-shadow-md: 0 4px 24px rgba(0,0,0,.5);
}

/* ===== 主容器 ===== */
.cg-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    min-height: 500px;
    background: var(--cg-bg);
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius);
    overflow: hidden;
    box-shadow: var(--cg-shadow-md);
    transition: background .25s, border-color .25s;
}

.cg-container.fullscreen-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh !important;
    border-radius: 0;
    border: none;
}

/* ===== 工具栏 ===== */
.cg-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--cg-toolbar-h);
    background: var(--cg-toolbar-bg);
    color: var(--cg-toolbar-text);
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* 工具栏彩虹光谱装饰条 */
.cg-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right,
        #ef4444, #f97316, #f59e0b, #84cc16,
        #06b6d4, #3b82f6, #7c3aed, #ec4899);
    opacity: .8;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--cg-primary);
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: 4px;
}

.cg-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 5px;
    background: rgba(255,255,255,.08);
    color: #e7dfd4;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
}
.cg-toolbar-btn:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.cg-toolbar-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.cg-toolbar-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
}
.cg-toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
}
.cg-toolbar-btn-primary.cg-btn-loading {
    background: linear-gradient(90deg, #92400e, #d97706, #92400e, #b45309);
    background-size: 300% 100%;
    animation: cgShimmer .8s infinite linear;
}

.cg-toolbar-btn-cancel {
    background: rgba(239,68,68,.18) !important;
    border-color: rgba(239,68,68,.35) !important;
    color: #fca5a5 !important;
}
.cg-toolbar-btn-cancel:hover {
    background: rgba(239,68,68,.32) !important;
}

@keyframes cgShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

body.dark .cg-toolbar-btn-primary.cg-btn-loading {
    background: linear-gradient(90deg, #78350f, #b45309, #78350f, #92400e);
    background-size: 300% 100%;
    animation: cgShimmer .8s infinite linear;
}

/* ===== 主内容区 ===== */
.cg-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 历史记录面板（左） ===== */
.cg-history-panel {
    width: var(--cg-history-w);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--cg-surface2);
    border-right: 1px solid var(--cg-border);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

.cg-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--cg-border);
    flex-shrink: 0;
}
.cg-history-header h3 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cg-text2);
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
}
.cg-history-count {
    margin-left: 4px;
    font-weight: 400;
    color: var(--cg-text-muted);
    font-size: 11px;
}

.cg-history-clear-btn {
    background: transparent;
    border: none;
    color: var(--cg-text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .18s, background .18s;
}
.cg-history-clear-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,.08);
}

.cg-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--cg-border);
    flex-shrink: 0;
}
.cg-history-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 9px;
    border: 1px solid var(--cg-border);
    border-radius: 5px;
    font-size: 12px;
    background: var(--cg-surface);
    color: var(--cg-text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.cg-history-search input:focus {
    border-color: var(--cg-primary);
    box-shadow: 0 0 0 2px rgba(245,158,11,.18);
}

.cg-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}
.cg-history-list::-webkit-scrollbar { width: 4px; }
.cg-history-list::-webkit-scrollbar-thumb { background: var(--cg-border2); border-radius: 4px; }
.cg-history-list::-webkit-scrollbar-track { background: var(--cg-surface2); }
body.dark .cg-history-list::-webkit-scrollbar-track { background: #1a1512; }

.cg-history-empty {
    text-align: center;
    color: var(--cg-text-muted);
    font-size: 12px;
    padding: 24px 12px;
    line-height: 1.8;
}

.cg-history-item {
    padding: 9px 14px 9px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
    position: relative;
}
.cg-history-item:hover {
    background: rgba(245,158,11,.08);
    border-left-color: var(--cg-primary);
}
.cg-history-item.active {
    background: rgba(245,158,11,.12);
    border-left-color: var(--cg-primary);
}

.cg-history-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    padding-right: 22px;
}
.cg-history-item-meta {
    font-size: 11px;
    color: var(--cg-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.cg-history-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    background: rgba(245,158,11,.15);
    color: var(--cg-primary-dark);
    white-space: nowrap;
}
body.dark .cg-history-tag {
    background: rgba(245,158,11,.2);
    color: #fcd34d;
}

.cg-history-del-btn {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: transparent;
    font-size: 12px;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    line-height: 1;
    transition: color .15s, background .15s;
}
.cg-history-item:hover .cg-history-del-btn {
    color: var(--cg-text-muted);
}
.cg-history-del-btn:hover {
    color: #ef4444 !important;
    background: rgba(239,68,68,.1);
}

/* ===== 输入面板（中） ===== */
.cg-input-panel {
    width: var(--cg-input-w);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--cg-border);
    background: var(--cg-surface);
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}

/* ===== 结果面板（右） ===== */
.cg-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--cg-surface);
    transition: background .25s;
}

/* ===== 面板通用头部 ===== */
.cg-panel-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--cg-border);
    background: linear-gradient(to bottom, var(--cg-surface2) 0%, var(--cg-surface) 100%);
    flex-shrink: 0;
}
.cg-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--cg-text2);
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
}
.cg-panel-tip {
    font-size: 11.5px;
    color: var(--cg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.cg-result-scene,
.cg-result-style-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(245,158,11,.14);
    color: var(--cg-primary-dark);
}
body.dark .cg-result-scene,
body.dark .cg-result-style-tag {
    background: rgba(245,158,11,.2);
    color: #fcd34d;
}

/* ===== 输入面板内容 ===== */
.cg-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
}
.cg-input-body::-webkit-scrollbar { width: 5px; }
.cg-input-body::-webkit-scrollbar-thumb { background: var(--cg-border2); border-radius: 4px; }
.cg-input-body::-webkit-scrollbar-track { background: var(--cg-surface); }
body.dark .cg-input-body::-webkit-scrollbar-track { background: #241e19; }

.cg-section {
    margin-bottom: 18px;
}
.cg-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cg-text2);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cg-optional {
    font-weight: 400;
    color: var(--cg-text-muted);
    font-size: 11px;
}

/* 场景类型格子 */
.cg-scene-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}
.cg-scene-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 7px;
    border: 1.5px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    background: var(--cg-surface2);
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .15s;
    color: var(--cg-text);
}
.cg-scene-btn:hover {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.07);
    transform: translateY(-1px);
}
.cg-scene-btn.selected {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.14);
    color: var(--cg-primary-dark);
    box-shadow: 0 0 0 2px var(--cg-primary);
}
body.dark .cg-scene-btn.selected {
    background: rgba(245,158,11,.18);
    color: #fcd34d;
    box-shadow: 0 0 0 2px #d97706;
}
.scene-icon {
    font-size: 18px;
    line-height: 1;
}
.scene-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* 调色风格格子 */
.cg-style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}
.cg-style-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1.5px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    background: var(--cg-surface2);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--cg-text);
    transition: border-color .18s, background .18s;
    text-align: left;
}
.cg-style-btn:hover {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.07);
}
.cg-style-btn.selected {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.14);
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--cg-primary);
}
body.dark .cg-style-btn.selected {
    background: rgba(245,158,11,.18);
    box-shadow: 0 0 0 2px #d97706;
}
.style-color-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0,0,0,.25);
}

/* 画面情绪 */
.cg-mood-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cg-mood-btn {
    padding: 5px 11px;
    border: 1.5px solid var(--cg-border);
    border-radius: 20px;
    background: var(--cg-surface2);
    cursor: pointer;
    font-size: 12px;
    color: var(--cg-text2);
    transition: border-color .18s, background .18s;
    white-space: nowrap;
}
.cg-mood-btn:hover {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.07);
}
.cg-mood-btn.selected {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.14);
    color: var(--cg-primary-dark);
    font-weight: 600;
}
body.dark .cg-mood-btn.selected {
    background: rgba(245,158,11,.2);
    color: #fcd34d;
}

/* 文本输入 */
.cg-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1.5px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    background: var(--cg-surface2);
    color: var(--cg-text);
    font-size: 13px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.cg-textarea:focus {
    border-color: var(--cg-primary);
    background: var(--cg-surface);
    box-shadow: 0 0 0 3px rgba(245,158,11,.12);
}
.cg-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1.5px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    background: var(--cg-surface2);
    color: var(--cg-text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.cg-input:focus {
    border-color: var(--cg-primary);
    background: var(--cg-surface);
    box-shadow: 0 0 0 3px rgba(245,158,11,.12);
}

/* placeholder 颜色 */
.cg-textarea::placeholder,
.cg-input::placeholder {
    color: var(--cg-text-muted);
    font-size: 12px;
}

/* ===== 结果面板内容 ===== */
.cg-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
}
.cg-result-body::-webkit-scrollbar { width: 6px; }
.cg-result-body::-webkit-scrollbar-thumb { background: var(--cg-border2); border-radius: 4px; }
.cg-result-body::-webkit-scrollbar-track { background: var(--cg-surface); }
body.dark .cg-result-body::-webkit-scrollbar-track { background: #241e19; }

/* 占位图 */
.cg-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 30px;
    text-align: center;
    color: var(--cg-text-muted);
}
.cg-placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    animation: cgFloat 3s ease-in-out infinite;
}
@keyframes cgFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.cg-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cg-text2);
    margin: 0 0 8px;
}
.cg-placeholder-desc {
    font-size: 13px;
    color: var(--cg-text-muted);
    margin: 4px 0;
    line-height: 1.6;
}
/* 彩虹装饰线 */
.cg-placeholder::before {
    content: '';
    display: block;
    width: 80px; height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #f59e0b, #7c3aed);
    margin-bottom: 20px;
    opacity: .5;
}

/* 加载中 */
.cg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 30px;
    text-align: center;
}
.cg-loading-spectrum {
    width: 120px; height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right,
        #ef4444, #f97316, #f59e0b, #84cc16,
        #06b6d4, #3b82f6, #7c3aed, #ec4899);
    background-size: 200% 100%;
    animation: cgSpectrumMove 1.4s linear infinite;
    margin-bottom: 20px;
}
@keyframes cgSpectrumMove {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}
.cg-loading-dots {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
}
.cg-loading-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cg-primary);
    animation: cgBounce 1s ease-in-out infinite;
}
.cg-loading-dots span:nth-child(2) { animation-delay: .18s; background: #a855f7; }
.cg-loading-dots span:nth-child(3) { animation-delay: .36s; background: var(--cg-accent); }
@keyframes cgBounce {
    0%, 80%, 100% { transform: scale(.75); opacity: .5; }
    40%           { transform: scale(1); opacity: 1; }
}
.cg-loading-text {
    font-size: 13px;
    color: var(--cg-text-muted);
    margin: 0;
}

/* ===== 调色结果内容 ===== */
.cg-result-content {
    padding: 20px 22px 28px;
}

/* 色板 */
.cg-palette-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: var(--cg-surface2);
    border-radius: var(--cg-radius);
    border: 1px solid var(--cg-border);
}
.cg-color-chip-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.cg-color-chip {
    width: 44px; height: 44px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    border: 2px solid rgba(255,255,255,.15);
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
    position: relative;
}
.cg-color-chip:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
/* 色値悬浮提示（显示在色片下方，避免被滚动容器截断） */
.cg-color-chip[data-hex]::after {
    content: attr(data-hex);
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #1c1917;
    color: #f5f5f4;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    font-family: monospace;
    z-index: 10;
}
.cg-color-chip[data-hex]:hover::after {
    opacity: 1;
}
.cg-chip-label {
    font-size: 10.5px;
    color: var(--cg-text-muted);
    text-align: center;
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.cg-chip-hex {
    font-size: 9.5px;
    color: var(--cg-text-muted);
    opacity: .75;
    font-family: monospace;
    letter-spacing: .3px;
}

/* 风格描述 */
.cg-style-desc {
    font-size: 13.5px;
    color: var(--cg-text2);
    line-height: 1.75;
    margin: 0 0 18px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(124,58,237,.06));
    border-radius: var(--cg-radius-sm);
    border-left: 3px solid var(--cg-primary);
}
body.dark .cg-style-desc {
    background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(124,58,237,.1));
}

/* 区块通用 */
.cg-params-section,
.cg-hsl-section,
.cg-advice-box,
.cg-tool-box {
    margin-bottom: 18px;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius);
    overflow: hidden;
    background: var(--cg-surface);
}
body.dark .cg-params-section,
body.dark .cg-hsl-section,
body.dark .cg-advice-box,
body.dark .cg-tool-box {
    background: var(--cg-surface2);
}

/* 区块标题（调色结果内，区别于输入区的 .cg-section-title） */
.cg-result-content .cg-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cg-text2);
    padding: 10px 14px;
    background: var(--cg-surface2);
    border-bottom: 1px solid var(--cg-border);
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}
body.dark .cg-result-content .cg-section-title {
    background: rgba(255,255,255,.04);
}

/* 参数列表 */
.cg-params-grid {
    padding: 12px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cg-param-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-label {
    width: 68px;
    font-size: 12px;
    color: var(--cg-text2);
    flex-shrink: 0;
    white-space: nowrap;
}

.cg-param-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--cg-surface2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--cg-border);
    position: relative;
}
body.dark .cg-param-bar-wrap {
    background: rgba(255,255,255,.05);
}

.cg-param-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 4px;
    transition: width .4s ease;
}

/* 正向（暖色系渐变） */
.cg-param-bar[data-positive="true"] {
    background: linear-gradient(to right, #fde68a, #f59e0b, #d97706);
}
/* 负向（冷色系渐变） */
.cg-param-bar[data-positive="false"] {
    background: linear-gradient(to right, #a5f3fc, #06b6d4, #0284c7);
}

.param-value {
    width: 40px;
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    color: var(--cg-text2);
}
/* 正向值（暖橙色） */
.param-value.cg-val-positive {
    color: #d97706;
}
/* 负向值（冷蓝色） */
.param-value.cg-val-negative {
    color: #0284c7;
}
body.dark .param-value.cg-val-positive {
    color: #fbbf24;
}
body.dark .param-value.cg-val-negative {
    color: #38bdf8;
}
/* 零值（灰色） */
.param-value.cg-val-zero {
    color: var(--cg-text-muted);
    font-weight: 500;
}

/* 后期建议 */
.cg-advice-box ul {
    margin: 0;
    padding: 10px 14px 12px 14px;
    list-style-type: none;
}
.cg-advice-box li {
    font-size: 13px;
    color: var(--cg-text);
    line-height: 1.7;
    margin-bottom: 6px;
    padding-left: 18px;
    position: relative;
}
.cg-advice-box li::before {
    content: '';
    position: absolute;
    left: 0; top: 8px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #7c3aed);
    flex-shrink: 0;
}
.cg-advice-box li:last-child { margin-bottom: 0; }

/* 错误状态 */
.cg-result-content.cg-result-error {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex: 1;
    padding: 20px;
}
.cg-error-inner {
    text-align: center;
    padding: 20px;
}
.cg-error-icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.cg-error-msg {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    margin: 0 0 6px;
}
.cg-error-hint {
    font-size: 12px;
    color: var(--cg-text-muted);
    margin: 0 0 16px;
    line-height: 1.6;
}
.cg-retry-btn {
    padding: 7px 20px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity .18s, transform .15s;
}
.cg-retry-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}
/* 错误状态暗黑模式 */
body.dark .cg-error-msg {
    color: #f87171;
}
body.dark .cg-error-hint {
    color: var(--cg-text-muted);
}
body.dark .cg-retry-btn {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

/* ===== Lightroom 参考表 */
.cg-tool-box {
    overflow-x: auto;
}
.cg-lr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.cg-lr-table th {
    padding: 8px 12px;
    background: var(--cg-surface2);
    color: var(--cg-text2);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--cg-border);
    white-space: nowrap;
}
body.dark .cg-lr-table th {
    background: rgba(255,255,255,.05);
}
.cg-lr-table td {
    padding: 7px 12px;
    color: var(--cg-text);
    border-bottom: 1px solid var(--cg-border);
    line-height: 1.5;
}
/* 参数数値列特殊样式 */
.cg-lr-table td:nth-child(2) {
    font-weight: 700;
    font-family: monospace;
    font-size: 13px;
    color: var(--cg-primary-dark);
    white-space: nowrap;
}
body.dark .cg-lr-table td:nth-child(2) {
    color: #fcd34d;
}
.cg-lr-table tr:last-child td {
    border-bottom: none;
}
.cg-lr-table tr:hover td {
    background: rgba(245,158,11,.05);
}

/* ===== 示例导入模态框 ===== */
.cg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    backdrop-filter: blur(2px);
}
.cg-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(640px, 94vw);
    max-height: 80vh;
    z-index: 10001;
    border-radius: var(--cg-radius);
    background: var(--cg-surface);
    box-shadow: 0 16px 48px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cg-border);
}
.cg-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.cg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cg-border);
    flex-shrink: 0;
    background: linear-gradient(to right, rgba(245,158,11,.08), transparent);
}
.cg-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cg-text);
    background: none;
    border: none;
    padding: 0;
}
.cg-modal-close {
    background: transparent;
    border: none;
    color: var(--cg-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color .18s, background .18s;
    line-height: 1;
}
.cg-modal-close:hover {
    color: #ef4444;
    background: rgba(239,68,68,.08);
}
.cg-modal-body {
    overflow-y: auto;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    align-content: start;
}
.cg-modal-body::-webkit-scrollbar { width: 5px; }
.cg-modal-body::-webkit-scrollbar-thumb { background: var(--cg-border2); border-radius: 4px; }
.cg-modal-body::-webkit-scrollbar-track { background: var(--cg-surface); }
body.dark .cg-modal-body::-webkit-scrollbar-track { background: #241e19; }

/* 示例卡片 */
.cg-example-card {
    border: 1.5px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    padding: 12px;
    cursor: pointer;
    background: var(--cg-surface2);
    transition: border-color .18s, background .18s, transform .15s;
    position: relative;
    overflow: hidden;
}
.cg-example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(to right, #f59e0b, #7c3aed);
    opacity: 0;
    transition: opacity .18s;
}
.cg-example-card:hover {
    border-color: var(--cg-primary);
    background: rgba(245,158,11,.06);
    transform: translateY(-2px);
}
.cg-example-card:hover::before {
    opacity: 1;
}
.cg-example-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--cg-text);
    margin-bottom: 6px;
}
.cg-example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.cg-example-tag {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(245,158,11,.12);
    color: var(--cg-primary-dark);
    font-weight: 500;
}
body.dark .cg-example-tag {
    background: rgba(245,158,11,.18);
    color: #fcd34d;
}
.cg-example-desc {
    font-size: 11.5px;
    color: var(--cg-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    :root {
        --cg-history-w: 0px;
        --cg-input-w: 300px;
    }
    .cg-history-panel {
        display: none;
    }
}
@media (max-width: 639px) {
    :root {
        --cg-input-w: 100%;
    }
    .cg-main-content {
        flex-direction: column;
    }
    .cg-input-panel {
        border-right: none;
        border-bottom: 1px solid var(--cg-border);
        max-height: 50vh;
    }
    .cg-scene-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .cg-style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
