/* =====================================================
   十万个为什么 - why_100000_reasons.css
   主题色系：深空探索系
   #0b0f2e（深夜星空）/ #1e2d6b（深蓝宇宙）/ #2e5bba（探索蓝）
   #60a5fa（星光蓝）/ #fbbf24（金色星芒）
   寓意：无尽探索、求知若渴、知识如星光照亮未知
   ===================================================== */

/* ========== 主容器 ========== */
.wr-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(30, 45, 107, 0.1);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.wr-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.wr-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #0b0f2e 0%, #1e2d6b 50%, #2e5bba 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(11, 15, 46, 0.45);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
    margin-right: 4px;
    letter-spacing: 0.5px;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e0e8ff;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    color: #1a1000;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.55);
}

/* ========== 主内容区 ========== */
.wr-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左侧历史面板 ========== */
.wr-history-panel {
    width: 190px;
    background: #fff;
    border-right: 1px solid #c7d2f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #f3f6ff, #eaefff);
    border-bottom: 1px solid #c7d2f0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1e2d6b;
}

.history-count {
    font-size: 11px;
    color: #60a5fa;
    font-weight: 400;
    margin-left: 4px;
}

.history-clear-btn {
    background: #eef2ff;
    border: none;
    color: #1e2d6b;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #c7d2f0;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #c7d2f0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #c7d2f0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f8f9ff;
}

.history-search input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #b0bcdf;
    font-size: 12px;
    padding: 20px 10px;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    margin: 3px 0;
    background: #f8f9ff;
    border: 1px solid #c7d2f0;
    border-left: 3px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: wrFadeIn 0.2s ease;
}

@keyframes wrFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-item:hover {
    background: #eef2ff;
    border-top-color: #93b4f8;
    border-right-color: #93b4f8;
    border-bottom-color: #93b4f8;
}

.history-item.active {
    background: #eef2ff;
    border-left-color: #2e5bba;
}

.history-item-question {
    font-size: 12px;
    font-weight: 500;
    color: #1e2d6b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #8599c9;
}

.history-item-category {
    background: #eef2ff;
    color: #2e5bba;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.history-item-delete {
    background: none;
    border: none;
    color: #b0bcdf;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ========== 中间输入面板 ========== */
.wr-input-panel {
    width: 320px;
    background: #fff;
    border-right: 1px solid #c7d2f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f3f6ff, #eaefff);
    border-bottom: 1px solid #c7d2f0;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e2d6b;
}

.panel-tip {
    font-size: 11px;
    color: #7a90c5;
}

.wr-input-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1e2d6b;
    margin-bottom: 6px;
}

.label-tip {
    font-weight: 400;
    color: #8599c9;
    font-size: 11px;
}

/* 问题输入框 */
.question-input-wrapper {
    position: relative;
}

.wr-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c7d2f0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 90px;
    max-height: 160px;
    box-sizing: border-box;
    transition: all 0.2s;
    font-family: inherit;
    background: #f8f9ff;
    color: #1e2d6b;
}

.wr-textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    background: #fff;
}

.wr-textarea::placeholder {
    color: #b0bcdf;
    font-size: 12px;
}

.char-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 10px;
    color: #b0bcdf;
    pointer-events: none;
}

/* 分类标签 */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.category-tag {
    padding: 4px 8px;
    border: 1px solid #c7d2f0;
    border-radius: 12px;
    background: #f8f9ff;
    color: #4a5f9a;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tag:hover {
    background: #eef2ff;
    border-color: #60a5fa;
    color: #1e2d6b;
}

.category-tag.active {
    background: linear-gradient(135deg, #1e2d6b, #2e5bba);
    border-color: #1e2d6b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 45, 107, 0.3);
}

.category-tag-pressing {
    transform: scale(0.93);
}

/* 解答深度 */
.depth-selector {
    display: flex;
    gap: 6px;
}

.depth-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #c7d2f0;
    border-radius: 6px;
    background: #f8f9ff;
    color: #4a5f9a;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.depth-btn:hover {
    background: #eef2ff;
    border-color: #60a5fa;
}

.depth-btn.active {
    background: linear-gradient(135deg, #1e2d6b, #2e5bba);
    border-color: #1e2d6b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 45, 107, 0.3);
}

/* Select 下拉框 */
.wr-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c7d2f0;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    background: #f8f9ff;
    color: #1e2d6b;
    transition: all 0.2s;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e2d6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.wr-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

/* 快捷提问 */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.quick-q-btn {
    padding: 5px 9px;
    border: 1px solid #c7d2f0;
    border-radius: 12px;
    background: #f8f9ff;
    color: #2e5bba;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-q-btn:hover {
    background: #eef2ff;
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(30, 45, 107, 0.15);
}

/* 提问主按钮 */
.ask-main-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0b0f2e, #1e2d6b, #2e5bba);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(30, 45, 107, 0.35);
    letter-spacing: 0.5px;
}

.ask-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(30, 45, 107, 0.45);
    background: linear-gradient(135deg, #1e2d6b, #2e5bba, #60a5fa);
}

.ask-main-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.ask-main-btn:active {
    transform: translateY(0);
}

.ask-hint {
    text-align: center;
    font-size: 11px;
    color: #b0bcdf;
    margin: 5px 0 0 0;
}

/* ========== 右侧答案面板 ========== */
.wr-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9ff;
}

.wr-result-panel .panel-header {
    background: linear-gradient(to bottom, #f3f6ff, #eaefff);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.wr-result-panel .panel-header h3 {
    margin: 0;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-meta-category, .result-meta-depth {
    background: #eef2ff;
    color: #2e5bba;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.result-time {
    font-size: 11px;
    color: #8599c9;
}

.wr-result-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

/* ========== 占位区 ========== */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    position: relative;
}

.result-placeholder::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(251,191,36,0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(96,165,250,0.07) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 8px;
}

.wr-placeholder-icon {
    font-size: 64px;
    line-height: 1;
    animation: wrPlaceholderFloat 3s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes wrPlaceholderFloat {
    0%, 100% { transform: translateY(0);    filter: drop-shadow(0 0 8px  rgba(251,191,36,0.3)); }
    50%       { transform: translateY(-8px); filter: drop-shadow(0 0 18px rgba(251,191,36,0.75)); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e2d6b;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #8599c9;
    margin: 2px 0;
}

.placeholder-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.why-tag {
    padding: 5px 10px;
    background: #eef2ff;
    border: 1px solid #c7d2f0;
    border-radius: 12px;
    font-size: 11px;
    color: #2e5bba;
    cursor: pointer;
    transition: all 0.2s;
}

.why-tag:hover {
    background: #dce6ff;
    border-color: #60a5fa;
    color: #1e2d6b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(30, 45, 107, 0.15);
}

/* ========== 加载状态 ========== */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
}

.ai-loading-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ai-loading-indicator span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
    animation: wrBounce 1.2s ease-in-out infinite;
}

.ai-loading-indicator span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wrBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.2); opacity: 1; }
}

.wr-breath-text {
    font-size: 13px;
    color: #1e2d6b;
    font-weight: 500;
    animation: wrBreathText 1.8s ease-in-out infinite;
    margin: 4px 0 0 0;
}

@keyframes wrBreathText {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* ========== 答案展示区 ========== */
.answer-container {
    animation: wrFadeIn 0.35s ease;
}

.answer-question {
    background: linear-gradient(135deg, #0b0f2e 0%, #1e2d6b 100%);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(11, 15, 46, 0.2);
}

.answer-question::before {
    content: '❓';
    margin-right: 8px;
}

.answer-content {
    background: #fff;
    border: 1px solid #c7d2f0;
    border-left: 4px solid #fbbf24;
    border-radius: 10px;
    padding: 18px;
    font-size: 14px;
    line-height: 1.8;
    color: #2d3a5e;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(30, 45, 107, 0.07);
    margin-bottom: 14px;
}

/* 相关问题 */
.related-questions {
    border-top: 1px solid #c7d2f0;
    padding-top: 14px;
    animation: wrFadeIn 0.35s ease;
}

.related-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e2d6b;
    margin-bottom: 10px;
}

.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.related-q-btn {
    padding: 6px 12px;
    background: #eef2ff;
    border: 1px solid #c7d2f0;
    border-radius: 14px;
    color: #2e5bba;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.related-q-btn:hover {
    background: #dce6ff;
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(30, 45, 107, 0.15);
}

/* ========== 错误提示 ========== */
.result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
}

.error-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.error-message {
    font-size: 13px;
    color: #5a6a9a;
    margin-bottom: 16px;
}

.result-error-retry {
    padding: 9px 20px;
    background: linear-gradient(135deg, #1e2d6b, #2e5bba);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(30, 45, 107, 0.3);
}

.result-error-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 45, 107, 0.4);
}

/* ========== 示例模态框 ========== */
.wr-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(11, 15, 46, 0.55);
    z-index: 10000;
    backdrop-filter: blur(3px);
}

.wr-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.wr-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(11, 15, 46, 0.35);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    animation: wrModalIn 0.3s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes wrModalIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.wr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0b0f2e, #1e2d6b);
    color: #fff;
    flex-shrink: 0;
}

.wr-modal-header h3 {
    margin: 0;
    font-size: 14px;
    color: #fbbf24;
}

.wr-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.wr-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.wr-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 示例卡片 */
.example-card {
    padding: 12px;
    border: 1px solid #c7d2f0;
    border-radius: 8px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.example-card:hover {
    background: #eef2ff;
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 45, 107, 0.15);
}

.example-card-icon {
    font-size: 22px;
    line-height: 1;
}

.example-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e2d6b;
}

.example-card-desc {
    font-size: 11px;
    color: #7a90c5;
    line-height: 1.4;
}

.example-card-badge {
    align-self: flex-start;
    padding: 2px 6px;
    border-radius: 8px;
    background: #dce6ff;
    color: #2e5bba;
    font-size: 10px;
    font-weight: 500;
}

/* ========== Toast提示 ========== */
.wr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.wr-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.wr-toast.success { background: linear-gradient(135deg, #1e2d6b, #2e5bba); }
.wr-toast.warn    { background: linear-gradient(135deg, #b45309, #d97706); }
.wr-toast.info    { background: linear-gradient(135deg, #374151, #6b7280); }

/* ========== 自定义滚动条 ========== */
.wr-result-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.wr-input-body::-webkit-scrollbar {
    width: 4px;
}

.wr-result-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.wr-input-body::-webkit-scrollbar-track {
    background: transparent;
}

.wr-result-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.wr-input-body::-webkit-scrollbar-thumb {
    background: #c7d2f0;
    border-radius: 2px;
}

.wr-result-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover,
.wr-input-body::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .wr-input-panel { width: 260px; }
    .wr-history-panel { width: 160px; }
}

@media (max-width: 768px) {
    .wr-container {
        height: auto;
        min-height: unset;
    }

    .wr-main-content {
        flex-direction: column;
    }

    .wr-history-panel {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid #c7d2f0;
    }

    .wr-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #c7d2f0;
    }

    .wr-result-panel {
        min-height: 400px;
    }

    .wr-modal-body {
        grid-template-columns: 1fr;
    }

    .copy-reply-btn {
        opacity: 1 !important;
    }

    .history-item-delete {
        opacity: 1 !important;
    }
}

/* ========== 暗黑模式 ========== */
body.dark .wr-container {
    background: #0d1224;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark .wr-toolbar {
    background: linear-gradient(135deg, #060810 0%, #0d1530 50%, #152f6b 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #c0ccf0;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark .wr-history-panel {
    background: #111827;
    border-right-color: #1e2a4a;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #131c35, #0f1628);
    border-bottom-color: #1e2a4a;
}

body.dark .history-panel-header h3 {
    color: #93b4f8;
}

body.dark .history-clear-btn {
    background: #1e2a4a;
    color: #93b4f8;
}

body.dark .history-clear-btn:hover {
    background: #2a3a65;
}

body.dark .history-search {
    border-bottom-color: #1e2a4a;
}

body.dark .history-search input {
    background: #1a2444;
    border-color: #2a3a65;
    color: #c0ccf0;
}

body.dark .history-search input::placeholder {
    color: #4a5a80;
}

body.dark .history-search input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

body.dark .history-empty {
    color: #3a4870;
}

body.dark .history-item {
    background: #1a2444;
    border-color: #2a3a65;
}

body.dark .history-item:hover {
    background: #1e2d6b;
    border-top-color: #3a5599;
    border-right-color: #3a5599;
    border-bottom-color: #3a5599;
}

body.dark .history-item.active {
    background: #1e2d6b;
    border-left-color: #93b4f8;
}

body.dark .history-item-question {
    color: #c0ccf0;
}

body.dark .history-item-meta {
    color: #4a5a80;
}

body.dark .history-item-category {
    background: #1e2d6b;
    color: #93b4f8;
}

body.dark .wr-input-panel {
    background: #111827;
    border-right-color: #1e2a4a;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #131c35, #0f1628);
    border-bottom-color: #1e2a4a;
}

body.dark .panel-header h3 {
    color: #93b4f8;
}

body.dark .panel-tip {
    color: #3a5599;
}

body.dark .form-group label {
    color: #93b4f8;
}

body.dark .wr-textarea {
    background: #1a2444;
    border-color: #2a3a65;
    color: #c0ccf0;
}

body.dark .wr-textarea:focus {
    border-color: #60a5fa;
    background: #1e2d6b;
}

body.dark .wr-textarea::placeholder {
    color: #3a5075;
}

body.dark .char-count {
    color: #3a5075;
}

body.dark .category-tag {
    background: #1a2444;
    border-color: #2a3a65;
    color: #8099d0;
}

body.dark .category-tag:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
    color: #c0ccf0;
}

body.dark .category-tag.active {
    background: linear-gradient(135deg, #1e3d9e, #2e5bba);
    border-color: #2e5bba;
    color: #fff;
}

body.dark .depth-btn {
    background: #1a2444;
    border-color: #2a3a65;
    color: #8099d0;
}

body.dark .depth-btn:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
}

body.dark .depth-btn.active {
    background: linear-gradient(135deg, #1e3d9e, #2e5bba);
    border-color: #2e5bba;
    color: #fff;
}

body.dark .wr-select {
    background: #1a2444;
    border-color: #2a3a65;
    color: #c0ccf0;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393b4f8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

body.dark .quick-q-btn {
    background: #1a2444;
    border-color: #2a3a65;
    color: #8099d0;
}

body.dark .quick-q-btn:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
}

body.dark .ask-main-btn {
    background: linear-gradient(135deg, #060810, #0f1a40, #1e3d9e);
}

body.dark .ask-main-btn:disabled {
    background: linear-gradient(135deg, #0a0e20, #131c35, #1a2a5e);
    opacity: 0.55;
    cursor: not-allowed;
}

body.dark .ask-main-btn:hover {
    background: linear-gradient(135deg, #0f1a40, #1e2d6b, #2e5bba);
}

body.dark .wr-result-panel {
    background: #0d1224;
}

body.dark .wr-result-panel .panel-header {
    background: linear-gradient(to bottom, #131c35, #0f1628);
    border-bottom-color: #1e2a4a;
}

body.dark .result-meta-category,
body.dark .result-meta-depth {
    background: #1e2d6b;
    color: #93b4f8;
}

body.dark .result-time {
    color: #3a5599;
}

body.dark .placeholder-title {
    color: #93b4f8;
}

body.dark .placeholder-desc {
    color: #3a5599;
}

body.dark .ai-loading-indicator span {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

body.dark .wr-breath-text {
    color: #93b4f8;
}

body.dark .answer-question {
    background: linear-gradient(135deg, #060810, #0f1a40);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark .answer-content {
    background: #111827;
    border-color: #1e2a4a;
    border-left-color: #fbbf24;
    color: #c0ccf0;
}

body.dark .related-questions {
    border-top-color: #1e2a4a;
}

body.dark .related-title {
    color: #93b4f8;
}

body.dark .related-q-btn {
    background: #1a2444;
    border-color: #2a3a65;
    color: #8099d0;
}

body.dark .related-q-btn:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
}

body.dark .error-message {
    color: #7a90c5;
}

body.dark .result-error-retry {
    background: linear-gradient(135deg, #0f1a40, #1e3d9e);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #1e2d6b, #2e5bba);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark .wr-modal-content {
    background: #111827;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .wr-modal-header {
    background: linear-gradient(135deg, #060810, #0f1a40);
}

body.dark .example-card {
    background: #1a2444;
    border-color: #2a3a65;
}

body.dark .example-card:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
}

body.dark .example-card-title {
    color: #c0ccf0;
}

body.dark .example-card-desc {
    color: #4a5a80;
}

body.dark .example-card-badge {
    background: #1e2d6b;
    color: #93b4f8;
}

/* 暗黑模式滚动条 */
body.dark .wr-result-body::-webkit-scrollbar-thumb,
body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .wr-input-body::-webkit-scrollbar-thumb {
    background: #2a3a65;
}

body.dark .wr-result-body::-webkit-scrollbar-thumb:hover,
body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .wr-input-body::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

/* 暗黑模式 why-tag 悬停 */
body.dark .why-tag {
    background: #1a2444;
    border-color: #2a3a65;
    color: #8099d0;
}

body.dark .why-tag:hover {
    background: #1e2d6b;
    border-color: #60a5fa;
    color: #c0ccf0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
