/* ========================================
/* 商品卖点发散 product_selling_points_divergence.css
   主题色：商业金 #d97706 / 琥珀 #f59e0b / 暖白 #fffbeb
   ======================================== */

/* ========== 容器 ========== */
.sp-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fffbeb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(217, 119, 6, 0.1);
    transition: box-shadow 0.3s ease, border-radius 0.3s ease;
}

/* 全屏模式 */
.sp-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.sp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #b45309 0%, #d97706 45%, #f59e0b 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.45);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-group--right {
    margin-left: auto;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #b45309;
    border-color: transparent;
    font-weight: 600;
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #92400e;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

.toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.5);
}

.toolbar-btn-cancel:hover {
    background: rgba(239, 68, 68, 1);
}

/* ========== 主内容区 ========== */
.sp-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fffbeb;
}

/* ========== 左栏：历史记录 ========== */
.sp-history-panel {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
}

.history-count {
    font-size: 11px;
    color: #d97706;
    margin-left: 4px;
    font-weight: 400;
}

.history-clear-btn {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    color: #ec4899;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fce7f3;
    border-color: #ec4899;
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffbeb;
    color: #374151;
}

.history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12);
}

.history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 0;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: #fef3c7;
}

.history-list::-webkit-scrollbar-thumb {
    background: #fcd34d;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

.history-empty {
    text-align: center;
    padding: 30px 14px;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.8;
}

.sp-history-item {
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #fef3c7;
    transition: all 0.2s;
}

.sp-history-item:hover {
    background: #fef3c7;
}

.sp-history-item.active {
    background: #fef9c3;
    border-left: 3px solid #d97706;
}

.hi-product {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.hi-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.hi-badge {
    font-size: 10px;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #fde68a;
}

.hi-time {
    font-size: 10px;
    color: #9ca3af;
}

/* ========== 中栏：输入 ========== */
.sp-input-panel {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
}

.panel-tip {
    font-size: 11px;
    color: #9ca3af;
}

.sp-input-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
}

.sp-input-body::-webkit-scrollbar {
    width: 4px;
}

.sp-input-body::-webkit-scrollbar-track {
    background: #fef3c7;
}

.sp-input-body::-webkit-scrollbar-thumb {
    background: #fcd34d;
    border-radius: 2px;
}

.sp-input-body::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.form-label-icon {
    margin-right: 4px;
}

.form-required {
    color: #ef4444;
    font-size: 12px;
}

.form-optional {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 400;
}

.sp-input {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff;
}

.sp-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.sp-input.shake {
    animation: shake 0.4s ease;
    border-color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.sp-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff;
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
    line-height: 1.5;
}

.sp-textarea:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.sp-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d97706' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.sp-select:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.char-counter {
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.sp-tips-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 13px;
    margin-top: 4px;
}

.sp-tips-box p {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.sp-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.sp-tips-box li {
    font-size: 11px;
    color: #78716c;
    margin-bottom: 4px;
    line-height: 1.5;
}

.sp-tips-box kbd {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    color: #92400e;
    font-family: inherit;
}

/* ========== 右栏：结果 ========== */
.sp-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafaf9;
}

.sp-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.sp-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
}

.result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-meta-info {
    display: flex;
    gap: 6px;
}

.result-product-badge {
    font-size: 11px;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #fde68a;
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-scenario-badge {
    font-size: 11px;
    background: #f0fdf4;
    color: #166534;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

body.dark .result-scenario-badge {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
}

.result-rewrite-btn {
    padding: 5px 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #92400e;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-rewrite-btn:hover {
    background: #fef3c7;
    border-color: #d97706;
    transform: translateY(-1px);
}

.sp-result-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.sp-result-body::-webkit-scrollbar {
    width: 5px;
}

.sp-result-body::-webkit-scrollbar-track {
    background: #fef3c7;
}

.sp-result-body::-webkit-scrollbar-thumb {
    background: #fcd34d;
    border-radius: 3px;
}

.sp-result-body::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

/* ========== 占位提示 ========== */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #9ca3af;
    text-align: center;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: spFloat 3s ease-in-out infinite;
}

@keyframes spFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 5px 0;
}

.placeholder-desc kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    color: #6b7280;
    font-family: inherit;
}

.placeholder-dims {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.placeholder-dims span {
    font-size: 11px;
    background: #fef3c7;
    color: #92400e;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #fde68a;
}

/* ========== 加载状态 ========== */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
}

.sp-loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sp-loading-dots span {
    width: 12px;
    height: 12px;
    background: #d97706;
    border-radius: 50%;
    animation: sp-dot-bounce 1.4s ease-in-out infinite both;
}

.sp-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.sp-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.sp-loading-dots span:nth-child(3) { animation-delay: 0s; }
.sp-loading-dots span:nth-child(4) { animation-delay: 0.16s; }
.sp-loading-dots span:nth-child(5) { animation-delay: 0.32s; }

@keyframes sp-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #92400e;
    margin: 0;
    font-weight: 500;
}

/* ========== 错误状态 ========== */
.result-error {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    color: #dc2626;
    font-size: 13px;
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.error-body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-retry-btn {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #dc2626;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.error-msg {
    flex: 1;
    line-height: 1.5;
}

.error-retry-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* 中栏嵌入操作按钮 */
.sp-inline-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #fde68a;
}

.sp-inline-generate-btn {
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
    user-select: none;
    font-family: inherit;
}

.sp-inline-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #92400e, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
}

.sp-inline-generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sp-inline-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@keyframes spFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content .sp-result {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-content .sp-dimension {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(217, 119, 6, 0.08);
    border: 1px solid #fde68a;
    position: relative;
    transition: box-shadow 0.2s;
    animation: spFadeInUp 0.32s ease backwards;
}

.result-content .sp-dimension:hover {
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.15);
}

/* 各维度不同颜色 + 入场动画分批延迟 */
.result-content .sp-dimension:nth-child(1) { border-top: 3px solid #3b82f6; animation-delay: 0.02s; }
.result-content .sp-dimension:nth-child(2) { border-top: 3px solid #10b981; animation-delay: 0.08s; }
.result-content .sp-dimension:nth-child(3) { border-top: 3px solid #ec4899; animation-delay: 0.14s; }
.result-content .sp-dimension:nth-child(4) { border-top: 3px solid #8b5cf6; animation-delay: 0.20s; }
.result-content .sp-dimension:nth-child(5) { border-top: 3px solid #ef4444; animation-delay: 0.26s; }
.result-content .sp-dimension:nth-child(6) { border-top: 3px solid #d97706; animation-delay: 0.32s; }

.result-content .sp-dimension-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 8px;
    background: linear-gradient(to right, #fafaf9, #fff);
    border-bottom: 1px solid #f3f4f6;
}

.result-content .sp-dim-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.result-content .sp-dim-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.result-content .sp-dim-desc {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
}

/* 复制按钮（JS注入） */
.sp-dim-copy-btn {
    padding: 3px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 4px;
}

.sp-dim-copy-btn:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

/* 卖点列表 */
.result-content .sp-points {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-content .sp-point-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    background: #fafaf9;
    border-radius: 7px;
    border-left: 3px solid #fde68a;
    transition: all 0.2s;
}

.result-content .sp-point-item:hover {
    background: #fef3c7;
    border-left-color: #d97706;
    transform: translateX(2px);
}

.result-content .sp-point-tag {
    font-size: 11px;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #fde68a;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
}

.result-content .sp-point-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    flex: 1;
}

/* 营销口号维度特殊样式 */
.result-content .sp-slogan-dim {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fcd34d;
}

.result-content .sp-slogans {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-content .sp-slogan-item {
    padding: 14px 36px;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
    border-radius: 8px;
    border: 1px solid #fde68a;
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.5;
    position: relative;
    transition: all 0.2s;
}

.result-content .sp-slogan-item::before {
    content: '"';
    font-size: 28px;
    color: #fcd34d;
    position: absolute;
    top: 2px;
    left: 8px;
    line-height: 1;
    font-family: Georgia, serif;
}

.result-content .sp-slogan-item::after {
    content: '"';
    font-size: 28px;
    color: #fcd34d;
    position: absolute;
    bottom: 2px;
    right: 8px;
    line-height: 1;
    font-family: Georgia, serif;
}

.result-content .sp-slogan-item:hover {
    background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%);
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

/* ========== Toast 提示 ========== */
.sp-tip-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 30, 0.88);
    color: #fff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.28s ease;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.sp-tip-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 示例模态框 ========== */
.sp-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    backdrop-filter: blur(3px);
}

.sp-modal-overlay.show {
    display: block;
}

.sp-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 99999;
    width: 640px;
    max-width: 94vw;
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sp-modal.show {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.sp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    flex-shrink: 0;
}

.sp-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.sp-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sp-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.sp-modal-body {
    overflow-y: auto;
    padding: 16px;
    flex: 1;
}

.sp-modal-body::-webkit-scrollbar {
    width: 4px;
}

.sp-modal-body::-webkit-scrollbar-track {
    background: #f9fafb;
}

.sp-modal-body::-webkit-scrollbar-thumb {
    background: #fcd34d;
    border-radius: 2px;
}

.sp-modal-body::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.example-card {
    padding: 12px 14px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    background: #fef3c7;
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

.ec-label {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 5px;
}

.ec-product {
    font-size: 12px;
    color: #374151;
    margin-bottom: 4px;
}

.ec-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ec-tag {
    font-size: 10px;
    background: #fff;
    color: #6b7280;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
}

/* ========== 暗黑模式 ========== */
body.dark .sp-container {
    background: #1a1a2e;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

body.dark .sp-toolbar {
    background: linear-gradient(135deg, #78350f 0%, #92400e 45%, #b45309 100%);
}

body.dark .sp-main-content {
    background: #1a1a2e;
}

body.dark .sp-history-panel {
    background: #16213e;
    border-right-color: #3d3000;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1a1a2e, #1e2a4a);
    border-bottom-color: #3d3000;
}

body.dark .history-panel-header h3 {
    color: #fbbf24;
}

body.dark .history-search {
    border-bottom-color: #3d3000;
}

body.dark .history-search input {
    background: #1a1a2e;
    border-color: #3d3000;
    color: #e5e7eb;
}

body.dark .history-search input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

body.dark .history-list::-webkit-scrollbar-track { background: #1a1a2e; }
body.dark .history-list::-webkit-scrollbar-thumb { background: #4a3800; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #d97706; }

body.dark .history-empty {
    color: #6b7280;
}

body.dark .sp-history-item {
    border-bottom-color: #1e2a4a;
    color: #e5e7eb;
}

body.dark .sp-history-item:hover {
    background: #1e2a4a;
}

body.dark .sp-history-item.active {
    background: #2a1f00;
    border-left-color: #d97706;
}

body.dark .hi-product {
    color: #e5e7eb;
}

body.dark .hi-badge {
    background: #2a1f00;
    color: #fbbf24;
    border-color: #3d3000;
}

body.dark .sp-input-panel {
    background: #16213e;
    border-right-color: #3d3000;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1a1a2e, #1e2a4a);
    border-bottom-color: #3d3000;
}

body.dark .panel-header h3 {
    color: #fbbf24;
}

body.dark .panel-tip {
    color: #6b7280;
}

body.dark .sp-input-body::-webkit-scrollbar-track { background: #1a1a2e; }
body.dark .sp-input-body::-webkit-scrollbar-thumb { background: #4a3800; }
body.dark .sp-input-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

body.dark .form-label {
    color: #d1d5db;
}

body.dark .sp-input,
body.dark .sp-textarea,
body.dark .sp-select {
    background: #0f0f1a;
    border-color: #374151;
    color: #e5e7eb;
}

/* select 在暗黑模式下需单独覆盖筕头图标（必须在 background 简写之后） */
body.dark .sp-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f59e0b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

body.dark .sp-input:focus,
body.dark .sp-textarea:focus,
body.dark .sp-select:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

body.dark .sp-tips-box {
    background: linear-gradient(135deg, #1e2a4a 0%, #2a1f00 100%);
    border-color: #3d3000;
}

body.dark .sp-tips-box p {
    color: #fbbf24;
}

body.dark .sp-tips-box li {
    color: #9ca3af;
}

body.dark .sp-tips-box kbd {
    background: #2a1f00;
    border-color: #4a3800;
    color: #fbbf24;
}

body.dark .sp-result-panel {
    background: #0f0f1a;
}

body.dark .sp-result-header {
    background: linear-gradient(to bottom, #1a1a2e, #1e2a4a);
    border-bottom-color: #3d3000;
}

body.dark .sp-result-header h3 {
    color: #fbbf24;
}

body.dark .result-product-badge {
    background: #2a1f00;
    color: #fbbf24;
    border-color: #3d3000;
}

body.dark .result-rewrite-btn {
    background: #1e2a4a;
    border-color: #4a3800;
    color: #fbbf24;
}

body.dark .result-rewrite-btn:hover {
    background: #2a1f00;
    border-color: #d97706;
}

body.dark .sp-result-body::-webkit-scrollbar-track { background: #0f0f1a; }
body.dark .sp-result-body::-webkit-scrollbar-thumb { background: #4a3800; }
body.dark .sp-result-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

body.dark .placeholder-title { color: #9ca3af; }
body.dark .placeholder-desc { color: #6b7280; }
body.dark .placeholder-desc kbd {
    background: #1e2a4a;
    border-color: #374151;
    color: #9ca3af;
}
body.dark .placeholder-dims span {
    background: #2a1f00;
    color: #fbbf24;
    border-color: #3d3000;
}

body.dark .sp-loading-dots span { background: #f59e0b; }
body.dark .loading-text { color: #fbbf24; }

body.dark .result-error {
    background: #1c0a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

body.dark .error-retry-btn {
    background: #1e2a4a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

body.dark .error-retry-btn:hover {
    background: #450a0a;
    border-color: #ef4444;
}

body.dark .result-content .sp-dimension {
    background: #16213e;
    border-color: #3d3000;
    box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

body.dark .result-content .sp-dimension-header {
    background: linear-gradient(to right, #1a1a2e, #16213e);
    border-bottom-color: #1e2a4a;
}

body.dark .result-content .sp-dim-title {
    color: #e5e7eb;
}

body.dark .result-content .sp-dim-desc {
    color: #6b7280;
}

body.dark .sp-dim-copy-btn {
    background: #1e2a4a;
    border-color: #374151;
    color: #9ca3af;
}

body.dark .sp-dim-copy-btn:hover {
    background: #2a1f00;
    border-color: #d97706;
    color: #fbbf24;
}

body.dark .result-content .sp-point-item {
    background: #0f0f1a;
    border-left-color: #3d3000;
}

body.dark .result-content .sp-point-item:hover {
    background: #1a1a2e;
    border-left-color: #d97706;
}

body.dark .result-content .sp-point-tag {
    background: #2a1f00;
    color: #fbbf24;
    border-color: #3d3000;
}

body.dark .result-content .sp-point-text {
    color: #d1d5db;
}

body.dark .result-content .sp-slogan-dim {
    background: linear-gradient(135deg, #1e2a4a 0%, #2a1f00 100%);
    border-color: #4a3800;
}

body.dark .result-content .sp-slogan-item {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    border-color: #3d3000;
    color: #fbbf24;
}

body.dark .result-content .sp-slogan-item::before,
body.dark .result-content .sp-slogan-item::after {
    color: #4a3800;
}

body.dark .result-content .sp-slogan-item:hover {
    background: linear-gradient(135deg, #2a1f00 0%, #1e2a4a 100%);
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark .sp-inline-generate-btn {
    background: linear-gradient(135deg, #78350f, #92400e);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark .sp-inline-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6b2f0c, #78350f);
}

body.dark .sp-inline-actions {
    border-top-color: #3d3000;
}
body.dark .sp-modal {
    background: #1a1a2e;
}

body.dark .sp-modal-header {
    background: linear-gradient(135deg, #78350f, #92400e);
}

body.dark .sp-modal-body {
    background: #1a1a2e;
}

body.dark .sp-modal-body::-webkit-scrollbar-track { background: #0f0f1a; }
body.dark .sp-modal-body::-webkit-scrollbar-thumb { background: #4a3800; }
body.dark .sp-modal-body::-webkit-scrollbar-thumb:hover { background: #d97706; }

body.dark .example-card {
    background: #16213e;
    border-color: #3d3000;
}

body.dark .example-card:hover {
    background: #2a1f00;
    border-color: #d97706;
}

body.dark .ec-label {
    color: #fbbf24;
}

body.dark .ec-product {
    color: #d1d5db;
}

body.dark .ec-tag {
    background: #1e2a4a;
    color: #9ca3af;
    border-color: #374151;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .sp-history-panel {
        display: none;
    }
}

@media (max-width: 639px) {
    .sp-main-content {
        flex-direction: column;
        overflow-y: auto;
    }
    .sp-history-panel {
        display: none;
    }
    .sp-input-panel {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #fde68a;
        flex-shrink: 0;
    }
    body.dark .sp-input-panel {
        border-bottom-color: #3d3000;
    }
    .sp-result-panel {
        flex: 1;
        min-height: 300px;
    }
    .example-grid {
        grid-template-columns: 1fr;
    }
    .toolbar-title {
        display: none;
    }
    .result-meta-info {
        display: none;
    }
}
