/* =====================================================
   AI事件营销 - 样式表  (前缀: aem-)
   ===================================================== */

/* ---- CSS 变量 ---- */
:root {
    --aem-primary:        #e55c2a;
    --aem-primary-hover:  #cc4a1a;
    --aem-primary-light:  #fff4ef;
    --aem-secondary:      #f97316;
    --aem-success:        #059669;
    --aem-warning:        #d97706;
    --aem-danger:         #dc2626;
    --aem-bg:             #fff8f5;
    --aem-surface:        #ffffff;
    --aem-border:         #fce4d4;
    --aem-text:           #1a0f08;
    --aem-text-muted:     #7c4a2d;
    --aem-text-light:     #c0906a;
    --aem-shadow-sm:      0 1px 4px rgba(229,92,42,.10);
    --aem-shadow-md:      0 4px 14px rgba(229,92,42,.13);
    --aem-shadow-lg:      0 8px 28px rgba(229,92,42,.16);
    --aem-radius:         12px;
    --aem-radius-sm:      7px;
    --aem-toolbar-h:      50px;
    --aem-transition:     0.2s ease;
}

/* 暗色主题 */
.aem-dark {
    --aem-primary:       #f97316;
    --aem-primary-hover: #fb923c;
    --aem-primary-light: #1a0e05;
    --aem-bg:            #140a02;
    --aem-surface:       #1e1008;
    --aem-border:        #3d2010;
    --aem-text:          #fff0e8;
    --aem-text-muted:    #e0a070;
    --aem-text-light:    #8a5030;
    --aem-shadow-sm:     0 1px 4px rgba(0,0,0,.35);
    --aem-shadow-md:     0 4px 14px rgba(0,0,0,.40);
    --aem-shadow-lg:     0 8px 28px rgba(0,0,0,.50);
}

/* ---- 全局容器 ---- */
.aem-container {
    display: flex;
    flex-direction: column;
    background: var(--aem-bg);
    border-radius: var(--aem-radius);
    overflow: hidden;
    box-shadow: var(--aem-shadow-lg);
    min-height: 640px;
    border: 1px solid var(--aem-border);
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

/* ---- 工具栏 ---- */
.aem-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: var(--aem-toolbar-h);
    background: var(--aem-surface);
    border-bottom: 1px solid var(--aem-border);
    flex-wrap: wrap;
    min-height: var(--aem-toolbar-h);
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

.toolbar-group          { display: flex; align-items: center; gap: 2px; }
.toolbar-group--right   { margin-left: auto; }

.aem-toolbar-btn {
    padding: 5px 11px;
    border: 1px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    background: var(--aem-surface);
    color: var(--aem-text);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--aem-transition);
    white-space: nowrap;
}

.aem-toolbar-btn:hover {
    background: var(--aem-primary-light);
    border-color: var(--aem-primary);
    color: var(--aem-primary);
}

.aem-toolbar-btn--ai {
    background: linear-gradient(135deg, #e55c2a, #f97316);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.aem-toolbar-btn--ai:hover {
    background: linear-gradient(135deg, #cc4a1a, #ea6c05);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229,92,42,.40);
}

/* ---- 主内容区三列布局 ---- */
.aem-main-content {
    display: grid;
    grid-template-columns: 210px 1fr 1fr;
    min-height: 590px;
    overflow: hidden;
}

/* ---- 历史记录面板 ---- */
.aem-history-panel {
    border-right: 1px solid var(--aem-border);
    display: flex;
    flex-direction: column;
    background: var(--aem-surface);
    overflow: hidden;
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--aem-border);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--aem-text);
}

.history-clear-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--aem-border);
    background: transparent;
    color: var(--aem-text-muted);
    cursor: pointer;
    transition: all var(--aem-transition);
}

.history-clear-btn:hover {
    border-color: var(--aem-danger);
    color: var(--aem-danger);
}

.history-search        { padding: 8px 10px; flex-shrink: 0; }
.history-search-wrap   { position: relative; }

.history-search-wrap input {
    width: 100%;
    padding: 5px 28px 5px 10px;
    border: 1px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    font-size: 12px;
    background: var(--aem-bg);
    color: var(--aem-text);
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--aem-transition);
}

.history-search-wrap input:focus { border-color: var(--aem-primary); }

.history-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--aem-text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    line-height: 1;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.history-empty {
    padding: 30px 14px;
    text-align: center;
    color: var(--aem-text-muted);
}

.history-empty-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.5; }
.history-empty-main { font-size: 13px; font-weight: 500; }
.history-empty-sub  { font-size: 11px; margin-top: 4px; color: var(--aem-text-light); }

.history-item {
    padding: 9px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--aem-transition);
    border-bottom: 1px solid var(--aem-border);
}

.history-item:hover  { background: var(--aem-primary-light); border-left-color: var(--aem-primary); }
.history-item.active { background: var(--aem-primary-light); border-left-color: var(--aem-primary); }

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--aem-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
    font-size: 10px;
    color: var(--aem-text-light);
}

.history-item-del {
    background: none;
    border: none;
    color: var(--aem-text-light);
    cursor: pointer;
    font-size: 10px;
    padding: 0 2px;
    transition: color var(--aem-transition);
    line-height: 1;
    opacity: 0;
}

.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { color: var(--aem-danger); }

.history-item-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    background: var(--aem-bg);
    color: var(--aem-primary);
    border: 1px solid var(--aem-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ---- 编辑器面板 ---- */
.aem-editor-panel {
    border-right: 1px solid var(--aem-border);
    display: flex;
    flex-direction: column;
    background: var(--aem-bg);
    overflow: hidden;
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

.editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--aem-surface);
    border-bottom: 1px solid var(--aem-border);
    flex-shrink: 0;
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

.editor-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--aem-text);
}

.editor-panel-meta {
    font-size: 11px;
    color: var(--aem-text-light);
}

/* ---- 表单样式 ---- */
.aem-form {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.aem-form-group {
    margin-bottom: 16px;
}

.aem-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--aem-text);
    margin-bottom: 6px;
}

.aem-label-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--aem-text-light);
    margin-left: 6px;
}

.required-mark {
    color: var(--aem-danger);
    margin-left: 2px;
}

.aem-input, .aem-select, .aem-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    font-size: 13px;
    background: var(--aem-surface);
    color: var(--aem-text);
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--aem-transition), box-shadow var(--aem-transition);
    font-family: inherit;
}

.aem-input:focus, .aem-select:focus, .aem-textarea:focus {
    border-color: var(--aem-primary);
    box-shadow: 0 0 0 3px rgba(229,92,42,.12);
}

.aem-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

.aem-char-counter {
    margin-top: 4px;
    font-size: 11px;
    color: var(--aem-text-light);
    text-align: right;
}

#specialRequestsCount {
    transition: color var(--aem-transition), font-weight var(--aem-transition);
}

.aem-count--warn  { color: var(--aem-warning); }
.aem-count--limit { color: var(--aem-danger); font-weight: 700; }

#specialRequestsHint {
    margin-left: 4px;
    transition: color var(--aem-transition);
}

.aem-char-counter.is-warn  #specialRequestsHint { color: var(--aem-warning); }
.aem-char-counter.is-limit #specialRequestsHint { color: var(--aem-danger); }

/* ---- 活动类型选择器 ---- */
.aem-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.aem-type-item { cursor: pointer; }
.aem-type-item input { display: none; }

.aem-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: 1.5px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    background: var(--aem-surface);
    cursor: pointer;
    transition: all var(--aem-transition);
    text-align: center;
}

.aem-type-card:hover {
    border-color: var(--aem-primary);
    background: var(--aem-primary-light);
}

.aem-type-item input:checked + .aem-type-card {
    border-color: var(--aem-primary);
    background: var(--aem-primary-light);
    box-shadow: 0 0 0 3px rgba(229,92,42,.12);
}

.type-icon { font-size: 18px; }
.type-name { font-size: 11px; font-weight: 600; color: var(--aem-text); margin-top: 3px; }
.type-desc { font-size: 9px; color: var(--aem-text-muted); margin-top: 1px; }

/* ---- 活动规模选择器 ---- */
.aem-scale-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.aem-scale-item { cursor: pointer; }
.aem-scale-item input { display: none; }

.aem-scale-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border: 1.5px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    background: var(--aem-surface);
    cursor: pointer;
    transition: all var(--aem-transition);
    text-align: center;
}

.aem-scale-card:hover {
    border-color: var(--aem-primary);
    background: var(--aem-primary-light);
}

.aem-scale-item input:checked + .aem-scale-card {
    border-color: var(--aem-primary);
    background: var(--aem-primary-light);
    box-shadow: 0 0 0 3px rgba(229,92,42,.12);
}

.scale-icon { font-size: 20px; }
.scale-name { font-size: 12px; font-weight: 600; color: var(--aem-text); margin-top: 4px; }
.scale-desc { font-size: 10px; color: var(--aem-text-muted); margin-top: 2px; line-height: 1.4; }

/* ---- 操作按钮区 ---- */
.aem-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.aem-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--aem-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--aem-transition);
    font-family: inherit;
}

.aem-btn--primary {
    background: linear-gradient(135deg, #e55c2a, #f97316);
    color: #fff;
}

.aem-btn--primary:hover {
    background: linear-gradient(135deg, #cc4a1a, #ea6c05);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229,92,42,.40);
}

.aem-btn--primary:disabled {
    background: #ccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.aem-btn--secondary {
    background: var(--aem-surface);
    color: var(--aem-text-muted);
    border: 1.5px solid var(--aem-border);
}

.aem-btn--secondary:hover {
    border-color: var(--aem-primary);
    color: var(--aem-primary);
    background: var(--aem-primary-light);
}

.shortcut-hint {
    font-size: 11px;
    color: var(--aem-text-light);
    padding: 3px 8px;
    background: var(--aem-bg);
    border: 1px solid var(--aem-border);
    border-radius: 4px;
}

.aem-shortcut-tip {
    margin-top: 10px;
    font-size: 11px;
    color: var(--aem-text-light);
    text-align: center;
    line-height: 1.5;
}

/* ---- 预览面板 ---- */
.aem-preview-panel {
    display: flex;
    flex-direction: column;
    background: var(--aem-bg);
    overflow: hidden;
    position: relative;
    transition: background var(--aem-transition);
}

.preview-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--aem-surface);
    border-bottom: 1px solid var(--aem-border);
    flex-shrink: 0;
    transition: background var(--aem-transition), border-color var(--aem-transition);
}

.preview-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--aem-text);
}

.preview-panel-actions { display: flex; gap: 6px; }

.preview-action-btn {
    padding: 4px 12px;
    border: 1px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    background: var(--aem-surface);
    color: var(--aem-text);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--aem-transition);
}

.preview-action-btn:hover {
    border-color: var(--aem-primary);
    color: var(--aem-primary);
    background: var(--aem-primary-light);
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ---- 空状态 ---- */
.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: var(--aem-text-muted);
    padding: 30px;
}

.preview-empty-icon { font-size: 56px; margin-bottom: 16px; }
.preview-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; transition: color var(--aem-transition); }
.preview-empty-title--error { color: #ef4444; }
.preview-empty-hint  { font-size: 13px; color: var(--aem-text-light); line-height: 1.7; }

/* ---- 浮动动画 ---- */
@keyframes aemFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.aem-float-anim { animation: aemFloat 3s ease-in-out infinite; }

/* ---- 加载状态 ---- */
.preview-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,248,245,.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    gap: 12px;
    transition: background var(--aem-transition);
}

.aem-dark .preview-loading {
    background: rgba(20,10,2,.92);
}

.loading-icon {
    font-size: 44px;
    animation: aemFloat 1.5s ease-in-out infinite;
}

.loading-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--aem-text);
}

.loading-hint {
    font-size: 13px;
    color: var(--aem-text-muted);
}

.cancel-generate-btn {
    margin-top: 8px;
    padding: 7px 20px;
    border: 1.5px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    background: var(--aem-surface);
    color: var(--aem-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--aem-transition);
}

.cancel-generate-btn:hover {
    border-color: var(--aem-danger);
    color: var(--aem-danger);
}

/* ---- Loading dots ---- */
.aem-loading-dots span {
    animation: aemDotBlink 1.4s infinite both;
    display: inline-block;
}

.aem-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.aem-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aemDotBlink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

/* ---- 错落入场动画 ---- */
@keyframes hg-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hg-anim-in {
    animation: hg-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ---- 方案卡片 ---- */
.plan-card {
    background: var(--aem-surface);
    border: 1px solid var(--aem-border);
    border-radius: var(--aem-radius);
    overflow: hidden;
    margin-bottom: 12px;
    transition: all var(--aem-transition);
    box-shadow: var(--aem-shadow-sm);
}

.plan-card:hover {
    box-shadow: var(--aem-shadow-md);
}

.plan-card-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, #e55c2a, #f97316);
    color: #fff;
}

.plan-card-brand {
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.plan-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 10px;
}

.plan-card-slogan {
    font-size: 13px;
    font-style: italic;
    opacity: 0.92;
    line-height: 1.5;
}

.plan-card-slogan .slogan-mark {
    opacity: 0.7;
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

/* ---- 方案各节 ---- */
.plan-sections {
    padding: 14px 18px;
}

.plan-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--aem-border);
}

.plan-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.plan-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--aem-primary);
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid var(--aem-primary);
}

.plan-section-body {
    font-size: 13px;
    color: var(--aem-text);
    line-height: 1.75;
    padding-left: 11px;
}

/* ---- 方案元数据 ---- */
.plan-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.plan-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--aem-primary-light);
    color: var(--aem-primary);
    border: 1px solid var(--aem-border);
}

/* ---- KPI表格 ---- */
.kpi-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.kpi-item {
    background: var(--aem-bg);
    border: 1px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--aem-text);
    line-height: 1.5;
}

.kpi-item strong {
    display: block;
    color: var(--aem-primary);
    font-size: 11px;
    margin-bottom: 2px;
}

/* ---- 执行清单 ---- */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 5px 0;
    font-size: 12px;
    color: var(--aem-text);
    border-bottom: 1px solid var(--aem-bg);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-icon {
    color: var(--aem-success);
    font-size: 13px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ---- Toast通知 ---- */
.aem-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1a0f08;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 13px;
    box-shadow: 0 6px 24px rgba(0,0,0,.20);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.aem-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.aem-toast.success { background: #059669; }
.aem-toast.error   { background: #dc2626; }
.aem-toast.warning { background: #d97706; }

/* ---- 弹框 ---- */
.aem-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.50);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.aem-modal.open { display: flex; }

.aem-modal-content {
    background: var(--aem-surface);
    border-radius: var(--aem-radius);
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.aem-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--aem-border);
    flex-shrink: 0;
}

.aem-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--aem-text);
}

.aem-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--aem-text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--aem-transition);
}

.aem-modal-close:hover {
    background: var(--aem-bg);
    color: var(--aem-danger);
}

.aem-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
}

.template-modal-hint {
    font-size: 13px;
    color: var(--aem-text-muted);
    margin: 0 0 16px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-card {
    border: 1.5px solid var(--aem-border);
    border-radius: var(--aem-radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all var(--aem-transition);
    background: var(--aem-bg);
}

.template-card:hover {
    border-color: var(--aem-primary);
    background: var(--aem-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--aem-shadow-sm);
}

.template-card-icon { font-size: 24px; margin-bottom: 6px; }
.template-card-name { font-size: 13px; font-weight: 600; color: var(--aem-text); margin-bottom: 4px; }
.template-card-desc { font-size: 11px; color: var(--aem-text-muted); }

/* ---- 周末/工作日动态背景 ---- */
.aem-container:not(.aem-weekend):not(.aem-dark) {
    --aem-bg: #f4f7fb;
}

.aem-container.aem-weekend:not(.aem-dark) {
    --aem-bg: #fff8f5;
}

/* ---- 全屏模式 ---- */
.aem-container.aem-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 999;
    overflow-y: auto;
}

/* ---- 滚动条美化 ---- */
.history-list::-webkit-scrollbar,
.aem-form::-webkit-scrollbar,
.preview-content::-webkit-scrollbar,
.aem-modal-body::-webkit-scrollbar { width: 4px; }

.history-list::-webkit-scrollbar-thumb,
.aem-form::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb,
.aem-modal-body::-webkit-scrollbar-thumb { background: var(--aem-primary); border-radius: 4px; opacity: 0.6; }

.history-list::-webkit-scrollbar-thumb:hover,
.aem-form::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover,
.aem-modal-body::-webkit-scrollbar-thumb:hover { background: var(--aem-primary-hover); opacity: 1; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .aem-main-content {
        grid-template-columns: 180px 1fr 1fr;
    }
    .aem-type-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .aem-main-content {
        grid-template-columns: 1fr;
    }
    .aem-history-panel {
        display: none;
    }
    .kpi-list {
        grid-template-columns: 1fr;
    }
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .aem-type-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .shortcut-hint,
    .aem-shortcut-tip { display: none; }
}
