/* ========== SQL索引推荐工具容器 ========== */
.sir-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.sir-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.sir-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-group + .toolbar-group {
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.toolbar-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #667eea;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn.btn-primary-action {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #7b3e00;
    font-weight: 600;
}

.toolbar-btn.btn-primary-action:hover {
    box-shadow: 0 4px 12px rgba(253, 160, 133, 0.5);
}

/* ========== 主内容区 ========== */
.sir-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

/* ========== 左侧历史面板 ========== */
.sir-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.history-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-item {
    padding: 9px 10px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: sirFadeIn 0.2s ease;
}

.history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.history-item.active {
    background: #ede9fe;
    border-color: #8b5cf6;
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

/* 独立删除按钮 - hover时显示 */
.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
    margin-bottom: 3px;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

.history-item-tag {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    background: #ede9fe;
    color: #7c3aed;
    font-weight: 500;
}

/* ========== 中间输入面板 ========== */
.sir-input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 320px;
    border-right: 1px solid #e2e8f0;
}

.input-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sql-section {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.section-hint {
    font-size: 11px;
    color: #94a3b8;
}

.sir-code-editor {
    flex: 1;
    width: 100%;
    padding: 14px 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.65;
    border: none;
    outline: none;
    resize: none;
    background: #fafafa;
    color: #334155;
    box-sizing: border-box;
    transition: background 0.2s;
    tab-size: 4;
}

.sir-code-editor::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

.sir-code-editor:focus {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #e0e0e0;
}

.sql-section .sir-code-editor {
    height: 100%;
    min-height: 120px;
}

/* DDL折叠区 */
.ddl-section {
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ddl-toggle {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.ddl-toggle:hover {
    background: #f1f5f9;
}

.toggle-icon {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.ddl-content {
    border-top: 1px solid #e2e8f0;
}

.ddl-editor {
    height: 120px;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
}

/* ========== SQL字符计数 ========== */
.section-hint {
    transition: color 0.2s;
}

.section-hint.has-sql {
    color: #667eea;
}

/* ========== 重新分析提示 ========== */
.result-reanalyze-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 240px;
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
    gap: 10px;
}

.result-reanalyze-hint .reanalyze-icon {
    font-size: 40px;
    opacity: 0.5;
    animation: sirIconPulse 2.8s ease-in-out infinite;
}

.result-reanalyze-hint p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.result-reanalyze-hint .reanalyze-sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

.result-reanalyze-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font-size: 11px;
    color: #475569;
}

/* ========== 快捷键提示行 ========== */
.ael-shortcut-tip {
    padding: 5px 14px 6px;
    font-size: 11px;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    line-height: 1.8;
    flex-shrink: 0;
}

.ael-shortcut-tip kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font-size: 10px;
    color: #64748b;
    font-family: monospace;
}

/* ========== AI错误提示统一样式 ========== */
.ai-error-hint {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    padding: 14px 16px;
    color: #be123c;
}

.ai-error-hint strong {
    color: #be123c;
    font-size: 14px;
}

/* ========== 选项栏前的分隔线 ========== */
.sir-options-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.option-group label {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
}

.sir-select {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    background: white;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sir-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.option-group-desc {
    flex: 1;
    min-width: 160px;
}

.sir-input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    outline: none;
    transition: all 0.2s;
    min-width: 120px;
}

.sir-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.sir-analyze-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.sir-analyze-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sir-analyze-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sir-analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sir-analyze-btn.loading {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* ========== 右侧结果面板 ========== */
.sir-result-panel {
    width: 46%;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 300px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.result-actions {
    display: flex;
    gap: 6px;
}

.result-action-btn {
    padding: 5px 10px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #616161;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-action-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: #f0efff;
}

.result-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.result-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #334155;
}

/* 占位提示 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.45;
    animation: sirIconPulse 2.8s ease-in-out infinite;
}

@keyframes sirIconPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(1.06); }
}

.result-placeholder p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.6;
}

.result-placeholder kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font-size: 11px;
    color: #475569;
}

.placeholder-tips {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    line-height: 1.8;
    padding-left: 20px;
    max-width: 340px;
}

.placeholder-tips li {
    margin-bottom: 4px;
}

/* ========== 结果面板滚动条美化 ========== */
.result-content::-webkit-scrollbar {
    width: 5px;
}

.result-content::-webkit-scrollbar-track {
    background: transparent;
}

.result-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.result-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ========== Markdown结果样式 ========== */
.result-content h2 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 18px 0 8px;
    padding: 6px 10px 6px 12px;
    background: linear-gradient(to right, #f0efff, transparent);
    border-left: 3px solid #667eea;
    border-radius: 0 4px 4px 0;
}

.result-content h2:first-child {
    margin-top: 4px;
}

.result-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 14px 0 6px;
}

.result-content h4 {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 10px 0 4px;
}

.result-content p {
    margin: 6px 0;
    color: #475569;
}

.result-content ul,
.result-content ol {
    padding-left: 20px;
    margin: 6px 0;
}

.result-content li {
    margin: 4px 0;
    color: #475569;
}

.result-content strong {
    color: #1e293b;
    font-weight: 600;
}

.result-content code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #7c3aed;
}

.result-content pre {
    background: #1e293b;
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
    position: relative;
}

.result-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.65;
}

.result-content blockquote {
    border-left: 3px solid #667eea;
    margin: 8px 0;
    padding: 6px 12px;
    background: #f0efff;
    border-radius: 0 4px 4px 0;
    color: #4c1d95;
    font-size: 12px;
}

.result-content hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 14px 0;
}

/* 代码块复制按钮 */
.pre-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.pre-copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ========== 错落入场动画 ========== */
@keyframes hgAnimIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hg-anim-in {
    animation: hgAnimIn 0.4s ease both;
}

/* ========== Loading状态 ========== */
.sir-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    height: 100%;
    padding: 40px 20px;
    color: #64748b;
    gap: 16px;
}

.sir-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: sirSpin 0.8s linear infinite;
}

@keyframes sirSpin {
    to { transform: rotate(360deg); }
}

.sir-loading p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.sir-loading .loading-hint {
    font-size: 11px;
    color: #94a3b8;
}

/* ========== 模态框 ========== */
.sir-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.sir-modal.show {
    display: flex;
}

.sir-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 520px;
    width: 100%;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    animation: sirModalIn 0.2s ease-out;
}

.sir-modal-wide {
    max-width: 720px;
}

@keyframes sirModalIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.sir-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.sir-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.sir-modal-close {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: none;
    color: #757575;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sir-modal-close:hover {
    background: #e8e8e8;
    color: #424242;
}

.sir-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

/* 快捷键表格 */
.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

.shortcut-table th,
.shortcut-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.shortcut-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 12px;
}

.shortcut-table td kbd {
    display: inline-block;
    padding: 2px 7px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    color: #475569;
}

.help-tips h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
}

.help-tips ul {
    padding-left: 20px;
    margin: 0;
}

.help-tips li {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.6;
}

/* 示例SQL网格 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.example-item {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-item:hover {
    border-color: #667eea;
    background: #f0efff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.example-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.example-item-desc {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

.example-item-sql {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    background: #1e293b;
    color: #94a3b8;
    padding: 8px 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    overflow: hidden;
    max-height: 80px;
    line-height: 1.5;
}

/* ========== Toast提示 ========== */
.sir-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.sir-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sir-toast.success { background: #059669; }
.sir-toast.warning { background: #d97706; }
.sir-toast.error { background: #dc2626; }
.sir-toast.info { background: #2563eb; }

/* ========== 动画 ========== */
@keyframes sirFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 暗黑模式 ========== */
body.theme-dark .sir-container {
    background: #1e293b;
}

body.theme-dark .sir-history-panel,
body.theme-dark .sir-input-panel,
body.theme-dark .sir-result-panel {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .history-header {
    background: #1a2332;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .history-header h3 {
    color: #cbd5e1;
}

body.theme-dark .history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .history-search input::placeholder {
    color: #64748b;
}

body.theme-dark .history-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .history-item:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: #475569;
}

body.theme-dark .history-item.active {
    background: #2d1f5e;
    border-color: #7c3aed;
}

body.theme-dark .history-item-title {
    color: #e2e8f0;
}

body.theme-dark .sir-loading {
    color: #94a3b8;
}

body.theme-dark .sir-loading .loading-hint {
    color: #64748b;
}

body.theme-dark .sir-toolbar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.theme-dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .section-header {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .section-title {
    color: #cbd5e1;
}

body.theme-dark .sir-code-editor {
    background: #0f172a;
    color: #e2e8f0;
}

body.theme-dark .sir-code-editor::placeholder {
    color: #475569;
}

body.theme-dark .sir-code-editor:focus {
    background: #0f172a;
    box-shadow: inset 0 0 0 1px #334155;
}

body.theme-dark .ddl-section,
body.theme-dark .ddl-toggle {
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .ddl-toggle:hover {
    background: #1e293b;
}

body.theme-dark .sir-options-bar {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .option-group label {
    color: #94a3b8;
}

body.theme-dark .sir-select,
body.theme-dark .sir-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .sir-select:focus,
body.theme-dark .sir-input:focus {
    border-color: #667eea;
}

body.theme-dark .result-header {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark .result-header h3 {
    color: #cbd5e1;
}

body.theme-dark .result-action-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.theme-dark .result-action-btn:hover:not(:disabled) {
    border-color: #7c3aed;
    color: #a78bfa;
    background: #2d1f5e;
}

body.theme-dark .result-content {
    color: #e2e8f0;
}

body.theme-dark .result-content::-webkit-scrollbar-thumb {
    background: #334155;
}

body.theme-dark .result-content::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

body.theme-dark .result-content h2 {
    color: #f1f5f9;
    background: linear-gradient(to right, #2d1f5e, transparent);
    border-left-color: #7c3aed;
}

body.theme-dark .result-reanalyze-hint p {
    color: #64748b;
}

body.theme-dark .result-reanalyze-hint .reanalyze-sub {
    color: #475569;
}

body.theme-dark .result-reanalyze-hint kbd {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.theme-dark .result-content h3 {
    color: #cbd5e1;
}

body.theme-dark .result-content p,
body.theme-dark .result-content li {
    color: #94a3b8;
}

body.theme-dark .result-content strong {
    color: #e2e8f0;
}

body.theme-dark .result-content code {
    background: #1e293b;
    border-color: #334155;
    color: #a78bfa;
}

body.theme-dark .result-content blockquote {
    background: #2d1f5e;
    color: #c4b5fd;
    border-left-color: #7c3aed;
}

body.theme-dark .result-content hr {
    border-color: #334155;
}

body.theme-dark .result-placeholder {
    color: #475569;
}

body.theme-dark .result-placeholder p {
    color: #475569;
}

body.theme-dark .placeholder-tips {
    color: #475569;
}

body.theme-dark .sir-modal-content {
    background: #0f172a;
}

body.theme-dark .sir-modal-header {
    background: #1e293b;
    border-color: #334155;
}

body.theme-dark .sir-modal-header h3 {
    color: #e2e8f0;
}

body.theme-dark .sir-modal-close {
    background: #1e293b;
    color: #94a3b8;
}

body.theme-dark .sir-modal-close:hover {
    background: #334155;
    color: #e2e8f0;
}

body.theme-dark .sir-modal-body {
    background: #0f172a;
    color: #e2e8f0;
}

body.theme-dark .shortcut-table th {
    background: #1e293b;
    color: #94a3b8;
}

body.theme-dark .shortcut-table td {
    border-color: #1e293b;
    color: #cbd5e1;
}

body.theme-dark .shortcut-table td kbd {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.theme-dark .help-tips h4 {
    color: #e2e8f0;
}

body.theme-dark .help-tips li {
    color: #64748b;
}

body.theme-dark .example-item {
    background: #1e293b;
    border-color: #334155;
}

body.theme-dark .example-item:hover {
    border-color: #7c3aed;
    background: #2d1f5e;
}

body.theme-dark .example-item-title {
    color: #e2e8f0;
}

body.theme-dark .example-item-desc {
    color: #64748b;
}

body.theme-dark .ael-shortcut-tip {
    background: #1e293b;
    color: #475569;
    border-top-color: rgba(148, 163, 184, 0.1);
}

body.theme-dark .ael-shortcut-tip kbd {
    background: #0f172a;
    border-color: #334155;
    color: #64748b;
}

body.theme-dark .ai-error-hint {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef9a9a;
}

body.theme-dark .ai-error-hint strong {
    color: #ef9a9a;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .sir-history-panel {
        display: none;
    }

    .sir-result-panel {
        width: 50%;
    }
}

@media (max-width: 640px) {
    .sir-main-content {
        flex-direction: column;
    }

    .sir-input-panel,
    .sir-result-panel {
        width: 100%;
        min-width: unset;
    }

    .sir-result-panel {
        min-height: 300px;
    }

    .sir-options-bar {
        flex-wrap: wrap;
    }
}
