/* =============================================
   名人名言工具 - celebrity_quotes.css
   三栏布局：历史 | 配置 | 名言结果
   主题色：典雅金 #c9963e / #8B6914
   ============================================= */

/* ========== 主容器 ========== */
.cq-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf8ef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(139, 105, 20, 0.15);
    transition: all 0.3s ease;
}

.cq-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;
}

/* ========== 顶部工具栏 ========== */
.cq-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    min-height: 40px;
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.45);
    flex-shrink: 0;
}

.cq-toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.cq-toolbar-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.90);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #8B6914;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.cq-toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.cq-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cq-toolbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* 主操作按钮 */
.cq-btn-primary {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(191, 54, 12, 0.45);
}

.cq-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff6d00 0%, #e65100 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(255, 109, 0, 0.55);
}

/* 生成中流光动画 */
.cq-btn-primary.cq-btn-loading {
    background: linear-gradient(90deg, #e65100 0%, #ffab40 35%, #e65100 65%, #bf360c 100%) !important;
    background-size: 200% 100% !important;
    animation: cqBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes cqBtnShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 取消按钮 */
.cq-btn-cancel {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.cq-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

/* 工具栏标题 */
.cq-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
}

/* ========== 主内容三栏 ========== */
.cq-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf8ef;
}

/* ========== 左栏：历史记录 ========== */
.cq-history-panel {
    width: 190px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8d9b5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cq-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #fffdf5 0%, #fdf5df 100%);
    border-bottom: 1px solid #e8d9b5;
    flex-shrink: 0;
}

.cq-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8B6914;
}

.cq-history-count {
    font-size: 11px;
    color: #c9963e;
    font-weight: 400;
}

.cq-clear-btn {
    background: #fff0f0;
    border: none;
    color: #e53935;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.cq-clear-btn:hover { background: #fde8e8; }

.cq-history-search {
    padding: 7px;
    border-bottom: 1px solid #e8d9b5;
    flex-shrink: 0;
}

.cq-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffdf5;
}

.cq-history-search input:focus {
    border-color: #c9963e;
    box-shadow: 0 0 0 2px rgba(201, 150, 62, 0.15);
}

.cq-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.cq-history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 10px;
    margin: 3px 0;
    background: #fffdf5;
    border: 1px solid #e8d9b5;
    border-left: 3px solid #c9963e;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: cqFadeIn 0.2s ease;
}

@keyframes cqFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cq-history-item:hover {
    background: #fef5e0;
    border-color: #c9963e;
    transform: translateX(2px);
}

.cq-history-item.active {
    background: #fef5e0;
    border-left-color: #8B6914;
    box-shadow: 0 1px 4px rgba(139, 105, 20, 0.2);
}

.cq-history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fff0f0;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.cq-history-item:hover .cq-history-item-del {
    opacity: 1;
}

.cq-history-item-del:hover {
    background: #ef4444;
    color: white;
}

.cq-history-item-name {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 3px;
    color: #5d4208;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 18px;
}

.cq-history-item-meta {
    font-size: 11px;
    color: #9e8040;
    display: flex;
    justify-content: space-between;
}

/* 历史为空时提示 */
.cq-history-empty {
    padding: 24px 12px;
    text-align: center;
    color: #b8a060;
    font-size: 12px;
}

.cq-history-empty-icon {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
    opacity: 0.5;
}

/* ========== 中栏：参数配置 ========== */
.cq-input-panel {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8d9b5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cq-panel-header {
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffdf5 0%, #fdf5df 100%);
    border-bottom: 1px solid #e8d9b5;
    flex-shrink: 0;
}

.cq-panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
    color: #8B6914;
}

.cq-panel-tip {
    font-size: 11px;
    color: #b8963e;
}

.cq-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.cq-field-group {
    margin-bottom: 14px;
}

.cq-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5d4208;
    margin-bottom: 6px;
}

.cq-input-wrap {
    position: relative;
}

.cq-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d4b96a;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.55;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    min-height: 72px;
    background: #fffdf5;
    color: #3d2b08;
}

.cq-textarea:focus {
    border-color: #c9963e;
    box-shadow: 0 0 0 2px rgba(201, 150, 62, 0.15);
    background: #fff;
}

.cq-textarea::placeholder { color: #c0a060; }

.cq-char-counter {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 11px;
    color: #c0a060;
    pointer-events: none;
}

.cq-clear-input-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: #f5f0e8;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cq-clear-input-btn:hover {
    background: #e8d9b5;
    color: #5d4208;
}

/* 主题分类网格 */
.cq-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.cq-category-item {
    padding: 5px 6px;
    background: #fffdf5;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    color: #8B6914;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cq-category-item .cq-cat-icon {
    font-size: 14px;
    line-height: 1;
}

.cq-category-item .cq-cat-name {
    font-weight: 500;
}

.cq-category-item:hover {
    background: #fef5e0;
    border-color: #c9963e;
}

.cq-category-item.selected {
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    border-color: #8B6914;
    color: #fff;
    box-shadow: 0 2px 6px rgba(139, 105, 20, 0.3);
}

/* 数量选项 */
.cq-count-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cq-count-item {
    padding: 4px 12px;
    background: #fffdf5;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #8B6914;
    transition: all 0.2s;
}

.cq-count-item:hover {
    background: #fef5e0;
    border-color: #c9963e;
}

.cq-count-item.selected {
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    border-color: #8B6914;
    color: #fff;
}

/* 语言选项 */
.cq-lang-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cq-lang-item {
    padding: 4px 12px;
    background: #fffdf5;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #8B6914;
    transition: all 0.2s;
}

.cq-lang-item:hover {
    background: #fef5e0;
    border-color: #c9963e;
}

.cq-lang-item.selected {
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    border-color: #8B6914;
    color: #fff;
}

/* 内嵌生成按钮 */
.cq-generate-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.35);
    letter-spacing: 0.5px;
}

.cq-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d4a84a 0%, #9a750f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.45);
}

.cq-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 使用说明框 */
.cq-tips-box {
    background: linear-gradient(135deg, #fffdf5 0%, #fdf5df 100%);
    border: 1px solid #e8d9b5;
    border-radius: 5px;
    padding: 10px 12px;
    font-size: 11.5px;
    color: #7a5c20;
    line-height: 1.6;
}

.cq-tips-box p {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: #5d4208;
}

.cq-tips-box ul {
    margin: 0;
    padding-left: 16px;
}

.cq-tips-box li {
    margin-bottom: 3px;
}

.cq-tips-box ul li::marker {
    font-weight: 600;
    color: #c9963e;
}

/* ========== 右栏：名言结果 ========== */
.cq-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fdf8ef;
    overflow: hidden;
    min-width: 0;
}

.cq-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    background: linear-gradient(to bottom, #fffdf5 0%, #fdf5df 100%);
    border-bottom: 1px solid #e8d9b5;
    flex-shrink: 0;
}

.cq-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8B6914;
}

.cq-result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cq-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cq-regen-btn {
    padding: 4px 10px;
    background: #fef5e0;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    color: #8B6914;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.cq-regen-btn:hover {
    background: #fde8b4;
    border-color: #c9963e;
}

.cq-result-count-badge {
    background: linear-gradient(135deg, #c9963e 0%, #8B6914 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.cq-result-person {
    font-size: 12px;
    color: #8B6914;
    background: #fef5e0;
    padding: 2px 8px;
    border-radius: 3px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cq-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 占位符 */
.cq-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 320px;
    padding: 40px 20px;
    text-align: center;
    color: #b8963e;
}

.cq-placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: cqFloat 3s ease-in-out infinite;
}

@keyframes cqFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.cq-placeholder-title {
    font-size: 17px;
    font-weight: 600;
    color: #8B6914;
    margin: 0 0 8px 0;
}

.cq-placeholder-desc {
    font-size: 13px;
    color: #b8963e;
    margin: 2px 0;
}

.cq-placeholder-shortcut {
    margin-top: 12px;
    font-size: 12px;
    color: #c0a060;
}

.cq-placeholder-shortcut kbd {
    display: inline-block;
    padding: 1px 6px;
    background: #fef5e0;
    border: 1px solid #d4b96a;
    border-radius: 3px;
    font-size: 11px;
    font-family: inherit;
    color: #8B6914;
}

/* 加载中 */
.cq-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 40px 20px;
    text-align: center;
}

.cq-loading-icon {
    font-size: 44px;
    animation: cqPulse 1.2s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes cqPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%       { transform: scale(1.15); opacity: 1; }
}

.cq-loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.cq-loading-dots span {
    width: 8px;
    height: 8px;
    background: #c9963e;
    border-radius: 50%;
    animation: cqDotBounce 1.2s ease-in-out infinite;
}

.cq-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.cq-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cqDotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%       { transform: translateY(-8px); opacity: 1; }
}

.cq-loading-text {
    font-size: 13px;
    color: #8B6914;
    margin: 0;
}

/* 结果内容 */
.cq-result-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: cq-quote-counter;
}

/* AI 输出根容器 - 必须定义 flex 布局否则卡片无间距 */
.cq-result-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* 名言卡片 */
.cq-quote-card {
    background: #fff;
    border-radius: 6px;
    padding: 18px 20px 14px;
    border-left: 4px solid #c9963e;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.08);
    position: relative;
    transition: all 0.2s;
    animation: cqCardIn 0.35s ease both;
    counter-increment: cq-quote-counter;
}

/* 卡片序号徽标（纯 CSS counter，无需修改 AI 输出） */
.cq-quote-card::before {
    content: '#' counter(cq-quote-counter);
    position: absolute;
    top: 10px;
    right: 46px;
    font-size: 10px;
    font-weight: 600;
    color: #d4b96a;
    opacity: 0.75;
    line-height: 1;
    pointer-events: none;
    letter-spacing: 0.2px;
}

@keyframes cqCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 卡片交错入场延迟 */
.cq-result-content .cq-quote-card:nth-child(2)  { animation-delay: 0.05s; }
.cq-result-content .cq-quote-card:nth-child(3)  { animation-delay: 0.10s; }
.cq-result-content .cq-quote-card:nth-child(4)  { animation-delay: 0.15s; }
.cq-result-content .cq-quote-card:nth-child(5)  { animation-delay: 0.20s; }
.cq-result-content .cq-quote-card:nth-child(6)  { animation-delay: 0.25s; }
.cq-result-content .cq-quote-card:nth-child(7)  { animation-delay: 0.30s; }
.cq-result-content .cq-quote-card:nth-child(8)  { animation-delay: 0.35s; }
.cq-result-content .cq-quote-card:nth-child(9)  { animation-delay: 0.40s; }
.cq-result-content .cq-quote-card:nth-child(10) { animation-delay: 0.45s; }
.cq-result-content .cq-quote-card:nth-child(11) { animation-delay: 0.50s; }
.cq-result-content .cq-quote-card:nth-child(12) { animation-delay: 0.55s; }
.cq-result-content .cq-quote-card:nth-child(13) { animation-delay: 0.60s; }
.cq-result-content .cq-quote-card:nth-child(14) { animation-delay: 0.65s; }
.cq-result-content .cq-quote-card:nth-child(15) { animation-delay: 0.70s; }

.cq-quote-card:hover {
    box-shadow: 0 4px 14px rgba(139, 105, 20, 0.14);
    transform: translateY(-1px);
}

.cq-quote-mark {
    font-size: 52px;
    line-height: 0.6;
    color: #c9963e;
    font-family: Georgia, serif;
    opacity: 0.35;
    margin-bottom: 4px;
    display: block;
    font-weight: 900;
}

.cq-quote-text {
    font-size: 15px;
    line-height: 1.75;
    color: #3d2b08;
    margin: 4px 0 12px;
    font-style: italic;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 英文引文样式 */
.cq-quote-en {
    font-size: 13px;
    line-height: 1.6;
    color: #9e8040;
    font-style: italic;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 2px solid #e8d9b5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.cq-quote-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f0e8d0;
}

.cq-quote-author {
    font-size: 13px;
    font-weight: 600;
    color: #8B6914;
}

.cq-quote-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cq-quote-tag {
    font-size: 11px;
    padding: 2px 7px;
    background: #fef5e0;
    border: 1px solid #e8d9b5;
    border-radius: 3px;
    color: #9e8040;
}

.cq-quote-card-actions {
    position: absolute;
    top: 10px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.cq-quote-card:hover .cq-quote-card-actions {
    opacity: 1;
}

.cq-quote-action-btn {
    width: 24px;
    height: 24px;
    background: #fef5e0;
    border: 1px solid #e8d9b5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #8B6914;
}

.cq-quote-action-btn:hover {
    background: #c9963e;
    border-color: #8B6914;
    color: #fff;
}

/* 结果区链接样式 */
.cq-result-content a {
    color: #c0392b;
    text-decoration: underline;
}
.cq-result-content a:hover {
    color: #7b241c;
    text-decoration: underline;
}

/* 历史记录时间标记 */
.cq-history-time {
    font-size: 10px;
    color: #b8963e;
    opacity: 0.8;
    white-space: nowrap;
}

/* 内嵌生成按鈕加载态 */
.cq-generate-btn.cq-generate-btn-loading {
    background: linear-gradient(90deg, #c9963e 0%, #ffd080 35%, #c9963e 65%, #8B6914 100%);
    background-size: 200% 100%;
    animation: cqBtnShimmer 1.4s ease-in-out infinite;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

/* 错误提示 */
.cq-result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    text-align: center;
    color: #e65100;
    min-height: 160px;
    justify-content: center;
}

.cq-error-icon { font-size: 32px; }

.cq-error-msg {
    font-size: 14px;
    color: #8d4c00;
}

.error-retry-btn {
    padding: 6px 16px;
    background: #fef5e0;
    border: 1px solid #d4b96a;
    border-radius: 4px;
    color: #8B6914;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.error-retry-btn:hover {
    background: #fde8b4;
    border-color: #c9963e;
}

/* ========== Toast 通知 ========== */
.cq-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(50, 35, 10, 0.88);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cq-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 示例模态框 ========== */
.cq-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(2px);
}

.cq-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cq-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%);
    width: min(640px, 92vw);
    max-height: 76vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(139, 105, 20, 0.2);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cq-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.cq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(to bottom, #fffdf5 0%, #fdf5df 100%);
    border-bottom: 1px solid #e8d9b5;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}

.cq-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #8B6914;
}

.cq-modal-close {
    width: 28px;
    height: 28px;
    background: #f5f0e8;
    border: none;
    color: #8B6914;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-modal-close:hover {
    background: #e8d9b5;
    color: #5d4208;
}

.cq-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.cq-example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cq-example-item {
    padding: 12px 14px;
    background: #fffdf5;
    border: 1px solid #e8d9b5;
    border-left: 3px solid #c9963e;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.cq-example-item:hover {
    background: #fef5e0;
    border-color: #c9963e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.12);
}

.cq-example-title {
    font-size: 13px;
    font-weight: 600;
    color: #5d4208;
    margin-bottom: 4px;
}

.cq-example-desc {
    font-size: 11.5px;
    color: #9e8040;
}

/* ========== 滚动条美化 ========== */
.cq-history-list::-webkit-scrollbar,
.cq-input-body::-webkit-scrollbar,
.cq-result-body::-webkit-scrollbar,
.cq-modal-body::-webkit-scrollbar { width: 5px; }

.cq-history-list::-webkit-scrollbar-track,
.cq-input-body::-webkit-scrollbar-track,
.cq-result-body::-webkit-scrollbar-track,
.cq-modal-body::-webkit-scrollbar-track { background: #fdf8ef; }

.cq-history-list::-webkit-scrollbar-thumb,
.cq-input-body::-webkit-scrollbar-thumb,
.cq-result-body::-webkit-scrollbar-thumb,
.cq-modal-body::-webkit-scrollbar-thumb {
    background: #d4b96a;
    border-radius: 3px;
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
    .cq-history-panel { display: none; }
    .cq-input-panel { width: 240px; }
}

@media (max-width: 640px) {
    .cq-input-panel { width: 200px; }
    .cq-category-grid { grid-template-columns: repeat(2, 1fr); }
    .cq-example-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .cq-input-panel { display: none; }
}

/* ========== 打印样式 ========== */
@media print {
    #cqResultPlaceholder,
    #cqResultLoading { display: none !important; }
    .cq-toolbar,
    .cq-history-panel,
    .cq-input-panel { display: none !important; }
    .cq-container {
        height: auto !important;
        min-height: unset !important;
        box-shadow: none !important;
        border-radius: 0;
    }
    .cq-result-panel { overflow: visible; }
    .cq-result-body { overflow: visible; height: auto; padding: 0; }
    .cq-result-content { gap: 12px; }
    .cq-quote-card {
        break-inside: avoid;
        box-shadow: none !important;
        animation: none !important;
        animation-delay: 0s !important;
    }
}

/* =============================
   暗黑模式 - body.dark 前缀
   ============================= */
body.dark .cq-container {
    background: #1a1510;
}

body.dark .cq-toolbar {
    background: linear-gradient(135deg, #6b4e1a 0%, #3d2b08 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark .cq-toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #f0d090;
    border: none;
}

body.dark .cq-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

body.dark .cq-btn-primary {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%) !important;
    color: #fff !important;
}

body.dark .cq-main-content {
    background: #1a1510;
}

/* 历史面板 - 暗黑 */
body.dark .cq-history-panel {
    background: #141008;
    border-right-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-history-header {
    background: linear-gradient(to bottom, #1c160c 0%, #141008 100%);
    border-bottom-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-history-header h3 { color: #d4a84a; }

body.dark .cq-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

body.dark .cq-clear-btn:hover { background: rgba(239, 68, 68, 0.28); }

body.dark .cq-history-search { border-bottom-color: rgba(201, 150, 62, 0.2); }

body.dark .cq-history-search input {
    background: #1a1510;
    border-color: #4a3a18;
    color: #e8d4a0;
}

body.dark .cq-history-search input::placeholder { color: #6a5230; }

body.dark .cq-history-search input:focus {
    border-color: #c9963e;
    box-shadow: 0 0 0 2px rgba(201, 150, 62, 0.2);
}

body.dark .cq-history-list { background: #141008; }

body.dark .cq-history-item {
    background: #1c160c;
    border-color: rgba(201, 150, 62, 0.25);
    border-left-color: #8B6914;
}

body.dark .cq-history-item:hover { background: #231c0f; }

body.dark .cq-history-item.active {
    background: #231c0f;
    border-left-color: #d4a84a;
    box-shadow: 0 1px 4px rgba(201, 150, 62, 0.25);
}

body.dark .cq-history-item-name { color: #e8d4a0; }

body.dark .cq-history-item-del {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

body.dark .cq-history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

body.dark .cq-history-item-meta { color: #7a6040; }

body.dark .cq-history-empty { color: #6a5230; }

/* 配置面板 - 暗黑 */
body.dark .cq-input-panel {
    background: #141008;
    border-right-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-panel-header {
    background: linear-gradient(to bottom, #1c160c 0%, #141008 100%);
    border-bottom-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-panel-header h3 { color: #d4a84a; }

body.dark .cq-panel-tip { color: #7a6040; }

body.dark .cq-label { color: #c0a060; }

body.dark .cq-textarea {
    background: #1a1510;
    border-color: #4a3a18;
    color: #e8d4a0;
}

body.dark .cq-textarea:focus {
    border-color: #c9963e;
    background: #1c160c;
    box-shadow: 0 0 0 2px rgba(201, 150, 62, 0.2);
}

body.dark .cq-textarea::placeholder { color: #5a4828; }

body.dark .cq-char-counter { color: #5a4828; }

body.dark .cq-clear-input-btn {
    background: #2a2010;
    color: #8a7040;
}

body.dark .cq-clear-input-btn:hover {
    background: #3a2c14;
    color: #c9963e;
}

body.dark .cq-category-item {
    background: #1a1510;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .cq-category-item:hover {
    background: #231c0f;
    border-color: #c9963e;
}

body.dark .cq-category-item.selected {
    background: linear-gradient(135deg, #8B6914 0%, #5d4208 100%);
    border-color: #c9963e;
    color: #fef5e0;
}

body.dark .cq-count-item,
body.dark .cq-lang-item {
    background: #1a1510;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .cq-count-item:hover,
body.dark .cq-lang-item:hover {
    background: #231c0f;
    border-color: #c9963e;
}

body.dark .cq-count-item.selected,
body.dark .cq-lang-item.selected {
    background: linear-gradient(135deg, #8B6914 0%, #5d4208 100%);
    border-color: #c9963e;
    color: #fef5e0;
}

body.dark .cq-generate-btn {
    background: linear-gradient(135deg, #8B6914 0%, #5d4208 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .cq-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #a07820 0%, #6b4e1a 100%);
}

body.dark .cq-tips-box {
    background: linear-gradient(135deg, #1a1510 0%, #1c160c 100%);
    border-color: rgba(201, 150, 62, 0.2);
    color: #7a6040;
}

body.dark .cq-tips-box p { color: #c0a060; }

/* 结果面板 - 暗黑 */
body.dark .cq-result-panel { background: #1a1510; }

body.dark .cq-result-header {
    background: linear-gradient(to bottom, #1c160c 0%, #141008 100%);
    border-bottom-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-result-header h3 { color: #d4a84a; }

body.dark .cq-regen-btn {
    background: #231c0f;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .cq-regen-btn:hover { background: #2d2210; border-color: #c9963e; }

body.dark .cq-result-count-badge {
    background: linear-gradient(135deg, #8B6914 0%, #5d4208 100%);
    color: #fef5e0;
}

body.dark .cq-result-person {
    background: #231c0f;
    color: #d4a84a;
}

body.dark .cq-result-body {
    background: #1a1510;
}

body.dark .cq-result-body::-webkit-scrollbar-track { background: #141008; }

body.dark .cq-result-body::-webkit-scrollbar-thumb { background: #4a3a18; }

body.dark .cq-placeholder-title { color: #d4a84a; }

body.dark .cq-placeholder-desc { color: #7a6040; }

body.dark .cq-placeholder-shortcut { color: #5a4828; }

body.dark .cq-placeholder-shortcut kbd {
    background: #231c0f;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .cq-loading-text { color: #d4a84a; }

body.dark .cq-loading-dots span { background: #8B6914; }

body.dark .cq-result-list {
    /* 暗黑模式下 AI 根容器无需额外颜色，继承父级 */
}

body.dark .cq-quote-card::before { color: #4a3a18; opacity: 0.8; }

body.dark .cq-quote-card {
    background: #1c160c;
    border-left-color: #8B6914;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .cq-quote-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

body.dark .cq-quote-mark { color: #8B6914; }

body.dark .cq-quote-text { color: #e8d4a0; }

body.dark .cq-quote-en { color: #7a6040; border-left-color: #4a3a18; }

body.dark .cq-quote-footer { border-top-color: #2d2210; }

body.dark .cq-quote-author { color: #d4a84a; }

body.dark .cq-quote-tag {
    background: #231c0f;
    border-color: #4a3a18;
    color: #9e8040;
}

body.dark .cq-quote-action-btn {
    background: #231c0f;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .cq-quote-action-btn:hover {
    background: #8B6914;
    border-color: #c9963e;
    color: #fff;
}

body.dark .cq-result-error { color: #e67e22; }

body.dark .cq-error-msg { color: #c0804a; }

body.dark .error-retry-btn {
    background: #231c0f;
    border-color: #4a3a18;
    color: #d4a84a;
}

body.dark .error-retry-btn:hover {
    background: #2d2210;
    border-color: #c9963e;
}

/* 模态框 - 暗黑 */
body.dark .cq-modal {
    background: #1c160c;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

body.dark .cq-modal-header {
    background: linear-gradient(to bottom, #231c0f 0%, #1c160c 100%);
    border-bottom-color: rgba(201, 150, 62, 0.2);
}

body.dark .cq-modal-header h3 { color: #d4a84a; }

body.dark .cq-modal-close {
    background: #2d2210;
    color: #d4a84a;
}

body.dark .cq-modal-close:hover { background: #3a2c14; color: #fef5e0; }

body.dark .cq-modal-body { background: #1c160c; }

body.dark .cq-example-item {
    background: #1a1510;
    border-color: rgba(201, 150, 62, 0.2);
    border-left-color: #8B6914;
}

body.dark .cq-example-item:hover {
    background: #231c0f;
    border-color: #c9963e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .cq-example-title { color: #e8d4a0; }

body.dark .cq-example-desc { color: #7a6040; }

body.dark .cq-history-list::-webkit-scrollbar-track,
body.dark .cq-input-body::-webkit-scrollbar-track,
body.dark .cq-modal-body::-webkit-scrollbar-track { background: #141008; }

body.dark .cq-history-list::-webkit-scrollbar-thumb,
body.dark .cq-input-body::-webkit-scrollbar-thumb,
body.dark .cq-modal-body::-webkit-scrollbar-thumb { background: #4a3a18; }

/* 暗黑模式补充样式 */
body.dark .cq-generate-btn.cq-generate-btn-loading {
    background: linear-gradient(90deg, #8B6914 0%, #c9963e 35%, #8B6914 65%, #5d4208 100%);
    background-size: 200% 100%;
}

body.dark .cq-result-content a {
    color: #e8a87c;
    text-decoration: underline;
}
body.dark .cq-result-content a:hover {
    color: #ffbc96;
}

body.dark .cq-history-time { color: #6a5230; }

body.dark .cq-tips-box ul li::marker { color: #8B6914; }
