/* =============================================
   小红书爆款文案生成 - 主题色: 小红书红 #FF2442
   ============================================= */

/* ========== 主容器 ========== */
.xhs-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #fff8f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(255, 36, 66, 0.08);
    transition: all 0.3s ease;
}

.xhs-editor-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.xhs-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #FF2442 0%, #ff6b81 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.toolbar-group:last-child {
    margin-left: auto;
    padding-right: 0;
    border-right: none;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #FF2442;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn kbd {
    font-size: 10px;
    font-family: inherit;
    background: rgba(255, 36, 66, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.primary-toolbar-btn {
    background: white;
    color: #FF2442;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.cancel-toolbar-btn {
    background: rgba(255, 255, 255, 0.85);
    color: #e53935;
}

/* ========== 主内容三栏 ========== */
.xhs-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左侧历史面板 ========== */
.xhs-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #ffdde1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fff5f7, #fff0f2);
    border-bottom: 1px solid #ffdde1;
    flex-shrink: 0;
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #FF2442;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-count-badge {
    background: #FF2442;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #FF2442;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #ffe0e4;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #ffdde1;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ffdde1;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff8f9;
}

.history-search input:focus {
    border-color: #FF2442;
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-empty {
    padding: 24px 12px;
    text-align: center;
    color: #ccc;
    font-size: 12px;
}

.history-item {
    position: relative;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #fff8f9;
    border: 1px solid #ffdde1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: #fff0f2;
    border-color: #FF2442;
    transform: translateX(2px);
}

.history-item.active {
    background: #ffe8ec;
    border-color: #FF2442;
    box-shadow: 0 1px 4px rgba(255, 36, 66, 0.15);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

.history-item-name {
    font-weight: 600;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 11px;
    color: #FF2442;
    margin-bottom: 2px;
    opacity: 0.8;
}

.history-item-time {
    font-size: 10px;
    color: #999;
}

/* ========== 中间输入面板 ========== */
.input-panel {
    flex: 0 0 360px;
    min-width: 300px;
    background: white;
    border-right: 1px solid #ffdde1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.input-panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fff5f7, #fff0f2);
    border-bottom: 1px solid #ffdde1;
    flex-shrink: 0;
}

.input-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #FF2442;
}

.input-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.form-group .required {
    color: #FF2442;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fafafa;
    color: #333;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #FF2442;
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-group select {
    cursor: pointer;
    appearance: auto;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
    transition: color 0.2s;
}

.char-count-warn { color: #f97316; }
.char-count-danger { color: #e53935; font-weight: 600; }

.input-error-shake {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.15) !important;
    animation: inputShake 0.35s ease;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group.half {
    flex: 1;
}

/* 生成按钮 */
.form-actions {
    margin-top: 18px;
}

.generate-main-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #FF2442 0%, #ff6b81 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
    letter-spacing: 0.5px;
}

.generate-main-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 36, 66, 0.4);
}

.generate-main-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
}

.generate-main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-main-btn.is-generating {
    position: relative;
    overflow: hidden;
    cursor: wait;
}

.generate-main-btn.is-generating:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
}

.generate-main-btn.is-generating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: btnShimmer 1.8s ease-in-out infinite;
}

@keyframes btnShimmer {
    to { left: 120%; }
}

.generate-main-btn .btn-icon {
    font-size: 16px;
}

.generate-main-btn .btn-shortcut {
    font-size: 11px;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* AI 状态区域 */
.ai-status {
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fff5f7, #ffe8ec);
    border: 1px solid #ffc0ca;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #FF2442;
    font-weight: 500;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #FF2442;
    border-radius: 50%;
    display: inline-block;
    animation: xhsBounce 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes xhsBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1.2); opacity: 1; }
}

.cancel-mini-btn {
    padding: 5px 12px;
    background: white;
    border: 1px solid #FF2442;
    color: #FF2442;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cancel-mini-btn:hover {
    background: #fff0f2;
}

/* ========== 右侧预览面板 ========== */
.preview-panel {
    flex: 1;
    min-width: 300px;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fff5f7, #fff0f2);
    border-bottom: 1px solid #ffdde1;
    flex-shrink: 0;
}

.preview-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #FF2442;
}

.preview-copy-btn {
    padding: 5px 14px;
    background: white;
    border: 1px solid #FF2442;
    color: #FF2442;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.preview-copy-btn:hover {
    background: #FF2442;
    color: white;
}

.preview-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* 预览内容容器：确保占满可用宽度，让 .xhs-card width:100% 有效依据 */
.preview-content {
    width: 100%;
    max-width: 480px;
}

.preview-empty {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.preview-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.preview-empty p {
    margin: 6px 0;
    font-size: 14px;
    color: #bbb;
}

.preview-empty-sub {
    font-size: 12px !important;
    color: #d0d0d0 !important;
}

.preview-generating {
    text-align: center;
    padding: 60px 20px;
}

.preview-generating-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: xhsSparkle 1.5s ease-in-out infinite;
}

.preview-generating p {
    margin: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #FF2442;
}

.preview-generating .loading-dots {
    justify-content: center;
    margin-top: 8px;
}

@keyframes xhsSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.15) rotate(10deg); opacity: 1; }
}

/* ========== 小红书卡片样式 ========== */
.xhs-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
    transition: box-shadow 0.2s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.xhs-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 顶部用户信息 */
.xhs-card-user {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px;
    gap: 10px;
}

.xhs-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #FF2442, #ff6b81);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.xhs-user-info {
    flex: 1;
}

.xhs-username {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.xhs-time {
    font-size: 11px;
    color: #999;
}

.xhs-follow-btn {
    padding: 4px 14px;
    background: transparent;
    border: 1.5px solid #FF2442;
    color: #FF2442;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.xhs-follow-btn:hover {
    background: #FF2442;
    color: white;
}

/* 文案图片占位（模拟图片区域）*/
.xhs-image-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #ffe8ec 0%, #fff0f2 50%, #ffdde1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255, 36, 66, 0.3);
    letter-spacing: 8px;
    user-select: none;
}

/* 标题 */
.xhs-title {
    padding: 14px 16px 8px;
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.5;
}

/* 正文 */
.xhs-content {
    padding: 0 16px 12px;
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    white-space: pre-line;
}

/* 标签 */
.xhs-tags {
    padding: 8px 16px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.xhs-tag {
    font-size: 12px;
    color: #FF2442;
    background: #fff0f2;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: default;
    transition: all 0.2s;
}

.xhs-tag:hover {
    background: #ffe0e5;
}

/* 互动按钮区 */
.xhs-actions {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px 16px;
    border-top: 1px solid #f5f5f5;
}

.xhs-action {
    font-size: 12px;
    color: #999;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.xhs-action:hover {
    color: #FF2442;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.25s ease-out;
}

.modal-content.modal-lg {
    max-width: 740px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #FF2442 0%, #ff6b81 100%);
    color: white;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    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;
}

.modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 模板筛选栏 */
.template-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-btn {
    padding: 5px 14px;
    border: 1.5px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: #FF2442;
    background: #FF2442;
    color: white;
}

/* 模板网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.template-item {
    padding: 14px 12px;
    background: #fff8f9;
    border: 1.5px solid #ffdde1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.template-item:hover {
    border-color: #FF2442;
    background: #fff0f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.12);
}

.template-icon {
    font-size: 28px;
    line-height: 1;
}

.template-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.template-meta {
    font-size: 11px;
    color: #FF2442;
    opacity: 0.8;
}

/* ========== 工具类 ========== */
.is-hidden {
    display: none !important;
}

.no-tags-hint {
    color: #ccc;
    font-size: 12px;
}

.copy-success-flash {
    background: #22c55e !important;
    color: white !important;
    transition: background 0.15s, color 0.15s;
}

/* ========== Toast 提示 ========== */
.xhs-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    z-index: 200000;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: xhsFadeIn .25s ease;
    white-space: nowrap;
    pointer-events: none;
}

.xhs-toast--success { background: #FF2442; }
.xhs-toast--error { background: #e53935; }
.xhs-toast--info { background: #607d8b; }

@keyframes xhsFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== 滚动条样式 ========== */
.history-list::-webkit-scrollbar,
.input-panel-body::-webkit-scrollbar,
.preview-scroll-area::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track,
.input-panel-body::-webkit-scrollbar-track,
.preview-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb,
.input-panel-body::-webkit-scrollbar-thumb,
.preview-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 36, 66, 0.25);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.input-panel-body::-webkit-scrollbar-thumb:hover,
.preview-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 36, 66, 0.5);
}

/* ========== 暗黑模式 ========== */
body.theme-dark .xhs-editor-container {
    background: #1a0a0f;
}

body.theme-dark .xhs-history-panel,
body.theme-dark .input-panel {
    background: #120007;
    border-color: rgba(255, 36, 66, 0.2);
}

body.theme-dark .history-header,
body.theme-dark .input-panel-header,
body.theme-dark .preview-header {
    background: #1e0a10;
    border-color: rgba(255, 36, 66, 0.2);
}

body.theme-dark .history-header h3,
body.theme-dark .input-panel-header h3,
body.theme-dark .preview-header h3 {
    color: #ff6b81;
}

body.theme-dark .history-search input {
    background: #1e0a10;
    border-color: rgba(255, 36, 66, 0.3);
    color: #e0e0e0;
}

body.theme-dark .history-search input::placeholder {
    color: #666;
}

body.theme-dark .history-item {
    background: #1e0a10;
    border-color: rgba(255, 36, 66, 0.2);
}

body.theme-dark .history-item:hover {
    background: #2a0d16;
    border-color: #FF2442;
}

body.theme-dark .history-item-name {
    color: #e0d0d3;
}

body.theme-dark .form-group input[type="text"],
body.theme-dark .form-group textarea,
body.theme-dark .form-group select {
    background: #1e0a10;
    border-color: rgba(255, 36, 66, 0.3);
    color: #e0e0e0;
}

body.theme-dark .form-group label {
    color: #ccc;
}

body.theme-dark .preview-panel {
    background: #120007;
}

body.theme-dark .xhs-card {
    background: #1e0a10;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

body.theme-dark .xhs-title {
    color: #f0d0d5;
}

body.theme-dark .xhs-content {
    color: #c0a0a8;
}

body.theme-dark .xhs-username {
    color: #e0c0c5;
}

body.theme-dark .xhs-actions {
    border-color: #2a0d16;
}

body.theme-dark .no-tags-hint {
    color: #555;
}

body.theme-dark .preview-generating p {
    color: #ff6b81;
}

body.theme-dark .modal-content {
    background: #1e0a10;
}

body.theme-dark .modal-body {
    background: #1e0a10;
}

body.theme-dark .template-item {
    background: #2a0d16;
    border-color: rgba(255, 36, 66, 0.25);
}

body.theme-dark .template-item:hover {
    background: #350f1c;
    border-color: #FF2442;
}

body.theme-dark .template-name {
    color: #e0d0d3;
}

body.theme-dark .ai-status {
    background: linear-gradient(135deg, #1e0a10, #2a0d16);
    border-color: rgba(255, 36, 66, 0.3);
}

body.theme-dark .ai-loading {
    color: #ff6b81;
}

body.theme-dark .cancel-mini-btn {
    background: #1e0a10;
    border-color: rgba(255, 36, 66, 0.5);
    color: #ff6b81;
}

body.theme-dark .cancel-mini-btn:hover {
    background: #2a0d16;
}

body.theme-dark .char-count {
    color: #555;
}

body.theme-dark .xhs-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.theme-dark .history-item.active {
    background: #350f1c;
    border-color: #FF2442;
    box-shadow: 0 1px 6px rgba(255, 36, 66, 0.25);
}

body.theme-dark .xhs-follow-btn {
    border-color: rgba(255, 36, 66, 0.6);
    color: #ff6b81;
}

body.theme-dark .xhs-follow-btn:hover {
    background: rgba(255, 36, 66, 0.2);
    color: #ff6b81;
}

body.theme-dark .history-list::-webkit-scrollbar-thumb,
body.theme-dark .input-panel-body::-webkit-scrollbar-thumb,
body.theme-dark .preview-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 36, 66, 0.4);
}

body.theme-dark .preview-empty p {
    color: #cc8899;
}

body.theme-dark .preview-empty-sub {
    color: #aa7788 !important;
}

body.theme-dark .xhs-tag {
    background: #2d0f18;
    color: #ff8099;
}

body.theme-dark .xhs-image-placeholder {
    background: linear-gradient(135deg, #2a0d16 0%, #220a12 50%, #2a0d16 100%);
    color: rgba(255, 100, 130, 0.35);
}

body.theme-dark .history-item-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ff8099;
}

body.theme-dark .history-item-delete:hover {
    background: #ef4444;
    color: white;
}

body.theme-dark .template-filter {
    border-bottom-color: rgba(255, 36, 66, 0.2);
}

body.theme-dark .filter-btn {
    background: #2a0d16;
    border-color: rgba(255, 36, 66, 0.3);
    color: #cc8899;
}

body.theme-dark .filter-btn:hover,
body.theme-dark .filter-btn.active {
    background: #FF2442;
    border-color: #FF2442;
    color: white;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .input-panel {
        flex: 0 0 280px;
    }

    .xhs-history-panel {
        width: 180px;
    }
}

@media (max-width: 700px) {
    .xhs-main-content {
        flex-direction: column;
    }

    .xhs-history-panel {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid #ffdde1;
    }

    .history-list {
        flex-direction: row;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
    }

    .history-item {
        min-width: 140px;
        margin-bottom: 0;
    }

    .input-panel {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #ffdde1;
    }

    .preview-panel {
        min-height: 300px;
    }

    .xhs-image-placeholder {
        height: 160px;
        font-size: 36px;
    }
}
