/* =============================================
   历史人物介绍 - historical_figure_introduction.css
   古典卷轴羊皮纸配色主题，三栏布局
   参考 self_encouragement / legal_assistant 风格
   ============================================= */

/* ========== 主容器 ========== */
.hfi-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf6e3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(139, 69, 19, 0.15);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.hfi-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;
}

/* ========== 顶部工具栏 ========== */
.hfi-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 45%, #6B3410 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.4);
    flex-shrink: 0;
    border-bottom: 2px solid #D4A853;
}

.hfi-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #F5DEB3;
    letter-spacing: 0.5px;
    margin-right: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(245, 222, 179, 0.9);
    border: 1px solid rgba(212, 168, 83, 0.5);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #5a2d0c;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #F5DEB3;
    border-color: #D4A853;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.2);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 主操作按钮 */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #D4A853 0%, #B8860B 100%);
    color: #fff !important;
    border: none;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.45);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #E8BE70 0%, #C89A1E 100%);
    box-shadow: 0 4px 14px rgba(212, 168, 83, 0.55);
}

/* ========== 表单校验抖动 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.hfi-input.shake,
.hfi-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;
}

/* ========== 主内容区：三栏 ========== */
.hfi-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf6e3;
}

/* ========== 左栏：历史记录 ========== */
.hfi-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fdf0d5;
    border-right: 1px solid #e8d4a0;
    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, #fdf6e3 0%, #f5e8c0 100%);
    border-bottom: 1px solid #e8d4a0;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5a2d0c;
    border: none;
    padding: 0;
    background: none;
}

.history-count {
    font-size: 11px;
    color: #B8860B;
    font-weight: 400;
}

.history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #c9a55a;
    border-top: 1px solid #e8d4a0;
    background: #fdf6e3;
    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 #e8d4a0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e8d4a0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #fffbf0;
}

.history-search input:focus {
    border-color: #D4A853;
    box-shadow: 0 0 0 2px rgba(212, 168, 83, 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: #f5e8c0; }
.history-list::-webkit-scrollbar-thumb { background: #d1c0a0; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.65); }

/* 历史列表加载禁用态 */
.history-list.hfi-list-loading {
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.history-empty {
    text-align: center;
    color: #B8860B;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    opacity: 0.7;
}

@keyframes hiFadeIn {
    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: #fffbf0;
    border: 1px solid #e8d4a0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: hiFadeIn 0.2s ease;
}

.history-item:hover {
    background: #fdf0d5;
    border-color: #D4A853;
    transform: translateX(2px);
}

.history-item.active {
    background: #faeece;
    border-color: #D4A853;
    box-shadow: 0 1px 4px rgba(212, 168, 83, 0.35);
}

.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: #5a2d0c;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 11px;
    color: #B8860B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #c9a55a;
}

/* ========== 中栏：表单输入 ========== */
.hfi-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #fffef8;
    border-right: 1px solid #e8d4a0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果展示 ========== */
.hfi-result-panel {
    flex: 1;
    background: #fffef8;
    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, #fdf6e3 0%, #f5e8c0 100%);
    border-bottom: 1px solid #e8d4a0;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #5a2d0c;
    white-space: nowrap;
    border-left: 4px solid #D4A853;
    padding-left: 8px;
}

.panel-tip {
    font-size: 11px;
    color: #B8860B;
    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-figure-tag {
    font-size: 11px;
    color: #5a2d0c;
    background: #fdf0d5;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    border: 1px solid #e8d4a0;
}

.result-time {
    font-size: 11px;
    color: #B8860B;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-regen-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    background: rgba(212, 168, 83, 0.12);
    border: 1px solid rgba(212, 168, 83, 0.4);
    border-radius: 4px;
    color: #5a2d0c;
    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(212, 168, 83, 0.25);
    border-color: #D4A853;
    transform: translateY(-1px);
}

/* ========== 输入区 ========== */
.hfi-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.hfi-input-body::-webkit-scrollbar { width: 4px; }
.hfi-input-body::-webkit-scrollbar-track { background: transparent; }
.hfi-input-body:hover::-webkit-scrollbar-track { background: #f5e8c0; }
.hfi-input-body::-webkit-scrollbar-thumb { background: #d1c0a0; border-radius: 2px; }
.hfi-input-body::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.65); }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5a2d0c;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

.hfi-input,
.hfi-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8d4a0;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fffbf0;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.hfi-input:focus,
.hfi-select:focus {
    border-color: #D4A853;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.hfi-input:hover:not(:focus),
.hfi-select:hover:not(:focus) {
    border-color: #c9a55a;
    background: #fff;
}

.hfi-input::placeholder {
    color: #c9a55a;
    font-style: italic;
}

.hfi-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='%23B8860B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: #fffbf0;
    padding-right: 28px;
}

/* 禁用态 */
.hfi-input:disabled,
.hfi-select:disabled {
    background: #f5f0e8 !important;
    color: #b0a080 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #e8d4a0 !important;
    box-shadow: none !important;
}

/* ========== 快捷人物标签 ========== */
.quick-figure-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.quick-tag {
    padding: 4px 10px;
    background: #fdf0d5;
    border: 1px solid #e8d4a0;
    border-radius: 12px;
    font-size: 11px;
    color: #5a2d0c;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-tag:hover {
    background: #D4A853;
    border-color: #B8860B;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(212, 168, 83, 0.35);
}

.quick-tag.selected {
    background: #B8860B;
    border-color: #8B6508;
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 101, 8, 0.4);
    font-weight: 700;
}

/* 工具栏右对齐组 */
.toolbar-group--right {
    margin-left: auto;
}

.hfi-generate-hint {
    margin-top: 8px;
    text-align: right;
}

.hfi-hint-text {
    font-size: 11px;
    color: #c9a55a;
    user-select: none;
    font-style: italic;
}

/* ========== 结果区域 ========== */
.hfi-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fffef8;
}

.hfi-result-body::-webkit-scrollbar { width: 5px; }
.hfi-result-body::-webkit-scrollbar-track { background: transparent; }
.hfi-result-body:hover::-webkit-scrollbar-track { background: #fdf6e3; }
.hfi-result-body::-webkit-scrollbar-thumb { background: #d1c0a0; border-radius: 3px; }
.hfi-result-body::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.65); }

/* 占位提示 */
.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 tdhFloat {
    0%, 100% { transform: translateY(0);    opacity: 0.85; }
    50%       { transform: translateY(-8px); opacity: 1;    }
}

.placeholder-icon {
    font-size: 58px;
    margin-bottom: 18px;
    animation: tdhFloat 3s ease-in-out infinite;
}

.placeholder-title {
    font-size: 17px;
    font-weight: 700;
    color: #5a2d0c;
    margin: 0 0 10px;
}

.placeholder-desc {
    font-size: 13px;
    color: #B8860B;
    margin: 4px 0;
    line-height: 1.65;
}

.placeholder-quote {
    margin-top: 26px;
    font-size: 14px;
    font-style: italic;
    color: #8B4513;
    padding: 12px 22px;
    border-left: 3px solid #D4A853;
    text-align: left;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1) 0%, rgba(139, 69, 19, 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; }
}

.fa-loading-bar {
    width: 220px;
    height: 4px;
    border-radius: 2px;
    margin: 0 auto 18px;
    background: linear-gradient(
        to right,
        rgba(212, 168, 83, 0.2) 0%,
        rgba(212, 168, 83, 0.8) 40%,
        rgba(139, 69, 19, 0.9) 60%,
        rgba(212, 168, 83, 0.2) 100%
    );
    background-size: 400px 4px;
    animation: shimmer 1.4s linear infinite;
}

.loading-text {
    font-size: 13px;
    color: #B8860B;
    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: #374151;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: 4px solid #D4A853;
    background: linear-gradient(to bottom, #fffdf5 0%, #fff 60%);
}

/* 结果淡入动画（JS 通过 offsetWidth 强制重播） */
.result-content.hfi-result-enter {
    animation: resultFadeIn 0.35s ease-out forwards;
}

/* Markdown 内容样式 */
.result-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: #5a2d0c;
    border-bottom: 2px solid rgba(212, 168, 83, 0.55);
    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: #5a2d0c;
    border-left: 4px solid #D4A853;
    padding-left: 8px;
    margin: 20px 0 10px;
    font-family: "楷体", "KaiTi", serif;
}

.result-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #8B4513;
    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: #D4A853;
}

.result-content ol li::marker {
    color: #8B4513;
    font-weight: 600;
}

.result-content blockquote {
    margin: 14px 0;
    padding: 12px 18px;
    border-left: 4px solid #D4A853;
    background: linear-gradient(to right, rgba(212, 168, 83, 0.1) 0%, rgba(212, 168, 83, 0.03) 100%);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #6b4c2a;
    font-family: "楷体", "KaiTi", serif;
    font-size: 13.5px;
}

.result-content hr {
    border: none;
    border-top: 1px solid rgba(212, 168, 83, 0.35);
    margin: 18px 0;
}

.result-content code {
    background: rgba(212, 168, 83, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
    color: #8B4513;
    font-family: monospace;
}

.result-content strong {
    color: #5a2d0c;
    font-weight: 700;
}

/* 错误状态 */
.result-content.result-content--error {
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fffef8;
    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;
}

.hfi-retry-btn {
    margin-top: 18px;
    padding: 9px 24px;
    background: linear-gradient(135deg, #D4A853 0%, #8B4513 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(212, 168, 83, 0.35);
}

.hfi-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 168, 83, 0.5);
}

/* ========== 示例模态框 ========== */
.hfi-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.hfi-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%;
    max-width: 760px;
    max-height: 82vh;
    background: #fdf6e3;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(139, 69, 19, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: hfiModalIn 0.22s ease-out;
}

@keyframes hfiModalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.hfi-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.hfi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #D4A853;
    flex-shrink: 0;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #F5DEB3;
}

.hfi-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: "楷体", "KaiTi", serif;
    color: #F5DEB3;
}

.hfi-modal-close {
    background: rgba(245, 222, 179, 0.2);
    border: none;
    color: #F5DEB3;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hfi-modal-close:hover {
    background: rgba(245, 222, 179, 0.35);
}

.hfi-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: #fdf6e3;
}

.hfi-modal-body::-webkit-scrollbar { width: 4px; }
.hfi-modal-body::-webkit-scrollbar-track { background: transparent; }
.hfi-modal-body:hover::-webkit-scrollbar-track { background: #f5e8c0; }
.hfi-modal-body::-webkit-scrollbar-thumb { background: #d1c0a0; border-radius: 2px; }
.hfi-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.65); }

/* 示例卡片 */
.example-card {
    border: 1px solid #e8d4a0;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffbf0;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #D4A853 0%, #8B4513 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.example-card:hover {
    border-color: #D4A853;
    background: #fdf0d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(212, 168, 83, 0.22);
}

.example-card:hover::before {
    opacity: 1;
}

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #5a2d0c;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.example-card-badge {
    font-size: 10px;
    font-weight: 500;
    background: #fdf0d5;
    color: #8B4513;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid #e8d4a0;
    white-space: nowrap;
}

.example-card-desc {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.example-card-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #5a2d0c;
    background: #fdf0d5;
    border: 1px solid #e8d4a0;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: #D4A853;
    border-color: #B8860B;
    color: #fff;
}

/* ========== 响应式布局 ========== */
@media (min-width: 900px) {
    .hfi-history-panel { display: flex; }
    .hfi-input-panel { display: flex; }
}

@media (max-width: 899px) and (min-width: 640px) {
    .hfi-history-panel { display: none; }
    .hfi-input-panel { width: 280px; }
}

@media (max-width: 639px) {
    .hfi-main-content { flex-direction: column; overflow-y: auto; }
    .hfi-history-panel { width: 100%; max-height: 150px; border-right: none; border-bottom: 1px solid #e8d4a0; }
    .hfi-input-panel { width: 100%; border-right: none; border-bottom: 1px solid #e8d4a0; max-height: 380px; }
    .hfi-result-panel { width: 100%; min-height: 300px; }
    .hfi-modal-body { grid-template-columns: 1fr; }
}

/* ========== 打印样式 ========== */
@media print {
    .hfi-toolbar,
    .hfi-history-panel,
    .hfi-input-panel,
    #resultPlaceholder,
    #resultLoading { display: none !important; }
    .hfi-container,
    .hfi-container.fullscreen { position: static !important; height: auto; box-shadow: none; }
    .hfi-main-content { display: block; }
    .hfi-result-panel { width: 100%; }
    .hfi-result-body { overflow: visible; }
    .result-content { padding: 0; border-left: none; }
}

/* ========== 暗黑模式（body.dark） ========== */
body.dark .hfi-container {
    background: #1a1510;
}

body.dark .hfi-main-content {
    background: #1a1510;
}

body.dark .hfi-history-panel {
    background: #221c14;
    border-color: rgba(212, 168, 83, 0.12);
}

body.dark .hfi-input-panel,
body.dark .hfi-result-panel {
    background: #1e1a12;
    border-color: rgba(212, 168, 83, 0.12);
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #2a2218 0%, #221c14 100%);
    border-color: rgba(212, 168, 83, 0.1);
}

body.dark .history-panel-header h3 {
    color: #D4A853;
}

body.dark .history-limit-footer {
    background: #1a1510;
    border-color: rgba(212, 168, 83, 0.1);
    color: #7a5c2a;
}

body.dark .history-search input {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.2);
    color: #d4c4a0;
}

body.dark .history-search input:focus {
    border-color: #D4A853;
}

body.dark .history-search input::placeholder {
    color: #7a5c2a;
}

body.dark .history-list:hover::-webkit-scrollbar-track {
    background: #2a2218;
}

body.dark .history-item {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.15);
}

body.dark .history-item:hover {
    background: #332a1a;
    border-color: rgba(212, 168, 83, 0.4);
}

body.dark .history-item.active {
    background: #3a3020;
    border-color: #D4A853;
}

body.dark .history-item-name {
    color: #e8c980;
}

body.dark .history-item-meta {
    color: #9a7c40;
}

body.dark .history-item-time {
    color: #7a6030;
}

body.dark .history-empty {
    color: #7a5c2a;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #2a2218 0%, #221c14 100%);
    border-color: rgba(212, 168, 83, 0.12);
}

body.dark .panel-header h3 {
    color: #e8c980;
    border-left-color: #D4A853;
}

body.dark .panel-tip {
    color: #9a7c40;
}

body.dark .hfi-input-body:hover::-webkit-scrollbar-track {
    background: #2a2218;
}

body.dark .form-group label {
    color: #e8c980;
}

body.dark .label-tip {
    color: #7a6030;
}

body.dark .hfi-input,
body.dark .hfi-select {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.2);
    color: #d4c4a0;
}

body.dark .hfi-input:focus,
body.dark .hfi-select:focus {
    border-color: #D4A853;
    background: #332a1a;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.12);
}

body.dark .hfi-input:hover:not(:focus),
body.dark .hfi-select:hover:not(:focus) {
    border-color: rgba(212, 168, 83, 0.4);
    background: #2e2518;
}

body.dark .hfi-input::placeholder {
    color: #7a5c2a;
}

body.dark .hfi-select {
    background-color: #2a2218;
    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='%23D4A853'/%3E%3C/svg%3E");
}

body.dark .hfi-select option {
    background: #2a2218;
    color: #d4c4a0;
}

body.dark .hfi-input:disabled,
body.dark .hfi-select:disabled {
    background: #221c14 !important;
    color: #6a5030 !important;
    border-color: rgba(212, 168, 83, 0.1) !important;
}

body.dark .quick-tag {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.2);
    color: #d4c4a0;
}

body.dark .quick-tag:hover {
    background: #D4A853;
    border-color: #B8860B;
    color: #1a1510;
}

body.dark .quick-tag.selected {
    background: #B8860B;
    border-color: #8B6508;
    color: #fff8e0;
    box-shadow: 0 2px 8px rgba(139, 101, 8, 0.5);
}

body.dark .hfi-hint-text {
    color: #7a5c2a;
}

body.dark .hfi-result-body {
    background: #1e1a12;
}

body.dark .hfi-result-body:hover::-webkit-scrollbar-track {
    background: #2a2218;
}

body.dark .result-placeholder {
    background: #1e1a12;
}

body.dark .placeholder-title {
    color: #e8c980;
}

body.dark .placeholder-desc {
    color: #9a7c40;
}

body.dark .placeholder-quote {
    color: #c9a55a;
    border-left-color: #D4A853;
    background: rgba(212, 168, 83, 0.06);
}

body.dark .result-loading {
    background: #1e1a12;
}

body.dark .loading-text {
    color: #9a7c40;
}

body.dark .result-content {
    color: #d4c4a0;
    background: linear-gradient(to bottom, #201c12 0%, #1e1a12 60%);
    border-left-color: #D4A853;
}

body.dark .result-content h1 {
    color: #e8c980;
    border-bottom-color: rgba(212, 168, 83, 0.4);
}

body.dark .result-content h2 {
    color: #e8c980;
    border-left-color: #D4A853;
}

body.dark .result-content h3 {
    color: #c9a55a;
}

body.dark .result-content ul li::marker {
    color: #D4A853;
}

body.dark .result-content ol li::marker {
    color: #c9a55a;
}

body.dark .result-content blockquote {
    border-left-color: #D4A853;
    background: rgba(212, 168, 83, 0.07);
    color: #c9a55a;
}

body.dark .result-content hr {
    border-top-color: rgba(212, 168, 83, 0.2);
}

body.dark .result-content code {
    background: rgba(212, 168, 83, 0.1);
    color: #e8c980;
}

body.dark .result-content strong {
    color: #e8c980;
}

body.dark .result-figure-tag {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.2);
    color: #d4c4a0;
}

body.dark .result-time {
    color: #9a7c40;
}

body.dark .result-regen-btn {
    background: rgba(212, 168, 83, 0.08);
    border-color: rgba(212, 168, 83, 0.25);
    color: #d4c4a0;
}

body.dark .result-regen-btn:hover {
    background: rgba(212, 168, 83, 0.18);
    border-color: #D4A853;
}

/* 暗黑模式 - 示例模态框 */
body.dark .hfi-modal {
    background: #221c14;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

body.dark .hfi-modal-body {
    background: #221c14;
}

body.dark .hfi-modal-body:hover::-webkit-scrollbar-track {
    background: #2a2218;
}

body.dark .example-card {
    background: #2a2218;
    border-color: rgba(212, 168, 83, 0.15);
}

body.dark .example-card:hover {
    background: #332a1a;
    border-color: rgba(212, 168, 83, 0.4);
}

body.dark .example-card-title {
    color: #e8c980;
}

body.dark .example-card-badge {
    background: #332a1a;
    border-color: rgba(212, 168, 83, 0.2);
    color: #c9a55a;
}

body.dark .example-card-desc {
    color: #9a7c40;
}

body.dark .example-card-import {
    background: #332a1a;
    border-color: rgba(212, 168, 83, 0.2);
    color: #d4c4a0;
}

body.dark .example-card-import:hover {
    background: #D4A853;
    border-color: #B8860B;
    color: #1a1510;
}

/* 暗黑模式 - 错误区域覆盖 */
body.dark .result-content.result-content--error {
    background: #1e1a12;
}

body.dark .result-error-block {
    background: #1e1a12;
}

body.dark .result-error-icon {
    color: #f87171;
}

body.dark .result-error-title {
    color: #f87171;
}

body.dark .result-error-hint {
    color: #7a6030;
}

body.dark .hfi-retry-btn {
    background: linear-gradient(135deg, #B8860B 0%, #6B3410 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .hfi-retry-btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
