/* =============================================
   历史事件解释 - historical_event_explanation.css
   深海蓝·铜金配色 史册主题，三栏布局
   体现历史事件的厚重感与严肃性
   ============================================= */

/* ========== 主容器 ========== */
.hee-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(26, 58, 92, 0.18);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.hee-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;
}

/* ========== 顶部工具栏 ========== */
.hee-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2d5a8e 50%, #0f2640 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(26, 58, 92, 0.5);
    flex-shrink: 0;
    border-bottom: 2px solid #c8902a;
}

.hee-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #e8d5a8;
    letter-spacing: 0.5px;
    margin-right: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(232, 213, 168, 0.15);
    border: 1px solid rgba(200, 144, 42, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e8d5a8;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(200, 144, 42, 0.25);
    border-color: #c8902a;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(200, 144, 42, 0.3);
    color: #f5e6c8;
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 主操作按钮 */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #c8902a 0%, #9e6a1a 100%);
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(200, 144, 42, 0.45);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #dfa43a 0%, #b27a22 100%);
    box-shadow: 0 4px 14px rgba(200, 144, 42, 0.55);
    color: #fff !important;
}

/* 工具栏右对齐 */
.toolbar-group--right {
    margin-left: auto;
}

/* ========== 表单校验抖动 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.hee-input.shake,
.hee-select.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏 ========== */
.hee-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
}

/* ========== 左栏：历史记录 ========== */
.hee-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #e8eef5;
    border-right: 1px solid #c5d5e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #dde8f5 0%, #cad8ec 100%);
    border-bottom: 1px solid #c5d5e8;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
    border: none;
    padding: 0;
    background: none;
}

.history-count {
    font-size: 11px;
    color: #2d5a8e;
    font-weight: 400;
}

.history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #7a9cbf;
    border-top: 1px solid #c5d5e8;
    background: #e8eef5;
    letter-spacing: 0.2px;
    user-select: none;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #c5d5e8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c5d5e8;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #f5f9ff;
}

.history-search input:focus {
    border-color: #2d5a8e;
    box-shadow: 0 0 0 2px rgba(45, 90, 142, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list:hover::-webkit-scrollbar-track { background: #d5e4f5; }
.history-list::-webkit-scrollbar-thumb { background: #a0b8d4; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(45, 90, 142, 0.6); }

.history-list.hee-list-loading {
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.history-empty {
    text-align: center;
    color: #7a9cbf;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    opacity: 0.75;
}

@keyframes heeFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #f5f9ff;
    border: 1px solid #c5d5e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: heeFadeIn 0.2s ease;
}

.history-item:hover {
    background: #e5eff9;
    border-color: #2d5a8e;
    transform: translateX(2px);
}

.history-item.active {
    background: #daeaf8;
    border-color: #2d5a8e;
    box-shadow: 0 1px 4px rgba(45, 90, 142, 0.3), inset 3px 0 0 #c8902a;
}

.history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

.history-item-name {
    font-size: 12px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 11px;
    color: #5580a8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #7a9cbf;
}

/* ========== 中栏：表单输入 ========== */
.hee-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fafcff;
    border-right: 1px solid #c5d5e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果展示 ========== */
.hee-result-panel {
    flex: 1;
    background: #fafcff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #dde8f5 0%, #cad8ec 100%);
    border-bottom: 1px solid #c5d5e8;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1a3a5c;
    white-space: nowrap;
    border-left: 4px solid #c8902a;
    padding-left: 8px;
}

.panel-tip {
    font-size: 11px;
    color: #5580a8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.result-event-tag {
    font-size: 11px;
    color: #1a3a5c;
    background: #dde8f5;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    border: 1px solid #c5d5e8;
}

.result-time {
    font-size: 11px;
    color: #5580a8;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-regen-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    background: rgba(200, 144, 42, 0.12);
    border: 1px solid rgba(200, 144, 42, 0.4);
    border-radius: 4px;
    color: #1a3a5c;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.6;
}

.result-regen-btn:hover {
    background: rgba(200, 144, 42, 0.22);
    border-color: #c8902a;
    transform: translateY(-1px);
}

/* ========== 输入区 ========== */
.hee-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.hee-input-body::-webkit-scrollbar { width: 4px; }
.hee-input-body::-webkit-scrollbar-track { background: transparent; }
.hee-input-body:hover::-webkit-scrollbar-track { background: #d5e4f5; }
.hee-input-body::-webkit-scrollbar-thumb { background: #a0b8d4; border-radius: 2px; }
.hee-input-body::-webkit-scrollbar-thumb:hover { background: rgba(45, 90, 142, 0.6); }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

.hee-input,
.hee-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c5d5e8;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #f5f9ff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.hee-input:focus,
.hee-select:focus {
    border-color: #2d5a8e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 90, 142, 0.12);
}

.hee-input:hover:not(:focus),
.hee-select:hover:not(:focus) {
    border-color: #7a9cbf;
    background: #fff;
}

.hee-input::placeholder {
    color: #9ab5d0;
    font-style: italic;
}

.hee-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232d5a8e'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: #f5f9ff;
    padding-right: 28px;
}

.hee-input:disabled,
.hee-select:disabled {
    background: #edf2f8 !important;
    color: #9ab5d0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #c5d5e8 !important;
    box-shadow: none !important;
}

/* ========== 快捷事件标签 ========== */
.quick-event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.quick-tag {
    padding: 4px 10px;
    background: #e8eef5;
    border: 1px solid #c5d5e8;
    border-radius: 12px;
    font-size: 11px;
    color: #1a3a5c;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-tag:hover {
    background: #2d5a8e;
    border-color: #1a3a5c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(45, 90, 142, 0.35);
}

.quick-tag.selected {
    background: #1a3a5c;
    border-color: #0f2640;
    color: #e8d5a8;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.45);
    font-weight: 700;
}

.hee-generate-hint {
    margin-top: 8px;
    text-align: right;
}

.hee-hint-text {
    font-size: 11px;
    color: #7a9cbf;
    user-select: none;
    font-style: italic;
}

/* ========== 字符计数 ========== */
.hee-char-count {
    float: right;
    font-size: 10px;
    font-weight: 400;
    color: #9ab5d0;
    font-style: normal;
    transition: color 0.2s;
}

.hee-char-count.warn {
    color: #f59e0b;
    font-weight: 600;
}

.hee-char-count.over {
    color: #ef4444;
    font-weight: 700;
}

/* ========== 结果区字数统计 ========== */
.result-word-count {
    font-size: 10px;
    color: #7a9cbf;
    background: rgba(45, 90, 142, 0.07);
    border: 1px solid rgba(45, 90, 142, 0.18);
    border-radius: 8px;
    padding: 1px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

/* ========== 分析模式说明提示 ========== */
.hee-mode-hint {
    margin-top: 6px;
    padding: 7px 10px;
    background: rgba(45, 90, 142, 0.06);
    border-left: 3px solid #c8902a;
    border-radius: 0 4px 4px 0;
    font-size: 11px;
    color: #5580a8;
    line-height: 1.6;
    min-height: 0;
    transition: all 0.2s;
}

/* ========== 结果区域 ========== */
.hee-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fafcff;
}

.hee-result-body::-webkit-scrollbar { width: 5px; }
.hee-result-body::-webkit-scrollbar-track { background: transparent; }
.hee-result-body:hover::-webkit-scrollbar-track { background: #e8eef5; }
.hee-result-body::-webkit-scrollbar-thumb { background: #a0b8d4; border-radius: 3px; }
.hee-result-body::-webkit-scrollbar-thumb:hover { background: rgba(45, 90, 142, 0.6); }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    user-select: none;
}

@keyframes heeFloat {
    0%, 100% { transform: translateY(0);    opacity: 0.85; }
    50%       { transform: translateY(-8px); opacity: 1;    }
}

.placeholder-icon {
    font-size: 58px;
    margin-bottom: 18px;
    animation: heeFloat 3s ease-in-out infinite;
}

.placeholder-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 10px;
}

.placeholder-desc {
    font-size: 13px;
    color: #5580a8;
    margin: 4px 0;
    line-height: 1.65;
}

.placeholder-quote {
    margin-top: 26px;
    font-size: 14px;
    font-style: italic;
    color: #1a3a5c;
    padding: 12px 22px;
    border-left: 3px solid #c8902a;
    text-align: left;
    background: linear-gradient(135deg, rgba(200, 144, 42, 0.08) 0%, rgba(45, 90, 142, 0.05) 100%);
    border-radius: 0 6px 6px 0;
    max-width: 360px;
    font-family: "楷体", "KaiTi", serif;
}

/* 加载动画 */
.result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

@keyframes scrollFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); opacity: 0.8; }
    50%       { transform: translateY(-10px) rotate(2deg); opacity: 1; }
}

.loading-scroll {
    margin-bottom: 20px;
}

.scroll-icon {
    font-size: 48px;
    animation: scrollFloat 1.6s ease-in-out infinite;
    display: inline-block;
}

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.hee-loading-bar {
    width: 220px;
    height: 4px;
    border-radius: 2px;
    margin: 0 auto 18px;
    background: linear-gradient(
        to right,
        rgba(45, 90, 142, 0.15) 0%,
        rgba(45, 90, 142, 0.75) 40%,
        rgba(200, 144, 42, 0.9) 60%,
        rgba(45, 90, 142, 0.15) 100%
    );
    background-size: 400px 4px;
    animation: shimmer 1.4s linear infinite;
}

.loading-text {
    font-size: 13px;
    color: #2d5a8e;
    font-weight: 500;
    margin: 0;
    font-family: "楷体", "KaiTi", serif;
}

/* 结果内容（Markdown 渲染区） */
@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content {
    flex: 1;
    min-height: 0;
    padding: 24px 30px;
    font-size: 14px;
    line-height: 1.9;
    color: #1e2d42;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: 4px solid #c8902a;
    background: linear-gradient(to bottom, #f8fbff 0%, #fff 60%);
}

.result-content.hee-result-enter {
    animation: resultFadeIn 0.35s ease-out forwards;
}

/* Markdown 内容样式 */
.result-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a3a5c;
    border-bottom: 2px solid rgba(200, 144, 42, 0.5);
    padding-bottom: 10px;
    margin: 4px 0 16px;
    font-family: "楷体", "KaiTi", serif;
    letter-spacing: 0.5px;
}

.result-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a3a5c;
    border-left: 4px solid #c8902a;
    padding-left: 8px;
    margin: 20px 0 10px;
    font-family: "楷体", "KaiTi", serif;
}

.result-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #2d5a8e;
    margin: 16px 0 8px;
    padding-left: 4px;
}

.result-content p {
    margin: 0 0 1.1em;
    line-height: 1.9;
}

.result-content p:last-child {
    margin-bottom: 0;
}

.result-content ul, .result-content ol {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.result-content ul li, .result-content ol li {
    margin-bottom: 6px;
    line-height: 1.75;
}

.result-content ul li::marker {
    color: #c8902a;
    font-weight: 600;
}

.result-content ol li::marker {
    color: #2d5a8e;
    font-weight: 600;
}

.result-content blockquote {
    margin: 14px 0;
    padding: 12px 18px;
    border-left: 4px solid #c8902a;
    background: linear-gradient(to right, rgba(200, 144, 42, 0.08) 0%, rgba(200, 144, 42, 0.02) 100%);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #2d4a6e;
    font-family: "楷体", "KaiTi", serif;
    font-size: 13.5px;
}

.result-content hr {
    border: none;
    border-top: 1px solid rgba(200, 144, 42, 0.3);
    margin: 18px 0;
}

.result-content code {
    background: rgba(45, 90, 142, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
    color: #1a3a5c;
    font-family: monospace;
}

.result-content strong {
    color: #1a3a5c;
    font-weight: 700;
}

/* 错误状态 */
.result-content.result-content--error {
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fafcff;
    animation: none;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    flex: 1;
    min-height: 200px;
}

.result-error-icon {
    font-size: 40px;
    margin-bottom: 16px;
    color: #f87171;
    line-height: 1;
}

.result-error-title {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 8px;
}

.result-error-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.error-retry-btn {
    margin-top: 18px;
    padding: 9px 24px;
    background: linear-gradient(135deg, #c8902a 0%, #1a3a5c 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(200, 144, 42, 0.35);
}

.error-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(200, 144, 42, 0.5);
}

/* ========== 示例模态框 ========== */
.hee-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.hee-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%;
    max-width: 760px;
    max-height: 82vh;
    background: #f0f4f8;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(26, 58, 92, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: heeModalIn 0.22s ease-out;
}

@keyframes heeModalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.hee-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.hee-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #c8902a;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a3a5c 0%, #2d5a8e 100%);
    color: #e8d5a8;
}

.hee-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #e8d5a8;
}

.hee-modal-close {
    background: rgba(232, 213, 168, 0.18);
    border: none;
    color: #e8d5a8;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hee-modal-close:hover {
    background: rgba(232, 213, 168, 0.32);
}

.hee-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-content: start;
    background: #f0f4f8;
}

.hee-modal-body::-webkit-scrollbar { width: 4px; }
.hee-modal-body::-webkit-scrollbar-track { background: transparent; }
.hee-modal-body:hover::-webkit-scrollbar-track { background: #d5e4f5; }
.hee-modal-body::-webkit-scrollbar-thumb { background: #a0b8d4; border-radius: 2px; }
.hee-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(45, 90, 142, 0.6); }

/* 示例卡片 */
.example-card {
    border: 1px solid #c5d5e8;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafcff;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #c8902a 0%, #1a3a5c 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #2d5a8e;
    background: #e8eef5;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(45, 90, 142, 0.18);
}

.example-card:hover::before {
    opacity: 1;
}

.example-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1a3a5c;
}

.example-card-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(200, 144, 42, 0.15);
    border: 1px solid rgba(200, 144, 42, 0.4);
    border-radius: 10px;
    color: #9e6a1a;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.example-card-desc {
    font-size: 12px;
    color: #5580a8;
    margin: 0 0 10px;
    line-height: 1.6;
}

.example-card-import {
    display: inline-block;
    padding: 5px 14px;
    background: linear-gradient(135deg, #2d5a8e 0%, #1a3a5c 100%);
    color: #e8d5a8;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: linear-gradient(135deg, #c8902a 0%, #9e6a1a 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 144, 42, 0.4);
}

/* ========== 暗黑模式 ========== */
body.dark .hee-container {
    background: #0d1a2a;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

body.dark .hee-toolbar {
    background: linear-gradient(135deg, #0d1a2a 0%, #162840 50%, #080f1a 100%);
    border-bottom-color: #9e6a1a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

body.dark .hee-toolbar .toolbar-title {
    color: #d4b87a;
}

body.dark .toolbar-btn {
    background: rgba(212, 184, 122, 0.08);
    border-color: rgba(158, 106, 26, 0.35);
    color: #c8a870;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(158, 106, 26, 0.2);
    border-color: #9e6a1a;
    color: #e8c880;
}

body.dark .toolbar-btn-primary {
    background: linear-gradient(135deg, #9e6a1a 0%, #7a5010 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(158, 106, 26, 0.5);
}

body.dark .toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #c8902a 0%, #9e6a1a 100%);
}

body.dark .hee-main-content {
    background: #0d1a2a;
}

body.dark .hee-history-panel {
    background: #0f1f30;
    border-right-color: #1e3a58;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #0f1f30 0%, #0a1520 100%);
    border-bottom-color: #1e3a58;
}

body.dark .history-panel-header h3 {
    color: #c8d8ec;
}

body.dark .history-limit-footer {
    color: #4a6a8a;
    border-top-color: #1e3a58;
    background: #0f1f30;
}

body.dark .history-search input {
    background: #162840;
    border-color: #1e3a58;
    color: #b0c8e0;
}

body.dark .history-search input:focus {
    border-color: #4a80c0;
    box-shadow: 0 0 0 2px rgba(74, 128, 192, 0.18);
}

body.dark .history-search input::placeholder {
    color: #4a6a8a;
}

body.dark .history-list::-webkit-scrollbar-track { background: #0a1520; }
body.dark .history-list::-webkit-scrollbar-thumb { background: #2a4a6a; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: rgba(74, 128, 192, 0.6); }

body.dark .history-item {
    background: #142030;
    border-color: #1e3a58;
}

body.dark .history-item:hover {
    background: #1a3050;
    border-color: #4a80c0;
}

body.dark .history-item.active {
    background: #1e3a5a;
    border-color: #4a80c0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 3px 0 0 #9e6a1a;
}

body.dark .history-item-name { color: #c8d8ec; }
body.dark .history-item-meta { color: #6a90b8; }
body.dark .history-item-time { color: #4a6a8a; }
body.dark .history-empty { color: #4a6a8a; }

body.dark .hee-input-panel {
    background: #111f30;
    border-right-color: #1e3a58;
}

body.dark .hee-result-panel {
    background: #111f30;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #0f1f30 0%, #0a1520 100%);
    border-bottom-color: #1e3a58;
}

body.dark .panel-header h3 { color: #c8d8ec; border-left-color: #9e6a1a; }
body.dark .panel-tip { color: #6a90b8; }

body.dark .result-event-tag {
    color: #c8d8ec;
    background: #162840;
    border-color: #1e3a58;
}

body.dark .result-time { color: #6a90b8; }

body.dark .result-regen-btn {
    background: rgba(158, 106, 26, 0.12);
    border-color: rgba(158, 106, 26, 0.4);
    color: #c8d8ec;
}

body.dark .result-regen-btn:hover {
    background: rgba(158, 106, 26, 0.25);
    border-color: #9e6a1a;
}

body.dark .hee-input-body::-webkit-scrollbar-track { background: #0a1520; }
body.dark .hee-input-body::-webkit-scrollbar-thumb { background: #2a4a6a; }
body.dark .hee-input-body::-webkit-scrollbar-thumb:hover { background: rgba(74, 128, 192, 0.6); }

body.dark .form-group label { color: #a8c4e0; }

body.dark .hee-input,
body.dark .hee-select {
    background: #162840;
    border-color: #1e3a58;
    color: #b0c8e0;
}

body.dark .hee-input:focus,
body.dark .hee-select:focus {
    border-color: #4a80c0;
    background: #1a3050;
    box-shadow: 0 0 0 3px rgba(74, 128, 192, 0.15);
}

body.dark .hee-input:hover:not(:focus),
body.dark .hee-select:hover:not(:focus) {
    border-color: #2a5080;
    background: #1a2e45;
}

/* 保留暗黑模式下 select 的 SVG 箭头（background 简写会清除 background-image）*/
body.dark .hee-select:focus,
body.dark .hee-select:hover:not(:focus) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a80c0'/%3E%3C/svg%3E");
}

body.dark .hee-input::placeholder { color: #3a5a7a; }

body.dark .hee-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a80c0'/%3E%3C/svg%3E");
    background-color: #162840;
}

body.dark .hee-input:disabled,
body.dark .hee-select:disabled {
    background: #0d1a2a !important;
    color: #3a5a7a !important;
    border-color: #1e3a58 !important;
}

body.dark .quick-tag {
    background: #162840;
    border-color: #1e3a58;
    color: #a8c4e0;
}

body.dark .quick-tag:hover {
    background: #1a3a5c;
    border-color: #4a80c0;
    color: #e8d5a8;
}

body.dark .quick-tag.selected {
    background: #0f2640;
    border-color: #2d5a8e;
    color: #e8d5a8;
}

body.dark .hee-char-count { color: #3a5a7a; }
body.dark .hee-char-count.warn { color: #f59e0b; }
body.dark .hee-char-count.over { color: #f87171; }

body.dark .result-word-count {
    color: #5a80a8;
    background: rgba(74, 128, 192, 0.08);
    border-color: rgba(74, 128, 192, 0.2);
}

body.dark .hee-mode-hint {
    background: rgba(74, 128, 192, 0.08);
    border-left-color: #9e6a1a;
    color: #6a90b8;
}

body.dark .hee-result-body {
    background: #111f30;
}

body.dark .hee-result-body::-webkit-scrollbar-track { background: #0a1520; }
body.dark .hee-result-body::-webkit-scrollbar-thumb { background: #2a4a6a; }
body.dark .hee-result-body::-webkit-scrollbar-thumb:hover { background: rgba(74, 128, 192, 0.6); }

body.dark .placeholder-title { color: #a8c4e0; }
body.dark .placeholder-desc { color: #6a90b8; }
body.dark .placeholder-quote {
    color: #a8c4e0;
    border-left-color: #9e6a1a;
    background: linear-gradient(135deg, rgba(158, 106, 26, 0.1) 0%, rgba(45, 90, 142, 0.06) 100%);
}

body.dark .loading-text { color: #6a90b8; }

body.dark .hee-loading-bar {
    background: linear-gradient(
        to right,
        rgba(74, 128, 192, 0.1) 0%,
        rgba(74, 128, 192, 0.7) 40%,
        rgba(158, 106, 26, 0.85) 60%,
        rgba(74, 128, 192, 0.1) 100%
    );
    background-size: 400px 4px;
}

body.dark .result-content {
    color: #b0c8e0;
    border-left-color: #9e6a1a;
    background: linear-gradient(to bottom, #111f30 0%, #0d1a2a 60%);
}

body.dark .result-content h1 {
    color: #c8d8ec;
    border-bottom-color: rgba(158, 106, 26, 0.5);
}

body.dark .result-content h2 {
    color: #c8d8ec;
    border-left-color: #9e6a1a;
}

body.dark .result-content h3 { color: #7aacdc; }
body.dark .result-content strong { color: #c8d8ec; }
body.dark .result-content code { background: rgba(74, 128, 192, 0.12); color: #a8c4e0; }

body.dark .result-content blockquote {
    background: linear-gradient(to right, rgba(158, 106, 26, 0.1) 0%, rgba(158, 106, 26, 0.03) 100%);
    border-left-color: #9e6a1a;
    color: #8ab0d0;
}

body.dark .result-content hr { border-top-color: rgba(158, 106, 26, 0.25); }

body.dark .result-content ul li::marker { color: #9e6a1a; font-weight: 600; }
body.dark .result-content ol li::marker { color: #4a80c0; font-weight: 600; }

body.dark .result-content.result-content--error { background: #111f30; }
body.dark .result-error-icon { color: #f87171; }
body.dark .result-error-title { color: #f87171; }
body.dark .result-error-hint { color: #5a7a9a; }
body.dark .error-retry-btn {
    background: linear-gradient(135deg, #9e6a1a 0%, #0f2640 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
body.dark .error-retry-btn:hover {
    box-shadow: 0 4px 14px rgba(158, 106, 26, 0.45);
}
body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}
body.dark .history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.22);
}
body.dark .history-count { color: #4a80c0; }
body.dark .label-tip { color: #4a6a8a; }
body.dark .hee-hint-text { color: #3a5a7a; }

body.dark .hee-modal-overlay { background: rgba(0, 0, 0, 0.7); }

body.dark .hee-modal {
    background: #0f1f30;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

body.dark .hee-modal-header {
    background: linear-gradient(135deg, #080f1a 0%, #0f1f30 100%);
    border-bottom-color: #9e6a1a;
}

body.dark .hee-modal-body {
    background: #0f1f30;
}

body.dark .hee-modal-body::-webkit-scrollbar-track { background: #0a1520; }
body.dark .hee-modal-body::-webkit-scrollbar-thumb { background: #2a4a6a; }
body.dark .hee-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(74, 128, 192, 0.6); }

body.dark .example-card {
    background: #142030;
    border-color: #1e3a58;
}

body.dark .example-card:hover {
    background: #1a3050;
    border-color: #4a80c0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

body.dark .example-card-title { color: #c8d8ec; }
body.dark .example-card-badge {
    background: rgba(158, 106, 26, 0.18);
    border-color: rgba(158, 106, 26, 0.4);
    color: #c8902a;
}

body.dark .example-card-desc { color: #6a90b8; }

body.dark .example-card-import {
    background: linear-gradient(135deg, #1e3a5c 0%, #0f2030 100%);
    color: #c8d8ec;
}

body.dark .example-card-import:hover {
    background: linear-gradient(135deg, #9e6a1a 0%, #7a5010 100%);
    color: #fff;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .hee-history-panel {
        display: none;
    }
    .hee-input-panel {
        width: 280px;
    }
}

@media (max-width: 640px) {
    .hee-main-content {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .hee-history-panel {
        display: none;
    }
    .hee-input-panel {
        width: 100%;
        max-height: 380px;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid #c5d5e8;
    }
    .hee-result-panel {
        min-width: unset;
        min-height: 400px;
    }
    .result-content {
        padding: 16px 18px;
    }
    .hee-toolbar {
        padding: 6px 8px;
    }
    .toolbar-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    .hee-modal {
        width: 96%;
    }
    .hee-modal-body {
        grid-template-columns: 1fr;
    }
    .result-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
    .result-word-count,
    .result-time {
        display: none;
    }
}

@media (max-width: 640px) {
    body.dark .hee-input-panel {
        border-bottom-color: #1e3a58;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .hee-toolbar,
    .hee-history-panel,
    .hee-input-panel,
    .hee-modal-overlay,
    .hee-modal {
        display: none !important;
    }
    #resultPlaceholder,
    #resultLoading {
        display: none !important;
    }
    .hee-container {
        position: static !important;
        height: auto !important;
        box-shadow: none;
    }
    .hee-main-content {
        display: block;
    }
    .hee-result-panel {
        width: 100%;
    }
    .hee-result-body,
    .hee-result-panel {
        overflow: visible;
    }
    .result-content {
        border-left: 2px solid #c8902a;
        padding: 12px 16px;
    }
}
