/* CSS 变量 - 主题系统 */
:root {
    /* 暗色主题（默认） */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #2d3748;
    --bg-hover: rgba(45, 55, 72, 0.6);
    --bg-overlay: rgba(15, 20, 25, 0.95);
    --bg-panel: rgba(26, 31, 46, 0.8);

    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #8c9aae;
    --text-disabled: #6c757d;

    --border-primary: #2d3748;
    --border-secondary: #4a5568;
    --border-light: #e0e0e0;

    --accent-primary: #00d4aa;
    --accent-hover: #00BF9A;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(45deg, #00d4aa, #764ba2);
    --accent-glow: rgba(0, 212, 170, 0.3);

    --success-color: #00d4aa;
    --success-bg: rgba(0, 212, 170, 0.2);
    --error-color: #f43f5e;
    --error-bg: rgba(244, 63, 94, 0.2);
    --danger-color: #f43f5e;

    --shadow-primary: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 15px var(--accent-glow);

    --tradingview-theme: 'dark';
}

/* 亮色主题 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-hover: rgba(233, 236, 239, 0.8);
    --bg-overlay: rgba(255, 255, 255, 0.95);
    --bg-panel: rgba(255, 255, 255, 0.95);

    --text-primary: #2c3e50;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-disabled: #adb5bd;

    --border-primary: #e9ecef;
    --border-secondary: #dee2e6;
    --border-light: #e0e0e0;

    --accent-primary: #0891b2;
    --accent-hover: #0ea5e9;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(45deg, #0891b2, #7c3aed);
    --accent-glow: rgba(8, 145, 178, 0.3);

    --success-color: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --error-color: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    --danger-color: #dc2626;

    --shadow-primary: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 15px var(--accent-glow);

    --tradingview-theme: 'light';
}

/* 主题切换动画 */
* {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 特殊元素的过渡优化 */
.resize-handle,
.toolbar-icon,
.control-btn,
.theme-toggle {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主题切换时的特殊动画效果 */
body {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 图表容器的主题切换动画 */
#chart-container {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 工具栏的主题切换动画 */
#bottom-container {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 按钮和交互元素的动画 */
button,
.btn,
.control-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 输入框的动画 */
input,
textarea,
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片和面板的动画 */
.card,
.panel,
.modal-container {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主题切换时的全局动画效果 */
body.theme-transitioning {
    overflow: hidden;
}

body.theme-transitioning * {
    transition-duration: 0.6s !important;
}

/* 主题切换时的页面缩放动画 */
body.theme-transitioning {
    transform: scale(0.98);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主题切换完成后的恢复动画 */
body:not(.theme-transitioning) {
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主题切换按钮的特殊动画 */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.theme-toggle:active::before {
    width: 200px;
    height: 200px;
    opacity: 1;
}

/* 主题切换时的图标旋转动画 */
.theme-toggle svg {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:active svg {
    transform: rotate(180deg);
}

/* 策略广场弹窗样式 */
.indicator-square-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.indicator-square-modal.show {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}

/* 策略广场模态框在亮色模式下的特殊背景 */
[data-theme="light"] .indicator-square-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* 暗色模式下的选中高亮优化 */
.ace_editor .ace_selection {
    background: rgba(59, 130, 246, 0.4) !important;
    /* 蓝色系 */
    border: 1px solid rgba(59, 130, 246, 0.6) !important;
}


.modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    margin: auto;
    background: var(--bg-panel);
    border-radius: 16px;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.indicator-square-modal.show .modal-container {
    transform: scale(1);
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.modal-tabs {
    display: flex;
    gap: 8px;
}

.modal-tab {
    position: relative;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-tab.active {
    background: #00a085;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 160, 133, 0.3);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.new-badge {
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.modal-search {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 11px 20px;
    align-items: center;
    flex-grow: 1;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-primary);
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--accent-primary);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
    transform: scale(1.05);
}

/* 弹窗内容 */
.modal-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 模态标签内容切换 */
.modal-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.modal-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* AI机器人页面样式 */
.ai-robot-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-robot-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 212, 170, 0.05) 100%);
}

.ai-robot-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ai-icon {
    font-size: 24px;
}

.ai-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 36px;
}

.ai-robot-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.ai-feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.ai-feature-card {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.ai-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ai-input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.ai-input-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ai-input-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.ai-input-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.ai-input-actions {
    display: flex;
    justify-content: flex-end;
}

.ai-generate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), #007a65);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-icon {
    font-size: 16px;
}

.ai-status-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    color: var(--accent-primary);
}

.status-icon {
    font-size: 18px;
}

.status-text {
    font-size: 14px;
}

/* 我的策略弹窗样式 */
.my-strategies-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    backdrop-filter: blur(8px);
}

.my-strategies-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-strategies-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.my-strategies-modal .modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.my-strategies-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.my-strategies-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-strategies-modal .my-icon {
    font-size: 24px;
}

.my-strategies-modal .my-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.my-strategies-modal .modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.my-strategies-modal .modal-close:hover {
    background: var(--bg-quaternary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.my-strategies-modal .modal-close svg {
    width: 20px;
    height: 20px;
}

.my-strategies-modal .modal-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 我的策略页面样式 */
.my-strategies-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.my-strategies-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.my-strategies-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.my-icon {
    font-size: 24px;
}

.my-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.my-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 36px;
}

.my-strategies-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

.strategies-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.strategy-filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.strategy-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.strategy-filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.strategies-search {
    flex-shrink: 0;
}

.strategies-search-input {
    width: 200px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.strategies-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.my-strategies-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
}

.my-strategies-list:empty,
.my-strategies-list:has(.empty-strategies),
.my-strategies-list:has(.strategies-loading) {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-strategies {
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 300px;
}

.retry-btn {
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #007a65;
    transform: translateY(-1px);
}

/* 我的策略卡片样式 */
.my-strategy-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.my-strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.my-strategy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.my-strategy-card:hover::before {
    opacity: 1;
}

.strategy-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.strategy-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.strategy-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.strategy-card-info {
    flex: 1;
    min-width: 0;
}

.strategy-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.strategy-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.strategy-template {
    color: var(--accent-primary);
    font-weight: 500;
}

.strategy-visibility {
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.strategy-card-status {
    flex-shrink: 0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.running {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-badge.paused {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-badge.stopped {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.strategy-card-details {
    padding: 16px 24px;
}

.strategy-detail-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

.strategy-detail-row:last-child {
    margin-bottom: 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.detail-value.profit {
    color: #22c55e;
}

.detail-value.loss {
    color: #ef4444;
}

.strategy-card-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-primary);
    background: rgba(255, 255, 255, 0.02);
}

.strategy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
}

.strategy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.strategy-btn.edit-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.strategy-btn.copy-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.1);
}

.strategy-btn.pause-btn:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.strategy-btn.resume-btn:hover {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}


.strategy-btn.edit-strategy-btn:hover {
    border-color: #3b82f6;  /* 蓝色边框 */
    color: #3b82f6;         /* 蓝色文字 */
    background: rgba(59, 130, 246, 0.1); /* 蓝色半透明背景 */
}

.strategy-btn.delete-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.strategy-btn.start-btn:hover {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.strategy-btn.visibility-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.strategy-btn.auth-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.strategy-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 加载状态样式 */
.strategies-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.strategies-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-primary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.strategies-loading .loading-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}



.content-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 12px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.filter-tab {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: #00a085;
    border-color: #00a085;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 策略类型筛选 */
.strategy-type-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.type-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.type-filter-tabs {
    display: flex;
    gap: 6px;
}

.type-filter-tab {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.type-filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.type-filter-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* 排序选项 */
.sort-options {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.sort-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sort-column {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    min-width: 0;
}

.sort-column:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #d1d5db;
}

.sort-column.active {
    color: #d1d5db;
}

.sort-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sort-icons {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.sort-icon {
    width: 10px;
    height: 10px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sort-column:hover .sort-icon {
    opacity: 0.8;
}

.sort-column.active .sort-icon {
    opacity: 0.8;
}

.sort-column.active .sort-up {
    opacity: 1;
}

.sort-column.active .sort-down {
    opacity: 0.4;
}

.sort-column.active.desc .sort-up {
    opacity: 0.4;
}

.sort-column.active.desc .sort-down {
    opacity: 1;
}



/* 策略广场 - 策略列表 */
.indicator-square-modal .indicator-list {
    flex: 1;
    padding: 16px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 策略广场卡片样式 */
.indicator-square-modal .indicator-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    min-height: 120px;
    margin-bottom: 20px;
}

.indicator-square-modal .indicator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.indicator-square-modal .indicator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.indicator-square-modal .indicator-card:hover::before {
    opacity: 1;
}

.indicator-square-modal .indicator-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 212, 170, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.indicator-square-modal .indicator-card:hover::after {
    opacity: 1;
}

.card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    line-height: 1.3;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.card-status.public {
    background: var(--success-bg);
    color: var(--success-color);
}

.card-description {
    width: 300px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.card-performance {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.performance-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.performance-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.performance-value.positive {
    color: var(--success-color);
}

.performance-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-primary);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.author-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.publish-time {
    font-size: 11px;
    color: var(--text-muted);
}

.card-stats {
    display: flex;
    gap: 16px;
}

.stat-item1 {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.stat-item1:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}


.stat-icon {
    width: 12px;
    height: 12px;
}

/* 加载代码按钮样式 */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-code-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.preview-code-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.load-code-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #00a085;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 160, 133, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.load-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 160, 133, 0.4);
    background: #008770;
}

.load-code-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 160, 133, 0.3);
}

.load-code-btn svg {
    width: 14px;
    height: 14px;
}

/* 加载代码按钮提示 */
.load-code-btn {
    position: relative;
}

.load-code-btn::before {
    content: '点击加载策略代码到编辑器';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-primary);
    z-index: 1000;
    margin-bottom: 8px;
}

.load-code-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.load-code-btn:hover::before,
.load-code-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* AI机器人启动按钮样式 */
.start-ai-robot-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.start-ai-robot-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    background: #16a34a;
}

.start-ai-robot-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.start-ai-robot-btn svg {
    width: 14px;
    height: 14px;
}

/* AI机器人启动按钮提示 */
.start-ai-robot-btn::before {
    content: '点击启动AI机器人';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-primary);
    z-index: 1000;
    margin-bottom: 8px;
}

.start-ai-robot-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.start-ai-robot-btn:hover::before,
.start-ai-robot-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 移动端AI机器人启动按钮样式 */
@media (max-width: 768px) {
    .start-ai-robot-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }

    /* 移动端隐藏提示 */
    .start-ai-robot-btn::before,
    .start-ai-robot-btn::after {
        display: none;
    }
}
/* 代码预览弹窗样式 */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.preview-container {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.preview-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.preview-content {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

.code-preview-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
}

.code-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    font-size: 11px;
    color: var(--text-muted);
}

.code-language {
    font-weight: 600;
    color: var(--accent-primary);
}

.code-lines {
    opacity: 0.8;
}

.code-preview {
    background: var(--bg-tertiary);
    padding: 16px;
    margin: 0;
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow: auto;
}

/* 代码预览行号样式 */
.code-preview {
    counter-reset: line;
}

.code-preview::before {
    content: '';
    display: block;
    height: 0;
    margin-top: -1em;
}

.preview-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    justify-content: flex-end;
}

.preview-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.preview-btn.secondary:hover {
    background: var(--bg-hover);
}

.preview-btn.primary {
    background: var(--accent-gradient);
    color: white;
}

.preview-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        height: 90%;
    }

    .modal-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .modal-tabs {
        justify-content: center;
    }

    .modal-search {
        flex-direction: column;
        gap: 12px;
    }

    .search-input {
        width: 100%;
    }

    .indicator-square-modal .indicator-list {
        padding: 16px;
    }

    .indicator-square-modal .indicator-card {
        flex-direction: column;
        min-height: auto;
        gap: 16px;
        padding: 16px;
    }

    .card-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .load-code-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }

    /* 移动端隐藏提示 */
    .load-code-btn::before,
    .load-code-btn::after {
        display: none;
    }

    /* 移动端预览弹窗样式 */
    .preview-modal {
        padding: 10px;
    }

    .preview-container {
        max-height: 90vh;
    }

    .preview-header {
        padding: 16px 20px;
    }

    .preview-header h3 {
        font-size: 16px;
    }

    .preview-content {
        padding: 16px 20px;
    }

    .preview-actions {
        padding: 16px 20px;
        flex-direction: column;
    }

    .preview-btn {
        width: 100%;
        padding: 12px 20px;
    }

    /* 移动端隐藏预览按钮 */
    .preview-code-btn {
        display: none;
    }

    .card-performance {
        flex-direction: row;
        gap: 16px;
        min-width: auto;
        width: 100%;
        justify-content: space-around;
    }

    .performance-item {
        min-width: auto;
    }

    .card-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .card-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* 用户系统样式 */
.user-header {
    height: 50px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0 20px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
    /* 防止header被压缩 */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 主题切换按钮 - 固定在右下角 */
.theme-toggle {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
}

/* 头部主题切换按钮样式 */
.header-theme-toggle {
    position: static;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    box-shadow: none;
    backdrop-filter: none;
    border: 1px solid var(--border-primary);
}

.header-theme-toggle:hover {
    background: var(--accent-gradient);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-theme-toggle .icon {
    width: 16px;
    height: 16px;
}

.theme-toggle:hover {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), var(--shadow-glow);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .icon {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.theme-toggle .dark-icon {
    display: block;
}

.theme-toggle .light-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .dark-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .light-icon {
    display: block;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .theme-toggle {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    .theme-toggle .icon {
        width: 20px;
        height: 20px;
    }

    /* 移动端头部主题切换按钮样式 */
    .header-theme-toggle {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .header-theme-toggle .icon {
        width: 14px;
        height: 14px;
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }

    .theme-toggle .icon {
        width: 18px;
        height: 18px;
    }

    /* 小屏幕头部主题切换按钮样式 */
    .header-theme-toggle {
        width: 24px;
        height: 24px;
        margin-right: 4px;
    }

    .header-theme-toggle .icon {
        width: 12px;
        height: 12px;
    }
}

/* 主题切换按钮的脉冲动画效果 */
@keyframes themePulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(0, 212, 170, 0.1);
    }

    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.theme-toggle:focus {
    outline: none;
    animation: themePulse 2s infinite;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.user-status {
    color: var(--text-muted);
    font-size: 12px;
}

.user-menu {
    position: relative;
    z-index: 1001;
}















/* 用户系统新样式 */
.edit-profile-btn,
.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-profile-btn:hover,
.logout-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.user-avatar.vip {
    border: 2px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.notification-badge {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-badge:hover {
    background: var(--bg-tertiary);
}

/* 垂直flex布局 - 确保完整显示 */
html,
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    /* 使用视口高度 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#tv_chart_container {
    flex: 1;
    min-height: 0;
    /* 重要：防止flex子元素撑破容器 */
    width: 100%;
    position: relative;
}

/* 底部工具栏样式 */
#bottom-container {
    position: relative;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    border-top: 1px solid var(--border-primary);
    transition: height 0.3s ease;
    height: 300px;
    min-height: 100px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

/* 确保收起状态覆盖所有可能的高度设置 */
#bottom-container.collapsed {
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
}

#bottom-container.collapsed .toolbar-header {
    height: 60px;
    padding: 0 12px;
}



/* 标题默认状态的过渡设置 */
.toolbar-title {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 收起状态下文本向右移动到展开按钮左侧的动画 */
#bottom-container.collapsed .toolbar-title {
    position: relative;
    left: calc(100% - 160px);
}

/* 控制按钮区域收起时的调整 */
.toolbar-controls {
    transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#bottom-container.collapsed .toolbar-controls {
    gap: 5px;
}

/* 确保展开按钮在收起状态下保持正确的位置和间距 */
#bottom-container.collapsed .toolbar-controls #toggleBtn {
    margin-left: 0;
    flex-shrink: 0;
}

/* 完全隐藏状态 */
#bottom-container.hidden {
    height: 0px !important;
    min-height: 0;
    border: none;
    overflow: hidden;
}

#bottom-container.hidden .resize-handle {
    display: none;
}

/* 浮动恢复按钮 */
.restore-button {
    position: fixed;
    bottom: 10px;
    right: 20px;
    width: 40px;
    height: 32px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
    z-index: 1000;
}

.restore-button:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.restore-button.show {
    display: flex;
}

/* 拖拽手柄 - 简化版本 */
.resize-handle {
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--border-primary);
    cursor: row-resize;
    z-index: 100;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bottom-container.collapsed .resize-handle {
    top: -3px;
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--text-muted);
    pointer-events: none;
}

#bottom-container.collapsed .resize-handle:hover {
    opacity: 0.3;
    background: var(--text-muted);
}

.resize-handle:hover {
    opacity: 1;
    background: var(--accent-primary);
}

.resize-handle::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    opacity: 0.8;
}

/* 拖拽时的状态 */
body.dragging .resize-handle {
    opacity: 1;
    background: var(--accent-primary);
}

body.dragging {
    user-select: none;
    cursor: row-resize;
}

body.dragging * {
    pointer-events: none;
}

body.dragging .resize-handle {
    pointer-events: auto;
}

/* 性能优化 */
#bottom-container {
    will-change: height;
}

.resize-handle {
    will-change: transform, opacity, height;
}

/* AI分析按钮样式 - From Uiverse.io by Spacious74 */
.flex {
    display: flex;
    align-items: center;
    gap: 5px;
}

.outer-cont {
    padding: 12px 20px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    background: linear-gradient(90deg, #5bfcc4, #f593e4, #71a4f0);
    border-radius: 12px;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow:
        inset 0px 0px 5px #ffffffa9,
        inset 0px 35px 30px #000,
        0px 5px 10px #000000cc;
    text-shadow: 1px 1px 1px #000;
}

.outer-cont::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 12px;
    filter: blur(0);
    z-index: -1;
    box-shadow: none;
    background: conic-gradient(#00000000 80deg,
            #40baf7,
            #f34ad7,
            #5bfcc4,
            #00000000 280deg);
    transition: all 0.3s ease;
}

.outer-cont:hover::before {
    filter: blur(15px);
}

.outer-cont:active::before {
    filter: blur(5px);
    transform: translateY(1px);
}

.outer-cont:active {
    box-shadow:
        inset 0px 0px 5px #ffffffa9,
        inset 0px 35px 30px #000;
    margin-top: 3px;
}

/* 工具栏头部 */
.toolbar-header {
    height: 60px;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.toolbar-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-panel);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.control-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

/* 工具栏内容区域 */
.toolbar-content {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
    background: var(--bg-panel);
    min-height: 0;
    position: relative;
}

#bottom-container.collapsed .toolbar-content {
    display: none;
}

/* 现货合约面板 */
.spot-panel {
    flex: 1;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.spot-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
}

.panel-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
}

.spot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-primary);
}

.spot-item:last-child {
    border-bottom: none;
}

.spot-symbol {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.symbol-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.symbol-exchange {
    color: var(--text-muted);
    font-size: 11px;
}

.spot-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.price-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.price-change {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.price-change.positive {
    background: var(--success-bg);
    color: var(--success-color);
}

.price-change.negative {
    background: var(--error-bg);
    color: var(--error-color);
}

/* K线显示面板 */
.kline-panel {
    width: 400px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.kline-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary), var(--accent-secondary));
}

.mini-chart {
    height: 200px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
}

.mini-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            var(--accent-glow) 0%,
            transparent 50%,
            var(--accent-glow) 100%);
    opacity: 0.3;
}

.chart-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    z-index: 1;
}

/* 自定义策略/回测策略样式 */
.indicators-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    background: var(--bg-panel);
    border-radius: 12px;
    overflow: hidden;
}

.indicators-nav {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    padding: 12px 0;
    gap: 4px;
    min-width: 140px;
    width: 140px;
}

.indicator-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    text-align: left;
    white-space: nowrap;
    margin: 0 8px;
    border-radius: 6px;
}

.indicator-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.indicator-tab-btn.active {
    border-left-color: var(--accent-primary);
    font-weight: 500;
    background: #252d3d;
}

/* 亮色模式下的策略tab选中状态 */
[data-theme="light"] .indicator-tab-btn.active {
    background: var(--bg-hover);
}

.indicator-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
}

.indicator-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.indicator-pane.active {
    display: flex;
}

/* 编辑器工具栏 */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 12px 20px;
    flex-shrink: 0;
}

.editor-toolbar-left,
.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.editor-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.editor-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.editor-btn.primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}





.editor-btn svg {
    width: 14px;
    height: 14px;
}



.editor-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.editor-btn.active:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

/* 编辑模式切换按钮组 */
.editor-toggle-group {
    display: flex;
    gap: 8px;
    margin-right: 8px;
    align-items: center;
}

.editor-toggle-group .editor-btn {
    min-width: 64px;
}

/* 编辑器布局 */
.editor-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: visible;
}



/* 编辑器主体 */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    /* 避免父级抢占滚动 */
    min-height: 0;
    /* 允许子项滚动 */
}

.code-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

/* 可视化编辑器容器 */
.visual-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow-y: auto;
    /* 作为唯一滚动容器 */
    overflow-x: hidden;
    /* 禁止横向滚动条 */
    height: 100%;
    border: 1px solid var(--border-primary);
    min-height: 0;
    /* 修复flex子项滚动问题 */
    -webkit-overflow-scrolling: touch;
}

/* 编辑器右侧操作栏 */
.editor-actions-sidebar {
    width: 160px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
}

.editor-side-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.editor-side-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
}

.editor-side-btn.primary {
    background: #00a085;
    border-color: #00a085;
    color: #ffffff;
    border-radius: 5px;
}

/* 按钮加载状态 */
.editor-side-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.editor-side-btn.loading {
    position: relative;
    color: transparent;
}

.editor-side-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* AI助手区域样式 */
.ai-assistant-area {
    margin-top: auto;
    /* 将AI助手区域推到最下方 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
}

.ai-gif {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.editor-side-btn.ai-btn {
    background: #00a085;
    border-color: #00a085;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 212, 170, 0.3);
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.editor-side-btn.ai-btn:hover {
    background: #00BF9A;
    border-color: #00BF9A;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 212, 170, 0.4);
}


/* AI策略助手样式 */
.ai-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-container {
    width: 90%;
    max-width: 900px;
    height: 80%;
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ai-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.ai-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-title::before {
    font-size: 18px;
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-tab-btn {
    background: none;
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ai-tab-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0A2D2A;
}

.ai-chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.ai-chat-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ai-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.ai-tab-content.active {
    display: flex;
}

.ai-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.ai-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ai-message.user .ai-message-avatar {
    background: var(--accent-primary);
    color: #0A2D2A;
    font-weight: 600;
    text-transform: uppercase;
}

/* 当用户头像使用背景图片时，确保正确显示 */
.ai-message.user .ai-message-avatar[style*="background-image"] {
    content: "知行";
    color: transparent;
}

.ai-message.assistant .ai-message-avatar {
    background-image: url('https://img.zhixing.icu/images/%E9%87%8F%E5%8C%96App/NR.png');
    color: transparent;
}

.ai-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap; /* 添加这行来保留换行符 */
}

.ai-message.user .ai-message-content {
    background: var(--accent-primary);
    color: #0A2D2A;
    border-bottom-right-radius: 4px;
}

.ai-message.assistant .ai-message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-bottom-left-radius: 4px;
}

.ai-message.assistant.loading .ai-message-content {
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-loading-dots {
    display: inline-flex;
    gap: 2px;
}

.ai-loading-dots span {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: aiLoading 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes aiLoading {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.ai-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.ai-chat-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ai-chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.ai-chat-input::placeholder {
    color: var(--text-secondary);
}

.ai-chat-send-btn {
    background: var(--accent-primary);
    border: none;
    color: #0A2D2A;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-chat-send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.ai-chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 简化的策略生成结果样式 */
.ai-strategy-title {
    font-size: 16px;
    font-weight: 600;
    color: #00a085;
    margin: 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #00a085;
}

.ai-strategy-simple {
    margin: 8px 0;
}

.ai-strategy-info {
    margin: 8px 0;
    padding: 10px;
    background: var(--bg-panel);
    border-radius: 6px;
    border-left: 3px solid #00a085;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.ai-strategy-info strong {
    color: var(--text-primary);
}

.ai-strategy-code-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 12px 0 6px 0;
    font-size: 14px;
}

.ai-strategy-code {
    background: var(--bg-panel);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-secondary);
    margin: 0 0 12px 0;
}

.ai-strategy-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.ai-strategy-action-btn {
    background: #00a085;
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-strategy-action-btn:hover {
    background: #00BF9A;
    transform: translateY(-1px);
}

.ai-strategy-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.ai-strategy-action-btn.secondary:hover {
    background: var(--bg-hover);
}

.ai-strategy-btn {
    background: #00a085;
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-strategy-btn:hover {
    background: #00BF9A;
    transform: translateY(-1px);
}

.ai-strategy-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.ai-strategy-btn.secondary:hover {
    background: var(--bg-hover);
}

/* 历史记录样式 */
.ai-history-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.ai-history-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-refresh-btn {
    background: var(--accent-primary);
    border: none;
    color: #0A2D2A;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-refresh-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.ai-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.ai-history-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.ai-history-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ai-history-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.ai-history-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ai-history-item-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.ai-history-item-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.ai-history-item-status.completed {
    background: #00a085;
    color: #ffffff;
}

.ai-history-item-status.processing {
    background: #f39c12;
    color: #ffffff;
}

.ai-history-item-status.failed {
    background: #e74c3c;
    color: #ffffff;
}

.ai-history-item-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ai-history-item-query {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
}

.ai-history-item-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: all 0.2s ease;
}

.ai-history-item:hover .ai-history-item-actions {
    opacity: 1;
}

.ai-history-action-btn {
    background: none;
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-history-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ai-history-action-btn.import {
    border-color: #00a085;
    color: #00a085;
}

.ai-history-action-btn.import:hover {
    background: #00a085;
    color: #ffffff;
}

.ai-history-action-btn.delete {
    border-color: #e74c3c;
    color: #e74c3c;
}

.ai-history-action-btn.delete:hover {
    background: #e74c3c;
    color: #ffffff;
}

/* 旧可视化编辑器 UI 适配当前主题 */
.visual-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.visual-editor-title {
    font-weight: 600;
    color: var(--text-primary);
}

.visual-editor-actions {
    display: flex;
    gap: 8px;
}

.visual-editor-btn {
    background: var(--bg-tertiary, #121826);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.visual-editor-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 230, 200, 0.08);
}

.visual-editor-btn.primary {
    background: var(--accent-primary);
    color: #02121a;
    border-color: var(--accent-primary);
}

.visual-editor-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

.visual-editor-sections {
    flex: 1;
    overflow: visible;
    padding: 12px;
    display: grid;
    gap: 12px;
}

/* 顶部轻量工具条（复制/粘贴） */
.visual-editor-toolbar {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px 0;
}

.visual-editor-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.section-title .title-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 扁平化：直接给标题后的第一个子元素加内边距，避免额外包裹层 */
.visual-editor-section> :not(.section-title) {
    padding: 12px;
}

.active-indicators {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.active-indicator {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
}

.active-indicator .remove {
    color: var(--text-secondary);
    cursor: pointer;
}

/* 扁平化条件卡片结构 */
.condition-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    margin-bottom: 10px;
}

.condition-card .condition-expression {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-primary);
}

/* 条件类型徽标（数值/字段） */
.condition-card .comparison-type {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    line-height: 1;
}

.condition-card .comparison-type.field {
    background: rgba(0, 230, 200, 0.12);
    border-color: rgba(0, 230, 200, 0.35);
    color: #00e6c8;
}

.condition-card .comparison-type.value {
    background: rgba(138, 143, 152, 0.12);
}

.condition-card .condition-actions {
    display: flex;
    gap: 8px;
}

.condition-card .action-btn {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
}

.long-theme {
    box-shadow: inset 0 0 0 1px rgba(0, 230, 200, 0.15);
}

.short-theme {
    box-shadow: inset 0 0 0 1px rgba(255, 95, 95, 0.2);
}

.threshold-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.threshold-input {
    width: 100px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 8px;
}

.conflict-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 8px;
}

.no-conditions {
    color: var(--text-secondary);
    font-size: 12px;
}

.field-tips {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-tip {
    color: var(--text-secondary);
    font-size: 12px;
}

/* 通用模态框（指标/条件选择等） */
.indicator-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 10px;
}

.indicator-modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    width: min(840px, 95vw);
    max-width: 95vw;
    max-height: 86vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 12px 14px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-primary);
}

/* 通用指标列表样式（非策略广场） */
.indicator-modal:not(.indicator-square-modal) .indicator-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

/* 通用指标卡片样式（非策略广场） */
.indicator-modal:not(.indicator-square-modal) .indicator-card {
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: .2s;
}

.indicator-modal:not(.indicator-square-modal) .indicator-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 230, 200, 0.08);
}

.indicator-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.indicator-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.param-group {
    margin-bottom: 10px;
}

.param-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.param-input,
.form-control {
    width: 100%;
    max-width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 10px;
}

/* 指标选择弹窗 - 搜索与卡片UI优化 */
.indicator-modal .modal-search {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-primary);
    z-index: 1;
}

.indicator-search-input {
    width: 320px;
    max-width: 100%;
    height: 36px;
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    transition: all .2s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%238a8f98" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 10-.71.71l.27.28v.79l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1114 9.5 4.5 4.5 0 019.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px 50%;
    background-size: 16px 16px;
}

.indicator-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.indicator-search-input::placeholder {
    color: var(--text-muted);
}

.search-stats {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
}

.indicator-modal .indicator-list {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.indicator-modal .indicator-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 120px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border: 1px solid var(--border-primary);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.indicator-modal .indicator-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.indicator-modal .indicator-name {
    font-size: 15px;
    letter-spacing: .2px;
}

.indicator-modal .indicator-desc {
    margin-top: 4px;
    line-height: 1.4;
}

.indicator-modal .indicator-params {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-primary);
    color: var(--text-secondary);
    font-size: 12px;
}

@media (max-width: 600px) {
    .indicator-modal .modal-search {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .indicator-search-input {
        width: 100%;
    }
}

/* 可视化占位 */
.visual-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
}

.visual-empty .visual-icon {
    font-size: 22px;
    opacity: 0.85;
}



/* ACE 编辑器样式 */
#aceEditor {
    background: var(--bg-primary) !important;
}

.ace_editor {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.ace_gutter {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-primary) !important;
    color: var(--text-muted) !important;
}

.ace_content {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* ACE 编辑器滚动条优化 */
.ace_editor .ace_scrollbar {
    background: transparent !important;
}

.ace_editor .ace_scrollbar::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.ace_editor .ace_scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 20, 25, 0.8);
    border-radius: 7px;
    border: 1px solid rgba(45, 55, 72, 0.3);
}

.ace_editor .ace_scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, rgba(140, 154, 174, 0.5), rgba(140, 154, 174, 0.3));
    border-radius: 7px;
    border: 2px solid rgba(15, 20, 25, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ace_editor .ace_scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, var(--accent-primary), rgba(0, 230, 200, 0.7));
    border-color: var(--accent-glow);
    box-shadow: 0 0 16px rgba(0, 230, 200, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.ace_editor .ace_scrollbar::-webkit-scrollbar-thumb:active {
    background: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 230, 200, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 自定义滚动条样式 - 通用 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 31, 46, 0.3);
    border-radius: 8px;
    margin: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(140, 154, 174, 0.6), rgba(140, 154, 174, 0.4));
    border-radius: 8px;
    border: 1px solid rgba(26, 31, 46, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-primary), rgba(0, 230, 200, 0.8));
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px rgba(0, 230, 200, 0.3);
    transform: scale(1.05);
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* 侧边栏和面板滚动条 */
.sidebar,
.panel-content,
.chart-controls {
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 154, 174, 0.5) rgba(26, 31, 46, 0.3);
}

/* Firefox 滚动条样式 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 154, 174, 0.6) rgba(26, 31, 46, 0.3);
}

/* 为特定元素添加更好的滚动体验 */
.code-editor-container,
#aceEditor {
    overflow: hidden;
    /* ACE自己处理滚动 */
}



/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar-content {
        flex-direction: column;
        gap: 15px;
    }

    .kline-panel {
        width: 100%;
    }

    .spot-panel {
        min-height: 200px;
    }

    .editor-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .editor-toolbar-left,
    .editor-toolbar-right {
        flex-wrap: wrap;
    }

    .indicators-container {
        flex-direction: column;
    }

    .indicators-nav {
        flex-direction: row;
        width: auto;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        padding: 8px 12px;
        overflow-x: auto;
        gap: 8px;
    }

    .indicator-tab-btn {
        min-width: 0;
        flex: none;
        white-space: nowrap;
        margin: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        text-align: center;
        padding: 8px 12px;
    }

    .indicator-tab-btn.active {
        border-left: none;
        border-bottom-color: var(--accent-primary);
        box-shadow: 0 2px 8px var(--accent-glow);
    }

    .editor-main {
        flex-direction: column;
    }

    .code-editor-container {
        flex: 1;
        min-height: 300px;
    }
}

/* 图表包装器样式 */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 简化的图表加载动画样式 */
.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 20, 24, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 亮色主题的图表加载动画样式 */
[data-theme="light"] .chart-loading-overlay {
    background: rgba(248, 249, 250, 0.95);
}

.chart-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #ffffff;
}

/* 亮色主题的加载文本样式 */
[data-theme="light"] .loading-content {
    color: #1a1a1a;
}

[data-theme="light"] .loading-text {
    color: #1a1a1a;
}

.loading-dots {
    display: inline-flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #00d4aa;
    border-radius: 50%;
    animation: loading-dots 1.4s ease-in-out infinite both;
}

/* 亮色主题的加载圆点样式 */
[data-theme="light"] .loading-dots span {
    background: #00a688;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-dots {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Tab切换样式 - 简约版 */
.tab-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.tab-header {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* 第一层tab导航 - 简约设计 */
.tab-nav-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.02);
}

.tab-item-primary {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.tab-item-primary:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-item-primary.active {
    color: #00a085;
    font-weight: 600;
    background: rgba(0, 160, 133, 0.12);
}

.tab-item-primary.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #00a085;
    transform: translateX(-50%);
    border-radius: 1px;
}

/* 亮色模式下的主tab选中状态 */
[data-theme="light"] .tab-item-primary.active {
    background: rgba(0, 160, 133, 0.15);
}

/* 第二层tab导航 - 极简设计 */
.tab-nav-secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 12px 6px;
    position: relative;
}

.tab-nav-secondary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-primary);
}

.tab-nav-secondary-left {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.tab-nav-secondary-left::-webkit-scrollbar {
    display: none;
}

.tab-nav-secondary-center {
    flex-grow: 1;
    min-width: 20px;
}

.tab-nav-secondary-right {
    flex-shrink: 0;
    margin-left: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* 清仓按钮样式 - 简约设计 */
.clear-all-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
    position: relative;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
}

.clear-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
}

.clear-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.3);
    transition: all 0.1s ease;
}

/* 亮色主题下的清仓按钮 */
[data-theme="light"] .clear-all-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.2);
    color: white;
}

[data-theme="light"] .clear-all-btn:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 16px rgba(245, 101, 101, 0.3);
}

.tab-item-secondary {
    padding: 4px 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-item-secondary:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-item-secondary.active {
    color: #00a085;
    font-weight: 600;
    background: rgba(0, 160, 133, 0.10);
}

/* 亮色模式下的第二层tab选中状态 */
[data-theme="light"] .tab-item-secondary.active {
    background: rgba(0, 160, 133, 0.12);
}

/* 平台筛选勾选框样式 */
.currency-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.currency-filter:hover {
    color: var(--text-secondary);
}

.currency-filter input[type="checkbox"] {
    position: relative;
    width: 14px;
    height: 14px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.currency-filter .checkmark {
    position: absolute;
    width: 14px;
    height: 14px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 2px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.currency-filter input[type="checkbox"]:checked+.checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.currency-filter input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.currency-filter:hover .checkmark {
    border-color: var(--accent-primary);
}

.currency-filter .label-text {
    font-weight: 400;
    white-space: nowrap;
}

/* tab内容区域 */
.tab-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background: var(--bg-panel);
    display: none;
    position: relative;
    height: calc(100% - 60px);
}

/* 当需要显示tab-content时的样式 */
.tab-content.show {
    display: flex;
    flex-direction: column;
}

/* 确保trading-panels-container默认显示 */
#trading-panels-container {
    display: block;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.tab-pane {
    display: none;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* indicators标签页特殊样式 - 移除父级内边距 */
#indicators {
    margin: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}



/* 空状态显示 */
.tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: var(--text-secondary);
    font-size: 15px;
    text-align: center;
    padding: 60px 40px;
    box-sizing: border-box;
    position: relative;
}

.tab-empty>div {
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tab-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tab-empty:hover .tab-empty-icon {
    opacity: 0.6;
    transform: scale(1.05);
}

/* 加载动画样式 */
.position-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}





/* 响应式设计 - 简约版 */
@media (max-width: 768px) {
    .tab-nav-primary {
        padding: 2px 8px;
        gap: 4px;
    }

    .tab-item-primary {
        padding: 4px 8px;
        font-size: 12px;
    }

    .tab-nav-secondary {
        padding: 2px 8px 4px;
        gap: 2px;
    }

    .tab-item-secondary {
        padding: 3px 6px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .tab-nav-primary {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tab-nav-primary::-webkit-scrollbar {
        display: none;
    }

    .tab-item-primary {
        flex-shrink: 0;
        min-width: 50px;
    }
}

/* 可编辑文本组件样式 */
.editable-text-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.editable-text-container:hover {
    background: var(--bg-hover);
}

.editable-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: default;
    user-select: none;
}

.edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.edit-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    opacity: 1;
    transform: scale(1.1);
}

.edit-btn .material-icons {
    font-size: 18px !important;
    line-height: 1;
}

/* 亮色模式下的编辑按钮 */
[data-theme="light"] .edit-btn {
    color: var(--text-secondary);
}

[data-theme="light"] .edit-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

/* 策略简介输入框样式 */
.strategy-description-container {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-description-container .editable-text {
    flex: 1;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 20px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.strategy-description-container .editable-text:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.strategy-description-container .editable-text.empty {
    color: var(--text-muted);
    font-style: italic;
}

.strategy-description-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
    transition: all 0.3s ease;
    resize: none;
    font-family: inherit;
}

.strategy-description-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.strategy-description-input::placeholder {
    color: var(--text-muted);
}

.description-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 编辑弹窗中的文本域样式 */
#strategyDescriptionInput {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

#strategyDescriptionInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

#strategyDescriptionInput::placeholder {
    color: var(--text-muted);
}

/* 编辑弹窗样式 */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.edit-modal.show {
    display: flex;
}

.edit-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}

/* 编辑弹窗在亮色模式下的特殊背景 */
[data-theme="light"] .edit-modal .edit-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.edit-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 亮色模式下的特殊样式 */
[data-theme="light"] .edit-modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
    background: var(--bg-primary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.edit-modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.edit-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.edit-modal-body {
    padding: 24px;
}

.edit-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-input-group label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.edit-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-primary);
}

.edit-input-group input::placeholder {
    color: var(--text-muted);
}

/* 亮色模式下的输入框样式 */
[data-theme="light"] .edit-input-group input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
}

[data-theme="light"] .edit-input-group input:focus {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-primary);
}

.edit-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-modal-btn.cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-primary);
}

.edit-modal-btn.cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.edit-modal-btn.confirm {
    background: var(--accent-primary);
    color: white;
    border: 1px solid var(--accent-primary);
}

.edit-modal-btn.confirm:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* 亮色模式下的按钮样式 */
[data-theme="light"] .edit-modal-btn.cancel {
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}

[data-theme="light"] .edit-modal-btn.cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.card-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    /* 可以根据需要调整间距 */
}

.card-performance-horizontal {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    /* 内部内容靠右 */
    align-items: center;
    /* 垂直居中 */
    gap: 20px;
    /* 调整间距 */
    width: 100%;
    /* 占满剩余宽度 */
    margin-top: 8px;
    /* 可选：与上方描述文字保持间距 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .edit-modal-content {
        width: 95%;
        margin: 20px;
    }

    .edit-modal-header {
        padding: 16px 20px 12px;
    }

    .edit-modal-body {
        padding: 20px;
    }

    .edit-modal-footer {
        padding: 12px 20px 16px;
    }
}

/* 加载动画样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
    background: var(--bg-secondary);
    border-radius: 12px;
    height: 100%;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--accent-secondary);
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--success-color);
    animation-delay: 0.4s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* 亮色模式下的加载动画 */
[data-theme="light"] .loading-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
}

[data-theme="light"] .loading-text {
    color: var(--text-primary);
}

/* AI二维码扫描器样式 - 主题适配 */
/* 暗色主题（默认） */
:root {
    --scanner-border-color: rgba(0, 255, 200, 0.4);
    --scanner-bg-color: rgba(0, 255, 200, 0.01);
    --scanner-corner-color: rgba(0, 255, 200, 0.6);
    --scanner-line-color: rgba(0, 255, 204, 0.8);
    --scanner-bg: rgba(0, 255, 200, 0.01);
    --scanner-center-border: rgba(0, 255, 200, 0.4);
}

/* 亮色主题适配 */
[data-theme="light"] {
    --scanner-border-color: rgba(34, 139, 34, 0.4);
    --scanner-bg-color: rgba(34, 139, 34, 0.01);
    --scanner-corner-color: rgba(34, 139, 34, 0.7);
    --scanner-line-color: rgba(34, 139, 34, 0.8);
    --scanner-bg: rgba(34, 139, 34, 0.005);
    --scanner-center-border: rgba(34, 139, 34, 0.5);
}

.ai-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--scanner-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.ai-scanner-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ai-scanner-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
}

/* 简约全屏扫描器主体 */
.ai-scanner-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* border: 1px solid var(--scanner-border-color, rgba(0, 255, 200, 0.4)); */
    /* background: var(--scanner-bg-color, rgba(0, 255, 200, 0.01)); */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* 简约四角装饰 */
.scanner-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--scanner-corner-color, rgba(0, 255, 200, 0.6));
    z-index: 10;
}

.scanner-corner.top-left {
    top: 10px;
    left: 0px;
    border-right: none;
    border-bottom: none;
}

.scanner-corner.top-right {
    top: 10px;
    right: 0px;
    border-left: none;
    border-bottom: none;
}

.scanner-corner.bottom-left {
    bottom: 10px;
    left: 0px;
    border-right: none;
    border-top: none;
}

.scanner-corner.bottom-right {
    bottom: 10px;
    right: 0px;
    border-left: none;
    border-top: none;
}

/* 扫描线容器 */
.scanner-line-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* 简约扫描线 */
.scanner-line {
    position: absolute;
    width: 2px;
    height: calc(100% - 20px);
    top: 10px;
    box-shadow: 0 0 10px var(--scanner-line-color, rgba(0, 255, 204, 0.4));
    animation: scannerLineSweep 2.5s ease-in-out infinite;
    left: 0;
    z-index: 15;
}

/* 简约中心显示区域 */
.scanner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 120px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 20;
    /* 移除毛玻璃效果 */
    /* backdrop-filter: blur(8px); */
    background: transparent;
    /* 确保背景完全透明 */
}

/* AI标识 */
.scanner-ai-icon {
    position: relative;
    z-index: 10;
    font-size: 12px;
    font-weight: 700;
    color: var(--scanner-text-color, #00ffcc);
    text-shadow: 0 0 5px var(--scanner-text-shadow, rgba(0, 255, 200, 0.8));
    animation: aiIconFlicker 0.8s ease-in-out infinite alternate;
}

/* 扫描状态文字 */
.scanner-status {
    display: none;
}

.scanner-status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--scanner-text-color, #00ffcc);
    text-shadow: 0 0 6px var(--scanner-text-shadow, rgba(0, 255, 200, 0.6));
    margin-bottom: 6px;
    animation: textFlicker 2s ease-in-out infinite;
}

/* 亮色主题状态文字 */
[data-theme="light"] {
    --scanner-text-color: #228B22;
    --scanner-text-shadow: rgba(34, 139, 34, 0.6);
}

/* 数据点 */
.scanner-data-points {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
}

.data-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ffcc;
    border-radius: 50%;
    animation: dataPointFlash 1s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(0, 255, 200, 0.8);
}

/* 关键帧动画 */
@keyframes aiScannerPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 40px rgba(0, 255, 200, 0.6);
    }
}

/* 全屏扫描线左右移动动画 */
@keyframes scannerLineSweep {
    0% {
        left: -10px;
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    95% {
        opacity: 0.8;
    }

    100% {
        left: calc(100% + 10px);
        opacity: 0;
    }
}

/* 扫描中心区域脉搏动画 */
@keyframes scannerCenterPulse {

    0%,
    100% {
        background: rgba(0, 255, 200, 0.1);
        border-color: rgba(0, 255, 200, 0.3);
        box-shadow: 0 0 5px rgba(0, 255, 200, 0.3);
    }

    50% {
        background: rgba(0, 255, 200, 0.2);
        border-color: rgba(0, 255, 200, 0.6);
        box-shadow: 0 0 15px rgba(0, 255, 200, 0.6);
    }
}

@keyframes aiIconFlicker {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 8px rgba(0, 255, 200, 0.6);
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(0, 255, 200, 1);
    }
}

@keyframes textFlicker {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }
}

@keyframes progressScan {
    0% {
        width: 0%;
        background-position: -200% 0;
    }

    50% {
        width: 100%;
        background-position: 0% 0;
    }

    100% {
        width: 100%;
        background-position: 200% 0;
    }
}

@keyframes dataPointFlash {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .scanner-corner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .scanner-center {
        width: 180px;
        height: 100px;
        gap: 8px;
    }

    .scanner-ai-icon {
        font-size: 10px;
    }

    .scanner-status-text {
        font-size: 12px;
    }

    .scanner-progress {
        width: 140px;
    }

    .scanner-data-points {
        width: 320px;
        height: 320px;
    }

    .scanner-line {
        width: 2px;
    }
}

@media (max-width: 480px) {
    .scanner-corner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }

    .scanner-corner.top-left,
    .scanner-corner.top-right {
        top: 10px;
    }

    .scanner-corner.top-left,
    .scanner-corner.bottom-left {
        left: 10px;
    }

    .scanner-corner.top-right,
    .scanner-corner.bottom-right {
        right: 10px;
    }

    .scanner-corner.bottom-left,
    .scanner-corner.bottom-right {
        bottom: 10px;
    }

    .scanner-center {
        width: 160px;
        height: 90px;
        gap: 6px;
    }



    .scanner-progress {
        width: 120px;
    }

    .scanner-data-points {
        width: 280px;
        height: 280px;
    }
}

/* AI分析结果弹窗样式 */
.ai-analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: aiModalFadeIn 0.2s ease-out;
}

.ai-analysis-modal.show {
    display: flex;
}

@keyframes aiModalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.ai-analysis-content {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid rgba(0, 255, 200, 0.3);
    border-radius: 16px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 255, 200, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    animation: aiModalSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 亮色主题弹窗内容 */
[data-theme="light"] .ai-analysis-content {
    border: 2px solid rgba(34, 139, 34, 0.4);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(34, 139, 34, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@keyframes aiModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes aiModalFadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(8px);
    }

    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes aiModalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

/* 弹窗关闭动画 */
.ai-analysis-modal.closing {
    animation: aiModalFadeOut 0.2s ease-in forwards;
}

.ai-analysis-modal.closing .ai-analysis-content {
    animation: aiModalSlideOut 0.2s ease-in forwards;
}

/* 弹窗头部 */
.ai-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.1) 0%, rgba(0, 100, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 255, 200, 0.2);
    position: relative;
}

/* 亮色主题弹窗头部 */
[data-theme="light"] .ai-analysis-header {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.1) 0%, rgba(46, 125, 50, 0.05) 100%);
    border-bottom: 1px solid rgba(34, 139, 34, 0.3);
}

.ai-analysis-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffcc, #0080ff, #00ffcc);
    background-size: 200% 100%;
    animation: headerGlow 3s ease-in-out infinite;
}

/* 亮色主题头部装饰条 */
[data-theme="light"] .ai-analysis-header::before {
    background: linear-gradient(90deg, #228B22, #2E7D32, #228B22);
}

@keyframes headerGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.ai-analysis-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.ai-title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00ffcc, #0080ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(0, 255, 200, 0.5);
    animation: aiIconSpin 4s linear infinite;
}

/* 亮色主题图标 */
[data-theme="light"] .ai-title-icon {
    background: linear-gradient(135deg, #228B22, #2E7D32);
    box-shadow: 0 0 15px rgba(34, 139, 34, 0.5);
}

@keyframes aiIconSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ai-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.3);
}

/* 亮色主题标题文字 */
[data-theme="light"] .ai-title-text {
    text-shadow: 0 0 10px rgba(34, 139, 34, 0.3);
}

.ai-analysis-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 24px;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
}

.ai-analysis-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.ai-analysis-close:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

/* 弹窗主体内容 */
.ai-analysis-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
    position: relative;
}

.ai-analysis-body::-webkit-scrollbar {
    width: 8px;
}

.ai-analysis-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.ai-analysis-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 200, 0.3);
    border-radius: 4px;
}

.ai-analysis-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 200, 0.5);
}

/* Markdown 内容样式 */
.ai-markdown-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

.ai-markdown-content h1 {
    color: #00ffcc;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0, 255, 200, 0.3);
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.3);
}

.ai-markdown-content h2 {
    color: #00ffcc;
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    text-shadow: 0 0 8px rgba(0, 255, 200, 0.2);
}

.ai-markdown-content h3 {
    color: #0080ff;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.ai-markdown-content h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.ai-markdown-content p {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.ai-markdown-content ul,
.ai-markdown-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.ai-markdown-content li {
    margin: 6px 0;
    color: var(--text-primary);
}

.ai-markdown-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #00ffcc;
    background: rgba(0, 255, 200, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.ai-markdown-content code {
    background: rgba(0, 255, 200, 0.1);
    color: #00ffcc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ai-markdown-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    position: relative;
}

.ai-markdown-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.ai-markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.ai-markdown-content th,
.ai-markdown-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.ai-markdown-content th {
    background: rgba(0, 255, 200, 0.1);
    color: #00ffcc;
    font-weight: 600;
}

.ai-markdown-content td {
    color: var(--text-primary);
}

.ai-markdown-content tr:last-child td {
    border-bottom: none;
}

.ai-markdown-content a {
    color: #00ffcc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.ai-markdown-content a:hover {
    border-bottom-color: #00ffcc;
    text-shadow: 0 0 5px rgba(0, 255, 200, 0.3);
}

.ai-markdown-content strong {
    color: #00ffcc;
    font-weight: 700;
}

.ai-markdown-content em {
    color: #0080ff;
    font-style: italic;
}

/* 分析指标卡片 */
.analysis-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.metric-card {
    background: rgba(0, 255, 200, 0.05);
    border: 1px solid rgba(0, 255, 200, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(0, 255, 200, 0.1);
    border-color: rgba(0, 255, 200, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 200, 0.1);
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #00ffcc;
    font-family: 'Courier New', monospace;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-analysis-content {
        width: 95%;
        max-height: 90vh;
        margin: 0 10px;
    }

    .ai-analysis-header {
        padding: 16px 20px;
    }

    .ai-title-text {
        font-size: 18px;
    }

    .ai-analysis-body {
        padding: 20px;
        max-height: calc(90vh - 120px);
    }

    .ai-markdown-content {
        font-size: 14px;
    }

    .ai-markdown-content h1 {
        font-size: 20px;
    }

    .ai-markdown-content h2 {
        font-size: 18px;
    }

    .analysis-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 策略回测弹窗样式 */
.backtest-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.backtest-modal.show {
    display: flex;
}

.backtest-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.backtest-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    animation: backtestModalSlide 0.3s ease-out;
}

@keyframes backtestModalSlide {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.backtest-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.backtest-modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.backtest-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.backtest-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.backtest-modal-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.backtest-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.backtest-input-row {
    display: flex;
    gap: 16px;
}

.backtest-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backtest-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.backtest-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.backtest-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.backtest-input::placeholder {
    color: var(--text-tertiary);
}

.backtest-input:hover:not(:focus) {
    border-color: var(--border-secondary);
}

/* Select元素样式 */
.backtest-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.backtest-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.backtest-select:hover:not(:focus) {
    border-color: var(--border-secondary);
}

.backtest-select.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.3s ease-in-out;
}

.backtest-select.error:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.backtest-select.success {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.05);
}

.backtest-select.success:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* 表单验证状态样式 */
.backtest-input.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.3s ease-in-out;
}

.backtest-input.error:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.backtest-input.success {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.05);
}

.backtest-input.success:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* 字段必需标识 */
.backtest-label.required::after {
    content: ' *';
    color: var(--error-color);
    font-weight: bold;
}

/* 表单错误提示 */
.backtest-input-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.backtest-input-error.show {
    display: block;
}

/* 晃动动画 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.backtest-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.backtest-modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.backtest-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.backtest-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.backtest-confirm {
    background: var(--accent-primary);
    color: white;
}

.backtest-confirm:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

.backtest-confirm:active {
    transform: translateY(0);
}

/* 运行时间设置样式 */
.weekday-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.weekday-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    user-select: none;
    font-size: 13px;
    min-width: 50px;
    justify-content: center;
}

.weekday-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.weekday-option input[type="checkbox"] {
    display: none;
}

.weekday-option input[type="checkbox"]:checked + span {
    color: white;
}

.weekday-option:has(input[type="checkbox"]:checked) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.weekday-option span {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s ease;
}

/* 时间选择器样式 */
.time-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-select {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.time-select:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.time-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.time-separator {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0 4px;
}

#tv_chart_container::shadow .valueValue-1319iuA {
    margin-top: 5px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .backtest-modal-content {
        width: 95vw;
        margin: 20px;
    }

    .backtest-input-row {
        flex-direction: column;
        gap: 12px;
    }

    .backtest-modal-header,
    .backtest-modal-body,
    .backtest-modal-footer {
        padding: 16px 20px;
    }
}


/* 亮色主题适配 */
[data-theme="light"] .backtest-modal-content {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .backtest-modal-overlay {
    background: rgba(255, 255, 255, 0.8);
}

/* =========================
   统一科技感弹窗系统样式
   ========================= */

.unified-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.unified-modal.show {
    display: flex;
    animation: unifiedModalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.unified-modal.hide {
    animation: unifiedModalFadeOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.unified-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.unified-modal-container {
    position: relative;
    background: linear-gradient(145deg,
            var(--bg-secondary) 0%,
            rgba(15, 20, 25, 0.95) 50%,
            var(--bg-secondary) 100%);
    /* border: 2px solid; */
    border-image: linear-gradient(135deg,
            rgba(0, 255, 200, 0.6) 0%,
            rgba(0, 100, 255, 0.4) 50%,
            rgba(0, 255, 200, 0.6) 100%) 1;
    border-radius: 20px;
    min-width: 400px;
    max-width: 500px;
    width: 90vw;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 255, 200, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.unified-modal.show .unified-modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 亮色主题适配 */
[data-theme="light"] .unified-modal-container {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(248, 250, 252, 0.98) 50%,
            rgba(255, 255, 255, 0.95) 100%);
    border-image: linear-gradient(135deg,
            rgba(34, 139, 34, 0.6) 0%,
            rgba(0, 123, 255, 0.4) 50%,
            rgba(34, 139, 34, 0.6) 100%) 1;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(34, 139, 34, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 弹窗头部 */
.unified-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px 20px;
    background: linear-gradient(135deg,
            rgba(0, 255, 200, 0.08) 0%,
            rgba(0, 100, 255, 0.04) 100%);
    border-bottom: 1px solid rgba(0, 255, 200, 0.2);
    position: relative;
}

[data-theme="light"] .unified-modal-header {
    background: linear-gradient(135deg,
            rgba(34, 139, 34, 0.08) 0%,
            rgba(0, 123, 255, 0.04) 100%);
    border-bottom: 1px solid rgba(34, 139, 34, 0.2);
}

.unified-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 255, 200, 0.6) 50%,
            transparent 100%);
    animation: scanLine 2s ease-in-out infinite;
}

[data-theme="light"] .unified-modal-header::before {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(34, 139, 34, 0.6) 50%,
            transparent 100%);
}

.unified-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.unified-modal-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 100%);
    animation: shimmer 2s ease-in-out infinite;
}

.unified-modal-icon svg {
    width: 24px;
    height: 24px;
    z-index: 1;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 不同类型的图标样式 */
.unified-modal-icon.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.unified-modal-icon.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.unified-modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.unified-modal-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.unified-modal-icon.confirm {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.unified-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* 弹窗内容 */
.unified-modal-content {
    padding: 24px 28px;
}

.unified-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
    word-wrap: break-word;
}

/* 弹窗底部 */
.unified-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px 24px;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .unified-modal-footer {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.01) 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 弹窗按钮样式 */
.unified-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.unified-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.unified-modal-btn:hover::before {
    left: 100%;
}

.unified-modal-btn:active {
    transform: scale(0.98);
}

/* 主要按钮（确认） */
.unified-modal-btn.primary {
    background: linear-gradient(135deg, #00d4aa 0%, #00a085 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.unified-modal-btn.primary:hover {
    background: linear-gradient(135deg, #00a085 0%, #008066 100%);
    box-shadow: 0 6px 16px rgba(0, 212, 170, 0.4);
    transform: translateY(-2px);
}

/* 次要按钮（取消） */
.unified-modal-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border-secondary);
}

.unified-modal-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* 危险按钮（删除） */
.unified-modal-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.unified-modal-btn.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes unifiedModalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes unifiedModalFadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(12px);
    }

    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes scanLine {

    0%,
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }

    50% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(100%) rotate(45deg);
    }

    100% {
        transform: translateX(200%) rotate(45deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .unified-modal-container {
        min-width: 350px;
        width: 95vw;
        margin: 0 10px;
    }

    .unified-modal-header,
    .unified-modal-content,
    .unified-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .unified-modal-title {
        font-size: 18px;
    }

    .unified-modal-message {
        font-size: 15px;
    }

    .unified-modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .unified-modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 交易标记样式增强 */
.execution-marker {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.execution-marker:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    z-index: 1000;
}

.buy-marker:hover {
    box-shadow: 0 8px 25px rgba(0, 208, 132, 0.4) !important;
}

.sell-marker:hover {
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4) !important;
}

/* 标记动画 */
@keyframes markerPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.execution-marker.pulse {
    animation: markerPulse 2s ease-in-out infinite;
}

/* 标记出现动画 */
@keyframes markerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.execution-marker {
    animation: markerFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   回测界面样式
   ================================ */

/* 回测内容容器 */
.backtest-content {
    height: 100%;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* 回测空状态 */
.backtest-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-secondary);
}

.backtest-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--accent-primary);
}

.backtest-empty-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 回测加载动画 */
.backtest-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    background: var(--bg-primary);
    z-index: 10;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--accent-primary);
    font-size: 16px;
    font-weight: 500;
}

/* 回测结果界面 */
.backtest-results {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 标签页导航 */
.backtest-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.backtest-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: inherit;
}

.backtest-tab:hover {
    color: var(--accent-primary);
}

.backtest-tab.active {
    color: var(--accent-primary);
}

.backtest-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* 面板切换 */
.backtest-panel {
    display: none;
    flex: 1;
    overflow: hidden;
}

.backtest-panel.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

/* 确保统一回测分析面板能够正确显示 */
#unified-analysis-panel.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

/* 概览统计网格 */
.overview-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    border-color: rgba(0, 212, 255, 0.3);
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.stat-value.positive {
    color: #00d4aa;
    text-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
}

.stat-value.negative {
    color: #f43f5e;
    text-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

/* 旧的指标网格样式 - 保留用于其他地方 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--success-color);
}

.metric-value.negative {
    color: var(--danger-color);
}

.metric-value.neutral {
    color: var(--text-primary);
}

/* 概览页面响应式设计 */
@media (max-width: 768px) {
    .overview-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
        background: rgba(30, 41, 59, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .stat-value {
        font-size: 22px;
        color: #ffffff;
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.7);
    }
}

@media (max-width: 480px) {
    .overview-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .stat-card {
        padding: 14px;
        background: rgba(30, 41, 59, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .stat-value {
        font-size: 20px;
        color: #ffffff;
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.7);
    }
}

/* 收益曲线 */
.equity-curve-container {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s ease;
}

.equity-curve-container:hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 212, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.equity-curve-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.equity-curve-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff 0%, #0ea5e9 50%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.equity-curve-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.equity-curve-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.equity-curve-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.equity-curve {
    position: relative;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.equity-curve::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(34, 197, 94, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

#equityChart {
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    border-radius: 12px;
    cursor: crosshair;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#equityChart:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chart-stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .equity-curve-container {
        padding: 16px;
        margin: 0 -8px;
    }
    
    .equity-curve-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .equity-curve-stats {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        font-size: 11px;
    }
    
    .equity-curve {
        height: 280px;
    }
    
    #equityChart {
        width: 100% !important;
        height: 280px !important;
    }
    
    .equity-curve-header h3 {
        font-size: 16px;
    }
    
    .chart-stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .equity-chart-container {
        padding: 16px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .equity-curve-container {
        padding: 12px;
        border-radius: 12px;
    }
    
    .equity-curve-stats {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .equity-curve-stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .equity-curve {
        height: 240px;
    }
    
    #equityChart {
        width: 100% !important;
        height: 240px !important;
    }
}

/* 收益曲线动画效果 */
@keyframes equityCurveGlow {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
    50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1) inset; }
}

.equity-curve-container.animated {
    animation: equityCurveGlow 3s ease-in-out infinite;
}

/* 收益曲线加载状态 */
.equity-curve.loading {
    background: linear-gradient(90deg, 
        rgba(15, 23, 42, 0.9) 25%, 
        rgba(30, 41, 59, 0.7) 50%, 
        rgba(15, 23, 42, 0.9) 75%
    );
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 资金曲线图表加载状态 */
.equity-chart-container.loading {
    position: relative;
    overflow: hidden;
}

.equity-chart-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    animation: chart-loading-shimmer 2s infinite;
    z-index: 3;
}

@keyframes chart-loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 图表空状态 */
.equity-chart-container.empty::after {
    content: '暂无数据';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
}

/* 交易表格 */
.trades-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1; /* 占满父容器 */
    height: 100%; /* 确保高度填满 */
    min-height: 0; /* 允许缩小 */
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* 确保表格在有滚动条时也能正确对齐 */
    position: relative;
}

.trades-table thead {
    background: var(--bg-tertiary);
    flex-shrink: 0; /* 表头不缩放 */
}

.trades-table thead tr {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.trades-table tbody {
    flex: 1;
    display: block;
    /* 设置滚动条按需显示 */
    overflow-y: auto;
    /* Firefox 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.trades-table tbody tr {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.trades-table th,
.trades-table td {
    padding: 12px 8px;
    text-align: center; /* 居中显示 */
    border-bottom: 1px solid var(--border-color);
    flex: 1; /* 所有列均分宽度 */
    min-width: 0; /* 允许内容收缩 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.trades-table th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trades-table td {
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 表格内数字和时间的对齐 */
.trades-table td:nth-child(1), /* 时间 */
.trades-table td:nth-child(3), /* 价格 */
.trades-table td:nth-child(4), /* 数量 */
.trades-table td:nth-child(5), /* 杠杆 */
.trades-table td:nth-child(8)  /* 盈亏 */ {
    font-variant-numeric: tabular-nums; /* 等宽数字 */
}

.trades-table tbody tr:hover {
    background: var(--bg-hover);
}

.trades-table tbody tr:last-child td {
    border-bottom: none;
}

/* 自定义滚动条样式 - 更细且不占用布局空间 */
.trades-table tbody::-webkit-scrollbar {
    width: 4px;
}

.trades-table tbody::-webkit-scrollbar-track {
    background: transparent;
}

.trades-table tbody::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
    /* 使滚动条浮动在内容上方 */
    background-clip: padding-box;
}

.trades-table tbody::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}



.trade-direction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    min-width: 50px;
    white-space: nowrap;
}

.trade-direction.long {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.trade-direction.short {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.trade-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    min-width: 50px;
    white-space: nowrap;
}

.trade-status.open {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}
.trade-status.stopLoss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.trade-status.stopProfit {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.trade-status.pending {
    background: rgba(249, 115, 22, 0.2); /* 浅橙色背景 */
    color: #f97316; /* 深橙色文字 */
}

.trade-profit {
    font-weight: 600;
}

.trade-profit.positive {
    color: var(--success-color);
}

.trade-profit.negative {
    color: var(--danger-color);
}

.trade-profit.neutral {
    color: var(--text-secondary);
}

/* 浮动盈亏样式 */
.floating-pnl, .floating-return {
    animation: floatingPnlBlink 1s ease-in-out infinite alternate;
}

@keyframes floatingPnlBlink {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 浮动盈亏数字变化动画 */
.trade-profit {
    transition: color 0.3s ease, background-color 0.3s ease;
}

.trade-profit.positive {
    animation: profitFlash 0.5s ease;
}

.trade-profit.negative {
    animation: lossFlash 0.5s ease;
}

@keyframes profitFlash {
    0% { background-color: rgba(0, 255, 136, 0.1); }
    100% { background-color: transparent; }
}

@keyframes lossFlash {
    0% { background-color: rgba(255, 71, 87, 0.1); }
    100% { background-color: transparent; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .metric-card {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 16px;
    }
    
    .backtest-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .backtest-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .backtest-tab {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .trades-table-container {
        min-height: 300px; /* 移动端最小高度 */
        flex: 1; /* 占满父容器 */
    }
    
    .trades-table th,
    .trades-table td {
        padding: 8px 4px;
        font-size: 12px;
        flex: 1; /* 移动端也使用均分宽度 */
    }
    
    .backtest-content {
        padding: 15px;
    }
}

/* 策略配置弹窗样式 */
.strategy-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.strategy-config-modal.show {
    opacity: 1;
    visibility: visible;
}

.strategy-config-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.strategy-config-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 480px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.strategy-config-modal.show .strategy-config-panel {
    transform: translateX(0);
}

.strategy-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
    position: relative;
}

.strategy-config-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.5;
}

.strategy-config-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.strategy-config-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.strategy-config-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.strategy-config-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

.strategy-config-content::-webkit-scrollbar {
    width: 6px;
}

.strategy-config-content::-webkit-scrollbar-track {
    background: transparent;
}

.strategy-config-content::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

.strategy-config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 滑块行特殊样式 */
.form-row#positionSliderRow {
    overflow: visible;
    min-width: 0;
}

.form-row#positionSliderRow .slider-header label {
    margin-bottom: 0;
}

.form-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-row label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.6;
}

.form-row select,
.form-row input {
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.form-row select:focus,
.form-row input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
    background: var(--bg-tertiary);
}

.form-row select:hover,
.form-row input:hover {
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
}

.form-row input::placeholder {
    color: var(--text-muted);
}

.filter-config-btn {
    padding: 12px 16px;
    border: 1px dashed var(--border-secondary);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 14px;
    cursor: not-allowed;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.strategy-config-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-confirm {
    background: var(--accent-gradient);
    color: white;
    position: relative;
    min-width: 100px;
}

.btn-confirm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-confirm:hover::before {
    left: 100%;
}

.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-confirm:active {
    transform: translateY(0);
}

/* 表单验证样式 */
.form-row input:invalid,
.form-row select:invalid {
    border-color: var(--error-color);
}

.form-row input:invalid:focus,
.form-row select:invalid:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

/* 余额和开仓张数显示样式 */
.max-position-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-top: 4px;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.balance-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-info span:last-child {
    color: var(--accent-primary);
    font-weight: 600;
}

.max-position-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.max-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.max-position-display span:last-child {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 16px;
}

/* 量子科技滑块样式 - 全新设计 */
.quantum-slider-container {
    position: relative;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%,
        rgba(30, 41, 59, 0.9) 30%,
        rgba(15, 23, 42, 0.95) 100%);
    border: 2px solid transparent;
    border-radius: 20px;
    margin: 16px 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    overflow: visible;
    min-height: 140px;
    z-index: 10;
    isolation: isolate;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quantum-slider-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #00d4aa 0%, 
        #00a8ff 25%, 
        #667eea 50%, 
        #764ba2 75%, 
        #00d4aa 100%);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.modern-slider-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 50%, 
        rgba(0, 0, 0, 0.02) 100%);
    border-radius: 16px;
    pointer-events: none;
}

/* 量子滑块头部样式 */
.slider-header-quantum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.slider-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 
        0 4px 16px rgba(0, 212, 170, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(0, 212, 170, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 6px 24px rgba(0, 212, 170, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.slider-label-quantum {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 0.5px;
}

.slider-metrics {
    display: flex;
    align-items: center;
    gap: 16px;
}

.percentage-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, 
        rgba(0, 212, 170, 0.1) 0%, 
        rgba(0, 168, 255, 0.1) 100%);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 170, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.percentage-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.4);
}

.percentage-value {
    color: #00d4aa;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

.percentage-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* 量子滑块主区域 */
.quantum-slider-main {
    position: relative;
    margin: 20px 0;
    min-height: 60px;
}

.slider-background-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 200%;
    background: radial-gradient(ellipse, 
        rgba(0, 212, 170, 0.1) 0%, 
        rgba(0, 168, 255, 0.05) 40%, 
        transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: backgroundPulse 4s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.slider-track-quantum {
    position: relative;
    height: 12px;
    background: linear-gradient(145deg, 
        rgba(15, 23, 42, 0.8) 0%, 
        rgba(30, 41, 59, 0.6) 50%, 
        rgba(15, 23, 42, 0.8) 100%);
    border-radius: 12px;
    margin: 20px 12px;
    border: 1px solid rgba(0, 212, 170, 0.2);
    overflow: visible;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 2px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* 滑块分段指示器 */
.slider-segments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
    z-index: 1;
}

.segment {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 1px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.segment:hover {
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* 量子进度条 */
.slider-progress-quantum {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        #00d4aa 0%, 
        #00c4aa 20%, 
        #00a8ff 60%, 
        #667eea 80%, 
        #764ba2 100%);
    border-radius: 12px;
    width: 1%;
    transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(0, 212, 170, 0.6),
        0 0 40px rgba(0, 212, 170, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 3;
}

.slider-progress-quantum::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 30%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.3) 70%, 
        transparent 100%);
    animation: progressShimmer 2s ease-in-out infinite;
    border-radius: 12px;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* 粒子效果 */
.slider-particles {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #00d4aa 0%, transparent 70%);
    border-radius: 50%;
    animation: particleFlow 3s linear infinite;
    opacity: 0;
}

.particle:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 50%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    left: 80%;
    animation-delay: 2s;
}

@keyframes particleFlow {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
    10% {
        opacity: 1;
        transform: scale(1) translateY(-10px);
    }
    90% {
        opacity: 1;
        transform: scale(1) translateY(10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
}

.slider-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 滑块交互增强动画 */
@keyframes sliderPulse {
    0% { 
        box-shadow: 
            0 6px 20px rgba(0, 212, 170, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.15),
            inset 0 1px 3px rgba(255, 255, 255, 0.5);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(0, 212, 170, 0.6),
            0 4px 12px rgba(0, 0, 0, 0.2),
            inset 0 1px 3px rgba(255, 255, 255, 0.6);
    }
    100% { 
        box-shadow: 
            0 6px 20px rgba(0, 212, 170, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.15),
            inset 0 1px 3px rgba(255, 255, 255, 0.5);
    }
}

@keyframes progressGlow {
    0% { 
        box-shadow: 
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            0 2px 8px rgba(0, 212, 170, 0.3);
    }
    50% { 
        box-shadow: 
            inset 0 1px 0 rgba(255, 255, 255, 0.5),
            0 3px 12px rgba(0, 212, 170, 0.5);
    }
    100% { 
        box-shadow: 
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            0 2px 8px rgba(0, 212, 170, 0.3);
    }
}

/* 滑块激活状态 */
.modern-slider-container:focus-within {
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 3px rgba(0, 212, 170, 0.1);
}

.modern-slider-container:focus-within .slider-progress {
    animation: progressGlow 2s ease-in-out infinite;
}

.modern-slider-container:focus-within #positionSlider::-webkit-slider-thumb {
    animation: sliderPulse 2s ease-in-out infinite;
}

.modern-slider-container:focus-within #positionSlider::-moz-range-thumb {
    animation: sliderPulse 2s ease-in-out infinite;
}

/* 拖拽状态样式 */
.modern-slider-container.slider-dragging {
    box-shadow: 
        0 6px 30px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 4px rgba(0, 212, 170, 0.15);
    transform: translateY(-1px);
    transition: none;
}

.modern-slider-container.slider-dragging .slider-progress {
    animation: progressGlow 1s ease-in-out infinite;
}

.modern-slider-container.slider-dragging #positionSlider::-webkit-slider-thumb {
    transform: scale(1.08);
    box-shadow: 
        0 3px 12px rgba(0, 212, 170, 0.5),
        0 1px 6px rgba(0, 0, 0, 0.2);
    transition: none;
}

.modern-slider-container.slider-dragging #positionSlider::-moz-range-thumb {
    transform: scale(1.08);
    box-shadow: 
        0 3px 12px rgba(0, 212, 170, 0.5),
        0 1px 6px rgba(0, 0, 0, 0.2);
    transition: none;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    #positionSlider::-webkit-slider-thumb {
        height: 36px;
        width: 36px;
        border: 4px solid rgba(255, 255, 255, 0.95);
    }
    
    #positionSlider::-moz-range-thumb {
        height: 36px;
        width: 36px;
        border: 4px solid rgba(255, 255, 255, 0.95);
    }
    
    .slider-track {
        height: 16px;
    }
    
    .modern-slider-container {
        min-height: 120px;
    }
    
    .modern-slider-container.slider-dragging #positionSlider::-webkit-slider-thumb {
        transform: scale(1.1);
    }
    
    .modern-slider-container.slider-dragging #positionSlider::-moz-range-thumb {
        transform: scale(1.1);
    }
}

/* 量子滑块手柄 */
.slider-thumb-quantum {
    position: absolute;
    top: 50%;
    left: 1%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 10;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 0 2px #00d4aa,
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.thumb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: linear-gradient(45deg, #00d4aa, #00a8ff) padding-box,
                linear-gradient(45deg, #00d4aa, #00a8ff) border-box;
    animation: ringRotate 4s linear infinite;
}

@keyframes ringRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.thumb-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 量子输入框 */
.quantum-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: grab;
    margin: 0;
    z-index: 5;
    opacity: 0;
}

.quantum-input:active {
    cursor: grabbing;
}

.quantum-input::-webkit-slider-track {
    background: transparent;
    height: 100%;
    border: none;
    outline: none;
}

.quantum-input::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    cursor: grab;
}

.quantum-input::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.quantum-input::-moz-range-track {
    background: transparent;
    height: 100%;
    border: none;
    outline: none;
}

.quantum-input::-moz-range-thumb {
    appearance: none;
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    cursor: grab;
}

.quantum-input::-moz-range-thumb:active {
    cursor: grabbing;
}

#positionSlider::-webkit-slider-track {
    background: transparent;
    height: 100%;
    border: none;
    outline: none;
}

#positionSlider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        #00d4aa 0%, 
        #00c4aa 25%, 
        #00a8ff 75%, 
        #0088ff 100%);
    cursor: grab;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 2px 8px rgba(0, 212, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.1s ease, transform 0.05s ease;
    position: relative;
}

#positionSlider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 212, 170, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 1);
}

#positionSlider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 
        0 2px 8px rgba(0, 212, 170, 0.5),
        0 1px 4px rgba(0, 0, 0, 0.2);
    transition: none;
}

/* Firefox 样式 */
#positionSlider::-moz-range-track {
    background: transparent;
    height: 100%;
    border: none;
    outline: none;
}

#positionSlider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        #00d4aa 0%, 
        #00c4aa 25%, 
        #00a8ff 75%, 
        #0088ff 100%);
    cursor: grab;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 2px 8px rgba(0, 212, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.1s ease, transform 0.05s ease;
}

#positionSlider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 212, 170, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

#positionSlider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 
        0 2px 8px rgba(0, 212, 170, 0.5),
        0 1px 4px rgba(0, 0, 0, 0.2);
    transition: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    gap: 12px;
    height: 32px;
    position: relative;
    z-index: 2;
}

.min-label, .max-label {
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.min-label:hover, .max-label:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.slider-value {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    background: linear-gradient(145deg, var(--bg-primary), var(--bg-secondary));
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-primary);
    min-width: 60px;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.slider-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 170, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.slider-value:hover::before {
    left: 100%;
}

/* 量子滑块底部信息栏 */
.slider-footer-quantum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0 4px;
    position: relative;
    z-index: 2;
}

.value-display-quantum {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.current-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: linear-gradient(135deg, 
        rgba(0, 212, 170, 0.1) 0%, 
        rgba(0, 168, 255, 0.1) 100%);
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 170, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(0, 212, 170, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.current-value:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px rgba(0, 212, 170, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 212, 170, 0.5);
}

.value-number {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    line-height: 1;
}

.value-unit {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.value-range {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.value-range:hover {
    opacity: 1;
}

.min-value,
.max-value {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.min-value:hover,
.max-value:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.range-separator {
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    position: relative;
}

.range-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(0, 212, 170, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 212, 170, 0.4);
}

/* 电源指示器 */
.power-indicator {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.power-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.power-dot.active {
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 
        0 0 12px rgba(0, 212, 170, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: powerDotPulse 2s ease-in-out infinite;
}

@keyframes powerDotPulse {
    0%, 100% { 
        box-shadow: 
            0 0 12px rgba(0, 212, 170, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 20px rgba(0, 212, 170, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* 量子滑块交互状态 */
.quantum-slider-container:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.quantum-slider-container.quantum-dragging {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
    border-width: 3px;
}

.quantum-slider-container.quantum-dragging::before {
    animation-duration: 2s;
}

.quantum-slider-container.quantum-dragging .slider-progress-quantum {
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 30px rgba(0, 212, 170, 0.8),
        0 0 60px rgba(0, 212, 170, 0.5);
}

.quantum-slider-container.quantum-dragging .slider-thumb-quantum {
    transform: translate(-50%, -50%) scale(1.2);
}

.quantum-slider-container.quantum-dragging .thumb-ring {
    animation-duration: 1s;
}

.quantum-slider-container.quantum-dragging .thumb-glow {
    animation-duration: 1s;
    opacity: 1;
}

.quantum-slider-container.quantum-dragging .particle {
    animation-duration: 1.5s;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .execution-marker {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
    
    .strategy-config-panel {
        width: 100%;
        max-width: 420px;
    }
    
    .strategy-config-content {
        padding: 20px;
    }
    
    .form-row {
        gap: 6px;
    }
    
    /* 移动端滑块优化 - 现代化设计 */
    .modern-slider-container {
        padding: 14px 16px 18px 16px;
        margin: 6px 0;
        min-height: 110px;
        border-radius: 14px;
        box-shadow: 
            0 3px 15px rgba(0, 0, 0, 0.1),
            0 1px 6px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    .slider-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        height: 32px;
        min-height: 32px;
    }
    
    .slider-header label {
        font-size: 13px;
        font-weight: 600;
    }
    
    .slider-percentage {
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 16px;
        box-shadow: 
            0 2px 8px rgba(0, 212, 170, 0.3),
            0 1px 2px rgba(0, 0, 0, 0.15);
    }
    
    .slider-track {
        height: 14px;
        margin: 12px 2px 18px 2px;
        border-radius: 10px;
        box-shadow: 
            inset 0 2px 5px rgba(0, 0, 0, 0.12),
            0 1px 3px rgba(255, 255, 255, 0.1);
    }
    
    #positionSlider::-webkit-slider-thumb {
        height: 28px;
        width: 28px;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 3px 10px rgba(0, 212, 170, 0.4),
            0 1px 4px rgba(0, 0, 0, 0.15);
    }
    
    #positionSlider::-webkit-slider-thumb:hover {
        transform: scale(1.08);
    }
    
    #positionSlider::-webkit-slider-thumb:active {
        transform: scale(1.05);
    }
    
    #positionSlider::-moz-range-thumb {
        height: 28px;
        width: 28px;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 3px 10px rgba(0, 212, 170, 0.4),
            0 1px 4px rgba(0, 0, 0, 0.15);
    }
    
    .slider-labels {
        font-size: 11px;
        margin-top: 6px;
        gap: 8px;
        height: 28px;
    }
    
    .min-label, .max-label {
        min-width: 36px;
        font-size: 11px;
        padding: 3px 6px;
        border-radius: 6px;
    }
    
    .slider-value {
        font-size: 14px;
        padding: 4px 10px;
        min-width: 50px;
        border-radius: 8px;
    }

    /* 量子滑块移动端优化 */
    .quantum-slider-container {
        padding: 18px;
        min-height: 120px;
        margin: 12px 0;
        border-radius: 16px;
    }

    .slider-header-quantum {
        margin-bottom: 16px;
    }

    .slider-icon {
        width: 28px;
        height: 28px;
    }

    .slider-label-quantum {
        font-size: 14px;
    }

    .percentage-value {
        font-size: 16px;
    }

    .percentage-label {
        font-size: 9px;
    }

    .quantum-slider-main {
        min-height: 50px;
        margin: 16px 0;
    }

    .slider-track-quantum {
        height: 16px;
        margin: 16px 8px;
    }

    .slider-thumb-quantum {
        width: 28px;
        height: 28px;
    }

    .thumb-core {
        width: 16px;
        height: 16px;
    }

    .thumb-ring {
        width: 24px;
        height: 24px;
    }

    .thumb-glow {
        width: 36px;
        height: 36px;
    }

    .current-value {
        padding: 10px 16px;
        border-radius: 12px;
    }

    .value-number {
        font-size: 20px;
    }

    .value-unit {
        font-size: 12px;
    }

    .min-value,
    .max-value {
        font-size: 11px;
        padding: 3px 6px;
    }

    .power-dot {
        width: 10px;
        height: 10px;
    }

    .quantum-slider-container.quantum-dragging {
        transform: translateY(-2px) scale(1.01);
    }
    
    .strategy-config-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .strategy-config-panel {
        width: 100%;
    }
}

/* 策略公开设置弹窗样式 */
.strategy-public-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.strategy-public-modal.show {
    display: flex;
}

.strategy-public-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}

[data-theme="light"] .strategy-public-modal .strategy-public-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.strategy-public-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

[data-theme="light"] .strategy-public-modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
    background: var(--bg-primary);
}

.strategy-public-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.strategy-public-modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.strategy-public-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.strategy-public-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.strategy-public-modal-body {
    padding: 24px;
    box-sizing: border-box;
}

.strategy-info {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.strategy-name {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.strategy-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.public-options {
    margin-bottom: 24px;
}

.option-group {
    margin-bottom: 16px;
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.option-label:hover {
    border-color: var(--accent-color);
    background: var(--bg-hover);
}

.option-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.option-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.option-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.option-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.price-input-group {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-top: 16px;
    box-sizing: border-box;
}

.price-label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.price-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.price-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.price-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

.strategy-public-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.strategy-public-modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-public-modal-btn.cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.strategy-public-modal-btn.cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.strategy-public-modal-btn.confirm {
    background: var(--accent-gradient);
    color: white;
}

.strategy-public-modal-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .strategy-public-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .strategy-public-modal-body {
        padding: 20px;
    }
    
    .strategy-public-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .strategy-public-modal-btn {
        width: 100%;
    }
    
    .price-input-group {
        padding: 12px;
    }
    
    .option-label {
        padding: 12px;
    }
}

/* 策略授权弹窗样式 */
.strategy-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.strategy-auth-modal.show {
    display: flex;
}

.strategy-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}

[data-theme="light"] .strategy-auth-modal .strategy-auth-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.strategy-auth-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

[data-theme="light"] .strategy-auth-modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
    background: var(--bg-primary);
}

.strategy-auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.strategy-auth-modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.strategy-auth-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.strategy-auth-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.strategy-auth-modal-body {
    padding: 24px;
    box-sizing: border-box;
}

/* 授权选项卡样式 */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-primary);
}

.auth-tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.auth-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.auth-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* 授权内容区域 */
.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

.auth-input-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.auth-input,
.auth-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.auth-input:focus,
.auth-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.auth-textarea {
    resize: vertical;
    min-height: 80px;
}

.auth-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* 授权记录样式 */

.auth-record-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-line {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

.auth-records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 12px;
    /* 确保滚动条始终可见 */
    scrollbar-gutter: stable;
}

/* 自定义滚动条样式 */
.auth-records-list::-webkit-scrollbar {
    width: 8px;
}

.auth-records-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-records-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-records-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.auth-records-list::-webkit-scrollbar-corner {
    background: var(--bg-tertiary);
}

/* 亮色主题下的滚动条样式 */
[data-theme="light"] .auth-records-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .auth-records-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .auth-records-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Firefox滚动条样式 */
.auth-records-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05);
}

/* 亮色主题下的Firefox滚动条 */
[data-theme="light"] .auth-records-list {
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.05);
}

.auth-record-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.auth-record-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-record-item.active {
    border-color: var(--accent-color);
}

.auth-record-item.pending {
    border-color: #f59e0b;
}

.auth-record-item.accepted {
    border-color: #10b981;
}

.auth-record-item.expired {
    border-color: #6b7280;
    opacity: 0.7;
}

.auth-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.auth-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-uid {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.auth-username {
    color: var(--text-muted);
    font-size: 12px;
}

.auth-email {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.auth-account {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.auth-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.auth-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.auth-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.auth-status.accepted {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.auth-status.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.auth-record-body {
    margin-bottom: 16px;
}

.auth-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.auth-remark {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.auth-record-actions {
    display: flex;
    gap: 8px;
}

.auth-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-action-btn.revoke-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-action-btn.revoke-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.auth-action-btn.resend-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.auth-action-btn.resend-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.auth-action-btn.cancel-btn {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.auth-action-btn.cancel-btn:hover:not(:disabled) {
    background: rgba(107, 114, 128, 0.2);
    border-color: rgba(107, 114, 128, 0.5);
}

.auth-action-btn.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.auth-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 授权弹窗底部按钮 */
.strategy-auth-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.strategy-auth-modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.strategy-auth-modal-btn.cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.strategy-auth-modal-btn.cancel:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.strategy-auth-modal-btn.confirm {
    background: var(--accent-gradient);
    color: white;
}

.strategy-auth-modal-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .strategy-auth-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .strategy-auth-modal-body {
        padding: 20px;
    }
    
    .strategy-auth-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .strategy-auth-modal-btn {
        width: 100%;
    }
    
    .auth-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .auth-tab-btn {
        border-bottom: none;
        border-right: 2px solid transparent;
        border-radius: 0;
    }
    
    .auth-tab-btn.active {
        border-right-color: var(--accent-color);
        border-bottom-color: transparent;
    }
}

.strategy-summary {
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 20px;
}

.strategy-summary-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 6px 6px 0 0;
}

.strategy-summary-header h4 {
    margin: 0 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.strategy-summary-content {
    padding: 16px;
}

.strategy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.strategy-description p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
}

.strategy-description p:last-child {
    margin-bottom: 0;
}

/* 购买按钮样式 */
.purchase-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.purchase-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.purchase-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.purchase-btn svg {
    width: 14px;
    height: 14px;
}

/* 已购买按钮样式 */
.purchased-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
    white-space: nowrap;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.purchased-btn svg {
    width: 14px;
    height: 14px;
    color: #10b981;
}

/* 亮色主题下的购买按钮适配 */
[data-theme="light"] .purchased-btn {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

/* 购买弹窗样式 */
.purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.purchase-modal.show {
    opacity: 1;
    visibility: visible;
}

.purchase-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.purchase-modal.show .purchase-modal-content {
    transform: scale(1) translateY(0);
}

.purchase-modal-header {
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 24px;
    text-align: center;
    position: relative;
}

.purchase-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.purchase-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.purchase-modal-icon {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.purchase-modal-title {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.purchase-modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 8px 0 0 0;
    font-size: 14px;
}

.purchase-modal-body {
    padding: 24px;
}

.purchase-strategy-info {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-primary);
}

.purchase-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    align-items: center;
}

.purchase-info-item:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-primary);
}

.purchase-info-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.purchase-info-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    max-width: 60%;
    text-align: right;
}

.purchase-price {
    color: #ef4444;
    font-weight: 700;
    font-size: 20px;
}

.purchase-benefits {
    margin-bottom: 24px;
}

.purchase-benefits-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchase-benefits-indicator {
    width: 4px;
    height: 16px;
    background: #10b981;
    border-radius: 2px;
}

.purchase-benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid #10b981;
    margin-bottom: 12px;
}

.purchase-benefit-item:last-child {
    margin-bottom: 0;
}

.purchase-benefit-check {
    background: #10b981;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.purchase-benefit-text {
    color: var(--text-primary);
    font-size: 14px;
}

.purchase-modal-actions {
    display: flex;
    gap: 12px;
}

.purchase-cancel-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.purchase-cancel-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.purchase-confirm-btn {
    flex: 2;
    padding: 14px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.purchase-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.purchase-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 亮色主题适配 */
[data-theme="light"] .purchase-modal {
    background-color: rgba(0, 0, 0, 0.4);
}

.ai-history-action-btn.view {
    border-color: #3498db;
    color: #3498db;
}

.ai-history-action-btn.view:hover {
    background: #3498db;
    color: #ffffff;
}

.advanced-settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 0;
}

.settings-group h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.threshold-controls,
.conflict-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.threshold-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    color: var(--text-primary);
    white-space: nowrap;
}

.threshold-control label {
    min-width: auto;
    font-size: inherit;
}

.threshold-input {
    width: 100px;  /* 保持原来的宽度 */
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;  /* 保持原来的圆角 */
    padding: 6px 8px;  /* 保持原来的内边距 */
}

.conflict-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;  /* 保持原来的圆角 */
    padding: 6px 8px;  /* 保持原来的内边距 */
    min-width: 120px;
}

/* 响应式：在小屏幕上保持横向但允许换行 */
@media (max-width: 768px) {
    .threshold-controls,
    .conflict-controls {
        gap: 12px;
    }
}




/* 历史订单弹窗样式 */
.history-orders-modal {
    /* position: fixed; */
    top: 0;
    left: 0;
    width: 100%;
    height: 80%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.history-orders-modal.show {
    display: flex;
}

.history-orders-modal .modal-container {
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    margin-bottom: 20px; /* 添加底部间距 */
}

.history-orders-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-orders-modal .history-icon {
    font-size: 24px;
}

.history-orders-modal .strategy-name {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

/* 筛选器样式 */
.history-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.filter-group select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    min-width: 120px;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* 统计信息样式 */
.history-stats {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--text-primary);
}



.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
}

.stat-value.win {
    color: #4ade80;
}

.stat-value.loss {
    color: #f87171;
}

/* 订单列表样式 */
.history-orders-list {
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.2s;
}

.order-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}



.order-signal {
    width: 60px;
    text-align: center;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 12px;
}

.order-signal.long {
    background: #dcfce7;
    color: #166534;
}

.order-signal.short {
    background: #fef2f2;
    color: #991b1b;
}

.order-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.order-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-label {
    font-size: 12px;
    color: #666;
}

.order-value {
    font-size: 14px;
    font-weight: 500;
}

.order-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.order-status.win {
    background: #dcfce7;
    color: #166534;
}

.order-status.loss {
    background: #fef2f2;
    color: #991b1b;
}

/* 分页样式 */
.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
}

.page-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #0056b3;
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .history-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .order-info {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}



/* 历史订单暗色主题适配 */
:root .history-orders-modal .modal-container,
:root .history-orders-modal .strategy-name {
    background: var(--bg-primary);
    color: var(--text-primary);
}

:root .history-orders-modal .strategy-name {
    color: var(--text-muted);
}

/* 筛选器暗色主题 */
:root .history-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

:root .filter-group label {
    color: var(--text-secondary);
}

:root .filter-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

:root .filter-group select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

:root .refresh-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

:root .refresh-btn:hover {
    background: var(--accent-hover);
}

/* 统计信息暗色主题 */
:root .history-stats {
    background: var(--accent-gradient);
    color: var(--text-primary);
}

/* 订单卡片暗色主题 */
:root .order-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

:root .order-item:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-primary);
    border-color: var(--accent-primary);
}

:root .order-signal.long {
    background: var(--success-bg);
    color: var(--success-color);
}

:root .order-signal.short {
    background: var(--error-bg);
    color: var(--error-color);
}

:root .order-label {
    color: var(--text-muted);
}

:root .order-value {
    color: var(--text-primary);
}

:root .order-status.win {
    background: var(--success-bg);
    color: var(--success-color);
}

:root .order-status.loss {
    background: var(--error-bg);
    color: var(--error-color);
}

/* 分页暗色主题 */
:root .page-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

:root .page-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

:root .page-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-disabled);
}

:root .page-info {
    color: var(--text-secondary);
}

/* 加载指示器暗色主题 */
:root .loading-indicator {
    color: var(--text-secondary);
}

:root .spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent-primary);
}

/* 光亮主题特定覆盖 */
[data-theme="light"] .history-orders-modal .modal-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .history-orders-modal .strategy-name {
    color: #666;
}

[data-theme="light"] .history-filters {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .filter-group label {
    color: #666;
}

[data-theme="light"] .filter-group select {
    background: white;
    border: 1px solid #ddd;
    color: #333;
}

[data-theme="light"] .filter-group select:focus {
    border-color: #007bff;
}

[data-theme="light"] .refresh-btn {
    background: #007bff;
    color: white;
}

[data-theme="light"] .refresh-btn:hover {
    background: #0056b3;
}

[data-theme="light"] .order-item {
    background: white;
    border: 1px solid #e5e7eb;
    color: #333;
}

[data-theme="light"] .order-item:hover {
    background: #f9fafb;
    border-color: #007bff;
}

[data-theme="light"] .order-signal.long {
    background: #dcfce7;
    color: #166534;
}

[data-theme="light"] .order-signal.short {
    background: #fef2f2;
    color: #991b1b;
}

[data-theme="light"] .order-label {
    color: #666;
}

[data-theme="light"] .order-value {
    color: #333;
}

[data-theme="light"] .order-status.win {
    background: #dcfce7;
    color: #166534;
}

[data-theme="light"] .order-status.loss {
    background: #fef2f2;
    color: #991b1b;
}

[data-theme="light"] .page-btn {
    background: #007bff;
    color: white;
}

[data-theme="light"] .page-btn:hover:not(:disabled) {
    background: #0056b3;
}

[data-theme="light"] .page-btn:disabled {
    background: #ccc;
    color: #666;
}

[data-theme="light"] .page-info {
    color: #666;
}

[data-theme="light"] .loading-indicator {
    color: #666;
}

[data-theme="light"] .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
}
/* 统计信息暗色主题 */
:root .history-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}
[data-theme="light"] .history-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}
/* 亮色主题下统计信息小卡片配色 */
[data-theme="light"] .stat-label {
    color: var(--text-muted);
    opacity: 1;
}

[data-theme="light"] .stat-value {
    color: var(--text-primary);
}

[data-theme="light"] .stat-value.win {
    color: var(--success-color);
}

[data-theme="light"] .stat-value.loss {
    color: var(--error-color);
}

/* 统计信息样式 - 统一优化版本 */
.history-stats {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--text-primary);
    flex-wrap: wrap;
    align-items: stretch;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat-item:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    white-space: nowrap;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-value.win {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.stat-value.loss {
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-stats {
        gap: 12px;
        padding: 12px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 10px 12px;
        gap: 6px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .history-stats {
        gap: 8px;
        padding: 10px;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 80px;
        padding: 8px 10px;
        gap: 4px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

/* 主题适配 */
[data-theme="light"] .history-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="light"] .stat-item {
    background: var(--bg-primary);
}

[data-theme="light"] .stat-item:hover {
    background: var(--bg-hover);
}

[data-theme="light"] .stat-label {
    color: var(--text-muted);
}

[data-theme="light"] .stat-value {
    color: var(--text-primary);
}

[data-theme="light"] .stat-value.win {
    color: var(--success-color);
}

[data-theme="light"] .stat-value.loss {
    color: var(--error-color);
}

/* 历史订单弹窗专用容器 */
.history-modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    margin: 20px auto;
    background: var(--bg-panel);
    border-radius: 16px;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-orders-modal.show .history-modal-container {
    transform: scale(1);
    opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .history-modal-container {
        width: 95%;
        max-height: 90vh;
        margin: 10px auto;
    }
}

/* 主题样式 */
[data-theme="light"] .history-modal-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}



.history-orders-modal.show {
    opacity: 1;
}

.history-modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    background: var(--bg-panel);
    border-radius: 16px;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 移除margin，由父容器的flex布局来居中 */
}

.history-orders-modal.show .history-modal-container {
    transform: scale(1);
    opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .history-orders-modal {
        padding: 10px;
    }
    
    .history-modal-container {
        width: 95%;
        max-height: 90vh;
    }
}

/* 主题样式保持不变 */
[data-theme="light"] .history-modal-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.strategy-btn.visibility-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.strategy-btn.history-btn:hover {
    border-color: #f97316;
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.strategy-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


.order-status.win {
    background: #dcfce7;
    color: #166534;
}

.order-status.loss {
    background: #fef2f2;
    color: #991b1b;
}

.order-status.pending {
    background: rgba(249, 115, 22, 0.2);   
    color: #f97316; 
}


:root .order-status.win {
    background: var(--success-bg);
    color: var(--success-color);
}

:root .order-status.loss {
    background: var(--error-bg);
    color: var(--error-color);
}

:root .order-status.pending {
    background: rgba(249, 115, 22, 0.2);   
    color: #f97316;       
}

[data-theme="light"] .order-status.win {
    background: #dcfce7;
    color: #166534;
}

[data-theme="light"] .order-status.loss {
    background: #fef2f2;
    color: #991b1b;
}

[data-theme="light"] .order-status.pending {
    background: rgba(249, 115, 22, 0.2);   
    color: #f97316; 
}




/* 历史订单弹窗的虚化背景覆盖层 */
.history-orders-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 亮色模式下的特殊背景 */
[data-theme="light"] .history-orders-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* 资金曲线面板样式 */
#equity-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}



.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #00d4aa, #00b8d4);
    border-radius: 1px;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #00d4aa, #00b8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    color: #00d4aa;
    filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.3));
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .equity-chart-container canvas {
        width: 100% !important;
        height: 250px !important;
    }
}

@media (max-width: 768px) {
    .equity-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .equity-chart-container canvas {
        height: 200px !important;
    }
    .equity-records-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .equity-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .equity-chart-container canvas {
        height: 180px !important;
    }
}

#equity-curve-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-primary);
}


/* 关键指标卡片样式 */
.equity-metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.metric-card:hover::before {
    opacity: 0.05;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    border-color: var(--accent-primary);
}

.metric-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.metric-content {
    flex: 1;
    z-index: 1;
    position: relative;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* 统一回测分析布局 */
.unified-content-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex: 1;
    min-height: 0;
}

/* 交易清单样式 */
.trades-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    flex: 1;
    min-height: 0;
}

.trades-table thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.trades-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    white-space: nowrap;
}

.trades-table tbody {
    overflow-y: auto;
    max-height: calc(100% - 50px);
}

.trades-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    white-space: nowrap;
}

.trades-table tbody tr:hover {
    background: var(--bg-hover);
}

/* 确保表格内容可以滚动 */
.trades-table tbody {
    overflow-y: auto;
    max-height: none;
    flex: 1;
}

.trades-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.trades-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.equity-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-primary);
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 资金曲线图表容器 */
.equity-chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.equity-chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.equity-chart-container canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

.equity-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(0, 212, 170, 0.03) 0%, 
            rgba(118, 75, 162, 0.03) 100%);
    pointer-events: none;
    border-radius: 16px;
}

.equity-chart-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 170, 0.3) 50%, 
        transparent 100%);
    pointer-events: none;
}

/* 图表装饰元素 */
.chart-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.decoration-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa, #00b8d4);
    opacity: 0.6;
    animation: decorationPulse 2s ease-in-out infinite;
}

.decoration-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.decoration-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes decorationPulse {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

/* 图表统计概览 */
.chart-stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* 统计指标颜色 */
#totalReturn {
    color: #00d4aa;
}

#maxDrawdown {
    color: #f43f5e;
}

#sharpeRatio {
    color: #f59e0b;
}

#winRate {
    color: #10b981;
}



/* 资金曲线数据表格 */
.equity-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
}

.equity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.equity-table thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.equity-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.equity-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

.equity-table tbody tr {
    transition: background-color 0.2s ease;
}

.equity-table tbody tr:hover {
    background: var(--bg-hover);
}

.equity-table tbody tr:last-child td {
    border-bottom: none;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .unified-content-layout {
        flex-direction: column;
        gap: 16px;
        height: auto;
    }
    
    .trades-section,
    .equity-section {
        flex: none;
        width: 100%;
    }
    
    .trades-container,
    .equity-chart-container {
        height: 350px;
        flex: none;
    }
}

@media (max-width: 768px) {
    .equity-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .metric-card {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .unified-content-layout {
        gap: 12px;
        margin-top: 16px;
        height: auto;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .trades-container,
    .equity-chart-container {
        height: 300px;
        padding: 16px;
        flex: none;
    }
    
    .trades-table th,
    .trades-table td {
        padding: 8px 6px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .equity-metrics {
        grid-template-columns: 1fr;
    }
    
    #equity-curve-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .panel-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* 函数项样式 */
.function-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.function-item:hover {
    border-color: var(--primary-color);
    /* 修改悬停背景色，确保与主背景有明显区别 */
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* 暗色主题下的悬停效果 */
:root .function-item:hover {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 亮色主题下的悬停效果 */
[data-theme="light"] .function-item:hover {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.function-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.function-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.function-category-tag {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.function-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.function-usage {
    color: var(--text-tertiary);
    font-size: 11px;
    font-style: italic;
}

.function-item:hover .function-name {
    color: var(--primary-color);
    font-weight: 700;
}

/* 悬停时其他文本的颜色调整 */
.function-item:hover .function-description {
    color: var(--text-primary);
}

.function-item:hover .function-usage {
    color: var(--text-secondary);
}

/* 亮色主题下确保文字可见性 */
[data-theme="light"] .function-item:hover .function-name {
    color: var(--primary-color);
}

[data-theme="light"] .function-item:hover .function-description {
    color: var(--text-primary);
}

[data-theme="light"] .function-item:hover .function-usage {
    color: var(--text-secondary);
}

.function-category-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.function-category-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.function-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 暗色主题下的分类按钮悬停效果 */
:root .function-category-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 亮色主题下的分类按钮悬停效果 */
[data-theme="light"] .function-category-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 亮色主题下确保选中状态的可见性 */
[data-theme="light"] .function-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* =========================== 函数库弹窗样式 =========================== */

/* 定义主色调变量 */
:root {
    --primary-color: var(--accent-primary);
}

[data-theme="light"] {
    --primary-color: var(--accent-primary);
}

.function-library-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.function-library-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.function-library-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.function-library-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.function-library-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.function-library-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.function-library-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.function-library-modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.function-library-modal-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

/* 搜索框样式 */
.function-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.function-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.function-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.function-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* 分类标签样式 */
.function-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.function-category-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.function-category-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.function-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 暗色主题下的分类按钮悬停效果 */
:root .function-category-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 亮色主题下的分类按钮悬停效果 */
[data-theme="light"] .function-category-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 亮色主题下确保选中状态的可见性 */
[data-theme="light"] .function-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white !important;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

/* 函数列表容器 */
.function-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.function-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 200px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.function-list {
    overflow-y: auto;
    max-height: 100%;
    padding-right: 8px;
}

.function-list::-webkit-scrollbar {
    width: 6px;
}

.function-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.function-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.function-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 函数分类组 */
.function-category-group {
    margin-bottom: 24px;
}

.function-category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.function-category-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.function-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* 函数项样式 */
.function-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.function-item:hover {
    border-color: var(--primary-color);
    /* 修改悬停背景色，确保与主背景有明显区别 */
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* 暗色主题下的悬停效果 */
:root .function-item:hover {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 亮色主题下的悬停效果 */
[data-theme="light"] .function-item:hover {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.function-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.function-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.function-category-tag {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.function-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.function-usage {
    color: var(--text-tertiary);
    font-size: 11px;
    font-style: italic;
}

.function-item:hover .function-name {
    color: var(--primary-color);
    font-weight: 700;
}

/* 悬停时其他文本的颜色调整 */
.function-item:hover .function-description {
    color: var(--text-primary);
}

.function-item:hover .function-usage {
    color: var(--text-secondary);
}

/* 亮色主题下确保文字可见性 */
[data-theme="light"] .function-item:hover .function-name {
    color: var(--primary-color);
}

[data-theme="light"] .function-item:hover .function-description {
    color: var(--text-primary);
}

[data-theme="light"] .function-item:hover .function-usage {
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .function-library-modal-content {
        width: 95vw;
        height: 90vh;
        margin: 0 auto;
    }
    
    .function-library-modal-body {
        padding: 16px;
    }
    
    .function-items-grid {
        grid-template-columns: 1fr;
    }
    
    .function-categories {
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .function-categories::-webkit-scrollbar {
        height: 4px;
    }
    
    .function-categories::-webkit-scrollbar-track {
        background: var(--bg-primary);
    }
    
    .function-categories::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}

/* ================ 技术指标参数配置弹窗样式 ================ */
.indicator-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(0px); /* 初始状态无模糊 */
    -webkit-backdrop-filter: blur(0px);
}

.indicator-config-modal.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(12px); /* 显示时添加模糊效果 */
    -webkit-backdrop-filter: blur(12px);
}

.indicator-config-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* 增加Safari兼容性 */
}

.indicator-config-modal-content {
    position: relative;
    width: 90vw;
    max-width: 580px;
    max-height: 85vh;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.indicator-config-modal.show .indicator-config-modal-content {
    transform: scale(1);
}

.indicator-config-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: relative;
}

.indicator-config-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.indicator-config-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.indicator-config-modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.indicator-config-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.indicator-config-modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* 指标信息区域 */
.indicator-info-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.indicator-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.indicator-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.indicator-category-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

.indicator-description {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 13px;
    font-weight: 400;
}

/* 配置区域 */
.indicator-config-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-group {
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.config-group-title {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.indicator-params-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 输出字段和预览组合区域 */
.outputs-and-preview {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.indicator-preview-area {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 使用提示区域 */
.preview-usage {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
}

.usage-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.usage-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}

/* 主题适配 */
[data-theme="light"] .preview-usage {
    background: #f8f9fa;
    border-color: #e9ecef;
}

[data-theme="dark"] .preview-usage {
    background: #1a1f2e;
    border-color: #374151;
}

.indicator-param-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.indicator-param-item:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.indicator-param-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.indicator-param-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.indicator-param-default {
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.indicator-param-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.indicator-param-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.indicator-param-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.indicator-param-input.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.indicator-param-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.indicator-param-error.show {
    display: block;
}

/* 输出字段选择区域 */
.indicator-outputs-section {
    margin-bottom: 24px;
}

.indicator-outputs-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.indicator-output-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.indicator-output-item:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.indicator-output-item.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.indicator-output-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.indicator-output-item.selected .indicator-output-radio {
    border-color: var(--primary-color);
}

.indicator-output-item.selected .indicator-output-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.indicator-output-info {
    flex: 1;
}

.indicator-output-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.indicator-output-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

/* 预览区域 */
.indicator-preview-section {
    margin-bottom: 8px;
}

.indicator-preview-code {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: var(--primary-color);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 参数输入组 */
.indicator-param-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.indicator-param-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.param-label-container {
    min-width: 100px;
    flex-shrink: 0;
}

.param-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.param-description {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.2;
}

.param-input-container {
    position: relative;
    flex: 1;
    max-width: 120px;
}

.param-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.param-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.param-input.invalid {
    border-color: var(--error-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), inset 0 1px 3px rgba(239, 68, 68, 0.1);
}

/* 亮色主题下的输入框优化 */
[data-theme="light"] .param-input {
    background: #f8f9fa;
    border-color: #e9ecef;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
}

[data-theme="light"] .param-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.075);
}

/* 暗色主题下的输入框优化 */
[data-theme="dark"] .param-input {
    background: #1a1f2e;
    border-color: #374151;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .param-input:focus {
    background: #0f1419;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.param-default-hint {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    pointer-events: none;
    background: var(--bg-secondary);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

/* 输出字段选择 */
.output-item {
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    position: relative;
}

.output-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.output-item.selected {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.output-radio-container {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-label {
    display: block;
    cursor: pointer;
    flex: 1;
}

.output-item input[type="radio"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.output-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.output-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.indicator-preview-code {
    background: var(--bg-primary);
    color: var(--primary-color);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
}

/* 无参数/输出提示 */
.no-params,
.no-outputs {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    font-style: italic;
}

/* 弹窗底部 */
.indicator-config-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.indicator-config-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.indicator-config-btn.cancel {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.indicator-config-btn.cancel:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.indicator-config-btn.confirm {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-primary) 100%);
    color: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.indicator-config-btn.confirm:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 亮色主题下确保按钮文字清晰可见 */
[data-theme="light"] .indicator-config-btn.confirm {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: 2px solid #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .indicator-config-btn.confirm:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.indicator-config-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 暗色主题增强效果 */
[data-theme="dark"] .indicator-config-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .indicator-config-modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .indicator-param-group:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .output-item:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .indicator-config-btn.cancel:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* 暗色主题下确保按钮对比度 */
[data-theme="dark"] .indicator-config-btn.confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .indicator-config-btn.confirm:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .indicator-config-modal-content {
        width: 95vw;
        max-height: 90vh;
        margin: 0 auto;
    }
    
    .indicator-config-modal-body {
        padding: 16px;
    }
    
    .indicator-param-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .param-label-container {
        min-width: auto;
    }
    
    .param-input-container {
        max-width: 100%;
        width: 100%;
    }
    
    .param-default-hint {
        position: static;
        margin-top: 4px;
        transform: none;
    }
    
    .outputs-and-preview {
        padding: 12px;
    }
    
    .preview-usage {
        margin-top: 8px;
        padding: 8px 10px;
    }
    
    .usage-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .usage-text {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .indicator-config-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .indicator-config-btn {
        width: 100%;
        justify-content: center;
    }
}




/* =========================== 函数库弹窗样式 =========================== */
.function-library-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.function-library-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.function-library-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.function-library-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.function-library-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.function-library-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.function-library-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.function-library-modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.function-library-modal-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

/* 搜索框样式 */
.function-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.function-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.function-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.function-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* 分类标签样式 */
.function-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.function-category-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.function-category-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.function-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 函数列表容器 */
.function-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.function-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 200px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.function-list {
    overflow-y: auto;
    max-height: 100%;
    padding-right: 8px;
}

.function-list::-webkit-scrollbar {
    width: 6px;
}

.function-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.function-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.function-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 函数分类组 */
.function-category-group {
    margin-bottom: 24px;
}

.function-category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.function-category-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.function-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* 函数项样式 */
.function-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.function-item:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.function-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.function-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.function-category-tag {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.function-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.function-usage {
    color: var(--text-tertiary);
    font-size: 11px;
    font-style: italic;
}

.function-item:hover .function-name {
    color: var(--primary-color);
}

/* =========================== 指标参数配置样式 =========================== */

/* 参数输入容器 */
.param-input-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 数据源选择器样式 */
.param-select.data-source-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.param-select.data-source-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.param-select.data-source-select:hover {
    border-color: var(--primary-color);
}

/* 数据源选择器选项样式 */
.param-select.data-source-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
}

.param-select.data-source-select option:hover {
    background: var(--hover-bg);
}

/* 数值参数输入框样式增强 */
.param-input[data-param-type="numeric"] {
    transition: all 0.2s ease;
}

.param-input[data-param-type="numeric"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 参数类型指示器 */
.param-label-container {
    position: relative;
}

.param-label-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

/* 数据源参数指示器 */
.indicator-param-group:has(.data-source-select) .param-label-container::after {
    background: #10b981; /* 绿色表示数据源 */
}

/* 数值参数指示器 */
.indicator-param-group:has(.param-input[data-param-type="numeric"]) .param-label-container::after {
    background: #3b82f6; /* 蓝色表示数值 */
}

/* 参数默认值提示样式增强 */
.param-default-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* 数据源参数特殊样式 */
.indicator-param-group:has(.data-source-select) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
    border-left: 3px solid #10b981;
    padding-left: 12px;
    border-radius: 0 6px 6px 0;
}

/* 数值参数特殊样式 */
.indicator-param-group:has(.param-input[data-param-type="numeric"]) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
    border-radius: 0 6px 6px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .function-library-modal-content {
        width: 95vw;
        height: 90vh;
        margin: 0 auto;
    }
    
    .function-library-modal-body {
        padding: 16px;
    }
    
    .function-items-grid {
        grid-template-columns: 1fr;
    }
    
    .function-categories {
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .function-categories::-webkit-scrollbar {
        height: 4px;
    }
    
    .function-categories::-webkit-scrollbar-track {
        background: var(--bg-primary);
    }
    
    .function-categories::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}/* 简化滑块样�?- 与最大开仓张数显示区域保持一�?*/
.simple-slider-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-top: 4px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.slider-value-display {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 16px;
}

.slider-main {
    position: relative;
    margin: 12px 0;
}

.slider-track {
    position: relative;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.2s ease;
    width: 1%;
}

.simple-slider-input {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.simple-slider-input::-webkit-slider-track {
    background: transparent;
    height: 8px;
    border-radius: 4px;
}

.simple-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.simple-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.simple-slider-input::-moz-range-track {
    background: transparent;
    height: 8px;
    border-radius: 4px;
    border: none;
}

.simple-slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.simple-slider-input::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.slider-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 12px;
    color: var(--text-tertiary);
}

.range-min,
.range-max {
    font-weight: 500;
}

/* 响应式设�?*/
@media (max-width: 768px) {
    .simple-slider-container {
        padding: 12px;
        gap: 10px;
    }
    
    .slider-header {
        margin-bottom: 6px;
    }
    
    .slider-label {
        font-size: 13px;
    }
    
    .slider-value-display {
        font-size: 15px;
    }
    
    .simple-slider-input::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }
    
    .simple-slider-input::-moz-range-thumb {
        width: 18px;
        height: 18px;
    }
}

/* ================================
   常用条件库样式
   ================================ */

/* 常用条件库按钮 */
.condition-library-section {
    margin: 20px 0;
    padding: 16px;
    background: rgba(45, 55, 72, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.condition-library-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.condition-library-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.condition-library-btn svg {
    width: 16px;
    height: 16px;
}

/* 常用条件库弹窗 */
.condition-library-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.condition-library-modal.show {
    display: flex;
    opacity: 1;
}

.condition-library-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.condition-library-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    margin: auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.condition-library-modal.show .condition-library-modal-content {
    transform: scale(1);
}

.condition-library-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.condition-library-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.condition-library-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.condition-library-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.condition-library-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* 搜索和分类区域 */
.condition-controls-area {
    padding: 24px 32px 0;
    flex-shrink: 0;
}

/* 条件搜索框 */
.condition-search-container {
    position: relative;
    margin-bottom: 20px;
}

.condition-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.condition-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.condition-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* 条件分类标签 */
.condition-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.condition-category-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.condition-category-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.condition-category-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* 条件列表容器 */
.condition-list-container {
    flex: 1;
    padding: 0 32px;
    overflow-y: auto;
    min-height: 0;
}

.condition-list-container::-webkit-scrollbar {
    width: 6px;
}

.condition-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.condition-list-container::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

.condition-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.condition-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.condition-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-primary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

/* 条件列表 */
.condition-list {
    display: grid;
    gap: 20px;
    padding: 8px 0;

}

.condition-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

.condition-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.condition-item.selected {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.condition-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.condition-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.condition-item-source {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    z-index: 1;
}

.condition-item-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    word-break: break-all;
    line-height: 1.4;
}

.condition-item-description {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.condition-item-checkbox {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-secondary);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.condition-item.selected .condition-item-checkbox {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.condition-item.selected .condition-item-checkbox::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 条件弹窗操作按钮 */
.condition-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--border-primary);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.condition-action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.condition-action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.condition-action-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.condition-action-btn.primary {
    background: var(--accent-primary);
    color: white;
}

.condition-action-btn.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.condition-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .condition-library-modal-content {
        width: 95%;
        height: 90vh;
        margin: 20px auto;
    }
    
    .condition-library-modal-header {
        padding: 16px 20px;
    }
    
    .condition-controls-area {
        padding: 20px 20px 0;
    }
    
    .condition-list-container {
        padding: 0 20px;
    }
    
    .condition-categories {
        gap: 8px;
    }
    
    .condition-category-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .condition-modal-actions {
        flex-direction: column;
        padding: 16px 20px;
    }
    
    .condition-action-btn {
        width: 100%;
    }
}