/* ========================================
   宠物专家 pet_expert.css
   主题色：温暖橙 #FF7043 / 琥珀 #FFA726
   前缀：pe-
   ======================================== */

/* ========== 主容器 ========== */
.pe-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #FFF8F5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 112, 67, 0.12);
    transition: all 0.3s ease;
    border: 1px solid #FFE0D0;
}

/* 全屏模式 */
.pe-container.pe-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    border: none;
}

/* ========== 顶部工具栏 ========== */
.pe-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #FF7043 0%, #FF8A65 50%, #FFA726 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.35);
    flex-wrap: wrap;
    gap: 8px;
}

.pe-toolbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pe-brand-icon {
    font-size: 20px;
    animation: pe-paw-bounce 2s ease-in-out infinite;
}

@keyframes pe-paw-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-5deg); }
    75% { transform: translateY(-3px) rotate(5deg); }
}

.pe-history-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #FF7043;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.pe-toolbar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pe-toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #FF7043;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pe-toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.pe-toolbar-btn:active {
    transform: translateY(0);
}

.pe-toolbar-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ========== 主内容区域 ========== */
.pe-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左侧历史面板 ========== */
.pe-history-panel {
    width: 210px;
    min-width: 180px;
    background: #fff;
    border-right: 1px solid #FFE0D0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.pe-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #FFF3EF, #FFECE5);
    border-bottom: 1px solid #FFD9CC;
    flex-shrink: 0;
}

.pe-history-title {
    font-size: 12px;
    font-weight: 700;
    color: #BF360C;
    letter-spacing: 0.3px;
}

.pe-history-clear-btn {
    background: #FFF0EC;
    border: none;
    color: #EF5350;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.pe-history-clear-btn:hover {
    background: #FFCDD2;
    color: #C62828;
}

.pe-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
    scrollbar-width: thin;
    scrollbar-color: #FFCCBC transparent;
}

.pe-history-list::-webkit-scrollbar {
    width: 4px;
}

.pe-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.pe-history-list::-webkit-scrollbar-thumb {
    background: #FFCCBC;
    border-radius: 4px;
}

.pe-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    color: #FFAB91;
    gap: 6px;
    font-size: 12px;
}

.pe-history-empty span {
    font-size: 28px;
    opacity: 0.5;
}

.pe-history-empty p {
    margin: 0;
    text-align: center;
    color: #BDBDBD;
}

.pe-history-item {
    padding: 10px 10px;
    margin-bottom: 5px;
    background: #FFFAF8;
    border: 1px solid #FFE0D0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: pe-fade-in 0.25s ease;
}

@keyframes pe-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.pe-history-item:hover {
    background: #FFF3EF;
    border-color: #FFAB91;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.12);
}

.pe-history-item-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.pe-history-pet-icon {
    font-size: 14px;
}

.pe-history-consult-icon {
    font-size: 12px;
}

.pe-history-time {
    font-size: 10px;
    color: #BDBDBD;
    margin-left: auto;
    flex-shrink: 0;
}

.pe-history-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #BDBDBD;
    font-size: 11px;
    padding: 1px 3px;
    border-radius: 3px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.pe-history-delete:hover {
    background: #FFCDD2;
    color: #EF5350;
}

.pe-history-pet-info {
    font-size: 11px;
    color: #FF8A65;
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pe-history-question {
    font-size: 11px;
    color: #757575;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pe-history-word-count {
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: #FFAB91;
    border-radius: 8px;
    padding: 1px 5px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.pe-history-advice-preview {
    font-size: 10px;
    color: #A1887F;
    line-height: 1.4;
    margin-top: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-style: italic;
    opacity: 0.8;
}

/* ========== 中间表单区域 ========== */
.pe-form-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px 18px;
    background: #FFF8F5;
    border-right: 1px solid #FFE0D0;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: #FFCCBC transparent;
}

.pe-form-panel::-webkit-scrollbar {
    width: 5px;
}

.pe-form-panel::-webkit-scrollbar-thumb {
    background: #FFCCBC;
    border-radius: 3px;
}

/* 表单区块 */
.pe-section {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #FFE0D0;
    box-shadow: 0 1px 4px rgba(255, 112, 67, 0.06);
}

.pe-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #BF360C;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.pe-optional-label {
    font-size: 11px;
    font-weight: 400;
    color: #BDBDBD;
    margin-left: 4px;
}

.pe-required-label {
    font-size: 11px;
    font-weight: 600;
    color: #EF5350;
    margin-left: 4px;
}

/* ========== 宠物类型选择卡片 ========== */
.pe-pet-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.pe-pet-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border: 2px solid #FFE0D0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #FFFAF8;
    gap: 4px;
    user-select: none;
}

.pe-pet-type:hover {
    border-color: #FF8A65;
    background: #FFF3EF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 112, 67, 0.18);
}

.pe-pet-type.active {
    border-color: #FF7043;
    background: linear-gradient(135deg, #FFF3EF 0%, #FFEBE3 100%);
    box-shadow: 0 3px 10px rgba(255, 112, 67, 0.25);
    transform: translateY(-1px);
}

.pe-pet-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.2s;
}

.pe-pet-type.active .pe-pet-icon {
    transform: scale(1.15);
}

.pe-pet-label {
    font-size: 11px;
    font-weight: 600;
    color: #795548;
    white-space: nowrap;
}

.pe-pet-type.active .pe-pet-label {
    color: #E64A19;
    font-weight: 700;
}

/* ========== 咨询类型按钮 ========== */
.pe-consult-types {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.pe-consult-type {
    padding: 7px 14px;
    border: 2px solid #FFE0D0;
    border-radius: 20px;
    background: #FFFAF8;
    color: #795548;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pe-consult-type:hover {
    border-color: #FF8A65;
    background: #FFF3EF;
    color: #E64A19;
}

.pe-consult-type.active {
    background: linear-gradient(135deg, #FF7043, #FFA726);
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 10px rgba(255, 112, 67, 0.35);
}

.pe-emergency-type {
    border-color: #FFCDD2;
}

.pe-emergency-type:hover {
    border-color: #EF5350;
    background: #FFF8F8;
    color: #C62828;
}

.pe-emergency-type.active {
    background: linear-gradient(135deg, #EF5350, #FF1744);
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 10px rgba(239, 83, 80, 0.35);
    animation: pe-emergency-pulse 1.5s ease-in-out infinite;
}

@keyframes pe-emergency-pulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(239, 83, 80, 0.35); }
    50% { box-shadow: 0 3px 18px rgba(239, 83, 80, 0.55); }
}

/* ========== 宠物信息输入行 ========== */
.pe-pet-info-row {
    display: flex;
    gap: 10px;
}

.pe-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pe-info-item label {
    font-size: 11px;
    font-weight: 600;
    color: #8D6E63;
}

.pe-info-item input {
    padding: 8px 10px;
    border: 1.5px solid #FFD9CC;
    border-radius: 7px;
    font-size: 13px;
    color: #4E342E;
    background: #FFFAF8;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.pe-info-item input:focus {
    border-color: #FF7043;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.12);
}

.pe-info-item input::placeholder {
    color: #D7CCC8;
    font-size: 12px;
}

/* ========== 问题描述区域 ========== */
.pe-question-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 160px;
}

.pe-question-textarea {
    width: 100%;
    min-height: 130px;
    padding: 12px 14px;
    border: 1.5px solid #FFD9CC;
    border-radius: 8px;
    font-size: 13px;
    color: #4E342E;
    background: #FFFAF8;
    outline: none;
    resize: vertical;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.6;
    box-sizing: border-box;
}

.pe-question-textarea:focus {
    border-color: #FF7043;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.12);
}

.pe-question-textarea::placeholder {
    color: #BCAAA4;
    font-size: 12px;
    line-height: 1.7;
}

.pe-question-textarea.pe-shake {
    animation: pe-shake 0.5s ease;
}

@keyframes pe-shake {
    0%, 100% { transform: translateX(0); border-color: #FF7043; }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.pe-char-counter {
    font-size: 11px;
    color: #BDBDBD;
    text-align: right;
    margin-top: 5px;
}

/* ========== 操作按钮区 ========== */
.pe-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.pe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.pe-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pe-btn-icon {
    font-size: 15px;
}

.pe-btn-primary {
    background: linear-gradient(135deg, #FF7043, #FFA726);
    color: white;
    box-shadow: 0 3px 12px rgba(255, 112, 67, 0.35);
}

.pe-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 112, 67, 0.45);
}

.pe-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.3);
}

.pe-btn-cancel {
    background: linear-gradient(135deg, #EF5350, #FF5722);
    color: white;
    box-shadow: 0 3px 12px rgba(239, 83, 80, 0.3);
}

.pe-btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 83, 80, 0.4);
}

.pe-btn-clear {
    background: #F5F5F5;
    color: #757575;
    border: 1px solid #E0E0E0;
}

.pe-btn-clear:hover {
    background: #EEEEEE;
    color: #424242;
    transform: translateY(-1px);
}

/* ========== 右侧结果面板 ========== */
.pe-result-panel {
    flex: 1.2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.pe-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #FFF8F5 0%, #FFF3EF 100%);
    border-bottom: 1px solid #FFE0D0;
    flex-shrink: 0;
}

.pe-result-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #BF360C;
}

.pe-result-icon {
    font-size: 16px;
    animation: pe-paw-bounce 2s ease-in-out infinite;
}

.pe-copy-result-btn {
    background: #FFF3EF;
    border: 1px solid #FFCCBC;
    color: #E64A19;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pe-copy-result-btn:hover:not(:disabled) {
    background: #FFE0D0;
    border-color: #FF8A65;
    transform: translateY(-1px);
}

.pe-copy-result-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pe-result-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: #FFCCBC transparent;
}

.pe-result-content::-webkit-scrollbar {
    width: 5px;
}

.pe-result-content::-webkit-scrollbar-thumb {
    background: #FFCCBC;
    border-radius: 3px;
}

/* ========== 结果占位符 ========== */
.pe-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    gap: 12px;
}

.pe-placeholder-emoji {
    font-size: 52px;
    opacity: 0.3;
    animation: pe-paw-bounce 2.5s ease-in-out infinite;
}

.pe-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: #BCAAA4;
    margin: 0;
}

.pe-placeholder-sub {
    font-size: 13px;
    color: #D7CCC8;
    margin: 0;
    line-height: 1.7;
}

.pe-placeholder-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.pe-placeholder-tag {
    padding: 5px 12px;
    background: #FFF3EF;
    border: 1px solid #FFD9CC;
    border-radius: 20px;
    font-size: 11px;
    color: #FF8A65;
    font-weight: 600;
}

/* ========== AI加载动画 ========== */
.pe-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    gap: 18px;
}

.pe-loading-paws {
    display: flex;
    gap: 8px;
}

.pe-loading-paws span {
    font-size: 24px;
    animation: pe-loading-wave 1.2s ease-in-out infinite;
}

.pe-loading-paws span:nth-child(1) { animation-delay: 0s; }
.pe-loading-paws span:nth-child(2) { animation-delay: 0.2s; }
.pe-loading-paws span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pe-loading-wave {
    0%, 60%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
    30% { transform: translateY(-12px) scale(1.15); opacity: 1; }
}

.pe-loading p {
    font-size: 13px;
    color: #FF8A65;
    margin: 0;
    font-weight: 500;
    animation: pe-loading-text 1.5s ease-in-out infinite;
}

@keyframes pe-loading-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========== 错误提示 ========== */
.pe-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    gap: 16px;
    text-align: center;
}

.pe-error-icon {
    font-size: 40px;
    opacity: 0.7;
}

.pe-error p {
    font-size: 13px;
    color: #757575;
    margin: 0;
    max-width: 260px;
    line-height: 1.6;
}

.pe-error-retry-btn {
    margin-top: 4px;
}

/* ========== AI结果内容样式（Markdown标签全覆盖） ========== */
.pe-result-body {
    font-size: 14px;
    line-height: 1.8;
    color: #3E2723;
    animation: pe-fade-in 0.4s ease;
}

.pe-result-body h2 {
    font-size: 16px;
    font-weight: 700;
    color: #E64A19;
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #FFE0D0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pe-result-body h2:first-child {
    margin-top: 0;
}

.pe-result-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: #FF7043;
    margin: 12px 0 6px;
    padding-left: 8px;
    border-left: 3px solid #FFAB91;
}

.pe-result-body h4 {
    font-size: 13px;
    font-weight: 700;
    color: #8D6E63;
    margin: 10px 0 5px;
}

.pe-result-body h5 {
    font-size: 12px;
    font-weight: 700;
    color: #A1887F;
    margin: 8px 0 4px;
    font-style: italic;
}

.pe-result-body p {
    margin: 6px 0;
    color: #4E342E;
}

.pe-result-body ul, .pe-result-body ol {
    margin: 6px 0 8px;
    padding-left: 22px;
}

.pe-result-body li {
    margin: 4px 0;
    color: #4E342E;
    line-height: 1.7;
}

.pe-result-body li::marker {
    color: #FF7043;
}

.pe-result-body strong {
    color: #BF360C;
    font-weight: 700;
}

.pe-result-body em {
    color: #795548;
    font-style: italic;
}

.pe-result-body a {
    color: #E64A19;
    text-decoration: underline;
}

.pe-result-body a:hover {
    color: #BF360C;
}

.pe-result-body blockquote {
    border-left: 4px solid #FFAB91;
    padding: 8px 14px;
    margin: 8px 0;
    background: #FFF8F5;
    border-radius: 0 6px 6px 0;
    color: #795548;
}

.pe-result-body code {
    background: #FFF3EF;
    color: #BF360C;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

/* ========== 模态框（示例导入） ========== */
.pe-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.92);
    z-index: 10001;
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    width: 680px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    border: 1px solid #FFE0D0;
}

.pe-modal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.pe-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pe-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 模态框内容容器：支持flex列布局与内滚动约束 */
.pe-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.pe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #FFE0D0;
    flex-shrink: 0;
}

.pe-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #BF360C;
}

.pe-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #BDBDBD;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.pe-modal-close:hover {
    background: #FFCDD2;
    color: #EF5350;
}

.pe-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
    flex: 1;
}

.pe-modal-tip {
    font-size: 12px;
    color: #BDBDBD;
    margin: 0 0 12px;
}

.pe-examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pe-example-card {
    padding: 14px;
    border: 1.5px solid #FFE0D0;
    border-radius: 10px;
    cursor: pointer;
    background: #FFFAF8;
    transition: all 0.2s ease;
}

.pe-example-card:hover {
    border-color: #FF7043;
    background: #FFF3EF;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 112, 67, 0.18);
}

.pe-example-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.pe-example-tag {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #FFE0D0;
    color: #E64A19;
}

.pe-tag-consult {
    background: #E3F2FD;
    color: #1976D2;
}

.pe-example-pet-info {
    font-size: 11px;
    color: #FF8A65;
    font-weight: 600;
    margin-bottom: 5px;
}

.pe-example-question {
    font-size: 12px;
    color: #4E342E;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pe-example-import-btn {
    font-size: 11px;
    color: #FF7043;
    font-weight: 600;
    text-align: right;
    opacity: 0.7;
}

.pe-example-card:hover .pe-example-import-btn {
    opacity: 1;
}

/* ========== Toast 提示 ========== */
.pe-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.pe-toast.pe-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pe-toast-success { background: linear-gradient(135deg, #4CAF50, #66BB6A); }
.pe-toast-error   { background: linear-gradient(135deg, #EF5350, #FF5722); }
.pe-toast-info    { background: linear-gradient(135deg, #42A5F5, #29B6F6); }
.pe-toast-warn    { background: linear-gradient(135deg, #FFA726, #FF9800); }

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .pe-history-panel {
        display: none;
    }

    .pe-main {
        flex-direction: column;
    }

    .pe-result-panel {
        min-height: 360px;
    }
}

@media (max-width: 639px) {
    .pe-pet-types {
        grid-template-columns: repeat(4, 1fr);
    }

    .pe-consult-types {
        gap: 5px;
    }

    .pe-consult-type {
        padding: 6px 10px;
        font-size: 11px;
    }

    .pe-pet-info-row {
        flex-wrap: wrap;
    }

    .pe-info-item {
        min-width: calc(50% - 5px);
    }

    .pe-examples-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   暗黑模式 — body.dark 父级选择器前缀
   ======================================== */

body.dark .pe-container {
    background: #1E1815;
    border-color: #3E2723;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark .pe-toolbar {
    background: linear-gradient(135deg, #BF360C 0%, #D84315 50%, #E65100 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 历史面板 - dark */
body.dark .pe-history-panel {
    background: #1A1210;
    border-right-color: #3E2723;
}

body.dark .pe-history-header {
    background: linear-gradient(to bottom, #2C1A14, #261510);
    border-bottom-color: #3E2723;
}

body.dark .pe-history-title {
    color: #FFAB91;
}

body.dark .pe-history-clear-btn {
    background: #3E2723;
    color: #EF9A9A;
}

body.dark .pe-history-clear-btn:hover {
    background: #4E342E;
    color: #EF5350;
}

body.dark .pe-history-list {
    scrollbar-color: #4E342E transparent;
}

body.dark .pe-history-empty span {
    opacity: 0.3;
}

body.dark .pe-history-empty p {
    color: #5D4037;
}

body.dark .pe-history-item {
    background: #241A17;
    border-color: #3E2723;
}

body.dark .pe-history-item:hover {
    background: #2E1F1A;
    border-color: #FF7043;
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.2);
}

body.dark .pe-history-pet-info {
    color: #FF8A65;
}

body.dark .pe-history-question {
    color: #8D6E63;
}

body.dark .pe-history-word-count {
    background: #5D4037;
    color: #FFAB91;
}

body.dark .pe-history-advice-preview {
    color: #5D4037;
}

body.dark .pe-history-time {
    color: #5D4037;
}

body.dark .pe-history-delete:hover {
    background: #4E342E;
    color: #EF5350;
}

body.dark .pe-history-delete {
    color: #5D4037;
}

/* 模态框遗罩层 - dark */
body.dark .pe-modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

/* 错误重试按鈕 - dark */
body.dark .pe-error-retry-btn {
    background: linear-gradient(135deg, #BF360C, #E65100);
}

/* 表单面板 - dark */
body.dark .pe-form-panel {
    background: #1E1815;
    border-right-color: #3E2723;
    scrollbar-color: #4E342E transparent;
}

body.dark .pe-section {
    background: #24190F;
    border-color: #3E2723;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

body.dark .pe-section-label {
    color: #FFAB91;
}

body.dark .pe-optional-label {
    color: #5D4037;
}

body.dark .pe-required-label {
    color: #EF9A9A;
}

/* 宠物类型选择 - dark */
body.dark .pe-pet-type {
    border-color: #3E2723;
    background: #1A1210;
}

body.dark .pe-pet-type:hover {
    border-color: #FF7043;
    background: #2E1F1A;
}

body.dark .pe-pet-type.active {
    border-color: #FF7043;
    background: linear-gradient(135deg, #2E1F1A, #3E2A1E);
    box-shadow: 0 3px 10px rgba(255, 112, 67, 0.3);
}

body.dark .pe-pet-label {
    color: #A1887F;
}

body.dark .pe-pet-type.active .pe-pet-label {
    color: #FF8A65;
}

/* 咨询类型按钮 - dark */
body.dark .pe-consult-type {
    border-color: #3E2723;
    background: #1A1210;
    color: #A1887F;
}

body.dark .pe-consult-type:hover {
    border-color: #FF7043;
    background: #2E1F1A;
    color: #FF8A65;
}

body.dark .pe-consult-type.active {
    background: linear-gradient(135deg, #BF360C, #E65100);
    color: white;
    border-color: transparent;
}

body.dark .pe-emergency-type {
    border-color: #4E342E;
}

body.dark .pe-emergency-type:hover {
    border-color: #EF5350;
    background: #2C1810;
    color: #EF9A9A;
}

/* 输入框 - dark */
body.dark .pe-info-item input {
    background: #1A1210;
    border-color: #3E2723;
    color: #EFEBE9;
}

body.dark .pe-info-item input:focus {
    border-color: #FF7043;
    background: #241913;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.2);
}

body.dark .pe-info-item input::placeholder {
    color: #5D4037;
}

body.dark .pe-info-item label {
    color: #A1887F;
}

body.dark .pe-question-textarea {
    background: #1A1210;
    border-color: #3E2723;
    color: #EFEBE9;
}

body.dark .pe-question-textarea:focus {
    border-color: #FF7043;
    background: #241913;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.2);
}

body.dark .pe-question-textarea::placeholder {
    color: #5D4037;
}

body.dark .pe-char-counter {
    color: #5D4037;
}

/* 按钮 - dark */
body.dark .pe-btn-clear {
    background: #2C1F1A;
    color: #A1887F;
    border-color: #3E2723;
}

body.dark .pe-btn-clear:hover {
    background: #3E2A1E;
    color: #EFEBE9;
}

/* 结果面板 - dark */
body.dark .pe-result-panel {
    background: #1A1210;
}

body.dark .pe-result-header {
    background: linear-gradient(to bottom, #24190F, #1E1510);
    border-bottom-color: #3E2723;
}

body.dark .pe-result-title {
    color: #FFAB91;
}

body.dark .pe-copy-result-btn {
    background: #2E1F1A;
    border-color: #4E342E;
    color: #FF8A65;
}

body.dark .pe-copy-result-btn:hover:not(:disabled) {
    background: #3E2A1E;
    border-color: #FF7043;
}

body.dark .pe-result-content {
    scrollbar-color: #4E342E transparent;
}

body.dark .pe-placeholder-title {
    color: #5D4037;
}

body.dark .pe-placeholder-sub {
    color: #4E342E;
}

body.dark .pe-placeholder-tag {
    background: #2E1F1A;
    border-color: #3E2723;
    color: #FF8A65;
}

/* AI结果内容 - dark */
body.dark .pe-result-body {
    color: #EFEBE9;
}

body.dark .pe-result-body h2 {
    color: #FF8A65;
    border-bottom-color: #3E2723;
}

body.dark .pe-result-body h3 {
    color: #FFAB91;
    border-left-color: #5D4037;
}

body.dark .pe-result-body h4 {
    color: #A1887F;
}

body.dark .pe-result-body h5 {
    color: #8D6E63;
}

body.dark .pe-result-body p {
    color: #D7CCC8;
}

body.dark .pe-result-body li {
    color: #D7CCC8;
}

body.dark .pe-result-body li::marker {
    color: #FF7043;
}

body.dark .pe-result-body strong {
    color: #FFAB91;
}

body.dark .pe-result-body em {
    color: #A1887F;
}

body.dark .pe-result-body a {
    color: #FF8A65;
}

body.dark .pe-result-body blockquote {
    border-left-color: #5D4037;
    background: #241913;
    color: #A1887F;
}

body.dark .pe-result-body code {
    background: #2E1F1A;
    color: #FF8A65;
}

body.dark .pe-result-body ul, body.dark .pe-result-body ol {
    color: #D7CCC8;
}

body.dark .pe-form-panel::-webkit-scrollbar-thumb {
    background: #4E342E;
    border-radius: 3px;
}

body.dark .pe-result-content::-webkit-scrollbar-thumb {
    background: #4E342E;
    border-radius: 3px;
}

body.dark .pe-history-list::-webkit-scrollbar-thumb {
    background: #4E342E;
    border-radius: 4px;
}

/* 错误块 - dark */
body.dark .pe-error {
    background: transparent;
}

body.dark .pe-error-icon {
    opacity: 0.6;
}

/* 模态框 body - dark */
body.dark .pe-modal-body {
    background: #24190F;
    scrollbar-color: #4E342E transparent;
}

body.dark .pe-modal-body::-webkit-scrollbar-thumb {
    background: #4E342E;
    border-radius: 4px;
}

/* 模态框头部 - dark */
body.dark .pe-modal-header {
    background: #2C1A14;
    border-bottom-color: #3E2723;
}

body.dark .pe-modal-close {
    color: #5D4037;
}

/* 加载块 - dark */
body.dark .pe-loading {
    background: transparent;
}

body.dark .pe-loading p {
    color: #FFAB91;
}

/* 错误状态 - dark */
body.dark .pe-error p {
    color: #A1887F;
}

/* 模态框 - dark */
body.dark .pe-modal {
    background: #24190F;
    border-color: #3E2723;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .pe-modal-header h3 {
    color: #FFAB91;
}

body.dark .pe-modal-close:hover {
    background: #4E342E;
    color: #EF9A9A;
}

body.dark .pe-modal-tip {
    color: #5D4037;
}

body.dark .pe-example-card {
    background: #1A1210;
    border-color: #3E2723;
}

body.dark .pe-example-card:hover {
    border-color: #FF7043;
    background: #2E1F1A;
    box-shadow: 0 6px 16px rgba(255, 112, 67, 0.2);
}

body.dark .pe-example-tag {
    background: #3E2723;
    color: #FF8A65;
}

body.dark .pe-tag-consult {
    background: #1A237E;
    color: #90CAF9;
}

body.dark .pe-example-pet-info {
    color: #FF8A65;
}

body.dark .pe-example-question {
    color: #A1887F;
}

body.dark .pe-example-import-btn {
    color: #FF8A65;
}
