/* =============================================
   问题分析 - problem_analysis.css
   特色：蓝绿色系分析风格，三栏布局
   响应式断点：≤639px 触发窄屏布局
   暗黑模式：body.dark 前缀覆盖
   ============================================= */

/* ========== 主容器 ========== */
.pa-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f7ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.pa-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.pa-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
    flex-shrink: 0;
}

.pa-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #0369a1;
    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-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
    color: #fff;
}

/* ========== 抖动动画（命名空间隔离） ========== */
@keyframes paShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.pa-textarea.shake,
.pa-select.shake {
    animation: paShake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容三栏 ========== */
.pa-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f7ff;
}

/* ========== 左栏：历史记录 ========== */
.pa-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #bae6fd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid #bae6fd;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.history-count {
    font-size: 11px;
    color: #7dd3fc;
    font-weight: 400;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e0f2fe;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #f0f9ff;
}

.history-search input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
    background: #fff;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 2px; }

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 8px;
}

.history-item {
    padding: 9px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 4px;
    background: #f8fbff;
    position: relative;
}

.history-item:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.history-item.active {
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    border-color: #38bdf8;
}

.history-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #1e3a5f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    padding-right: 22px;
}

.history-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px;
}

.history-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.history-badge-type {
    background: #dbeafe;
    color: #1d4ed8;
}

.history-badge-mode {
    background: #dcfce7;
    color: #15803d;
}

.history-badge-severity {
    background: #fef3c7;
    color: #92400e;
}

.history-item-time {
    font-size: 10px;
    color: #94a3b8;
}

/* 历史项单条删除按钮 */
.history-item-del {
    position: absolute;
    top: 7px;
    right: 7px;
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
    transition: all 0.15s;
}

.history-item:hover .history-item-del {
    display: block;
}

.history-item-del:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ========== 中栏：输入面板 ========== */
.pa-input-panel {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #bae6fd;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px 10px;
    background: linear-gradient(to bottom, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid #bae6fd;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.panel-tip {
    font-size: 11px;
    color: #64748b;
}

.pa-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.pa-input-body::-webkit-scrollbar { width: 4px; }
.pa-input-body::-webkit-scrollbar-track { background: transparent; }
.pa-input-body::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 2px; }

/* ---- 通用表单元素 ---- */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 3px;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* ---- 输入控件 ---- */
.pa-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid #bae6fd;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    color: #1e293b;
    background: #f8fbff;
}

.pa-textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background: #fff;
}

.pa-textarea-sm {
    min-height: 72px;
}

.pa-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.pa-textarea-hint {
    font-size: 11px;
    color: #94a3b8;
}

.desc-char-count {
    font-size: 11px;
    color: #7dd3fc;
    font-weight: 500;
}

.pa-select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #bae6fd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
    appearance: none;
    background: #f8fbff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230369a1' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    padding-right: 30px;
    color: #1e293b;
    box-sizing: border-box;
}

.pa-select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background-color: #fff;
}

/* ---- 分析模式选择卡片 ---- */
.analysis-mode-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mode-card {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    border: 1.5px solid #bae6fd;
    border-radius: 7px;
    overflow: hidden;
    transition: all 0.2s;
    background: #f8fbff;
}

.mode-card input[type="radio"] {
    display: none;
}

.mode-card-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    transition: background 0.2s;
}

.mode-card:hover {
    border-color: #38bdf8;
    background: #e0f2fe;
}

.mode-card.selected {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.15);
}

.mode-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.mode-name {
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    min-width: 56px;
}

.mode-desc {
    font-size: 11px;
    color: #64748b;
}

/* ========== 右栏：结果面板 ========== */
.pa-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 0;
}

.pa-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.result-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.result-meta-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.result-char-count {
    font-size: 11px;
    color: #94a3b8;
}

.result-time {
    font-size: 11px;
    color: #94a3b8;
}

.pa-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
}

.pa-result-body::-webkit-scrollbar { width: 6px; }
.pa-result-body::-webkit-scrollbar-track { background: transparent; }
.pa-result-body::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 3px; }

/* ---- 错误结果块 ---- */
.pa-result-error-block {
    padding: 16px 18px;
    background: #fff5f5;
    border-left: 3px solid #ef4444;
    border-radius: 0 6px 6px 0;
    margin: 4px 0;
}

.pa-result-error-title {
    font-size: 13px;
    color: #ef4444;
    font-weight: 500;
    margin-bottom: 7px;
    line-height: 1.5;
}

.pa-result-error-tip {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
    line-height: 1.5;
}

.pa-result-retry-btn {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    color: #ef4444;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.pa-result-retry-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
    transform: translateY(-1px);
}

/* ---- 占位内容 ---- */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 20px;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 14px;
    opacity: 0.5;
}

.placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 4px 0;
    line-height: 1.6;
}

.placeholder-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
}

.feature-tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 500;
    border: 1px solid #bae6fd;
}

/* ---- 加载动画 ---- */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 20px;
}

.loading-brain {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.brain-pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #7dd3fc, #0ea5e9);
    animation: brainPulse 1.4s ease-in-out infinite;
}

@keyframes brainPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.7; box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5); }
    50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 12px rgba(14, 165, 233, 0); }
}

.loading-text {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    margin: 0 0 16px 0;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 240px;
}

.loading-step {
    font-size: 12px;
    color: #94a3b8;
    padding: 5px 12px;
    border-radius: 4px;
    border-left: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.loading-step.active {
    color: #0369a1;
    border-left-color: #0ea5e9;
    background: #f0f9ff;
    font-weight: 500;
}

.loading-step.done {
    color: #15803d;
    border-left-color: #10b981;
    background: #f0fdf4;
}

/* ---- 结果内容（Markdown 渲染） ---- */
.result-content.markdown-body {
    font-size: 13.5px;
    line-height: 1.75;
    color: #1e293b;
}

.result-content.markdown-body h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0369a1;
    border-left: 3px solid #0ea5e9;
    margin: 20px 0 10px;
    background: linear-gradient(90deg, #e0f2fe, transparent);
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
}

.result-content.markdown-body h3 {
    font-size: 13.5px;
    font-weight: 600;
    color: #0284c7;
    margin: 14px 0 7px;
}

.result-content.markdown-body p {
    margin: 0 0 10px 0;
    color: #334155;
}

.result-content.markdown-body ul,
.result-content.markdown-body ol {
    margin: 6px 0 10px 0;
    padding-left: 20px;
}

.result-content.markdown-body li {
    margin-bottom: 5px;
    color: #334155;
}

.result-content.markdown-body strong {
    color: #0369a1;
    font-weight: 600;
}

.result-content.markdown-body blockquote {
    border-left: 3px solid #38bdf8;
    background: #f0f9ff;
    padding: 8px 14px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #475569;
}

.result-content.markdown-body code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.result-content.markdown-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.6;
    margin: 10px 0;
}

.result-content.markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.result-content.markdown-body hr {
    border: none;
    border-top: 1px solid #e0f2fe;
    margin: 14px 0;
}

.result-content.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12.5px;
}

.result-content.markdown-body th {
    background: #e0f2fe;
    color: #0369a1;
    padding: 7px 10px;
    border: 1px solid #bae6fd;
    text-align: left;
    font-weight: 600;
}

.result-content.markdown-body td {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.result-content.markdown-body tr:nth-child(even) td {
    background: #f8fbff;
}

/* ========== 示例模态框 ========== */
.pa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.pa-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 10001;
    width: min(720px, 92vw);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: paModalIn 0.22s ease forwards;
}

@keyframes paModalIn {
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    from { transform: translate(-50%, -50%) scale(0.94); opacity: 0; }
}

.pa-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.pa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0f2fe;
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
    flex-shrink: 0;
}

.pa-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
}

.pa-modal-close {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.pa-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.pa-modal-body {
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
}

.example-card {
    border: 1.5px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fbff;
    position: relative;
}

.example-card:hover {
    border-color: #0ea5e9;
    background: #e0f2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.example-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.example-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.example-title {
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.example-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.example-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.example-badge-type { background: #dbeafe; color: #1d4ed8; }
.example-badge-severity { background: #fef3c7; color: #92400e; }
.example-badge-mode { background: #dcfce7; color: #15803d; }

.example-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* ========== Toast 提示 ========== */
.pa-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(3, 105, 161, 0.92);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.pa-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 暗黑模式 ========== */
body.dark .pa-container {
    background: #0f1928;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .pa-toolbar {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #7dd3fc;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
}

body.dark .pa-main-content {
    background: #0f1928;
}

body.dark .pa-history-panel {
    background: #1a2535;
    border-right-color: #1e3a5f;
}

body.dark .history-list::-webkit-scrollbar-track {
    background: #1a2535;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1a2535 0%, #1e2f45 100%);
    border-bottom-color: #1e3a5f;
}

body.dark .history-panel-header h3 {
    color: #7dd3fc;
}

body.dark .history-search input {
    background: #1e2f45;
    border-color: #1e3a5f;
    color: #cbd5e1;
}

body.dark .history-search input:focus {
    border-color: #0ea5e9;
    background: #1a2535;
}

body.dark .history-item {
    background: #1e2f45;
    border-color: transparent;
}

body.dark .history-item:hover {
    background: #1e3a5f;
    border-color: #0369a1;
}

body.dark .history-item.active {
    background: linear-gradient(135deg, #1e3a5f, #1e2f45);
    border-color: #0ea5e9;
}

body.dark .history-item-title {
    color: #bae6fd;
}

body.dark .history-badge-type {
    background: #1e3a5f;
    color: #7dd3fc;
}

body.dark .history-badge-mode {
    background: #14532d;
    color: #6ee7b7;
}

body.dark .history-badge-severity {
    background: #451a03;
    color: #fcd34d;
}

body.dark .pa-input-panel {
    background: #1a2535;
    border-right-color: #1e3a5f;
}

body.dark .pa-input-body::-webkit-scrollbar-track {
    background: #1a2535;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1a2535 0%, #1e2f45 100%);
    border-bottom-color: #1e3a5f;
}

body.dark .panel-header h3 {
    color: #7dd3fc;
}

body.dark .panel-tip {
    color: #64748b;
}

body.dark .form-group label {
    color: #94a3b8;
}

body.dark .pa-textarea {
    background: #1e2f45;
    border-color: #1e3a5f;
    color: #cbd5e1;
}

body.dark .pa-textarea:focus {
    border-color: #0ea5e9;
    background: #1a2535;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

body.dark .pa-textarea-hint {
    color: #64748b;
}

body.dark .desc-char-count {
    color: #0ea5e9;
}

body.dark .pa-select {
    background-color: #1e2f45;
    border-color: #1e3a5f;
    color: #cbd5e1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237dd3fc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

body.dark .pa-select:focus {
    border-color: #0ea5e9;
    background-color: #1a2535;
}

body.dark .mode-card {
    background: #1e2f45;
    border-color: #1e3a5f;
}

body.dark .mode-card:hover {
    border-color: #0ea5e9;
    background: #1e3a5f;
}

body.dark .mode-card.selected {
    background: linear-gradient(135deg, #1e3a5f, #1e2f45);
    border-color: #0ea5e9;
}

body.dark .mode-name {
    color: #7dd3fc;
}

body.dark .mode-desc {
    color: #64748b;
}

body.dark .pa-result-panel {
    background: #1a2535;
}

body.dark .pa-result-body {
    background: #1a2535;
}

body.dark .pa-result-body::-webkit-scrollbar-track {
    background: #0f1928;
}

body.dark .pa-result-body::-webkit-scrollbar-thumb {
    background: #1e3a5f;
}

body.dark .result-placeholder {
    color: #64748b;
}

body.dark .placeholder-title {
    color: #94a3b8;
}

body.dark .placeholder-desc {
    color: #64748b;
}

body.dark .feature-tag {
    background: #1e3a5f;
    color: #7dd3fc;
    border-color: #0369a1;
}

body.dark .loading-text {
    color: #94a3b8;
}

body.dark .loading-step {
    color: #64748b;
    border-left-color: #1e3a5f;
}

body.dark .loading-step.active {
    color: #7dd3fc;
    border-left-color: #0ea5e9;
    background: #1e3a5f;
}

body.dark .loading-step.done {
    color: #6ee7b7;
    border-left-color: #059669;
    background: #14532d;
}

body.dark .result-content.markdown-body {
    color: #cbd5e1;
}

body.dark .result-content.markdown-body h2 {
    color: #7dd3fc;
    border-left-color: #0ea5e9;
    background: linear-gradient(90deg, #1e3a5f, transparent);
}

body.dark .result-content.markdown-body h3 {
    color: #38bdf8;
}

body.dark .result-content.markdown-body p,
body.dark .result-content.markdown-body li {
    color: #94a3b8;
}

body.dark .result-content.markdown-body strong {
    color: #7dd3fc;
}

body.dark .result-content.markdown-body blockquote {
    background: #1e3a5f;
    border-left-color: #0ea5e9;
    color: #94a3b8;
}

body.dark .result-content.markdown-body code {
    background: #1e3a5f;
    color: #7dd3fc;
}

body.dark .result-content.markdown-body hr {
    border-top-color: #1e3a5f;
}

body.dark .result-content.markdown-body th {
    background: #1e3a5f;
    color: #7dd3fc;
    border-color: #1e3a5f;
}

body.dark .result-content.markdown-body td {
    border-color: #1e3a5f;
    color: #94a3b8;
}

body.dark .result-content.markdown-body tr:nth-child(even) td {
    background: #1e2f45;
}

body.dark .result-meta-type {
    background: #1e3a5f;
    color: #7dd3fc;
}

body.dark .result-char-count,
body.dark .result-time {
    color: #64748b;
}

body.dark .pa-modal {
    background: #1a2535;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark .pa-modal-header {
    background: linear-gradient(to right, #1a2535, #1e2f45);
    border-bottom-color: #1e3a5f;
}

body.dark .pa-modal-header h3 {
    color: #7dd3fc;
}

body.dark .pa-modal-close:hover {
    background: #7f1d1d;
}

body.dark .example-card {
    background: #1e2f45;
    border-color: #1e3a5f;
}

body.dark .example-card:hover {
    background: #1e3a5f;
    border-color: #0ea5e9;
}

body.dark .example-title {
    color: #7dd3fc;
}

body.dark .example-badge-type {
    background: #1e3a5f;
    color: #7dd3fc;
}

body.dark .example-badge-severity {
    background: #451a03;
    color: #fcd34d;
}

body.dark .example-badge-mode {
    background: #14532d;
    color: #6ee7b7;
}

body.dark .example-desc {
    color: #64748b;
}

body.dark .history-clear-btn {
    background: #3b1212;
    color: #f87171;
}

body.dark .history-clear-btn:hover {
    background: #7f1d1d;
}

body.dark .history-empty {
    color: #64748b;
}

/* 历史项单条删除按钮 - 暗黑模式 */
body.dark .history-item-del:hover {
    background: #7f1d1d;
    color: #f87171;
}

/* 错误结果块 - 暗黑模式 */
body.dark .pa-result-error-block {
    background: #2d1515;
    border-left-color: #ef4444;
}

body.dark .pa-result-error-title {
    color: #f87171;
}

body.dark .pa-result-error-tip {
    color: #64748b;
}

body.dark .pa-result-retry-btn {
    background: #3b1212;
    border-color: #7f1d1d;
    color: #f87171;
}

body.dark .pa-result-retry-btn:hover {
    background: #7f1d1d;
    border-color: #ef4444;
    transform: translateY(-1px);
}

/* ========== 响应式（≤639px） ========== */
@media (max-width: 639px) {
    .pa-container {
        height: auto;
        min-height: unset;
    }

    .pa-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .pa-main-content {
        flex-direction: column;
    }

    .pa-history-panel {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #bae6fd;
    }

    .pa-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #bae6fd;
    }

    .form-row {
        flex-direction: column;
    }

    .pa-modal {
        width: 96vw;
        max-height: 85vh;
    }

    .pa-modal-body {
        grid-template-columns: 1fr;
    }

    .analysis-mode-group {
        gap: 5px;
    }
}

/* 暗黑模式下 ≤639px 断点的 border 颜色适配 */
body.dark .pa-history-panel {
    border-bottom-color: #1e3a5f;
}

body.dark .pa-input-panel {
    border-bottom-color: #1e3a5f;
}
