/* =============================================
   植物百科 - plant_encyclopedia.css
   三栏布局：历史 | 查询 | 结果
   主题色：森林绿系（#1b4332 / #2d6a4f / #52b788 / #95d5b2 / #d8f3dc）
   ============================================= */

/* ========== 主容器 ========== */
.pe-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f7f2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.pe-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;
}

/* ========== 顶部工具栏 ========== */
.pe-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 60%, #40916c 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(27, 67, 50, 0.4);
    flex-shrink: 0;
    position: relative;
}

.pe-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pe-toolbar .toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1b4332;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.pe-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.pe-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pe-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮（查询） */
.pe-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(82, 183, 136, 0.45);
}

.pe-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #74c69d 0%, #40916c 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.55);
}

/* 查询按钮 loading 流光动画 */
.pe-toolbar .toolbar-btn-primary.pe-btn-loading {
    background: linear-gradient(90deg, #2d6a4f 0%, #74c69d 35%, #2d6a4f 65%, #1b4332 100%);
    background-size: 200% 100%;
    animation: peBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(82, 183, 136, 0.5);
}

@keyframes peBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pe-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 主内容：三栏 ========== */
.pe-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f7f2;
}

/* ========== 左栏：历史记录 ========== */
.pe-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #c8e6d4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pe-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #f0f9f4 0%, #e8f5ec 100%);
    border-bottom: 1px solid #c8e6d4;
    flex-shrink: 0;
}

.pe-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1b4332;
}

.pe-history-count {
    font-size: 11px;
    color: #74c69d;
    font-weight: 400;
}

.pe-history-clear-btn {
    background: #e8f5ec;
    border: none;
    color: #2d6a4f;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.pe-history-clear-btn:hover { background: #c8e6d4; }

.pe-history-search {
    padding: 7px;
    border-bottom: 1px solid #c8e6d4;
    flex-shrink: 0;
}

.pe-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #c8e6d4;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1b4332;
    background: #f8fdf9;
}

.pe-history-search input:focus {
    border-color: #52b788;
    box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.15);
}

.pe-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.pe-history-list::-webkit-scrollbar { width: 4px; }
.pe-history-list::-webkit-scrollbar-track { background: transparent; }
.pe-history-list::-webkit-scrollbar-thumb { background: #b7e0c8; border-radius: 2px; }
.pe-history-list::-webkit-scrollbar-thumb:hover { background: #52b788; }

.pe-history-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
}

.pe-history-item-main { flex: 1; min-width: 0; }

.pe-history-item:hover {
    background: #eaf7ef;
    border-color: #b7e0c8;
}

.pe-history-item.active {
    background: #d8f3dc;
    border-color: #c8e6d4;
    border-left-color: #52b788;
}

.pe-history-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #1b4332;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pe-history-item-meta {
    font-size: 10px;
    color: #74c69d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pe-history-item-type {
    background: #d8f3dc;
    color: #2d6a4f;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.pe-history-item-del {
    background: none;
    border: none;
    color: #95d5b2;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0;
}

.pe-history-item:hover .pe-history-item-del { opacity: 1; }
.pe-history-item:hover .pe-history-item-del:hover {
    color: #2d6a4f;
    background: #d8f3dc;
}

.pe-history-empty {
    text-align: center;
    color: #95d5b2;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：查询输入 ========== */
.pe-input-panel {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #c8e6d4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pe-panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #c8e6d4;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #f0f9f4 0%, #e8f5ec 100%);
}

.pe-panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #1b4332;
}

.pe-panel-tip {
    font-size: 11px;
    color: #52b788;
    display: block;
}

.pe-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.pe-input-body::-webkit-scrollbar { width: 4px; }
.pe-input-body::-webkit-scrollbar-track { background: transparent; }
.pe-input-body::-webkit-scrollbar-thumb { background: #b7e0c8; border-radius: 2px; }

/* 搜索输入框 */
.pe-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: stretch;
}

.pe-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #c8e6d4;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #1b4332;
    background: #f8fdf9;
    outline: none;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.pe-search-input:focus {
    border-color: #52b788;
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
    background: #fff;
}

.pe-search-input::placeholder {
    font-size: 13px;
    color: #95d5b2;
    letter-spacing: 0;
    font-weight: 400;
}

.pe-search-input.shake {
    animation: peShake 0.4s ease;
}

@keyframes peShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* 中栏查询按钮 */
.pe-search-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.35);
}

.pe-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.45);
}

.pe-search-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 字数统计 */
.pe-char-counter {
    text-align: right;
    font-size: 11px;
    color: #95d5b2;
    margin-bottom: 12px;
}

.pe-char-counter.warning { color: #f4a261; }
.pe-char-counter.limit { color: #e63946; font-weight: 600; }

/* 查询模式 */
.pe-mode-group { margin-bottom: 14px; }

.pe-mode-label {
    font-size: 12px;
    color: #2d6a4f;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.pe-mode-options {
    display: flex;
    gap: 6px;
}

.pe-mode-option {
    flex: 1;
    padding: 7px 6px;
    text-align: center;
    border: 1.5px solid #c8e6d4;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #40916c;
    transition: all 0.18s;
    user-select: none;
    background: #f8fdf9;
}

.pe-mode-option:hover {
    border-color: #52b788;
    color: #2d6a4f;
    background: #eaf7ef;
}

.pe-mode-option.selected {
    border-color: #2d6a4f;
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.3);
}

.pe-mode-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

/* 模式切换提示 */
.pe-mode-hint {
    font-size: 11px;
    color: #52b788;
    display: block;
    margin-bottom: 10px;
    min-height: 16px;
    transition: opacity 0.3s;
    opacity: 0;
}

.pe-mode-hint.visible { opacity: 1; }

/* 热门植物标签 */
.pe-quick-label {
    font-size: 12px;
    color: #2d6a4f;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.pe-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.pe-quick-tag {
    padding: 4px 10px;
    background: #eaf7ef;
    border: 1px solid #b7e0c8;
    border-radius: 20px;
    font-size: 13px;
    color: #1b4332;
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 500;
}

.pe-quick-tag:hover {
    background: #2d6a4f;
    border-color: #2d6a4f;
    color: #fff;
    transform: scale(1.05);
}

/* 使用提示框 */
.pe-tips-box {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ec 100%);
    border: 1px solid #c8e6d4;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #2d6a4f;
    line-height: 1.7;
}

.pe-tips-box p { margin: 0 0 4px; font-weight: 600; }
.pe-tips-box ul { margin: 0; padding-left: 16px; }
.pe-tips-box li { margin-bottom: 2px; }

/* ========== 右栏：查询结果 ========== */
.pe-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fdf9;
    min-width: 0;
}

.pe-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #c8e6d4;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #f0f9f4 0%, #e8f5ec 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pe-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1b4332;
}

.pe-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.pe-result-plant-label {
    font-size: 14px;
    font-weight: 700;
    color: #1b4332;
}

.pe-result-mode-badge {
    background: #d8f3dc;
    color: #2d6a4f;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.pe-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.pe-result-body::-webkit-scrollbar { width: 5px; }
.pe-result-body::-webkit-scrollbar-track { background: transparent; }
.pe-result-body::-webkit-scrollbar-thumb { background: #b7e0c8; border-radius: 3px; }
.pe-result-body::-webkit-scrollbar-thumb:hover { background: #52b788; }

/* 占位提示 */
.pe-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #95d5b2;
    text-align: center;
    padding: 40px;
    min-height: 180px;
}

.pe-placeholder-icon { font-size: 60px; margin-bottom: 14px; opacity: 0.75; animation: pePlaceholderFloat 3s ease-in-out infinite; }

@keyframes pePlaceholderFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.pe-placeholder-title { font-size: 16px; font-weight: 600; color: #52b788; margin: 0 0 8px; }
.pe-placeholder-desc { font-size: 13px; color: #95d5b2; margin: 3px 0; line-height: 1.6; }

/* 加载中 */
.pe-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.pe-loading-leaves {
    display: flex;
    gap: 10px;
    font-size: 22px;
}

.pe-loading-leaves span {
    display: inline-block;
    animation: peLeafBounce 1.3s ease-in-out infinite;
}

.pe-loading-leaves span:nth-child(2) { animation-delay: 0.22s; }
.pe-loading-leaves span:nth-child(3) { animation-delay: 0.44s; }

@keyframes peLeafBounce {
    0%, 80%, 100% { transform: scale(0.7) rotate(-10deg); opacity: 0.5; }
    40% { transform: scale(1.2) rotate(10deg); opacity: 1; }
}

.pe-loading-text {
    font-size: 13px;
    color: #52b788;
    margin: 0;
    animation: peBreathText 1.8s ease-in-out infinite;
}

@keyframes peBreathText {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ========== 结果内容（AI 生成的 HTML 样式） ========== */
.result-content {
    animation: peFadeInUp 0.35s ease;
    min-height: 0;
}

@keyframes peFadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 生成的植物条目根容器 */
.result-content .plant-entry {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

/* 植物头部 */
.result-content .plant-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px 14px;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
    position: relative;
    overflow: hidden;
}

.result-content .plant-head::before {
    content: '🌿';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.15;
}

.result-content .plant-name-main {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.25);
    line-height: 1;
}

.result-content .plant-latin {
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    font-style: italic;
    font-family: "Palatino Linotype", "Georgia", serif;
}

.result-content .plant-family-tag {
    font-size: 11px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.4);
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}

/* 基本属性行 */
.result-content .plant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 22px;
    background: #e8f5ec;
    border-bottom: 1px solid #c8e6d4;
}

.result-content .plant-meta-item {
    font-size: 12px;
    color: #2d6a4f;
    background: #d8f3dc;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #b7e0c8;
}

/* 各小节 */
.result-content .plant-section {
    padding: 14px 22px;
    border-bottom: 1px solid #e8f5ec;
    flex-shrink: 0;
}

.result-content .plant-section:last-child { border-bottom: none; }

.result-content .plant-section h4 {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 700;
    color: #1b4332;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content .plant-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, #52b788, #1b4332);
    border-radius: 2px;
}

/* 内容文字 */
.result-content .plant-section p {
    margin: 0 0 7px;
    font-size: 14px;
    color: #1b4332;
    line-height: 1.85;
}

.result-content .plant-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: #1b4332;
    line-height: 1.85;
}

.result-content .plant-section ul li {
    margin-bottom: 5px;
}

.result-content .plant-section ul li::marker {
    color: #52b788;
}

.result-content .plant-section ol {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    color: #1b4332;
    line-height: 1.85;
}

.result-content .plant-section ol li {
    margin-bottom: 5px;
}

.result-content .plant-section ol li::marker {
    color: #2d6a4f;
    font-weight: 700;
}

/* h2/h3 子标题 */
.result-content .plant-section h2 {
    font-size: 15px;
    font-weight: 700;
    color: #1b4332;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #c8e6d4;
}

.result-content .plant-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #2d6a4f;
    margin: 10px 0 5px;
}

/* blockquote 浏览器默认 margin(40px) 显式重置，防止 AI 生成内容缩进异常 */
.result-content blockquote { margin: 0; padding: 0; }

/* blockquote 诗词引用 */
.result-content .plant-section blockquote {
    margin: 8px 0;
    padding: 8px 14px;
    border-left: 4px solid #52b788;
    background: #f0f9f4;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #2d6a4f;
    font-style: italic;
    line-height: 1.8;
}

/* 分割线 */
.result-content .plant-section hr {
    border: none;
    border-top: 1px dashed #c8e6d4;
    margin: 10px 0;
}

/* 内联样式增强 */
.result-content strong { color: #1b4332; font-weight: 700; }
.result-content em { color: #40916c; font-style: italic; }
.result-content a {
    color: #2d6a4f;
    text-decoration: none;
    border-bottom: 1px solid rgba(82, 183, 136, 0.4);
    transition: border-color 0.15s, color 0.15s;
}
.result-content a:hover {
    color: #1b4332;
    border-bottom-color: #2d6a4f;
}

/* pre/code 代码块样式 */
.result-content pre {
    position: relative;
    background: #f0f9f4;
    border: 1px solid #c8e6d4;
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
    margin: 8px 0;
}

.result-content code {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    color: #1b4332;
    background: #e8f5ec;
    padding: 1px 5px;
    border-radius: 3px;
}

.result-content pre code {
    background: transparent;
    padding: 0;
    color: #1b4332;
    font-size: 13px;
}

/* 代码块一键复制按鈕 */
.code-copy-btn {
    position: absolute;
    top: 7px;
    right: 8px;
    padding: 3px 9px;
    font-size: 11px;
    background: rgba(45, 106, 79, 0.12);
    border: 1px solid #c8e6d4;
    border-radius: 4px;
    color: #2d6a4f;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.18s, background 0.18s;
    white-space: nowrap;
    line-height: 1.5;
    font-weight: 500;
}

.result-content pre:hover .code-copy-btn { opacity: 1; }

.code-copy-btn:hover {
    background: #2d6a4f;
    color: #fff;
    border-color: #2d6a4f;
}

.code-copy-btn.with-label { top: 28px; }

/* 错误重试按鈕 */
.pe-retry-btn {
    margin-top: 12px;
    padding: 7px 20px;
    background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(82, 183, 136, 0.35);
    display: inline-block;
}

.pe-retry-btn:hover {
    background: linear-gradient(135deg, #74c69d 0%, #40916c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(82, 183, 136, 0.45);
}

/* 进度条 */
#peProgressBar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    display: none;
    background: linear-gradient(90deg, #95d5b2, #52b788, #95d5b2);
    background-size: 200% 100%;
    animation: peProgressShimmer 1.6s linear infinite;
    border-radius: 0 2px 2px 0;
    transition: width 0.25s ease, opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

@keyframes peProgressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 表格样式 */
.result-content .plant-section table,
.result-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.result-content .plant-section table th,
.result-content table th {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

.result-content .plant-section table td,
.result-content table td {
    padding: 7px 12px;
    color: #1b4332;
    border-bottom: 1px solid #e8f5ec;
    line-height: 1.6;
}

.result-content .plant-section table tr:nth-child(even) td,
.result-content table tr:nth-child(even) td {
    background: #f0f9f4;
}

.result-content .plant-section table tr:hover td,
.result-content table tr:hover td {
    background: #e8f5ec;
}

/* 错误提示 容器 */
#peResultError { flex: 1; }

/* 错误提示 */
.pe-result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.pe-result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.pe-result-error .error-msg { font-size: 14px; color: #2d6a4f; margin: 0 0 6px; font-weight: 600; }
.pe-result-error .error-tip { font-size: 12px; color: #95d5b2; margin: 0; }

/* ========== 示例导入模态框 ========== */
.pe-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: none;
}

.pe-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s cubic-bezier(.34, 1.4, .64, 1),
                transform 0.3s cubic-bezier(.34, 1.4, .64, 1);
}

/* 弹性入场起始态（由 JS 添加/移除） */
.pe-modal.pe-entering {
    opacity: 0 !important;
    transform: translate(-50%, -54%) !important;
}

.pe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: #fff;
    flex-shrink: 0;
}

.pe-modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }

.pe-modal-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.pe-modal-close:hover { background: rgba(255,255,255,0.35); }

.pe-modal-body {
    overflow-y: auto;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

.pe-example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pe-example-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #c8e6d4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fdf9;
}

.pe-example-card:hover {
    border-color: #52b788;
    background: #eaf7ef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.2);
}

.pe-example-icon { font-size: 26px; flex-shrink: 0; }

.pe-example-info { flex: 1; min-width: 0; }

.pe-example-name {
    font-size: 15px;
    font-weight: 700;
    color: #1b4332;
    margin-bottom: 3px;
}

.pe-example-type-badge {
    display: inline-block;
    font-size: 10px;
    background: #d8f3dc;
    color: #2d6a4f;
    padding: 1px 6px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

.pe-example-desc {
    font-size: 11px;
    color: #52b788;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 暗黑模式（body.dark 前缀强制隔离） ========== */
body.dark .pe-container {
    background: #0d1f14;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

body.dark .pe-toolbar {
    background: linear-gradient(135deg, #0a1a0e 0%, #133621 60%, #1b4332 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark .pe-toolbar .toolbar-btn {
    background: rgba(82, 183, 136, 0.15);
    color: #95d5b2;
    border: 1px solid rgba(82, 183, 136, 0.2);
}

body.dark .pe-toolbar .toolbar-btn:hover:not(:disabled) {
    background: rgba(82, 183, 136, 0.28);
    color: #d8f3dc;
}

body.dark .pe-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
    color: #fff;
    border: none;
}

body.dark .pe-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #52b788 0%, #40916c 100%);
}

body.dark .pe-toolbar .toolbar-title { color: rgba(212, 237, 218, 0.9); }

body.dark .pe-main-content { background: #0d1f14; }

/* 暗黑 - 左栏历史 */
body.dark .pe-history-panel {
    background: #112219;
    border-right-color: #1e3a2a;
}

body.dark .pe-history-header {
    background: linear-gradient(to bottom, #152b1e 0%, #112219 100%);
    border-bottom-color: #1e3a2a;
}

body.dark .pe-history-header h3 { color: #95d5b2; }
body.dark .pe-history-count { color: #52b788; }

body.dark .pe-history-clear-btn {
    background: #1e3a2a;
    color: #74c69d;
}

body.dark .pe-history-clear-btn:hover { background: #264d38; }

body.dark .pe-history-search { border-bottom-color: #1e3a2a; }

body.dark .pe-history-search input {
    background: #0d1f14;
    border-color: #264d38;
    color: #d8f3dc;
}

body.dark .pe-history-search input::placeholder { color: #52b788; }

body.dark .pe-history-search input:focus {
    border-color: #52b788;
    box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.2);
}

body.dark .pe-history-list::-webkit-scrollbar-track { background: #0a1a0e; }
body.dark .pe-history-list::-webkit-scrollbar-track:hover { background: #112219; }
body.dark .pe-history-list::-webkit-scrollbar-thumb { background: #264d38; }
body.dark .pe-history-list::-webkit-scrollbar-thumb:hover { background: #52b788; }

body.dark .pe-history-item:hover {
    background: #1a3326;
    border-color: #264d38;
}

body.dark .pe-history-item.active {
    background: #1e3a2a;
    border-color: #1e3a2a;
    border-left-color: #40916c;
}

body.dark .pe-history-item-name { color: #95d5b2; }
body.dark .pe-history-item-meta { color: #52b788; }

body.dark .pe-history-item-type {
    background: #1e3a2a;
    color: #74c69d;
}

body.dark .pe-history-item-del { color: #40916c; }
body.dark .pe-history-item:hover .pe-history-item-del:hover {
    color: #95d5b2;
    background: #1e3a2a;
}

body.dark .pe-history-empty { color: #40916c; }

/* 暗黑 - 中栏输入 */
body.dark .pe-input-panel {
    background: #112219;
    border-right-color: #1e3a2a;
}

body.dark .pe-panel-header {
    background: linear-gradient(to bottom, #152b1e 0%, #112219 100%);
    border-bottom-color: #1e3a2a;
}

body.dark .pe-panel-header h3 { color: #95d5b2; }
body.dark .pe-panel-tip { color: #52b788; }

body.dark .pe-input-body::-webkit-scrollbar-track { background: #0a1a0e; }
body.dark .pe-input-body::-webkit-scrollbar-track:hover { background: #112219; }
body.dark .pe-input-body::-webkit-scrollbar-thumb { background: #264d38; }

body.dark .pe-search-input {
    background: #0d1f14;
    border-color: #264d38;
    color: #d8f3dc;
}

body.dark .pe-search-input:focus {
    border-color: #52b788;
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.2);
    background: #112219;
}

body.dark .pe-search-input::placeholder { color: #74c69d; }

body.dark .pe-search-btn {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark .pe-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #52b788 0%, #40916c 100%);
}

body.dark .pe-char-counter { color: #40916c; }

body.dark .pe-mode-label { color: #74c69d; }

body.dark .pe-mode-option {
    background: #0d1f14;
    border-color: #264d38;
    color: #74c69d;
}

body.dark .pe-mode-option:hover {
    border-color: #52b788;
    color: #95d5b2;
    background: #1a3326;
}

body.dark .pe-mode-option.selected {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    border-color: #40916c;
    color: #d8f3dc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

body.dark .pe-mode-hint { color: #52b788; }

body.dark .pe-quick-label { color: #74c69d; }

body.dark .pe-quick-tag {
    background: #1a3326;
    border-color: #264d38;
    color: #95d5b2;
}

body.dark .pe-quick-tag:hover {
    background: #40916c;
    border-color: #40916c;
    color: #fff;
}

body.dark .pe-tips-box {
    background: linear-gradient(135deg, #112219 0%, #0d1f14 100%);
    border-color: #1e3a2a;
    color: #74c69d;
}

/* 暗黑 - 右栏结果 */
body.dark .pe-result-panel { background: #0d1f14; }

body.dark .pe-result-header {
    background: linear-gradient(to bottom, #152b1e 0%, #112219 100%);
    border-bottom-color: #1e3a2a;
}

body.dark .pe-result-header h3 { color: #95d5b2; }
body.dark .pe-result-plant-label { color: #d8f3dc; }

body.dark .pe-result-mode-badge {
    background: #1e3a2a;
    color: #74c69d;
}

body.dark .pe-result-body::-webkit-scrollbar-track { background: #0a1a0e; }
body.dark .pe-result-body::-webkit-scrollbar-track:hover { background: #112219; }
body.dark .pe-result-body::-webkit-scrollbar-thumb { background: #264d38; }
body.dark .pe-result-body::-webkit-scrollbar-thumb:hover { background: #52b788; }

body.dark .pe-placeholder-title { color: #52b788; }
body.dark .pe-placeholder-desc { color: #4b5563; }

body.dark .pe-loading-text { color: #52b788; }

/* 暗黑 - AI 结果内容 */
body.dark .result-content .plant-entry {
    background: #112219;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

body.dark .result-content .plant-head {
    background: linear-gradient(135deg, #051009 0%, #0a1a0e 50%, #133621 100%);
}

body.dark .result-content .plant-meta {
    background: #152b1e;
    border-bottom-color: #1e3a2a;
}

body.dark .result-content .plant-meta-item {
    background: #1e3a2a;
    color: #74c69d;
    border-color: #264d38;
}

body.dark .result-content .plant-section {
    border-bottom-color: #1e3a2a;
}

body.dark .result-content .plant-section h4 { color: #95d5b2; }
body.dark .result-content .plant-section p { color: #c8e6d4; }
body.dark .result-content .plant-section ul { color: #c8e6d4; }
body.dark .result-content .plant-section ol { color: #c8e6d4; }

body.dark .result-content .plant-section h2 {
    color: #95d5b2;
    border-bottom-color: #1e3a2a;
}

body.dark .result-content .plant-section h3 { color: #74c69d; }

body.dark .result-content .plant-section blockquote {
    background: #152b1e;
    border-left-color: #40916c;
    color: #95d5b2;
}

body.dark .result-content .plant-section hr { border-top-color: #1e3a2a; }

body.dark .result-content strong { color: #d8f3dc; }
body.dark .result-content em { color: #74c69d; }
body.dark .result-content a { color: #52b788; border-bottom-color: rgba(82, 183, 136, 0.35); }
body.dark .result-content a:hover { color: #95d5b2; border-bottom-color: #52b788; }

/* 暗黑 - pre/code */
body.dark .result-content pre {
    background: #112219;
    border-color: #1e3a2a;
}

body.dark .result-content code {
    background: #1e3a2a;
    color: #95d5b2;
}

body.dark .result-content pre code {
    background: transparent;
    color: #c8e6d4;
}

body.dark .code-copy-btn {
    background: rgba(82, 183, 136, 0.12);
    border-color: #264d38;
    color: #74c69d;
}

body.dark .code-copy-btn:hover {
    background: #40916c;
    color: #fff;
    border-color: #40916c;
}

body.dark .pe-retry-btn {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark .pe-retry-btn:hover {
    background: linear-gradient(135deg, #52b788 0%, #40916c 100%);
}

body.dark .result-content .plant-section table th,
body.dark .result-content table th {
    background: linear-gradient(135deg, #0a1a0e 0%, #152b1e 100%);
}

body.dark .result-content .plant-section table td,
body.dark .result-content table td {
    color: #c8e6d4;
    border-bottom-color: #1e3a2a;
}

body.dark .result-content .plant-section table tr:nth-child(even) td,
body.dark .result-content table tr:nth-child(even) td {
    background: #152b1e;
}

body.dark .result-content .plant-section table tr:hover td,
body.dark .result-content table tr:hover td {
    background: #1a3326;
}

/* 暗黑 - 模态框 */
body.dark .pe-modal {
    background: #112219;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

body.dark .pe-modal-header {
    background: linear-gradient(135deg, #0a1a0e 0%, #1b4332 100%);
}

body.dark .pe-example-card {
    background: #0d1f14;
    border-color: #1e3a2a;
}

body.dark .pe-example-card:hover {
    border-color: #40916c;
    background: #152b1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark .pe-example-name { color: #95d5b2; }

body.dark .pe-example-type-badge {
    background: #1e3a2a;
    color: #74c69d;
}

body.dark .pe-example-desc { color: #52b788; }

body.dark .pe-modal-body::-webkit-scrollbar { width: 4px; }
body.dark .pe-modal-body::-webkit-scrollbar-track { background: #0a1a0e; }
body.dark .pe-modal-body::-webkit-scrollbar-track:hover { background: #112219; }
body.dark .pe-modal-body::-webkit-scrollbar-thumb { background: #264d38; border-radius: 2px; }

/* 暗黑 - select option 兼容 */
body.dark .pe-container select option {
    background: #112219;
    color: #95d5b2;
}

/* ========== Toast 提示 ========== */
.pe-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(27, 67, 50, 0.93);
    color: #d8f3dc;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pe-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pe-toast.warn {
    background: rgba(180, 90, 20, 0.93);
    color: #fde8c8;
}

body.dark .pe-toast {
    background: rgba(10, 26, 14, 0.95);
    color: #95d5b2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

body.dark .pe-toast.warn {
    background: rgba(120, 60, 10, 0.93);
    color: #fde8c8;
}

/* 暗黑 - 错误文字颜色 */
body.dark .pe-result-error .error-msg { color: #74c69d; }
body.dark .pe-result-error .error-tip { color: #40916c; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .pe-history-panel { width: 160px; }
    .pe-input-panel { width: 220px; }
}

@media (max-width: 680px) {
    .pe-main-content { flex-direction: column; }
    .pe-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #c8e6d4;
        flex-direction: column;
    }
    .pe-history-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; display: flex; padding: 5px; }
    .pe-history-item { flex-shrink: 0; width: 120px; }
    .pe-input-panel { width: 100%; border-right: none; max-height: 240px; }
    .pe-example-grid { grid-template-columns: 1fr; }
}
