/* ========== 幽默搞笑段子 - 容器 ========== */
.hj-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fffbeb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.12);
    transition: all 0.3s ease;
}

.hj-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.hj-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #b45309 0%, #d97706 45%, #f59e0b 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(180, 83, 9, 0.4);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* 全屏按钮组右对齐规范 */
.toolbar-group--right {
    margin-left: auto;
}

.hj-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.hj-toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.hj-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.hj-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hj-toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hj-toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #b45309;
    border-color: transparent;
    font-weight: 600;
}

.hj-toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #92400e;
}

.hj-toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.5);
}

.hj-toolbar-btn-cancel:hover {
    background: rgba(239, 68, 68, 1);
}

/* ========== 主内容区 ========== */
.hj-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fffbeb;
}

/* ========== 左栏：历史记录 ========== */
.hj-history-panel {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.hj-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.hj-history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.hj-history-count {
    font-size: 11px;
    color: #d97706;
    margin-left: 4px;
    font-weight: 400;
}

.hj-history-clear-btn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #ea580c;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.hj-history-clear-btn:hover {
    background: #ffedd5;
    border-color: #ea580c;
}

.hj-history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.hj-history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffbeb;
    color: #374151;
}

.hj-history-search input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.hj-history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.hj-history-empty {
    text-align: center;
    color: #d97706;
    font-size: 12px;
    padding: 24px 12px;
    line-height: 1.8;
}

.hj-history-item {
    padding: 9px 10px;
    margin: 3px 0;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: hjFadeIn 0.2s ease;
}

@keyframes hjFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hj-history-item:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    transform: translateX(2px);
}

.hj-history-item.active {
    background: #fef9c3;
    border-color: #f59e0b;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.hj-history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fff7ed;
    color: #ea580c;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.hj-history-item:hover .hj-history-item-del {
    opacity: 1;
}

.hj-history-item-del:hover {
    background: #ea580c;
    color: white;
}

.hj-history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
    padding-right: 18px;
}

.hj-history-item-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.hj-history-item-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.hj-history-item-time {
    font-size: 10px;
    color: #d97706;
    margin-top: 2px;
}

/* ========== 中栏：输入设置 ========== */
.hj-input-panel {
    width: 340px;
    min-width: 280px;
    background: #ffffff;
    border-right: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.hj-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}

.hj-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.hj-panel-tip {
    font-size: 11px;
    color: #d97706;
}

.hj-input-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.hj-form-group {
    margin-bottom: 16px;
}

.hj-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.hj-form-half {
    flex: 1;
    margin-bottom: 0;
}

.hj-form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 7px;
}

.hj-form-icon {
    font-size: 14px;
}

.hj-form-required {
    color: #ef4444;
    font-size: 13px;
}

.hj-form-optional {
    color: #d97706;
    font-size: 11px;
    font-weight: 400;
}

.hj-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #fcd34d;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffbeb;
    color: #374151;
    min-height: 68px;
}

.hj-textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    background: #fff;
}

.hj-textarea::placeholder {
    color: #fbbf24;
    font-size: 12px;
}

.hj-char-counter {
    text-align: right;
    font-size: 11px;
    color: #d97706;
    margin-top: 3px;
}

.hj-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #fcd34d;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    background: #fffbeb;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f59e0b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.hj-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* 小提示框 */
.hj-tips-box {
    background: linear-gradient(135deg, #fffbeb, #fef9c3);
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #92400e;
    margin-top: 4px;
}

.hj-tips-box p {
    margin: 0 0 8px;
    font-weight: 600;
    color: #78350f;
}

.hj-tips-box ul {
    margin: 0;
    padding-left: 16px;
    line-height: 1.9;
}

.hj-tips-box kbd {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    color: #92400e;
    font-family: inherit;
}

/* ========== 右栏：结果展示 ========== */
.hj-result-panel {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hj-result-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
    gap: 8px;
}

.hj-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin-right: auto;
}

.hj-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.hj-result-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.hj-badge-type {
    background: #fef3c7;
    color: #92400e;
}

.hj-badge-count {
    background: #fff7ed;
    color: #c2410c;
}

.hj-result-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 占位提示 - 规范：flex:1 + min-height */
.hj-result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #d97706;
}

.hj-placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: hjFloat 2.5s ease-in-out infinite;
}

@keyframes hjFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%       { transform: translateY(-10px) rotate(3deg); }
}

.hj-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #b45309;
    margin: 0 0 10px;
}

.hj-placeholder-desc {
    font-size: 13px;
    color: #d97706;
    margin: 3px 0;
}

/* 加载动画 - 规范：flex:1 + min-height */
.hj-result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hj-laugh-wave {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 18px;
}

.hj-laugh-wave span {
    font-size: 28px;
    animation: hjWave 1.4s ease-in-out infinite;
    display: inline-block;
}

.hj-laugh-wave span:nth-child(1) { animation-delay: 0s; }
.hj-laugh-wave span:nth-child(2) { animation-delay: 0.18s; }
.hj-laugh-wave span:nth-child(3) { animation-delay: 0.36s; }
.hj-laugh-wave span:nth-child(4) { animation-delay: 0.54s; }
.hj-laugh-wave span:nth-child(5) { animation-delay: 0.72s; }

@keyframes hjWave {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-10px) scale(1.2); }
}

.hj-loading-text {
    font-size: 14px;
    color: #b45309;
    font-weight: 500;
    margin: 0;
}

/* 结果内容 */
.hj-result-content {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    animation: hjResultFadeIn 0.35s ease;
}

@keyframes hjResultFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Markdown标签基础样式规范 */
.hj-result-content h1 { font-size: 20px; font-weight: 800; color: #78350f; margin: 16px 0 12px; border-bottom: 2px solid #fcd34d; padding-bottom: 8px; line-height: 1.4; }
.hj-result-content h2 { font-size: 17px; font-weight: 700; color: #78350f; margin: 14px 0 10px; border-bottom: 1.5px solid #fde68a; padding-bottom: 6px; line-height: 1.4; }
.hj-result-content strong { font-weight: 700; color: #92400e; }
.hj-result-content em { font-style: italic; color: #b45309; }
.hj-result-content h3 { font-size: 16px; color: #78350f; margin: 12px 0 8px; }
.hj-result-content h4 { font-size: 14px; color: #92400e; margin: 10px 0 6px; }
.hj-result-content h5 { font-size: 13px; color: #b45309; margin: 8px 0 5px; }
.hj-result-content pre { background: #fef3c7; padding: 10px; border-radius: 6px; overflow-x: auto; }
.hj-result-content code { background: #fef3c7; padding: 1px 5px; border-radius: 3px; font-size: 12px; color: #92400e; }
.hj-result-content blockquote { border-left: 3px solid #f59e0b; padding: 8px 14px; margin: 8px 0; background: #fffbeb; color: #92400e; }

/* AI返回的段子卡片样式 */
.hj-result-content .jokes-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 680px;
    margin: 0 auto;
}

.hj-result-content .joke-item {
    background: linear-gradient(135deg, #fffbeb, #fef9c3);
    border: 1.5px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    transition: all 0.25s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.hj-result-content .joke-item:hover {
    border-color: #f59e0b;
    border-left-color: #d97706;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.hj-result-content .joke-number {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    line-height: 1;
}

.hj-result-content .joke-body {
    flex: 1;
    min-width: 0;
    padding-right: 68px;
}

.hj-result-content .joke-text {
    font-size: 15px;
    line-height: 1.8;
    color: #1f2937;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.hj-result-content .joke-punchline {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 6px;
    line-height: 1.6;
}

.hj-result-content .joke-tag {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 10px;
    padding: 2px 8px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #fde68a;
}

/* 错误提示 - 规范：flex:1 + min-height */
.hj-result-error {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #dc2626;
    font-size: 14px;
    gap: 10px;
}

.hj-result-error::before {
    content: '😢';
    font-size: 40px;
}

.hj-result-error-retry {
    margin-top: 6px;
    padding: 8px 22px;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.hj-result-error-retry:hover {
    background: linear-gradient(135deg, #92400e, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

/* 换一批按钮 */
.hj-result-regen-btn {
    margin-top: 12px;
    padding: 9px 24px;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.2);
}

.hj-result-regen-btn:hover {
    background: linear-gradient(135deg, #92400e, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35);
}

/* 暗黑模式下换一批按钮 */
body.dark .hj-result-regen-btn {
    background: linear-gradient(135deg, #92400e, #b45309);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .hj-result-regen-btn:hover {
    background: linear-gradient(135deg, #78350f, #92400e);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ========== 示例模态框 ========== */
.hj-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(120, 53, 15, 0.3);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(2px);
}

.hj-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.hj-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #fff;
    border-radius: 12px;
    z-index: 100002;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(120, 53, 15, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hj-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.hj-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    flex-shrink: 0;
}

.hj-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.hj-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hj-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.hj-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fffbeb;
}

.hj-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.hj-example-card {
    padding: 14px 16px;
    background: #ffffff;
    border: 1.5px solid #fde68a;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

.hj-example-card:hover {
    border-color: #f59e0b;
    background: #fef9c3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}

.hj-example-card-label {
    font-size: 15px;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 6px;
}

.hj-example-card-desc {
    font-size: 12px;
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

.hj-example-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.hj-example-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 500;
}

.hj-tag-type {
    background: #fef3c7;
    color: #92400e;
}

.hj-tag-style {
    background: #fff7ed;
    color: #c2410c;
}

/* 模态框加载中占位 */
.hj-example-loading {
    text-align: center;
    padding: 32px;
    color: #d97706;
    font-size: 13px;
}

/* 模态框无数据占位 */
.hj-example-empty {
    text-align: center;
    color: #d97706;
    padding: 20px;
    font-size: 13px;
}

/* shake 校验动画 - 规范：@keyframes必须在CSS中定义 */
@keyframes hjShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.hj-textarea.shake {
    animation: hjShake 0.4s ease;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ========== 自定义滚动条 ========== */
.hj-history-list::-webkit-scrollbar,
.hj-input-body::-webkit-scrollbar,
.hj-result-content::-webkit-scrollbar,
.hj-modal-body::-webkit-scrollbar {
    width: 4px;
}

.hj-history-list::-webkit-scrollbar-track,
.hj-input-body::-webkit-scrollbar-track,
.hj-result-content::-webkit-scrollbar-track,
.hj-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.hj-history-list::-webkit-scrollbar-thumb,
.hj-input-body::-webkit-scrollbar-thumb,
.hj-result-content::-webkit-scrollbar-thumb,
.hj-modal-body::-webkit-scrollbar-thumb {
    background: #8a2be2;
    border-radius: 4px;
}

.hj-history-list::-webkit-scrollbar-thumb:hover,
.hj-input-body::-webkit-scrollbar-thumb:hover,
.hj-result-content::-webkit-scrollbar-thumb:hover,
.hj-modal-body::-webkit-scrollbar-thumb:hover {
    background: #6a1db5;
}

/* ========== 响应式布局 ========== */
@media (min-width: 640px) and (max-width: 899px) {
    .hj-history-panel { display: none; }
    .hj-input-panel { width: 300px; }
}

@media (max-width: 639px) {
    .hj-main-content { flex-direction: column; }
    .hj-history-panel { display: none; }
    .hj-input-panel { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid #fde68a; max-height: 55%; }
    .hj-result-panel { min-width: unset; }
    .hj-form-row { flex-direction: column; gap: 8px; }
}

/* ========== 暗黑模式 ========== */
body.dark .hj-container {
    background: #1c1505;
}

body.dark .hj-toolbar {
    background: linear-gradient(135deg, #78350f 0%, #92400e 50%, #b45309 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .hj-main-content {
    background: #1c1505;
}

body.dark .hj-history-panel,
body.dark .hj-input-panel,
body.dark .hj-result-panel {
    background: #120e01;
    border-color: #3d2a00;
}

body.dark .hj-history-header,
body.dark .hj-panel-header,
body.dark .hj-result-header {
    background: linear-gradient(to bottom, #1e1603, #170f00);
    border-color: #3d2a00;
}

body.dark .hj-history-header h3,
body.dark .hj-panel-header h3,
body.dark .hj-result-header h3 {
    color: #fbbf24;
}

body.dark .hj-panel-tip {
    color: #d97706;
}

body.dark .hj-history-search input {
    background: #1c1505;
    border-color: #78350f;
    color: #e5e7eb;
}

body.dark .hj-history-search input::placeholder {
    color: #92400e;
}

body.dark .hj-history-list {
    background: #120e01;
}

body.dark .hj-history-empty {
    color: #92400e;
}

body.dark .hj-history-item {
    background: #1e1603;
    border-color: #3d2a00;
}

body.dark .hj-history-item:hover {
    background: #2d1e00;
    border-color: #b45309;
}

body.dark .hj-history-item.active {
    background: #2d1e00;
    border-color: #d97706;
}

body.dark .hj-history-item-title {
    color: #fde68a;
}

body.dark .hj-history-item-badge {
    background: #2d1e00;
    color: #fbbf24;
}

body.dark .hj-history-item-time {
    color: #b45309;
}

body.dark .hj-history-clear-btn {
    background: #1e1603;
    border-color: #78350f;
    color: #fb923c;
}

body.dark .hj-history-clear-btn:hover {
    background: #2d1e00;
}

body.dark .hj-input-body {
    background: #120e01;
}

body.dark .hj-form-label {
    color: #fde68a;
}

body.dark .hj-textarea {
    background: #1e1603;
    border-color: #78350f;
    color: #e5e7eb;
}

body.dark .hj-textarea:focus {
    border-color: #d97706;
    background: #1e1603;
}

body.dark .hj-textarea::placeholder {
    color: #92400e;
}

body.dark .hj-select {
    background-color: #1e1603;
    border-color: #78350f;
    color: #e5e7eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fbbf24' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

body.dark .hj-select option {
    background: #1e1603;
}

body.dark .hj-tips-box {
    background: linear-gradient(135deg, #1e1603, #170f00);
    border-color: #3d2a00;
    color: #d97706;
}

body.dark .hj-tips-box p {
    color: #fbbf24;
}

body.dark .hj-tips-box kbd {
    background: #2d1e00;
    border-color: #78350f;
    color: #fde68a;
}

body.dark .hj-char-counter {
    color: #b45309;
}

body.dark .hj-result-placeholder {
    color: #b45309;
}

body.dark .hj-placeholder-title {
    color: #d97706;
}

body.dark .hj-placeholder-desc {
    color: #b45309;
}

body.dark .hj-loading-text {
    color: #d97706;
}

body.dark .hj-result-content {
    background: #120e01;
}

body.dark .hj-result-content .joke-item {
    background: linear-gradient(135deg, #1e1603, #170f00);
    border-color: #3d2a00;
    border-left-color: #92400e;
}

body.dark .hj-result-content .joke-item:hover {
    border-color: #d97706;
    border-left-color: #d97706;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

body.dark .hj-result-content .joke-number {
    background: linear-gradient(135deg, #b45309, #78350f);
    color: #fde68a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark .hj-result-content .joke-text {
    color: #e5e7eb;
}

body.dark .hj-result-content .joke-punchline {
    background: #2d0a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

body.dark .hj-result-content .joke-tag {
    background: #2d1e00;
    color: #fbbf24;
    border-color: #78350f;
}

body.dark .hj-result-content h1 { color: #fde68a; border-bottom-color: #78350f; }
body.dark .hj-result-content h2 { color: #fde68a; border-bottom-color: #3d2a00; }
body.dark .hj-result-content strong { color: #fbbf24; }
body.dark .hj-result-content em { color: #d97706; }
body.dark .hj-result-content h3 { color: #fde68a; }
body.dark .hj-result-content h4 { color: #fbbf24; }
body.dark .hj-result-content h5 { color: #d97706; }
body.dark .hj-result-content pre { background: #1e1603; }
body.dark .hj-result-content code { background: #2d1e00; color: #fbbf24; }
body.dark .hj-result-content blockquote { border-left-color: #d97706; background: #1e1603; color: #fde68a; }

body.dark .hj-result-error {
    color: #fca5a5;
}

body.dark .hj-result-error-retry {
    background: linear-gradient(135deg, #78350f, #92400e);
}

body.dark .hj-result-error-retry:hover {
    background: linear-gradient(135deg, #5c2a0a, #78350f);
}

body.dark .hj-result-meta .hj-badge-type {
    background: #2d1e00;
    color: #fbbf24;
}

body.dark .hj-result-meta .hj-badge-count {
    background: #2d1200;
    color: #fb923c;
}

body.dark .hj-modal {
    background: #1c1505;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

body.dark .hj-modal-header {
    background: linear-gradient(135deg, #78350f, #b45309);
}

body.dark .hj-modal-body {
    background: #1c1505;
}

body.dark .hj-example-card {
    background: #1e1603;
    border-color: #3d2a00;
}

body.dark .hj-example-card:hover {
    border-color: #d97706;
    background: #2d1e00;
}

body.dark .hj-example-card-label {
    color: #fde68a;
}

body.dark .hj-example-card-desc {
    color: #d1d5db;
}

body.dark .hj-tag-type {
    background: #2d1e00;
    color: #fbbf24;
}

body.dark .hj-tag-style {
    background: #2d1200;
    color: #fb923c;
}

body.dark .hj-example-loading {
    color: #d97706;
}

body.dark .hj-example-empty {
    color: #b45309;
}

/* 暗黑模式自定义滚动条 */
body.dark .hj-history-list::-webkit-scrollbar-thumb,
body.dark .hj-input-body::-webkit-scrollbar-thumb,
body.dark .hj-result-content::-webkit-scrollbar-thumb,
body.dark .hj-modal-body::-webkit-scrollbar-thumb {
    background: #9d4edd;
}

body.dark .hj-history-list::-webkit-scrollbar-thumb:hover,
body.dark .hj-input-body::-webkit-scrollbar-thumb:hover,
body.dark .hj-result-content::-webkit-scrollbar-thumb:hover,
body.dark .hj-modal-body::-webkit-scrollbar-thumb:hover {
    background: #b366ff;
}
