/* =============================================
   动物百科 - animal_encyclopedia.css
   三栏布局：历史 | 查询 | 结果
   主题色：野性琥珀系（#3E2723 / #5D4037 / #A0622A / #E07B00 / #FFF3E0）
   ============================================= */

/* ========== 主容器 ========== */
.ae-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #FFF3E0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ae-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;
}

/* ========== 顶部工具栏 ========== */
.ae-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 36px;
    background: linear-gradient(135deg, #3E2723 0%, #5D4037 60%, #795548 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(62, 39, 35, 0.45);
    flex-shrink: 0;
    position: relative;
}

.ae-toolbar .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.ae-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: #5D4037;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.ae-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.ae-toolbar .toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ae-toolbar .toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮（查询） */
.ae-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #E07B00 0%, #A0622A 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(224, 123, 0, 0.45);
}

.ae-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF8F00 0%, #C07A30 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(224, 123, 0, 0.55);
}

/* 查询按钮 loading 流光动画 */
.ae-toolbar .toolbar-btn-primary.ae-btn-loading {
    background: linear-gradient(90deg, #A0622A 0%, #E07B00 35%, #A0622A 65%, #5D4037 100%);
    background-size: 200% 100%;
    animation: aeBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(224, 123, 0, 0.5);
}

@keyframes aeBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ae-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 243, 224, 0.92);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* ========== 主内容：三栏 ========== */
.ae-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #FFF3E0;
}

/* ========== 左栏：历史记录 ========== */
.ae-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #FFFBF5;
    border-right: 1px solid #FFCCBC;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ae-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #FFF3E0 0%, #FFE0B2 100%);
    border-bottom: 1px solid #FFCCBC;
    flex-shrink: 0;
}

.ae-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3E2723;
}

.ae-history-count {
    font-size: 11px;
    color: #A0622A;
    font-weight: 400;
}

.ae-history-clear-btn {
    background: #FFE0B2;
    border: none;
    color: #5D4037;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.ae-history-clear-btn:hover { background: #FFCCBC; }

.ae-history-search {
    padding: 7px;
    border-bottom: 1px solid #FFCCBC;
    flex-shrink: 0;
}

.ae-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #FFCCBC;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #3E2723;
    background: #FFFBF5;
}

.ae-history-search input::placeholder { color: #BCAAA4; }

.ae-history-search input:focus {
    border-color: #E07B00;
    box-shadow: 0 0 0 2px rgba(224, 123, 0, 0.15);
}

.ae-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.ae-history-list::-webkit-scrollbar { width: 4px; }
.ae-history-list::-webkit-scrollbar-track { background: transparent; }
.ae-history-list::-webkit-scrollbar-track:hover { background: #FFF3E0; }
.ae-history-list::-webkit-scrollbar-thumb { background: #FFCCBC; border-radius: 2px; }
.ae-history-list::-webkit-scrollbar-thumb:hover { background: #E07B00; }

.ae-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;
}

.ae-history-item-main { flex: 1; min-width: 0; }

.ae-history-item:hover {
    background: #FFF3E0;
    border-color: #FFD8A8;
}

.ae-history-item.active {
    background: #FFE0B2;
    border-color: #FFCCBC;
    border-left-color: #E07B00;
}

.ae-history-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #3E2723;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ae-history-item-meta {
    font-size: 10px;
    color: #A0622A;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ae-history-item-type {
    background: #FFE0B2;
    color: #5D4037;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.ae-history-item-del {
    background: none;
    border: none;
    color: #FFCCBC;
    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;
}

.ae-history-item:hover .ae-history-item-del { opacity: 1; }
.ae-history-item:hover .ae-history-item-del:hover {
    color: #3E2723;
    background: #FFE0B2;
}

.ae-history-empty {
    text-align: center;
    color: #BCAAA4;
    font-size: 12px;
    padding: 24px 8px;
    line-height: 1.7;
}

/* ========== 中栏：查询输入 ========== */
.ae-input-panel {
    width: 280px;
    flex-shrink: 0;
    background: #FFFBF5;
    border-right: 1px solid #FFCCBC;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ae-panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #FFCCBC;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #FFF3E0 0%, #FFE0B2 100%);
}

.ae-panel-header h3 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #3E2723;
}

.ae-panel-tip {
    font-size: 11px;
    color: #A0622A;
    display: block;
}

.ae-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.ae-input-body::-webkit-scrollbar { width: 4px; }
.ae-input-body::-webkit-scrollbar-track { background: transparent; }
.ae-input-body::-webkit-scrollbar-track:hover { background: #FFF3E0; }
.ae-input-body::-webkit-scrollbar-thumb { background: #FFCCBC; border-radius: 2px; }
.ae-input-body::-webkit-scrollbar-thumb:hover { background: #E07B00; }


/* 搜索输入框 */
.ae-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: stretch;
}

.ae-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #FFCCBC;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #3E2723;
    background: #FFFBF5;
    outline: none;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.ae-search-input:focus {
    border-color: #E07B00;
    box-shadow: 0 0 0 3px rgba(224, 123, 0, 0.15);
    background: #fff;
}

.ae-search-input::placeholder {
    font-size: 13px;
    color: #BCAAA4;
    letter-spacing: 0;
    font-weight: 400;
}

.ae-search-input.shake {
    animation: aeShake 0.4s ease;
}

@keyframes aeShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* 中栏查询按钮 */
.ae-search-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 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(62, 39, 35, 0.35);
}

.ae-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #795548 0%, #5D4037 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(62, 39, 35, 0.45);
}

.ae-search-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 字数统计 */
.ae-char-counter {
    text-align: right;
    font-size: 11px;
    color: #BCAAA4;
    margin-bottom: 12px;
}

.ae-char-counter.warning { color: #f4a261; }
.ae-char-counter.limit { color: #e63946; font-weight: 600; }

/* 查询模式 */
.ae-mode-group { margin-bottom: 14px; }

.ae-mode-label {
    font-size: 12px;
    color: #5D4037;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.ae-mode-options {
    display: flex;
    gap: 6px;
}

.ae-mode-option {
    flex: 1;
    padding: 7px 6px;
    text-align: center;
    border: 1.5px solid #FFCCBC;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #795548;
    transition: all 0.18s;
    user-select: none;
    background: #FFFBF5;
}

.ae-mode-option:hover {
    border-color: #E07B00;
    color: #5D4037;
    background: #FFF3E0;
}

.ae-mode-option.selected {
    border-color: #5D4037;
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    color: #FFF3E0;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(62, 39, 35, 0.3);
}

.ae-mode-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

/* 模式切换提示 */
.ae-mode-hint {
    font-size: 11px;
    color: #A0622A;
    display: block;
    margin-bottom: 10px;
    min-height: 16px;
    transition: opacity 0.3s;
    opacity: 0;
}

.ae-mode-hint.visible { opacity: 1; }

/* 热门动物标签 */
.ae-quick-label {
    font-size: 12px;
    color: #5D4037;
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
}

.ae-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.ae-quick-tag {
    padding: 4px 10px;
    background: #FFE0B2;
    border: 1px solid #FFCCBC;
    border-radius: 20px;
    font-size: 13px;
    color: #3E2723;
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 500;
}

.ae-quick-tag:hover {
    background: #5D4037;
    border-color: #5D4037;
    color: #fff;
    transform: scale(1.05);
}

.ae-quick-tag:active { transform: scale(0.95); }

/* 历史搜索匹配数量提示 */
.ae-history-match-count {
    font-size: 11px;
    color: #A0622A;
    text-align: center;
    padding: 4px 6px 2px;
    font-weight: 500;
}

/* 使用提示框 */
.ae-tips-box {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 1px solid #FFCCBC;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #5D4037;
    line-height: 1.7;
}

.ae-tips-box p { margin: 0 0 4px; font-weight: 600; }
.ae-tips-box ul { margin: 0; padding-left: 16px; }
.ae-tips-box li { margin-bottom: 2px; }

/* ========== 右栏：查询结果 ========== */
.ae-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #FFFBF5;
    min-width: 0;
}

.ae-result-header {
    padding: 10px 16px;
    border-bottom: 1px solid #FFCCBC;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #FFF3E0 0%, #FFE0B2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ae-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #3E2723;
}

.ae-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.ae-result-animal-label {
    font-size: 14px;
    font-weight: 700;
    color: #3E2723;
}

.ae-result-mode-badge {
    background: #FFE0B2;
    color: #5D4037;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* 深度解析快捷升级按钮 */
.ae-upgrade-btn {
    padding: 3px 10px;
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    color: #FFF3E0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(62, 39, 35, 0.3);
    letter-spacing: 0.3px;
}

.ae-upgrade-btn:hover {
    background: linear-gradient(135deg, #E07B00 0%, #A0622A 100%);
    box-shadow: 0 2px 8px rgba(224, 123, 0, 0.4);
    transform: translateY(-1px);
}

.ae-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.ae-result-body::-webkit-scrollbar { width: 5px; }
.ae-result-body::-webkit-scrollbar-track { background: transparent; }
.ae-result-body::-webkit-scrollbar-track:hover { background: #FFF3E0; }
.ae-result-body::-webkit-scrollbar-thumb { background: #FFCCBC; border-radius: 3px; }
.ae-result-body::-webkit-scrollbar-thumb:hover { background: #E07B00; }

/* 占位提示 */
.ae-result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #BCAAA4;
    text-align: center;
    padding: 40px;
    min-height: 180px;
}

.ae-placeholder-icon {
    font-size: 60px;
    margin-bottom: 14px;
    opacity: 0.75;
    animation: aePlaceholderFloat 3s ease-in-out infinite;
}

@keyframes aePlaceholderFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.ae-placeholder-title { font-size: 16px; font-weight: 600; color: #A0622A; margin: 0 0 8px; }
.ae-placeholder-desc { font-size: 13px; color: #BCAAA4; margin: 3px 0; line-height: 1.6; }

/* 加载中 */
.ae-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.ae-loading-paws {
    display: flex;
    gap: 10px;
    font-size: 22px;
}

.ae-loading-paws span {
    display: inline-block;
    animation: aePawBounce 1.3s ease-in-out infinite;
}

.ae-loading-paws span:nth-child(2) { animation-delay: 0.22s; }
.ae-loading-paws span:nth-child(3) { animation-delay: 0.44s; }

@keyframes aePawBounce {
    0%, 80%, 100% { transform: scale(0.7) rotate(-10deg); opacity: 0.5; }
    40% { transform: scale(1.2) rotate(10deg); opacity: 1; }
}

.ae-loading-text {
    font-size: 13px;
    color: #A0622A;
    margin: 0;
    animation: aeBreathText 1.8s ease-in-out infinite;
}

@keyframes aeBreathText {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ========== 结果内容（AI 生成的 HTML 样式） ========== */
.result-content {
    min-height: 0;
}

/* 入场动画由 JS 动态添加/移除此 class，确保重复查询时每次都重播 */
.result-content.ae-enter-anim {
    animation: aeFadeInUp 0.35s ease;
}

@keyframes aeFadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 生成的动物条目根容器 */
.result-content .animal-entry {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 动物头部 */
.result-content .animal-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px 14px;
    background: linear-gradient(135deg, #3E2723 0%, #5D4037 50%, #795548 100%);
    position: relative;
    overflow: hidden;
}

.result-content .animal-head::before {
    content: '🦁';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.15;
}

.result-content .animal-name-main {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    line-height: 1;
}

.result-content .animal-latin {
    font-size: 15px;
    color: rgba(255, 243, 224, 0.85);
    font-style: italic;
    font-family: "Palatino Linotype", "Georgia", serif;
}

.result-content .animal-class-tag {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.22);
    color: #FFF3E0;
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 243, 224, 0.4);
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}

/* 基本属性行 */
.result-content .animal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 22px;
    background: #FFE0B2;
    border-bottom: 1px solid #FFCCBC;
}

.result-content .animal-meta-item {
    font-size: 12px;
    color: #5D4037;
    background: #FFF3E0;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #FFCCBC;
}

/* 各小节 */
.result-content .animal-section {
    padding: 14px 22px;
    border-bottom: 1px solid #FFF3E0;
    flex-shrink: 0;
}

.result-content .animal-section:last-child { border-bottom: none; }

.result-content .animal-section h4 {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 700;
    color: #3E2723;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content .animal-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, #E07B00, #5D4037);
    border-radius: 2px;
}

/* 内容文字 */
.result-content .animal-section p {
    margin: 0 0 7px;
    font-size: 14px;
    color: #3E2723;
    line-height: 1.85;
}

.result-content .animal-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: #3E2723;
    line-height: 1.85;
}

.result-content .animal-section ul li {
    margin-bottom: 5px;
}

.result-content .animal-section ul li::marker {
    color: #E07B00;
}

.result-content .animal-section ol {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    color: #3E2723;
    line-height: 1.85;
}

.result-content .animal-section ol li {
    margin-bottom: 5px;
}

.result-content .animal-section ol li::marker {
    color: #5D4037;
    font-weight: 700;
}

/* h2/h3 子标题 */
.result-content .animal-section h2 {
    font-size: 15px;
    font-weight: 700;
    color: #3E2723;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #FFCCBC;
}

.result-content .animal-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #5D4037;
    margin: 10px 0 5px;
}

/* blockquote 浏览器默认 margin(40px) 显式重置，防止 AI 生成内容缩进异常 */
.result-content blockquote { margin: 0; padding: 0; }

/* blockquote 故事引用 */
.result-content .animal-section blockquote {
    margin: 8px 0;
    padding: 8px 14px;
    border-left: 4px solid #E07B00;
    background: #FFF3E0;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #5D4037;
    font-style: italic;
    line-height: 1.8;
}

/* 分割线 */
.result-content .animal-section hr {
    border: none;
    border-top: 1px dashed #FFCCBC;
    margin: 10px 0;
}

/* 内联样式增强 */
.result-content strong { color: #3E2723; font-weight: 700; }
.result-content em { color: #795548; font-style: italic; }
.result-content a {
    color: #5D4037;
    text-decoration: none;
    border-bottom: 1px solid rgba(224, 123, 0, 0.4);
    transition: border-color 0.15s, color 0.15s;
}
.result-content a:hover {
    color: #3E2723;
    border-bottom-color: #E07B00;
}

/* pre/code 代码块样式 */
.result-content pre {
    position: relative;
    background: #FFF8F0;
    border: 1px solid #FFCCBC;
    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: #3E2723;
    background: #FFE0B2;
    padding: 1px 5px;
    border-radius: 3px;
}

.result-content pre code {
    background: transparent;
    padding: 0;
    color: #3E2723;
    font-size: 13px;
}

/* 代码块一键复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 7px;
    right: 8px;
    padding: 3px 9px;
    font-size: 11px;
    background: rgba(93, 64, 55, 0.12);
    border: 1px solid #FFCCBC;
    border-radius: 4px;
    color: #5D4037;
    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: #5D4037;
    color: #fff;
    border-color: #5D4037;
}

.code-copy-btn.with-label { top: 28px; }

/* 错误重试按钮 */
.ae-retry-btn {
    margin-top: 12px;
    padding: 7px 20px;
    background: linear-gradient(135deg, #E07B00 0%, #A0622A 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(224, 123, 0, 0.35);
    display: inline-block;
}

.ae-retry-btn:hover {
    background: linear-gradient(135deg, #FF8F00 0%, #C07A30 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(224, 123, 0, 0.45);
}

body.dark .ae-retry-btn {
    background: linear-gradient(135deg, #BF6900 0%, #8D4E20 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark .ae-retry-btn:hover {
    background: linear-gradient(135deg, #E07B00 0%, #A0622A 100%);
}

/* 进度条 */
#aeProgressBar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 0%;
    display: none;
    background: linear-gradient(90deg, #FFCA28, #E07B00, #FFCA28);
    background-size: 200% 100%;
    animation: aeProgressShimmer 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 aeProgressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 表格样式 */
.result-content .animal-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.07);
}

.result-content .animal-section table th,
.result-content table th {
    background: linear-gradient(135deg, #3E2723 0%, #5D4037 100%);
    color: #FFF3E0;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

.result-content .animal-section table td,
.result-content table td {
    padding: 7px 12px;
    color: #3E2723;
    border-bottom: 1px solid #FFF3E0;
    line-height: 1.6;
}

.result-content .animal-section table tr:nth-child(even) td,
.result-content table tr:nth-child(even) td {
    background: #FFF8F0;
}

.result-content .animal-section table tr:hover td,
.result-content table tr:hover td {
    background: #FFE0B2;
}

/* 错误提示 容器 */
#aeResultError { flex: 1; }

/* 错误提示 */
.ae-result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.ae-result-error .error-icon { font-size: 36px; margin-bottom: 10px; }
.ae-result-error .error-msg { font-size: 14px; color: #5D4037; margin: 0 0 6px; font-weight: 600; }
.ae-result-error .error-tip { font-size: 12px; color: #BCAAA4; margin: 0; }

/* ========== 示例导入模态框 ========== */
.ae-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: none;
}

.ae-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: 580px;
    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 添加/移除） */
.ae-modal.ae-entering {
    opacity: 0 !important;
    transform: translate(-50%, -54%) !important;
}

.ae-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #3E2723 0%, #5D4037 100%);
    color: #FFF3E0;
    flex-shrink: 0;
}

.ae-modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: #FFF3E0; }

.ae-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #FFF3E0;
    font-size: 16px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.ae-modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.ae-modal-body {
    overflow-y: auto;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

.ae-modal-body::-webkit-scrollbar { width: 4px; }
.ae-modal-body::-webkit-scrollbar-track { background: transparent; }
.ae-modal-body::-webkit-scrollbar-track:hover { background: #FFF3E0; }
.ae-modal-body::-webkit-scrollbar-thumb { background: #FFCCBC; border-radius: 2px; }
.ae-modal-body::-webkit-scrollbar-thumb:hover { background: #E07B00; }

.ae-example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ae-example-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #FFCCBC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #FFFBF5;
}

.ae-example-card:hover {
    border-color: #E07B00;
    background: #FFF3E0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 123, 0, 0.2);
}

.ae-example-icon { font-size: 26px; flex-shrink: 0; }

.ae-example-info { flex: 1; min-width: 0; }

.ae-example-name {
    font-size: 15px;
    font-weight: 700;
    color: #3E2723;
    margin-bottom: 3px;
}

.ae-example-type-badge {
    display: inline-block;
    font-size: 10px;
    background: #FFE0B2;
    color: #5D4037;
    padding: 1px 6px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

.ae-example-desc {
    font-size: 11px;
    color: #A0622A;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 暗黑模式（body.dark 前缀强制隔离） ========== */
body.dark .ae-container {
    background: #1A0E06;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

body.dark .ae-toolbar {
    background: linear-gradient(135deg, #1A0E06 0%, #2A1508 60%, #3E2723 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

body.dark .ae-toolbar .toolbar-btn {
    background: rgba(224, 123, 0, 0.15);
    color: #D7A870;
    border: 1px solid rgba(224, 123, 0, 0.22);
}

body.dark .ae-toolbar .toolbar-btn:hover:not(:disabled) {
    background: rgba(224, 123, 0, 0.28);
    color: #FFD8A8;
}

body.dark .ae-toolbar .toolbar-btn-primary {
    background: linear-gradient(135deg, #BF6900 0%, #8D4E20 100%);
    color: #fff;
    border: none;
}

body.dark .ae-toolbar .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #E07B00 0%, #A0622A 100%);
}

body.dark .ae-toolbar .toolbar-title { color: rgba(255, 220, 165, 0.9); }

body.dark .ae-main-content { background: #1A0E06; }

/* 暗黑 - 左栏历史 */
body.dark .ae-history-panel {
    background: #231108;
    border-right-color: #4E342E;
}

body.dark .ae-history-header {
    background: linear-gradient(to bottom, #2A1508 0%, #231108 100%);
    border-bottom-color: #4E342E;
}

body.dark .ae-history-header h3 { color: #D7A870; }
body.dark .ae-history-count { color: #A0622A; }

body.dark .ae-history-clear-btn {
    background: #4E342E;
    color: #D7A870;
}

body.dark .ae-history-clear-btn:hover { background: #6A4A3A; }

body.dark .ae-history-search { border-bottom-color: #4E342E; }

body.dark .ae-history-search input {
    background: #1A0E06;
    border-color: #4E342E;
    color: #FFD8A8;
}

body.dark .ae-history-search input::placeholder { color: #8D6A4A; }

body.dark .ae-history-search input:focus {
    border-color: #E07B00;
    box-shadow: 0 0 0 2px rgba(224, 123, 0, 0.22);
}

body.dark .ae-history-list::-webkit-scrollbar-track { background: #140A03; }
body.dark .ae-history-list::-webkit-scrollbar-track:hover { background: #231108; }
body.dark .ae-history-list::-webkit-scrollbar-thumb { background: #4E342E; }
body.dark .ae-history-list::-webkit-scrollbar-thumb:hover { background: #E07B00; }

body.dark .ae-history-item:hover {
    background: #2A1508;
    border-color: #4E342E;
}

body.dark .ae-history-item.active {
    background: #3E2210;
    border-color: #4E342E;
    border-left-color: #E07B00;
}

body.dark .ae-history-item-name { color: #D7A870; }
body.dark .ae-history-item-meta { color: #A0622A; }

body.dark .ae-history-item-type {
    background: #3E2210;
    color: #D7A870;
}

body.dark .ae-history-item-del { color: #6A4A3A; }
body.dark .ae-history-item:hover .ae-history-item-del { color: #A0622A; }
body.dark .ae-history-item:hover .ae-history-item-del:hover {
    color: #FFD8A8;
    background: #4E342E;
}

body.dark .ae-history-match-count { color: #A0622A; }

body.dark .ae-history-empty { color: #6A4A3A; }

/* 暗黑 - 中栏输入 */
body.dark .ae-input-panel {
    background: #231108;
    border-right-color: #4E342E;
}

body.dark .ae-panel-header {
    background: linear-gradient(to bottom, #2A1508 0%, #231108 100%);
    border-bottom-color: #4E342E;
}

body.dark .ae-panel-header h3 { color: #D7A870; }
body.dark .ae-panel-tip { color: #A0622A; }

body.dark .ae-input-body::-webkit-scrollbar-track { background: #140A03; }
body.dark .ae-input-body::-webkit-scrollbar-track:hover { background: #231108; }
body.dark .ae-input-body::-webkit-scrollbar-thumb { background: #4E342E; }
body.dark .ae-input-body::-webkit-scrollbar-thumb:hover { background: #E07B00; }

body.dark .ae-search-input {
    background: #1A0E06;
    border-color: #4E342E;
    color: #FFD8A8;
}

body.dark .ae-search-input:focus {
    border-color: #E07B00;
    box-shadow: 0 0 0 3px rgba(224, 123, 0, 0.2);
    background: #231108;
}

body.dark .ae-search-input::placeholder { color: #8D6A4A; }

body.dark .ae-search-btn {
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

body.dark .ae-search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #795548 0%, #5D4037 100%);
}

body.dark .ae-char-counter { color: #6A4A3A; }
body.dark .ae-char-counter.warning { color: #d4834a; }
body.dark .ae-char-counter.limit   { color: #e05050; font-weight: 600; }

body.dark .ae-mode-label { color: #D7A870; }

body.dark .ae-mode-option {
    background: #1A0E06;
    border-color: #4E342E;
    color: #D7A870;
}

body.dark .ae-mode-option:hover {
    border-color: #E07B00;
    color: #FFD8A8;
    background: #2A1508;
}

body.dark .ae-mode-option.selected {
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    border-color: #795548;
    color: #FFD8A8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark .ae-mode-hint { color: #A0622A; }

body.dark .ae-quick-label { color: #D7A870; }

body.dark .ae-quick-tag {
    background: #2A1508;
    border-color: #4E342E;
    color: #D7A870;
}

body.dark .ae-quick-tag:hover {
    background: #5D4037;
    border-color: #5D4037;
    color: #fff;
}

body.dark .ae-tips-box {
    background: linear-gradient(135deg, #231108 0%, #1A0E06 100%);
    border-color: #4E342E;
    color: #D7A870;
}

/* 暗黑 - 右栏结果 */
body.dark .ae-result-panel { background: #1A0E06; }

body.dark .ae-result-header {
    background: linear-gradient(to bottom, #2A1508 0%, #231108 100%);
    border-bottom-color: #4E342E;
}

body.dark .ae-result-header h3 { color: #D7A870; }
body.dark .ae-result-animal-label { color: #FFD8A8; }

body.dark .ae-result-mode-badge {
    background: #3E2210;
    color: #D7A870;
}

body.dark .ae-upgrade-btn {
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    color: #FFD8A8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

body.dark .ae-upgrade-btn:hover {
    background: linear-gradient(135deg, #BF6900 0%, #8D4E20 100%);
    box-shadow: 0 2px 8px rgba(224, 123, 0, 0.35);
}

body.dark .ae-result-body::-webkit-scrollbar-track { background: #140A03; }
body.dark .ae-result-body::-webkit-scrollbar-track:hover { background: #231108; }
body.dark .ae-result-body::-webkit-scrollbar-thumb { background: #4E342E; }
body.dark .ae-result-body::-webkit-scrollbar-thumb:hover { background: #E07B00; }

body.dark .ae-placeholder-title { color: #A0622A; }
body.dark .ae-placeholder-desc { color: #6A4A3A; }

body.dark .ae-loading-text { color: #A0622A; }

/* 暗黑 - AI 结果内容 */
body.dark .result-content .animal-entry {
    background: #231108;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

body.dark .result-content .animal-head {
    background: linear-gradient(135deg, #0F0703 0%, #1A0E06 50%, #2A1508 100%);
}

body.dark .result-content .animal-meta {
    background: #2A1508;
    border-bottom-color: #4E342E;
}

body.dark .result-content .animal-meta-item {
    background: #3E2210;
    color: #D7A870;
    border-color: #4E342E;
}

body.dark .result-content .animal-section {
    border-bottom-color: #2A1508;
}

body.dark .result-content .animal-section h4 { color: #D7A870; }
body.dark .result-content .animal-section p { color: #D4B896; }
body.dark .result-content .animal-section ul { color: #D4B896; }
body.dark .result-content .animal-section ol { color: #D4B896; }

body.dark .result-content .animal-section h2 {
    color: #D7A870;
    border-bottom-color: #4E342E;
}

body.dark .result-content .animal-section h3 { color: #C49060; }

body.dark .result-content .animal-section blockquote {
    background: #2A1508;
    border-left-color: #E07B00;
    color: #D7A870;
}

body.dark .result-content .animal-section hr { border-top-color: #4E342E; }

body.dark .result-content strong { color: #FFD8A8; }
body.dark .result-content em { color: #D7A870; }
body.dark .result-content a { color: #E07B00; border-bottom-color: rgba(224, 123, 0, 0.38); }
body.dark .result-content a:hover { color: #FFB300; border-bottom-color: #E07B00; }

/* 暗黑 - pre/code */
body.dark .result-content pre {
    background: #231108;
    border-color: #4E342E;
}

body.dark .result-content code {
    background: #3E2210;
    color: #D7A870;
}

body.dark .result-content pre code {
    background: transparent;
    color: #FFD8A8;
}

body.dark .code-copy-btn {
    background: rgba(224, 123, 0, 0.12);
    border-color: #4E342E;
    color: #D7A870;
}

body.dark .code-copy-btn:hover {
    background: #5D4037;
    color: #fff;
    border-color: #5D4037;
}

body.dark .result-content .animal-section table th,
body.dark .result-content table th {
    background: linear-gradient(135deg, #1A0E06 0%, #2A1508 100%);
    color: #FFD8A8;
}

body.dark .result-content .animal-section table td,
body.dark .result-content table td {
    color: #D4B896;
    border-bottom-color: #2A1508;
}

body.dark .result-content .animal-section table tr:nth-child(even) td,
body.dark .result-content table tr:nth-child(even) td {
    background: #2A1508;
}

body.dark .result-content .animal-section table tr:hover td,
body.dark .result-content table tr:hover td {
    background: #3E2210;
}

/* 暗黑 - 错误提示 */
body.dark .ae-result-error .error-msg { color: #D7A870; }
body.dark .ae-result-error .error-tip { color: #6A4A3A; }

/* 暗黑 - 模态框 */
body.dark .ae-modal {
    background: #231108;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

body.dark .ae-modal-header {
    background: linear-gradient(135deg, #1A0E06 0%, #3E2723 100%);
}

body.dark .ae-modal-header h3 { color: #FFD8A8; }

body.dark .ae-example-card {
    background: #1A0E06;
    border-color: #4E342E;
}

body.dark .ae-example-card:hover {
    border-color: #E07B00;
    background: #2A1508;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

body.dark .ae-example-name { color: #D7A870; }

body.dark .ae-example-type-badge {
    background: #3E2210;
    color: #D7A870;
}

body.dark .ae-example-desc { color: #A0622A; }

body.dark .ae-modal-body::-webkit-scrollbar { width: 4px; }
body.dark .ae-modal-body::-webkit-scrollbar-track { background: #140A03; }
body.dark .ae-modal-body::-webkit-scrollbar-track:hover { background: #231108; }
body.dark .ae-modal-body::-webkit-scrollbar-thumb { background: #4E342E; border-radius: 2px; }
body.dark .ae-modal-body::-webkit-scrollbar-thumb:hover { background: #795548; }

/* 暗黑 - select option 兼容 */
body.dark .ae-container select option {
    background: #231108;
    color: #D7A870;
}

/* ========== Toast 提示 ========== */
.ae-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(62, 39, 35, 0.93);
    color: #FFF3E0;
    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);
}

.ae-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ae-toast.warn {
    background: rgba(180, 90, 20, 0.93);
    color: #fde8c8;
}

.ae-toast.info {
    background: rgba(62, 39, 35, 0.93);
    color: #FFF3E0;
}

body.dark .ae-toast {
    background: rgba(26, 14, 6, 0.96);
    color: #D7A870;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

body.dark .ae-toast.warn {
    background: rgba(120, 60, 10, 0.93);
    color: #fde8c8;
}

/* 移动端复制按钮强制可见 */
@media (max-width: 768px) {
    .code-copy-btn { opacity: 1; }
    /* 移动端无 hover，历史删除按钮需部分可见方便触控 */
    .ae-history-item-del { opacity: 0.55; }
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ae-history-panel { width: 160px; }
    .ae-input-panel { width: 220px; }
}

@media (max-width: 680px) {
    .ae-main-content { flex-direction: column; }
    .ae-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #FFCCBC;
    }
    .ae-history-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; display: flex; padding: 5px; }
    .ae-history-item { flex-shrink: 0; width: 120px; }
    .ae-input-panel { width: 100%; border-right: none; max-height: 240px; }
    .ae-example-grid { grid-template-columns: 1fr; }
}
