/**
 * 中国景点查询 - china_attractions_query.css
 * 以山水画意境为视觉主题，红色+墨绿色+金黄色为主色调
 */

/* =============================================
   CSS 变量（亮色模式）
   ============================================= */
:root {
    --caq-primary:        #c0392b;   /* 中国红 */
    --caq-primary-dark:   #96281b;
    --caq-primary-light:  #e74c3c;
    --caq-accent:         #d4ac0d;   /* 金黄 */
    --caq-accent2:        #27ae60;   /* 墨绿 */
    --caq-bg:             #faf8f5;   /* 宣纸色 */
    --caq-bg-panel:       #ffffff;
    --caq-bg-toolbar:     #2c1810;   /* 深朱砂 */
    --caq-toolbar-text:   #f5e6d0;
    --caq-border:         #e8d5c4;
    --caq-text:           #2d1b0e;
    --caq-text-muted:     #8b6a52;
    --caq-text-light:     #b5967c;
    --caq-history-bg:     #fdf6ee;
    --caq-history-hover:  #fdf0e0;
    --caq-history-active: #fce4c8;
    --caq-shadow:         0 2px 12px rgba(192, 57, 43, 0.10);
    --caq-shadow-card:    0 4px 20px rgba(192, 57, 43, 0.12);
    --caq-radius:         10px;
    --caq-history-width:  220px;
    --caq-input-width:    300px;
}

/* =============================================
   CSS 变量（暗黑模式覆盖）
   ============================================= */
body.dark {
    --caq-primary:        #e74c3c;
    --caq-primary-dark:   #c0392b;
    --caq-primary-light:  #ff6b6b;
    --caq-accent:         #f0c040;
    --caq-accent2:        #2ecc71;
    --caq-bg:             #1a1210;
    --caq-bg-panel:       #231a17;
    --caq-bg-toolbar:     #0e0908;
    --caq-toolbar-text:   #e8c9a0;
    --caq-border:         #3d2a20;
    --caq-text:           #eaddd0;
    --caq-text-muted:     #9e7a62;
    --caq-text-light:     #7a5c45;
    --caq-history-bg:     #1e1410;
    --caq-history-hover:  #2a1d16;
    --caq-history-active: #3a2418;
    --caq-shadow:         0 2px 12px rgba(0, 0, 0, 0.4);
    --caq-shadow-card:    0 4px 20px rgba(0, 0, 0, 0.5);
}

/* =============================================
   容器基础
   ============================================= */
.caq-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 560px;
    background: var(--caq-bg);
    border-radius: var(--caq-radius);
    overflow: hidden;
    box-shadow: var(--caq-shadow-card);
    border: 1px solid var(--caq-border);
    transition: background 0.3s, border-color 0.3s;
    position: relative;
}

.caq-container.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100vh;
    width: 100vw;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

/* =============================================
   顶部工具栏
   ============================================= */
.caq-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 48px;
    background: var(--caq-bg-toolbar);
    flex-shrink: 0;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--caq-primary);
    position: relative;
    overflow: hidden;
}

/* 工具栏装饰纹样 */
.caq-toolbar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.02) 8px,
        rgba(255,255,255,0.02) 16px
    );
    pointer-events: none;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-group:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--caq-accent);
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--caq-toolbar-text);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.dark .toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: var(--caq-primary) !important;
    border-color: var(--caq-primary-dark) !important;
    color: #fff !important;
    font-weight: 600;
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: var(--caq-primary-light) !important;
}

/* =============================================
   三栏主内容
   ============================================= */
.caq-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* =============================================
   左栏：历史记录
   ============================================= */
.caq-history-panel {
    width: var(--caq-history-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--caq-history-bg);
    border-right: 1px solid var(--caq-border);
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--caq-border);
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(250,245,238,0.9) 0%, var(--caq-history-bg) 100%);
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, rgba(30,20,14,0.9) 0%, var(--caq-history-bg) 100%);
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--caq-text-muted);
    background: none;
    border: none;
    padding: 0;
}

.history-count {
    font-size: 11px;
    color: var(--caq-text-light);
}

.history-clear-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--caq-text-light);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fff0f0;
    border-color: #fca5a5;
    color: #dc2626;
}

body.dark .history-clear-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: #7f1d1d;
    color: #f87171;
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--caq-border);
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 8px;
    font-size: 11px;
    border: 1px solid var(--caq-border);
    border-radius: 5px;
    background: var(--caq-bg-panel);
    color: var(--caq-text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.history-search input:focus {
    border-color: var(--caq-primary);
}

body.dark .history-search input {
    background: var(--caq-bg);
    color: var(--caq-text);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--caq-border); border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: var(--caq-text-light); }

.history-empty {
    text-align: center;
    padding: 24px 12px;
    font-size: 11px;
    color: var(--caq-text-light);
    line-height: 1.8;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    gap: 6px;
}

.history-item:hover {
    background: var(--caq-history-hover);
}

.history-item.active {
    background: var(--caq-history-active);
    box-shadow: inset 3px 0 0 #3b82f6;
}

.history-item-main {
    flex: 1;
    min-width: 0;
}

.history-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--caq-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.history-item-type {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(192, 57, 43, 0.12);
    color: var(--caq-primary);
}

body.dark .history-item-type {
    background: rgba(231, 76, 60, 0.2);
    color: var(--caq-primary-light);
}

.history-item-meta span:last-child {
    font-size: 10px;
    color: var(--caq-text-light);
}

.history-item-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--caq-text-light);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #fee2e2;
    color: #dc2626;
}

body.dark .history-item-del:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

/* =============================================
   中栏：查询输入
   ============================================= */
.caq-input-panel {
    width: var(--caq-input-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--caq-bg-panel);
    border-right: 1px solid var(--caq-border);
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.panel-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--caq-border);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-text);
    background: none;
    border: none;
    padding: 0;
}

.panel-tip {
    font-size: 11px;
    color: var(--caq-text-muted);
}

.caq-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
}

.caq-input-body::-webkit-scrollbar { width: 4px; }
.caq-input-body::-webkit-scrollbar-thumb { background: var(--caq-border); border-radius: 2px; }
.caq-input-body::-webkit-scrollbar-thumb:hover { background: var(--caq-text-light); }

/* 搜索框 */
.caq-search-box {
    display: flex;
    align-items: center;
    border: 2px solid var(--caq-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    background: var(--caq-bg);
}

.caq-search-box:focus-within {
    border-color: var(--caq-primary);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.caq-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 13px;
    background: transparent;
    color: var(--caq-text);
}

.caq-search-input::placeholder {
    color: var(--caq-text-light);
    font-size: 12px;
}

.caq-search-btn {
    padding: 10px 14px;
    background: var(--caq-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
    flex-shrink: 0;
}

.caq-search-btn:hover:not(:disabled) {
    background: var(--caq-primary-light);
}

.caq-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.caq-search-input.shake {
    animation: caqShake 0.4s ease;
    border-color: var(--caq-primary-light) !important;
}

@keyframes caqShake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 字数统计 */
.caq-char-counter {
    text-align: right;
    font-size: 10px;
    color: var(--caq-text-light);
    margin: 4px 2px 10px;
}

.caq-char-counter.warning { color: #e67e22; }
.caq-char-counter.limit   { color: var(--caq-primary); font-weight: 600; }

/* 查询模式 */
.caq-mode-group {
    margin-bottom: 14px;
}

.caq-mode-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--caq-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.caq-mode-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.caq-mode-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid var(--caq-border);
    cursor: pointer;
    font-size: 12px;
    color: var(--caq-text-muted);
    transition: all 0.2s;
    background: var(--caq-bg);
}

.caq-mode-option:hover {
    border-color: var(--caq-primary);
    color: var(--caq-primary);
    background: rgba(192, 57, 43, 0.04);
}

.caq-mode-option.selected {
    border-color: var(--caq-primary);
    background: rgba(192, 57, 43, 0.08);
    color: var(--caq-primary);
    font-weight: 600;
}

.caq-mode-option.selected::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    color: var(--caq-primary);
    font-weight: 700;
    flex-shrink: 0;
}

body.dark .caq-mode-option.selected {
    background: rgba(231, 76, 60, 0.15);
}

.caq-mode-icon {
    font-size: 14px;
}

/* 快捷标签 */
.caq-quick-label, .caq-region-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--caq-text-muted);
    margin: 14px 0 6px;
}

.caq-quick-tags, .caq-region-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

.caq-quick-tag {
    padding: 4px 9px;
    font-size: 11px;
    border-radius: 20px;
    background: rgba(192, 57, 43, 0.08);
    color: var(--caq-primary);
    border: 1px solid rgba(192, 57, 43, 0.2);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.caq-quick-tag:hover {
    background: var(--caq-primary);
    color: #fff;
    border-color: var(--caq-primary);
}

/* 快捷标签 selected 状态 - 按压反馈 */
.caq-quick-tag.selected {
    background: var(--caq-primary);
    color: #fff;
    border-color: var(--caq-primary-dark);
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(192, 57, 43, 0.3) inset;
}

body.dark .caq-quick-tag {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.25);
    color: #ff8f82;
}

body.dark .caq-quick-tag:hover {
    background: var(--caq-primary);
    color: #fff;
}

body.dark .caq-quick-tag.selected {
    background: var(--caq-primary);
    color: #fff;
    border-color: var(--caq-primary-dark);
    transform: scale(0.97);
}

.caq-region-tag {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    background: rgba(39, 174, 96, 0.08);
    color: var(--caq-accent2);
    border: 1px solid rgba(39, 174, 96, 0.2);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.caq-region-tag:hover {
    background: var(--caq-accent2);
    color: #fff;
    border-color: var(--caq-accent2);
}

.caq-region-tag.active {
    background: var(--caq-accent2);
    color: #fff;
    border-color: var(--caq-accent2);
}

body.dark .caq-region-tag {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.2);
    color: #52d68a;
}

/* 使用提示框 */
.caq-tips-box {
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(212, 172, 13, 0.06) 0%, rgba(192, 57, 43, 0.04) 100%);
    border: 1px solid rgba(212, 172, 13, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
}

.caq-tips-box p {
    margin: 0 0 6px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--caq-accent);
}

.caq-tips-box ul {
    margin: 0;
    padding-left: 14px;
}

.caq-tips-box li {
    font-size: 11px;
    color: var(--caq-text-muted);
    line-height: 1.7;
}

body.dark .caq-tips-box {
    background: rgba(212, 172, 13, 0.06);
    border-color: rgba(212, 172, 13, 0.15);
}

/* =============================================
   右栏：查询结果
   ============================================= */
.caq-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--caq-bg-panel);
    overflow: hidden;
    transition: background 0.3s;
}

.caq-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--caq-border);
    flex-shrink: 0;
}

.caq-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-text);
    background: none;
    border: none;
    padding: 0;
}

.result-meta-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-meta-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-primary);
}

.result-mode-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(192, 57, 43, 0.1);
    color: var(--caq-primary);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

body.dark .result-mode-badge {
    background: rgba(231, 76, 60, 0.15);
    color: #ff8f82;
    border-color: rgba(231, 76, 60, 0.3);
}

.caq-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    /* 必须声明 flex 布局，确保 result-placeholder/result-loading 的 height:100% 正确生效 */
    display: flex;
    flex-direction: column;
}

.caq-result-body::-webkit-scrollbar { width: 6px; }
.caq-result-body::-webkit-scrollbar-thumb { background: var(--caq-border); border-radius: 3px; }
.caq-result-body::-webkit-scrollbar-thumb:hover { background: var(--caq-text-light); }

/* 占位提示 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 240px;
    text-align: center;
    padding: 24px;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.75;
    filter: drop-shadow(0 3px 6px rgba(192, 57, 43, 0.2));
    animation: caqFloat 3s ease-in-out infinite;
}

@keyframes caqFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--caq-text);
    margin: 0 0 10px;
}

.placeholder-desc {
    font-size: 12px;
    color: var(--caq-text-muted);
    margin: 3px 0;
}

/* 加载动画 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 240px;
}

/* 加载动画 - 三点脉冲 */
.loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--caq-primary);
    animation: caqPulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

.loading-dot:nth-child(2) { animation-delay: 0.22s; }
.loading-dot:nth-child(3) { animation-delay: 0.44s; }

@keyframes caqPulse {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
    40%           { transform: scale(1);    opacity: 1;    }
}

.loading-text {
    font-size: 13px;
    color: var(--caq-text-muted);
    margin: 0;
}

/* 结果内容区（AI生成HTML） */
.result-content {
    animation: caqFadeIn 0.35s ease;
}

/* 结果区 Markdown h2 样式（AI可能输出 h2） */
.result-content h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--caq-primary);
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(192, 57, 43, 0.2);
    line-height: 1.3;
}

body.dark .result-content h2 {
    border-bottom-color: rgba(231, 76, 60, 0.25);
}

/* 结果区 Markdown 常用标签基础样式 */
.result-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--caq-text);
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--caq-border);
}

.result-content h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-text);
    margin: 12px 0 6px;
}

.result-content h5 {
    font-size: 12px;
    font-weight: 700;
    color: var(--caq-text-muted);
    margin: 10px 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.result-content blockquote {
    border-left: 3px solid var(--caq-primary);
    margin: 8px 0;
    padding: 6px 12px;
    background: rgba(192, 57, 43, 0.04);
    border-radius: 0 5px 5px 0;
    color: var(--caq-text-muted);
    font-style: italic;
    font-size: 13px;
}

.result-content strong {
    font-weight: 700;
    color: var(--caq-text);
}

.result-content em {
    font-style: italic;
    color: var(--caq-text-muted);
}

.result-content code {
    font-family: monospace;
    font-size: 12px;
    background: rgba(192, 57, 43, 0.07);
    color: var(--caq-primary);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(192, 57, 43, 0.15);
}

.result-content pre {
    background: var(--caq-bg);
    border: 1px solid var(--caq-border);
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0;
}

.result-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--caq-text);
    font-size: 12px;
}

.result-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}

.result-content table th,
.result-content table td {
    padding: 6px 10px;
    border: 1px solid var(--caq-border);
    color: var(--caq-text);
    text-align: left;
}

.result-content table th {
    background: rgba(192, 57, 43, 0.07);
    font-weight: 600;
    color: var(--caq-primary);
}

/* 暗黑模式下的 Markdown 标签覆盖 */
body.dark .result-content h2 {
    border-bottom-color: rgba(231, 76, 60, 0.25);
}

body.dark .result-content h3 {
    color: var(--caq-text);
    border-bottom-color: var(--caq-border);
}

body.dark .result-content h4 {
    color: var(--caq-text);
}

body.dark .result-content h5 {
    color: var(--caq-text-muted);
}

body.dark .result-content blockquote {
    border-left-color: var(--caq-primary);
    background: rgba(231, 76, 60, 0.06);
    color: var(--caq-text-muted);
}

body.dark .result-content strong {
    color: var(--caq-text);
}

body.dark .result-content em {
    color: var(--caq-text-muted);
}

body.dark .result-content code {
    background: rgba(231, 76, 60, 0.12);
    color: #ff8f82;
    border-color: rgba(231, 76, 60, 0.2);
}

body.dark .result-content pre {
    background: rgba(255,255,255,0.04);
    border-color: var(--caq-border);
}

body.dark .result-content table th {
    background: rgba(231, 76, 60, 0.1);
    color: #ff8f82;
}

body.dark .result-content table td {
    border-color: var(--caq-border);
    color: var(--caq-text);
}

@keyframes caqFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 结果卡片内部样式（AI生成的HTML的样式） */
.result-content .caq-result-card {
    background: linear-gradient(135deg, var(--caq-bg) 0%, rgba(255,255,255,0.8) 100%);
    border: 1px solid var(--caq-border);
    border-radius: var(--caq-radius);
    padding: 18px 20px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

body.dark .result-content .caq-result-card {
    background: linear-gradient(135deg, var(--caq-bg) 0%, rgba(35, 26, 23, 0.8) 100%);
}

.result-content .caq-result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--caq-primary), var(--caq-accent));
    border-radius: 4px 0 0 4px;
}

.result-content .caq-attraction-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--caq-border);
}

.result-content .caq-attraction-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(192, 57, 43, 0.2));
}

.result-content .caq-attraction-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--caq-primary);
    margin: 0 0 4px;
    line-height: 1.2;
}

.result-content .caq-attraction-location {
    font-size: 12px;
    color: var(--caq-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-content .caq-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.result-content .caq-tag {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.result-content .caq-tag-type {
    background: rgba(192, 57, 43, 0.1);
    color: var(--caq-primary);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

.result-content .caq-tag-level {
    background: rgba(212, 172, 13, 0.12);
    color: var(--caq-accent);
    border: 1px solid rgba(212, 172, 13, 0.25);
}

.result-content .caq-tag-season {
    background: rgba(39, 174, 96, 0.1);
    color: var(--caq-accent2);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

body.dark .result-content .caq-tag-type {
    background: rgba(231, 76, 60, 0.15);
    color: #ff8f82;
    border-color: rgba(231, 76, 60, 0.3);
}

body.dark .result-content .caq-tag-level {
    background: rgba(240, 192, 64, 0.12);
    color: #f0c040;
    border-color: rgba(240, 192, 64, 0.25);
}

body.dark .result-content .caq-tag-season {
    background: rgba(46, 204, 113, 0.12);
    color: #52d68a;
    border-color: rgba(46, 204, 113, 0.25);
}

.result-content .caq-section {
    margin-bottom: 14px;
}

.result-content .caq-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-text);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--caq-border);
}

.result-content .caq-section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--caq-primary);
    border-radius: 2px;
}

.result-content p {
    font-size: 13px;
    color: var(--caq-text);
    line-height: 1.8;
    margin: 0 0 8px;
}

.result-content ul, .result-content ol {
    margin: 0 0 8px;
    padding-left: 18px;
}

.result-content li::marker {
    color: var(--caq-primary);
}

.result-content li {
    font-size: 13px;
    color: var(--caq-text);
    line-height: 1.8;
}

.result-content .caq-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.result-content .caq-info-item {
    background: var(--caq-bg);
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid var(--caq-border);
}

body.dark .result-content .caq-info-item {
    background: rgba(255,255,255,0.03);
}

.result-content .caq-info-label {
    font-size: 10px;
    color: var(--caq-text-light);
    margin-bottom: 3px;
}

.result-content .caq-info-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--caq-text);
}

.result-content .caq-highlight-box {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.06), rgba(212, 172, 13, 0.05));
    border-left: 3px solid var(--caq-primary);
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin: 10px 0;
}

body.dark .result-content .caq-highlight-box {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(240, 192, 64, 0.05));
}

.result-content .caq-highlight-box p {
    margin: 0;
    font-size: 13px;
    color: var(--caq-text);
    font-style: italic;
}

/* 错误提示（与 placeholder/loading 三态布局保持一致） */
#caqResultError {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 240px;
    padding: 32px 16px;
    text-align: center;
}

.error-icon { font-size: 36px; margin-bottom: 10px; }
.error-msg  { font-size: 14px; color: var(--caq-primary); font-weight: 600; margin: 0 0 6px; }
.error-tip  { font-size: 12px; color: var(--caq-text-muted); margin: 0 0 14px; }

/* 错误重试按鈕 */
.caq-retry-btn {
    padding: 7px 18px;
    background: var(--caq-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.caq-retry-btn:hover {
    background: var(--caq-primary-light);
    transform: translateY(-1px);
}

.caq-retry-btn:active {
    transform: translateY(0);
}

/* =============================================
   Toast 通知
   ============================================= */
.caq-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(44, 24, 16, 0.92);
    color: #f5e6d0;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 24px;
    z-index: 19999;
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
}

.caq-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.dark .caq-toast {
    background: rgba(14, 9, 8, 0.94);
    color: #e8c9a0;
}

/* =============================================
   示例模态框
   ============================================= */
.caq-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.caq-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 94vw;
    max-height: 80vh;
    background: var(--caq-bg-panel);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 10001;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--caq-border);
    transition: background 0.3s;
}

.caq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--caq-border);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.06), rgba(212, 172, 13, 0.04));
}

.caq-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--caq-text);
    background: none;
    border: none;
    padding: 0;
}

.caq-modal-close {
    background: none;
    border: 1px solid var(--caq-border);
    color: var(--caq-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.2s;
}

.caq-modal-close:hover {
    background: var(--caq-primary);
    border-color: var(--caq-primary);
    color: #fff;
}

.caq-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.caq-modal-body::-webkit-scrollbar { width: 5px; }
.caq-modal-body::-webkit-scrollbar-thumb { background: var(--caq-border); border-radius: 3px; }
.caq-modal-body::-webkit-scrollbar-thumb:hover { background: var(--caq-text-light); }

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.example-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 9px;
    border: 1px solid var(--caq-border);
    background: var(--caq-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: var(--caq-primary);
    background: rgba(192, 57, 43, 0.04);
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.1);
    transform: translateY(-1px);
}

body.dark .example-card {
    background: var(--caq-bg);
}

body.dark .example-card:hover {
    background: rgba(231, 76, 60, 0.08);
    border-color: var(--caq-primary);
}

.example-icon {
    font-size: 26px;
    flex-shrink: 0;
    margin-top: 1px;
}

.example-info {
    flex: 1;
    min-width: 0;
}

.example-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--caq-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.example-type-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(192, 57, 43, 0.1);
    color: var(--caq-primary);
    margin-bottom: 4px;
}

body.dark .example-type-badge {
    background: rgba(231, 76, 60, 0.15);
    color: #ff8f82;
}

.example-desc {
    font-size: 11px;
    color: var(--caq-text-muted);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* =============================================
   响应式设计
   ============================================= */
@media (max-width: 900px) {
    :root {
        --caq-history-width: 0px;
        --caq-input-width:   260px;
    }
    .caq-history-panel { display: none; }
}

@media (max-width: 640px) {
    :root {
        --caq-input-width: 100%;
    }
    .caq-main-content { flex-direction: column; }
    .caq-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--caq-border);
        max-height: 240px;
    }
    .caq-result-panel { flex: 1; }
    .example-grid { grid-template-columns: 1fr; }
    .caq-toolbar { height: auto; min-height: 48px; padding: 6px 10px; }
}
