/* ========== 祝福语生成工具 - 主容器 ========== */
.bp-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #fdf5f7;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.bp-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.bp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #d4145a 0%, #fbb03b 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(212, 20, 90, 0.3);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-right: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #c0135a;
    transition: all 0.25s;
    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:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.toolbar-btn-primary {
    background: #fff;
    color: #b01552;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.toolbar-btn-primary:not(:disabled) {
    animation: btnPulse 2.8s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
    50%       { box-shadow: 0 2px 12px rgba(212, 20, 90, 0.35); }
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff5f8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ========== 主内容区 ========== */
.bp-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fdf5f7;
}

/* ========== 左栏：历史记录 ========== */
.bp-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #fce4ec;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fffafa 0%, #fff5f7 100%);
    border-bottom: 1px solid #fce4ec;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #8d4560;
}

.history-count {
    font-size: 11px;
    color: #d4a0b0;
    margin-left: 4px;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #fce4ec;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #f8bbd0;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fffafa;
}

.history-search input:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.1);
    background: #fff;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #f8bbd0;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #f48fb1;
}

.history-empty {
    text-align: center;
    color: #d4a0b0;
    font-size: 12px;
    padding: 24px 0;
}

.history-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #fffafa;
    border: 1px solid #fce4ec;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInSlide 0.2s ease;
}

.history-item:hover {
    background: #fff5f7;
    border-color: #f8bbd0;
    transform: translateX(2px);
}

.history-item.active {
    background: #fce4ec;
    border-color: #d4145a;
    box-shadow: inset 3px 0 0 #3b82f6, 0 1px 4px rgba(212, 20, 90, 0.15);
}

.history-item-occasion {
    font-size: 13px;
    font-weight: 600;
    color: #880e4f;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: #d4a0b0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.history-item-delete {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    display: flex;
}

.history-item-delete:hover {
    background: #fca5a5;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 中栏：表单输入 ========== */
.bp-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #fce4ec;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #fce4ec;
    background: linear-gradient(to bottom, #fffafa 0%, #fff5f7 100%);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
    color: #880e4f;
}

.panel-tip {
    font-size: 11px;
    color: #d4a0b0;
}

.bp-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.bp-input-body::-webkit-scrollbar {
    width: 4px;
}

.bp-input-body::-webkit-scrollbar-thumb {
    background: #f8bbd0;
    border-radius: 2px;
}

.bp-input-body::-webkit-scrollbar-thumb:hover {
    background: #f48fb1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8d4560;
    margin-bottom: 6px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-weight: 400;
    color: #d4a0b0;
}

/* 场合选择特殊样式 */
.occasion-input-group {
    background: linear-gradient(135deg, #fff5f7 0%, #fce4ec 100%);
    border: 1.5px solid #f8bbd0;
    border-radius: 10px;
    padding: 12px;
}

.occasion-input-group label {
    color: #c0135a;
    font-size: 13px;
}

.occasion-select {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #880e4f !important;
    border-color: #f48fb1 !important;
}

.bp-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f8bbd0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2030;
    background: #fffafa;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.bp-input:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.1);
    background: #fff;
}

.bp-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f8bbd0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2030;
    background: #fffafa;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    appearance: auto;
}

.bp-select:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.1);
    background: #fff;
}

/* 数量选择器 */
.count-selector {
    display: flex;
    gap: 8px;
}

.count-btn {
    flex: 1;
    padding: 7px 0;
    border: 1.5px solid #f8bbd0;
    border-radius: 6px;
    background: #fffafa;
    color: #8d4560;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.count-btn:hover {
    border-color: #d4145a;
    color: #d4145a;
    background: #fff5f7;
}

.count-btn.active {
    border-color: #d4145a;
    background: linear-gradient(135deg, #d4145a, #fbb03b);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(212, 20, 90, 0.3);
}

.bp-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f8bbd0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a2030;
    background: #fffafa;
    outline: none;
    resize: vertical;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 70px;
}

.bp-textarea:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.1);
    background: #fff;
}

/* 额外要求字数计数器 */
.extra-req-counter {
    text-align: right;
    font-size: 11px;
    color: #d4a0b0;
    margin-top: 3px;
    transition: color 0.2s;
}

.extra-req-counter.near-limit {
    color: #f59e0b;
    font-weight: 500;
}

.extra-req-counter.at-limit {
    color: #ef4444;
    font-weight: 600;
}

/* ========== 右栏：结果展示 ========== */
.bp-result-panel {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.bp-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
}

.bp-result-panel .panel-header h3 {
    margin: 0;
    white-space: nowrap;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.result-meta-occasion {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(135deg, #d4145a, #fbb03b);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-refresh-btn {
    padding: 4px 10px;
    background: linear-gradient(135deg, #d4145a, #fbb03b);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-refresh-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(212, 20, 90, 0.3);
}

.result-count-info, .result-time {
    font-size: 11px;
    color: #d4a0b0;
}

.bp-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.bp-result-body::-webkit-scrollbar {
    width: 5px;
}

.bp-result-body::-webkit-scrollbar-track {
    background: #fdf5f7;
    border-radius: 3px;
}

.bp-result-body::-webkit-scrollbar-thumb {
    background: #f8bbd0;
    border-radius: 3px;
}

.bp-result-body::-webkit-scrollbar-thumb:hover {
    background: #f48fb1;
}

/* 占位状态 */
.result-placeholder {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #d4a0b0;
    text-align: center;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #8d4560;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #d4a0b0;
    margin: 0 0 4px 0;
}

.placeholder-tips {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tip-tag {
    padding: 4px 12px;
    background: #fff5f7;
    border: 1px solid #f8bbd0;
    border-radius: 20px;
    font-size: 12px;
    color: #c0135a;
}

/* 加载状态 */
.result-loading {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* 爱心漂浮动画 */
.loading-hearts {
    position: relative;
    width: 80px;
    height: 60px;
    margin-bottom: 20px;
}

.heart {
    position: absolute;
    font-size: 24px;
    animation: heartFloat 1.8s ease-in-out infinite;
}

.heart.h1 { left: 0;   animation-delay: 0s; }
.heart.h2 { left: 28px; animation-delay: 0.4s; top: 10px; font-size: 20px; }
.heart.h3 { left: 52px; animation-delay: 0.8s; }

@keyframes heartFloat {
    0%, 100% { transform: translateY(0) scale(1);   opacity: 0.7; }
    50%       { transform: translateY(-14px) scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #8d4560;
    margin: 0 0 6px 0;
    font-weight: 500;
}

.loading-carousel-msg {
    font-size: 12px;
    color: #d4a0b0;
    margin: 0 0 12px 0;
    min-height: 18px;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #d4145a;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* 错误状态 */
.result-error {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

.result-error-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.8;
}

.result-error-msg {
    font-size: 14px;
    color: #8d4560;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.error-retry-btn {
    padding: 9px 24px;
    background: linear-gradient(135deg, #d4145a, #fbb03b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(212, 20, 90, 0.3);
}

.error-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(212, 20, 90, 0.4);
}

.error-retry-btn:active {
    transform: translateY(0);
}

/* 每条祝福语卡片 */
.blessing-card {
    position: relative;
    background: #fff8fa;
    border: 1px solid #fce4ec;
    border-left: 3px solid #f8bbd0;
    border-radius: 8px;
    padding: 12px 44px 12px 16px;
    margin: 10px 0;
    transition: border-color 0.2s, box-shadow 0.2s, border-left-color 0.2s;
}

.blessing-card:hover {
    border-color: #f48fb1;
    border-left-color: #d4145a;
    box-shadow: 0 2px 8px rgba(212, 20, 90, 0.1);
}

.blessing-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #f8bbd0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4145a;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s, transform 0.15s;
    line-height: 1;
}

.blessing-card:hover .blessing-copy-btn {
    opacity: 1;
}

.blessing-copy-btn:hover {
    background: #fff5f7;
    transform: scale(1.1);
}

.blessing-copy-btn.copied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #28a745;
    opacity: 1;
}

body.dark .blessing-card {
    background: #2f1520;
    border-color: #5a2535;
    border-left-color: #d4145a;
}

body.dark .blessing-card:hover {
    border-color: #8b3050;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .blessing-copy-btn {
    background: #3a1525;
    border-color: #5a2535;
    color: #f48fb1;
}

body.dark .blessing-copy-btn:hover {
    background: #4a1a30;
}

body.dark .blessing-copy-btn.copied {
    background: #1a3a25;
    border-color: #2d7a45;
    color: #5dd88a;
}

/* 结果内容 */
.result-content {
    font-size: 14px;
    line-height: 1.8;
    color: #3a1a28;
    animation: fadeInUp 0.4s ease;
    padding-bottom: 20px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content h2 {
    font-size: 15px;
    font-weight: 700;
    color: #c0135a;
    margin: 18px 0 10px 0;
    padding: 6px 10px 6px 10px;
    background: linear-gradient(135deg, #fff5f7 0%, #fce4ec 60%, transparent 100%);
    border-bottom: 2px solid #f8bbd0;
    border-left: 3px solid #d4145a;
    border-radius: 0 6px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content h2:first-child {
    margin-top: 0;
}

.result-content p {
    margin: 8px 0;
    color: #5a2a38;
}

.result-content strong {
    color: #880e4f;
    font-weight: 600;
}

.result-content em {
    font-style: italic;
    color: #c2185b;
}

.result-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #ad1457;
    margin: 12px 0 6px 0;
    padding-left: 8px;
    border-left: 2px solid #f8bbd0;
}

.result-content pre {
    background: #fff5f7;
    border: 1px solid #f8bbd0;
    border-radius: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
}

.result-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #ad1457;
    background: #fff5f7;
    padding: 1px 5px;
    border-radius: 3px;
}

.result-content blockquote {
    margin: 4px 0 10px 0;
    padding: 6px 12px;
    background: #fff5f7;
    border-left: 3px solid #d4145a;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: #c0135a;
}

.result-content ul, .result-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.result-content li {
    margin-bottom: 4px;
    color: #5a2a38;
}

.result-content hr {
    border: none;
    border-top: 1px dashed #fce4ec;
    margin: 16px 0;
}

/* ========== 示例模态框 ========== */
.bp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.bp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 700px;
    max-width: 96vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.bp-modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.bp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #d4145a 0%, #fbb03b 100%);
    color: white;
    flex-shrink: 0;
}

.bp-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.bp-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bp-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.bp-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.bp-modal-body::-webkit-scrollbar {
    width: 5px;
}

.bp-modal-body::-webkit-scrollbar-track {
    background: #fdf5f7;
    border-radius: 3px;
}

.bp-modal-body::-webkit-scrollbar-thumb {
    background: #f8bbd0;
    border-radius: 3px;
}

.bp-modal-body::-webkit-scrollbar-thumb:hover {
    background: #f48fb1;
}

.example-card {
    padding: 14px 16px;
    background: #fffafa;
    border: 1.5px solid #fce4ec;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #d4145a;
    background: #fff5f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 20, 90, 0.12);
}

.example-card-occasion {
    font-size: 17px;
    font-weight: 700;
    color: #c0135a;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 12px;
    color: #8d6070;
    line-height: 1.5;
    margin-bottom: 8px;
}

.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.example-tag {
    padding: 2px 8px;
    background: #fce4ec;
    color: #c0135a;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* ========== Toast 提示 ========== */
.bp-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(212, 20, 90, 0.92);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.bp-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bp-toast.error {
    background: rgba(239, 68, 68, 0.9);
}

/* ========== 暗黑模式 ========== */
body.dark .bp-container {
    background: #1c0d11;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark .bp-toolbar {
    background: linear-gradient(135deg, #8b0a32 0%, #b07820 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #f8bbd0;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

body.dark .toolbar-btn-primary:not(:disabled) {
    animation: btnPulseDark 2.8s ease-in-out infinite;
}

@keyframes btnPulseDark {
    0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
    50%       { box-shadow: 0 2px 14px rgba(212, 20, 90, 0.5); }
}

body.dark .toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.18);
    color: #fce4ec;
}

body.dark .bp-main-content {
    background: #1c0d11;
}

/* 左栏暗黑 */
body.dark .bp-history-panel {
    background: #2a1520;
    border-right-color: #4a2030;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #2a1520 0%, #251020 100%);
    border-bottom-color: #4a2030;
}

body.dark .history-panel-header h3 {
    color: #e8a0b0;
}

body.dark .history-count {
    color: #7a4050;
}

body.dark .history-search input {
    background: #1f0f16;
    border-color: #4a2030;
    color: #e0c8cc;
}

body.dark .history-search input:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.2);
    background: #271218;
}

body.dark .history-search input::placeholder {
    color: #6a3545;
}

body.dark .history-list {
    background: #2a1520;
}

body.dark .history-list::-webkit-scrollbar-thumb {
    background: #4a2030;
}

body.dark .history-list::-webkit-scrollbar-track {
    background: #2a1520;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #6a3545;
}

body.dark .history-empty {
    color: #6a3545;
}

body.dark .history-item {
    background: #1f0f16;
    border-color: #4a2030;
}

body.dark .history-item:hover {
    background: #2a1525;
    border-color: #d4145a;
}

body.dark .history-item.active {
    background: #3a0e20;
    border-color: #d4145a;
    box-shadow: inset 3px 0 0 #3b82f6, 0 1px 5px rgba(0, 0, 0, 0.3);
}

body.dark .history-item-occasion {
    color: #f48fb1;
}

body.dark .history-item-meta {
    color: #6a3545;
}

body.dark .history-clear-btn {
    background: #3a0e20;
    color: #ef9999;
}

body.dark .history-clear-btn:hover {
    background: #5a1525;
}

/* 中栏暗黑 */
body.dark .bp-input-panel {
    background: #2a1520;
    border-right-color: #4a2030;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #2a1520 0%, #251020 100%);
    border-bottom-color: #4a2030;
}

body.dark .panel-header h3 {
    color: #e8a0b0;
}

body.dark .panel-tip {
    color: #6a3545;
}

body.dark .bp-input-body::-webkit-scrollbar-thumb {
    background: #4a2030;
}

body.dark .bp-input-body::-webkit-scrollbar-track {
    background: #2a1520;
}

body.dark .bp-input-body::-webkit-scrollbar-thumb:hover {
    background: #6a3545;
}

body.dark .extra-req-counter {
    color: #6a3545;
}

body.dark .extra-req-counter.near-limit {
    color: #c49a4a;
}

body.dark .extra-req-counter.at-limit {
    color: #dc6060;
}

body.dark .form-group label {
    color: #c08090;
}

body.dark .occasion-input-group {
    background: linear-gradient(135deg, #3a0e20 0%, #2f0a18 100%);
    border-color: #8b1a40;
}

body.dark .occasion-input-group label {
    color: #f48fb1;
}

body.dark .occasion-select {
    color: #f48fb1 !important;
    border-color: #8b1a40 !important;
}

body.dark .bp-input,
body.dark .bp-select,
body.dark .bp-textarea {
    background: #1f0f16;
    border-color: #4a2030;
    color: #e0c8cc;
    color-scheme: dark;
}

body.dark .bp-input:focus,
body.dark .bp-select:focus,
body.dark .bp-textarea:focus {
    border-color: #d4145a;
    box-shadow: 0 0 0 2px rgba(212, 20, 90, 0.2);
    background: #271218;
}

body.dark .count-btn {
    background: #1f0f16;
    border-color: #4a2030;
    color: #c08090;
}

body.dark .count-btn:hover {
    border-color: #d4145a;
    color: #f48fb1;
    background: #3a0e20;
}

body.dark .count-btn.active {
    border-color: #d4145a;
    background: linear-gradient(135deg, #8b0a32, #b07820);
    color: white;
}

/* 右栏暗黑 */
body.dark .bp-result-panel {
    background: #2a1520;
}

body.dark .bp-result-body {
    background: #2a1520;
}

body.dark .bp-result-body::-webkit-scrollbar-thumb {
    background: #4a2030;
}

body.dark .bp-result-body::-webkit-scrollbar-track {
    background: #2a1520;
}

body.dark .bp-result-body::-webkit-scrollbar-thumb:hover {
    background: #6a3545;
}

body.dark .result-count-info,
body.dark .result-time {
    color: #7a4050;
}

body.dark .placeholder-icon {
    filter: brightness(0.8);
}

body.dark .placeholder-title {
    color: #c08090;
}

body.dark .placeholder-desc {
    color: #6a3545;
}

body.dark .tip-tag {
    background: #3a0e20;
    border-color: #8b1a40;
    color: #f48fb1;
}

body.dark .loading-text {
    color: #c08090;
}

body.dark .loading-carousel-msg {
    color: #6a3545;
}

body.dark .loading-dots span {
    background: #d4145a;
}

body.dark .result-content {
    color: #e0c8cc;
}

body.dark .result-content h2 {
    color: #f48fb1;
    background: linear-gradient(135deg, #3a0e20 0%, #2f0a18 60%, transparent 100%);
    border-bottom-color: #8b1a40;
    border-left-color: #d4145a;
}

body.dark .result-content p {
    color: #c8a0a8;
}

body.dark .result-content strong {
    color: #f8bbd0;
}

body.dark .result-content em {
    color: #f48fb1;
}

body.dark .result-content h3 {
    color: #f48fb1;
    border-left-color: #8b1a40;
}

body.dark .result-content pre {
    background: #3a0e20;
    border-color: #8b1a40;
    color: #f8bbd0;
}

body.dark .result-content code {
    background: #3a0e20;
    color: #f48fb1;
}

body.dark .result-content blockquote {
    background: #3a0e20;
    border-left-color: #d4145a;
    color: #f48fb1;
}

body.dark .result-content li {
    color: #c8a0a8;
}

body.dark .result-content hr {
    border-top-color: #4a2030;
}

body.dark .result-error-msg {
    color: #c08090;
}

body.dark .error-retry-btn {
    background: linear-gradient(135deg, #8b0a32, #b07820);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .error-retry-btn:hover {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
}

body.dark .result-refresh-btn {
    background: linear-gradient(135deg, #8b0a32, #b07820);
}

/* 示例模态框暗黑 */
body.dark .bp-modal-content {
    background: #2a1520;
}

body.dark .bp-modal-header {
    background: linear-gradient(135deg, #8b0a32 0%, #b07820 100%);
}

body.dark .bp-modal-body {
    background: #2a1520;
}

body.dark .bp-modal-body::-webkit-scrollbar-track {
    background: #1c0d11;
}

body.dark .bp-modal-body::-webkit-scrollbar-thumb {
    background: #4a2030;
}

body.dark .bp-modal-body::-webkit-scrollbar-thumb:hover {
    background: #6a3545;
}

body.dark .example-card {
    background: #1f0f16;
    border-color: #4a2030;
}

body.dark .example-card:hover {
    border-color: #d4145a;
    background: #3a0e20;
}

body.dark .example-card-occasion {
    color: #f48fb1;
}

body.dark .example-card-desc {
    color: #6a3545;
}

body.dark .example-tag {
    background: #3a0e20;
    color: #f48fb1;
}

/* ========== 响应式布局 ========== */
@media (min-width: 640px) and (max-width: 899px) {
    .bp-history-panel {
        display: none;
    }

    .bp-input-panel {
        width: 300px;
        flex-shrink: 0;
    }

    .bp-result-panel {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 639px) {
    .bp-main-content {
        flex-direction: column;
    }

    .bp-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #fce4ec;
        flex-direction: row;
        flex-wrap: wrap;
    }

    body.dark .bp-history-panel {
        border-bottom-color: #4a2030;
    }

    .history-panel-header {
        width: 100%;
    }

    .history-search {
        width: 40%;
        border-bottom: none;
        border-right: 1px solid #fce4ec;
    }

    .history-list {
        flex: 1;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        padding: 4px;
        gap: 6px;
    }

    .history-item {
        flex-shrink: 0;
        min-width: 120px;
        margin-bottom: 0;
    }

    .bp-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #fce4ec;
    }

    body.dark .bp-input-panel {
        border-bottom-color: #4a2030;
    }

    .bp-input-body {
        max-height: 300px;
    }

    .bp-result-panel {
        min-height: 380px;
    }

    .bp-toolbar {
        gap: 4px;
    }

    .toolbar-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .bp-modal-body {
        grid-template-columns: 1fr;
    }
}
