/* =============================================
   问题分解 - problem_decomposition.css
   三栏布局：历史 | 输入 | 结果
   主题色：深蓝绿渐变（代表清晰、逻辑、结构化思维）
   ============================================= */

/* ========== 主容器 ========== */
.pd-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f7ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.pd-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;
}

/* ========== 顶部工具栏 ========== */
.pd-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 38px;
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #0288d1 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(13, 71, 161, 0.45);
    flex-shrink: 0;
}

.pd-toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pd-toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.pd-toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #0d47a1;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.pd-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.pd-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pd-toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮（开始分解） */
.pd-btn-primary {
    background: linear-gradient(135deg, #00897b 0%, #00695c 100%) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(0, 105, 92, 0.5);
}

.pd-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 105, 92, 0.55) !important;
}

/* 分解中 shimmer 动画 */
.pd-btn-primary.pd-btn-loading {
    background: linear-gradient(90deg, #00695c 0%, #26a69a 35%, #00695c 65%, #004d40 100%) !important;
    background-size: 200% 100% !important;
    animation: pdBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes pdBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 取消按钮 */
.pd-btn-cancel {
    background: rgba(255, 255, 255, 0.88) !important;
    color: #b71c1c !important;
}

/* ========== 主内容：三栏 ========== */
.pd-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f7ff;
}

/* ========== 左栏：历史记录 ========== */
.pd-history-panel {
    width: 195px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #bbdefb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pd-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #e3f2fd 0%, #bbdefb 100%);
    border-bottom: 1px solid #bbdefb;
    flex-shrink: 0;
}

.pd-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0d47a1;
}

.pd-history-count {
    font-size: 11px;
    color: #1565c0;
    font-weight: 400;
    margin-left: 2px;
}

.pd-history-clear-btn {
    background: #fce4ec;
    border: none;
    color: #b71c1c;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.pd-history-clear-btn:hover { background: #f8bbd0; }

.pd-history-search {
    padding: 7px;
    border-bottom: 1px solid #bbdefb;
    flex-shrink: 0;
}

.pd-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #90caf9;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #0d47a1;
    background: #f0f7ff;
}

.pd-history-search input:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.12);
}

.pd-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 4px;
}

.pd-history-list::-webkit-scrollbar { width: 4px; }
.pd-history-list::-webkit-scrollbar-track { background: transparent; }
.pd-history-list::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 2px; }
.pd-history-list::-webkit-scrollbar-thumb:hover { background: #ab47bc; }

.pd-history-empty {
    text-align: center;
    color: #90a4ae;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

.pd-history-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    margin: 3px 4px;
    background: #f8fafc;
    border: 1px solid #e3f2fd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: pdFadeIn 0.2s ease;
}

@keyframes pdFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pd-history-item:hover {
    background: #e3f2fd;
    border-color: #90caf9;
    transform: translateX(2px);
}

.pd-history-item.active {
    background: #e3f2fd;
    border-color: #1565c0;
    box-shadow: inset 3px 0 0 #3b82f6, 0 1px 3px rgba(21, 101, 192, 0.2);
}

.pd-history-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #1a237e;
    margin-bottom: 3px;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pd-history-item-meta {
    font-size: 10px;
    color: #90a4ae;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pd-history-item-approach {
    font-size: 10px;
    color: #0288d1;
    background: #e1f5fe;
    padding: 1px 5px;
    border-radius: 3px;
}

.pd-history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fce4ec;
    color: #b71c1c;
    border: none;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.pd-history-item:hover .pd-history-item-del { display: flex; }
.pd-history-item-del:hover { background: #f8bbd0; }

/* ========== 中栏：输入面板 ========== */
.pd-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #bbdefb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pd-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #f0f7ff 0%, #e3f2fd 100%);
    border-bottom: 1px solid #bbdefb;
    flex-shrink: 0;
}

.pd-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0d47a1;
}

.pd-panel-tip {
    font-size: 11px;
    color: #90a4ae;
}

.pd-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.pd-input-body::-webkit-scrollbar { width: 4px; }
.pd-input-body::-webkit-scrollbar-track { background: transparent; }
.pd-input-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 2px; }
.pd-input-body::-webkit-scrollbar-thumb:hover { background: #ab47bc; }

/* 字段组 */
.pd-field-group {
    margin-bottom: 14px;
}

.pd-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #37474f;
    margin-bottom: 5px;
}

.pd-required {
    color: #d32f2f;
    margin-left: 2px;
}

.pd-optional {
    font-size: 11px;
    font-weight: 400;
    color: #90a4ae;
}

/* 文本框 */
.pd-textarea-wrap {
    position: relative;
}

.pd-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #90caf9;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1a237e;
    background: #f8fbff;
    font-family: inherit;
}

.pd-textarea:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
    background: #fff;
}

.pd-textarea.shake {
    animation: pdShake 0.45s ease;
    border-color: #d32f2f !important;
}

@keyframes pdShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.pd-textarea-sm { resize: none; }

.pd-char-counter {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 11px;
    color: #90a4ae;
    pointer-events: none;
    transition: color 0.2s;
}

.pd-char-counter.warning { color: #e67e22; }
.pd-char-counter.danger  { color: #d32f2f; }

/* -------- 分解方式选项 -------- */
.pd-approach-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pd-approach-option {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1.5px solid #bbdefb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fbff;
    user-select: none;
}

.pd-approach-option:hover {
    border-color: #1565c0;
    background: #e3f2fd;
}

.pd-approach-option.selected {
    border-color: #1565c0;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 1px 4px rgba(21, 101, 192, 0.2);
}

.pd-approach-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.pd-approach-name {
    font-size: 12px;
    font-weight: 500;
    color: #0d47a1;
}

/* -------- 分解方式实时说明 -------- */
.pd-approach-hint {
    margin-top: 7px;
    padding: 7px 10px;
    background: #e8f4fd;
    border-left: 3px solid #1565c0;
    border-radius: 0 5px 5px 0;
    font-size: 11.5px;
    color: #1a3a6b;
    line-height: 1.6;
    min-height: 32px;
    transition: all 0.2s ease;
    animation: pdFadeIn 0.2s ease;
}

/* -------- 详细程度选项 -------- */
.pd-detail-options {
    display: flex;
    gap: 6px;
}

.pd-detail-option {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    border: 1.5px solid #bbdefb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #546e7a;
    transition: all 0.2s;
    background: #f8fbff;
    user-select: none;
}

.pd-detail-option:hover {
    border-color: #1565c0;
    color: #0d47a1;
    background: #e3f2fd;
}

.pd-detail-option.selected {
    border-color: #1565c0;
    color: #0d47a1;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 1px 4px rgba(21, 101, 192, 0.2);
    font-weight: 600;
}

/* -------- 快捷示例标签 -------- */
.pd-quick-label {
    font-size: 11px;
    font-weight: 600;
    color: #90a4ae;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.pd-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.pd-quick-tag {
    display: inline-block;
    padding: 3px 9px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 12px;
    font-size: 11px;
    color: #0d47a1;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pd-quick-tag:hover {
    background: #bbdefb;
    border-color: #1565c0;
    transform: translateY(-1px);
}

/* -------- 使用说明 -------- */
.pd-tips-box {
    background: #f0f7ff;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 2px;
}

.pd-tips-box p {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0d47a1;
}

.pd-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.pd-tips-box li {
    font-size: 11px;
    color: #546e7a;
    line-height: 1.8;
}

.pd-tips-box kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 3px;
    font-size: 10px;
    color: #0d47a1;
    font-family: monospace;
}

/* ========== 右栏：结果面板 ========== */
.pd-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.pd-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #f0f7ff 0%, #e3f2fd 100%);
    border-bottom: 1px solid #bbdefb;
    flex-shrink: 0;
}

.pd-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0d47a1;
}

.pd-result-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pd-result-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #e1f5fe;
    color: #0277bd;
    border-radius: 10px;
    border: 1px solid #81d4fa;
    font-weight: 500;
}

.pd-btn-redecompose {
    font-size: 11px;
    padding: 3px 9px;
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pd-btn-redecompose:hover {
    background: #bbdefb;
    border-color: #1565c0;
}

.pd-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.pd-result-body::-webkit-scrollbar { width: 5px; }
.pd-result-body::-webkit-scrollbar-track { background: transparent; }
.pd-result-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 3px; }
.pd-result-body::-webkit-scrollbar-thumb:hover { background: #ab47bc; }

/* 占位提示 */
.pd-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 240px;
    text-align: center;
    padding: 30px 20px;
}

.pd-placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.72;
    animation: pdFloat 3s ease-in-out infinite;
}

@keyframes pdFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.pd-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #78909c;
    margin: 0 0 10px;
}

.pd-placeholder-desc {
    font-size: 13px;
    color: #90a4ae;
    margin: 3px 0;
    line-height: 1.7;
}

/* 加载中 */
.pd-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    padding: 30px 20px;
}

.pd-loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.pd-loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1565c0;
    animation: pdBounce 1.4s ease-in-out infinite;
}

.pd-loading-dots span:nth-child(1) { animation-delay: 0s;    background: #0d47a1; }
.pd-loading-dots span:nth-child(2) { animation-delay: 0.16s; background: #1565c0; }
.pd-loading-dots span:nth-child(3) { animation-delay: 0.32s; background: #0288d1; }

@keyframes pdBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.2); opacity: 1; }
}

.pd-loading-text {
    font-size: 13px;
    color: #546e7a;
    text-align: center;
}

/* 结果内容 */
.pd-result-content {
    line-height: 1.75;
    font-size: 14px;
    color: #1a237e;
}

/* 结果入场动画（独立类，JS 动态添加以支持重触发） */
.pd-result-enter {
    animation: pdFadeInUp 0.35s ease-out forwards;
}

@keyframes pdFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 返回 HTML 结果内的样式美化 */
.pd-result-content h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0d47a1;
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #bbdefb;
}

.pd-result-content h2:first-child { margin-top: 0; }

.pd-result-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: #0d47a1;
    margin: 16px 0 6px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e3f2fd;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pd-result-content h4:first-child { margin-top: 0; }

.pd-result-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0d47a1;
    margin: 16px 0 8px;
    border-left: 4px solid #1565c0;
    padding-left: 10px;
}

.pd-result-content h3:first-child { margin-top: 0; }

.pd-result-content h5 {
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
    margin: 12px 0 5px;
}

.pd-result-content ul, .pd-result-content ol {
    margin: 6px 0 10px;
    padding-left: 20px;
}

.pd-result-content li {
    margin-bottom: 5px;
    line-height: 1.7;
    color: #263238;
}

.pd-result-content li::marker {
    color: #1565c0;
}

.pd-result-content strong {
    color: #0d47a1;
    font-weight: 600;
}

.pd-result-content p {
    margin: 8px 0;
    color: #37474f;
}

.pd-result-content blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    background: #e3f2fd;
    border-left: 4px solid #1565c0;
    border-radius: 0 4px 4px 0;
    color: #1a237e;
    font-size: 13px;
}

.pd-result-content em {
    font-style: italic;
    color: #1565c0;
}

.pd-result-content pre {
    background: #f0f7ff;
    border: 1px solid #bbdefb;
    border-radius: 5px;
    padding: 10px 14px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.6;
    margin: 10px 0;
}

.pd-result-content code {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.pd-result-content pre code {
    background: transparent;
    color: #1a237e;
    padding: 0;
    border-radius: 0;
    font-size: 12.5px;
}

/* 错误提示 */
.pd-result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    padding: 30px 20px;
    color: #b71c1c;
    font-size: 13px;
    background: #fce4ec;
    border-radius: 8px;
    text-align: center;
    line-height: 1.7;
}

/* ========== 示例模态框 ========== */
.pd-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.pd-modal-overlay.show { display: block; }

.pd-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%) scale(0.96);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    z-index: 10001;
    width: 620px;
    max-width: 95vw;
    max-height: 80vh;
    overflow: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.pd-modal.show {
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.pd-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0d47a1 0%, #0288d1 100%);
    color: #fff;
    flex-shrink: 0;
}

.pd-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.pd-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pd-modal-close:hover { background: rgba(255,255,255,0.3); }

.pd-modal-body {
    overflow-y: auto;
    padding: 14px;
    flex: 1;
}

.pd-modal-body::-webkit-scrollbar { width: 5px; }
.pd-modal-body::-webkit-scrollbar-track { background: transparent; }
.pd-modal-body::-webkit-scrollbar-thumb { background: #ce93d8; border-radius: 3px; }
.pd-modal-body::-webkit-scrollbar-thumb:hover { background: #ab47bc; }

.pd-example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pd-example-card {
    padding: 12px 14px;
    border: 1.5px solid #bbdefb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fbff;
}

.pd-example-card:hover {
    border-color: #1565c0;
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.18);
}

.pd-example-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #0d47a1;
    margin-bottom: 5px;
}

.pd-example-card-meta {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.pd-example-card-approach {
    font-size: 10px;
    padding: 1px 6px;
    background: #e1f5fe;
    color: #0277bd;
    border-radius: 8px;
}

.pd-example-card-detail {
    font-size: 10px;
    padding: 1px 6px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 8px;
}

.pd-example-card-desc {
    font-size: 12px;
    color: #546e7a;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .pd-history-panel { display: none; }
    .pd-input-panel { width: 280px; }
}

@media (max-width: 640px) {
    .pd-main-content { flex-direction: column; }
    .pd-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #bbdefb; max-height: 50%; }
    .pd-result-panel { flex: 1; min-height: 200px; }
    .pd-approach-options { grid-template-columns: 1fr 1fr; }
    .pd-example-grid { grid-template-columns: 1fr; }
}

/* =============================
   暗黑模式（body.dark 前缀）
   ============================= */
body.dark .pd-container {
    background: #0d1117;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark .pd-toolbar {
    background: linear-gradient(135deg, #001d6c 0%, #003a8c 40%, #00467f 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .pd-toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #90caf9;
}

body.dark .pd-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    color: #e3f2fd;
}

body.dark .pd-btn-primary {
    background: linear-gradient(135deg, #004d40 0%, #00695c 100%) !important;
    color: #b2dfdb !important;
    box-shadow: 0 2px 6px rgba(0, 105, 92, 0.5);
}

body.dark .pd-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #00695c 0%, #00897b 100%) !important;
}

body.dark .pd-btn-primary.pd-btn-loading {
    background: linear-gradient(90deg, #00695c 0%, #00897b 35%, #00695c 65%, #004d40 100%) !important;
    background-size: 200% 100% !important;
}

body.dark .pd-main-content { background: #0d1117; }

/* 暗黑 - 历史面板 */
body.dark .pd-history-panel {
    background: #161b22;
    border-right-color: #21262d;
}

body.dark .pd-history-header {
    background: linear-gradient(to bottom, #161b22 0%, #1c2128 100%);
    border-bottom-color: #21262d;
}

body.dark .pd-history-header h3 { color: #79b8ff; }
body.dark .pd-history-count { color: #58a6ff; }

body.dark .pd-history-clear-btn {
    background: #21262d;
    color: #ff6b6b;
}

body.dark .pd-history-clear-btn:hover { background: #2d333b; }

body.dark .pd-history-search { border-bottom-color: #21262d; }

body.dark .pd-history-search input {
    background: #0d1117;
    border-color: #21262d;
    color: #c9d1d9;
}

body.dark .pd-history-search input:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.12);
}

body.dark .pd-history-list::-webkit-scrollbar-track { background: #161b22; }
body.dark .pd-history-list::-webkit-scrollbar-thumb { background: #30363d; }
body.dark .pd-history-list::-webkit-scrollbar-thumb:hover { background: #58a6ff; }

body.dark .pd-history-empty { color: #484f58; }

body.dark .pd-history-item {
    background: #1c2128;
    border-color: #21262d;
}

body.dark .pd-history-item:hover {
    background: #1e2a3a;
    border-color: #30363d;
}

body.dark .pd-history-item.active {
    background: #1a2e3d;
    border-color: #58a6ff;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .pd-history-item-title { color: #c9d1d9; }
body.dark .pd-history-item-meta { color: #484f58; }

body.dark .pd-history-item-approach {
    background: #162032;
    color: #79b8ff;
}

/* 暗黑 - 输入面板 */
body.dark .pd-input-panel {
    background: #161b22;
    border-right-color: #21262d;
}

body.dark .pd-panel-header {
    background: linear-gradient(to bottom, #161b22 0%, #1c2128 100%);
    border-bottom-color: #21262d;
}

body.dark .pd-panel-header h3 { color: #79b8ff; }
body.dark .pd-panel-tip { color: #484f58; }

body.dark .pd-input-body::-webkit-scrollbar-track { background: #161b22; }
body.dark .pd-input-body::-webkit-scrollbar-thumb { background: #30363d; }
body.dark .pd-input-body::-webkit-scrollbar-thumb:hover { background: #58a6ff; }

body.dark .pd-field-label { color: #8b949e; }

body.dark .pd-textarea {
    background: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body.dark .pd-textarea:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
    background: #0d1117;
}

body.dark .pd-char-counter { color: #484f58; }
body.dark .pd-char-counter.warning { color: #e67e22; }
body.dark .pd-char-counter.danger  { color: #ff6b6b; }

body.dark .pd-approach-option {
    background: #161b22;
    border-color: #21262d;
}

body.dark .pd-approach-option:hover {
    border-color: #58a6ff;
    background: #1a2e3d;
}

body.dark .pd-approach-option.selected {
    border-color: #58a6ff;
    background: linear-gradient(135deg, #1a2e3d 0%, #162032 100%);
}

body.dark .pd-approach-name { color: #79b8ff; }

body.dark .pd-detail-option {
    background: #161b22;
    border-color: #21262d;
    color: #8b949e;
}

body.dark .pd-detail-option:hover {
    border-color: #58a6ff;
    color: #79b8ff;
    background: #1a2e3d;
}

body.dark .pd-detail-option.selected {
    border-color: #58a6ff;
    color: #79b8ff;
    background: linear-gradient(135deg, #1a2e3d 0%, #162032 100%);
}

body.dark .pd-quick-label { color: #484f58; }

body.dark .pd-quick-tag {
    background: #1c2128;
    border-color: #30363d;
    color: #79b8ff;
}

body.dark .pd-quick-tag:hover {
    background: #1a2e3d;
    border-color: #58a6ff;
}

body.dark .pd-tips-box {
    background: #161b22;
    border-color: #21262d;
}

body.dark .pd-tips-box p { color: #79b8ff; }
body.dark .pd-tips-box li { color: #8b949e; }

body.dark .pd-tips-box kbd {
    background: #1c2128;
    border-color: #30363d;
    color: #79b8ff;
}

body.dark .pd-approach-hint {
    background: #162032;
    border-left-color: #58a6ff;
    color: #79b8ff;
}

/* 暗黑 - 结果面板 */
body.dark .pd-result-panel { background: #161b22; }

body.dark .pd-result-header {
    background: linear-gradient(to bottom, #161b22 0%, #1c2128 100%);
    border-bottom-color: #21262d;
}

body.dark .pd-result-header h3 { color: #79b8ff; }

body.dark .pd-result-badge {
    background: #162032;
    color: #79b8ff;
    border-color: #1e3a5f;
}

body.dark .pd-btn-redecompose {
    background: #1c2128;
    color: #79b8ff;
    border-color: #30363d;
}

body.dark .pd-btn-redecompose:hover {
    background: #1a2e3d;
    border-color: #58a6ff;
}

body.dark .pd-result-body { background: #161b22; }
body.dark .pd-result-body::-webkit-scrollbar-track { background: #161b22; }
body.dark .pd-result-body::-webkit-scrollbar-thumb { background: #30363d; }
body.dark .pd-result-body::-webkit-scrollbar-thumb:hover { background: #58a6ff; }

body.dark .pd-placeholder-icon  { opacity: 0.45; }
body.dark .pd-placeholder-title { color: #6e7681; }
body.dark .pd-placeholder-desc  { color: #484f58; }

body.dark .pd-loading-dots span {
    background: #58a6ff;
}

body.dark .pd-loading-dots span:nth-child(1) { background: #79b8ff; }
body.dark .pd-loading-dots span:nth-child(2) { background: #58a6ff; }
body.dark .pd-loading-dots span:nth-child(3) { background: #0288d1; }

body.dark .pd-loading-text { color: #8b949e; }

body.dark .pd-result-content {
    color: #c9d1d9;
}

body.dark .pd-result-content h2 {
    color: #79b8ff;
    border-bottom-color: #21262d;
}

body.dark .pd-result-content h5 {
    color: #58a6ff;
}

body.dark .pd-result-content h3 {
    color: #79b8ff;
    border-left-color: #58a6ff;
}

body.dark .pd-result-content h4 {
    color: #79b8ff;
    border-bottom-color: #21262d;
}

body.dark .pd-result-content li { color: #c9d1d9; }
body.dark .pd-result-content li::marker { color: #58a6ff; }
body.dark .pd-result-content strong { color: #79b8ff; }
body.dark .pd-result-content p { color: #8b949e; }

body.dark .pd-result-content blockquote {
    background: #1a2e3d;
    border-left-color: #58a6ff;
    color: #79b8ff;
}

body.dark .pd-result-error {
    background: #2d1117;
    color: #ff6b6b;
    border: 1px solid #3d1a1a;
}

body.dark .pd-result-content em {
    color: #79b8ff;
}

body.dark .pd-result-content pre {
    background: #1c2128;
    border-color: #30363d;
    color: #c9d1d9;
}

body.dark .pd-result-content code {
    background: #1c2128;
    color: #79b8ff;
}

body.dark .pd-result-content pre code {
    background: transparent;
    color: #c9d1d9;
}

/* 暗黑 - 模态框 */
body.dark .pd-modal {
    background: #161b22;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .pd-modal-header {
    background: linear-gradient(135deg, #001d6c 0%, #003a8c 100%);
}

body.dark .pd-modal-body::-webkit-scrollbar-thumb { background: #30363d; }
body.dark .pd-modal-body::-webkit-scrollbar-thumb:hover { background: #58a6ff; }

body.dark .pd-example-card {
    background: #1c2128;
    border-color: #21262d;
}

body.dark .pd-example-card:hover {
    border-color: #58a6ff;
    background: #1a2e3d;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

body.dark .pd-example-card-title { color: #79b8ff; }

body.dark .pd-example-card-approach {
    background: #162032;
    color: #79b8ff;
}

body.dark .pd-example-card-detail {
    background: #0f2614;
    color: #56d364;
}

body.dark .pd-example-card-desc { color: #8b949e; }
