/* ========== 宝宝睡前故事 - 主容器 ========== */
.bbs-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: linear-gradient(135deg, #fef9f0 0%, #fff5e6 50%, #fef0f8 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 180, 50, 0.12);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.bbs-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.bbs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f093fb 0%, #f5a3c7 30%, #fda085 70%, #f6d365 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(240, 147, 251, 0.35);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #c75cb5;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    color: #a0449a;
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: #fff;
    color: #e8418b !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(232, 65, 139, 0.3);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #c0306d !important;
    box-shadow: 0 4px 12px rgba(232, 65, 139, 0.4);
}

/* ========== 主内容区 ========== */
.bbs-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左栏：历史记录 ========== */
.bbs-history-panel {
    width: 200px;
    background: #fff8f5;
    border-right: 1px solid #f5c8d8;
    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, #fff5f0, #feeee8);
    border-bottom: 1px solid #f5c8d8;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #c75cb5;
}

.history-count {
    display: inline-block;
    margin-left: 6px;
    background: #f5c8d8;
    color: #a0449a;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 10px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #f5c8d8;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #f0c0d0;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.history-search input:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 2px rgba(240, 147, 251, 0.15);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.history-empty {
    text-align: center;
    color: #d4a0c0;
    padding: 30px 10px;
    font-size: 12px;
}

.history-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #fff;
    border: 1px solid #f5d8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInItem 0.2s ease;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #fff5f8;
    border-color: #f0a0c8;
    transform: translateX(2px);
}

.history-item:focus-visible {
    outline: 2px solid #f093fb;
    outline-offset: 1px;
    border-color: #f093fb;
}

.history-item.active {
    background: #fff0f8;
    border-color: #f093fb;
    box-shadow: 0 1px 5px rgba(240, 147, 251, 0.2);
}

.history-item-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

.history-item-title {
    font-weight: 600;
    font-size: 12px;
    color: #8b4570;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 10px;
    color: #c090a0;
    margin-top: 3px;
}

/* ========== 中栏：参数设置 ========== */
.bbs-input-panel {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #f5c8d8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fff8fc, #fff0f8);
    border-bottom: 1px solid #f5c8d8;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 700;
    color: #a0449a;
}

.panel-tip {
    font-size: 11px;
    color: #c090b0;
}

.bbs-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    -webkit-overflow-scrolling: touch;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8b5070;
    margin-bottom: 6px;
}

.label-tip {
    font-size: 10px;
    color: #c090b0;
    font-weight: 400;
}

.bbs-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f0c0d0;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    background: #fffafc;
}

.bbs-input:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.12);
    background: #fff;
}

.bbs-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f0c0d0;
    border-radius: 10px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    background: #fffafc;
    color: #555;
    line-height: 1.5;
}

.bbs-textarea:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.12);
    background: #fff;
}

.bbs-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #f0c0d0;
    border-radius: 10px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    background: #fffafc;
    color: #555;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c090b0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.bbs-select:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.12);
}

/* 主题标签 */
.theme-tags, .age-selector, .length-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.theme-tag {
    padding: 5px 10px;
    background: #fff0f8;
    border: 1.5px solid #f5c8d8;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: #a0609a;
    transition: all 0.2s;
}

.theme-tag:hover {
    background: #fce4f5;
    border-color: #f093fb;
    color: #8a409a;
}

.theme-tag.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5a3c7 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.35);
}

/* 年龄选择 */
.age-btn, .length-btn {
    flex: 1;
    padding: 8px 6px;
    background: #fff0f8;
    border: 1.5px solid #f5c8d8;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #a0609a;
    transition: all 0.2s;
    text-align: center;
}

.age-btn:hover, .length-btn:hover {
    background: #fce4f5;
    border-color: #f093fb;
}

.age-btn.active, .length-btn.active {
    background: linear-gradient(135deg, #f5a3c7 0%, #fda085 100%);
    border-color: transparent;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 163, 199, 0.35);
}

.length-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.length-btn small {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
}

/* 快捷场景 */
.quick-scenarios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.scenario-btn {
    padding: 7px 8px;
    background: linear-gradient(135deg, #fff5f0 0%, #fff0f8 100%);
    border: 1px solid #f5c8d8;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    color: #8b5070;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    line-height: 1.3;
}

.scenario-btn:hover {
    background: linear-gradient(135deg, #fce4f5 0%, #ffe4f0 100%);
    border-color: #f093fb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(240, 147, 251, 0.2);
}

/* 生成按钮 */
.generate-main-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5a3c7 50%, #fda085 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    letter-spacing: 1px;
}

.generate-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.5);
}

.generate-main-btn:active {
    transform: translateY(0);
}

.generate-main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-hint {
    text-align: center;
    font-size: 11px;
    color: #c090b0;
    margin: 6px 0 0 0;
}

/* ========== 右栏：故事展示 ========== */
.bbs-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

.bbs-result-panel .panel-header {
    border-bottom: 1px solid #f5c8d8;
}

.result-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.result-tag {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f093fb40, #fda08540);
    border: 1px solid #f093fb50;
    border-radius: 10px;
    font-size: 11px;
    color: #a04090;
    font-weight: 500;
}

.result-time {
    font-size: 11px;
    color: #c090b0;
}

.bbs-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(160deg, #fffbf8 0%, #fff8fd 100%);
    -webkit-overflow-scrolling: touch;
}

/* 故事结果区入场动画 */
@keyframes bbsResultEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bbs-result-enter-anim {
    animation: bbsResultEnter 0.35s ease-out both;
}

/* 滚动条样式 */
.bbs-result-body::-webkit-scrollbar,
.story-content::-webkit-scrollbar,
.bbs-input-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 5px;
}

.bbs-result-body::-webkit-scrollbar-track,
.story-content::-webkit-scrollbar-track,
.bbs-input-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.bbs-result-body::-webkit-scrollbar-thumb,
.story-content::-webkit-scrollbar-thumb,
.bbs-input-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: #f5c8d8;
    border-radius: 4px;
}

.bbs-result-body::-webkit-scrollbar-thumb:hover,
.story-content::-webkit-scrollbar-thumb:hover,
.bbs-input-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #f093fb;
}

/* 占位符 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.stars-decoration {
    font-size: 20px;
    margin-bottom: 10px;
    letter-spacing: 8px;
    animation: starsFade 2s ease-in-out infinite alternate;
}

@keyframes starsFade {
    from { opacity: 0.5; }
    to   { opacity: 1; }
}

.placeholder-emoji {
    font-size: 60px;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 12px rgba(240, 147, 251, 0.3));
    animation: placeholderFloat 3s ease-in-out infinite;
}

@keyframes placeholderFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

.placeholder-title {
    font-size: 18px;
    font-weight: 700;
    color: #a04090;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #c090b0;
    margin: 3px 0;
}

.placeholder-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.story-tag {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fff0f8 0%, #fff5ee 100%);
    border: 1.5px solid #f5c8d8;
    border-radius: 20px;
    font-size: 12px;
    color: #a0609a;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.story-tag:hover {
    background: linear-gradient(135deg, #fce4f5 0%, #ffe8e0 100%);
    border-color: #f093fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.2);
}

/* 加载动画 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
}

.moon-animation {
    margin-bottom: 10px;
}

.moon-bounce {
    font-size: 50px;
    display: inline-block;
    animation: moonBounce 1.2s ease-in-out infinite;
}

@keyframes moonBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50%       { transform: translateY(-15px) rotate(5deg); }
}

.stars-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.star-twinkle {
    font-size: 18px;
    animation: twinkle 1.5s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50%       { opacity: 1; transform: scale(1.2); }
}

.loading-text {
    font-size: 14px;
    color: #c075b5;
    font-weight: 500;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

/* 故事内容 */
.story-content-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.story-content {
    flex: 1;
    padding: 32px 40px;
    font-size: 16px;
    line-height: 2.1;
    color: #5a3550;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: "Georgia", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", serif;
    letter-spacing: 0.02em;
    min-height: 0;
}

.story-content .story-title {
    font-size: 22px;
    font-weight: 700;
    color: #9030a0;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 16px;
}

/* 标题装饰线 */
.story-content .story-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f093fb, #fda085, transparent);
    border-radius: 2px;
}

.story-content .story-paragraph {
    text-indent: 2em;
    margin-bottom: 12px;
}

/* 首段首字放大效果 */
.story-content .story-paragraph:first-of-type::first-letter {
    font-size: 2em;
    font-weight: 700;
    color: #c040b0;
    float: left;
    line-height: 0.85;
    margin: 4px 6px 0 0;
    font-family: "Georgia", serif;
}

.story-footer {
    padding: 14px 20px;
    background: linear-gradient(to bottom, rgba(255,245,250,0), rgba(255,240,248,0.95));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f5d8e8;
    flex-shrink: 0;
}

.story-footer-decoration {
    font-size: 13px;
    color: #c090b0;
    letter-spacing: 2px;
}

.copy-reply-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #f5a3c7, #fda085);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(245, 163, 199, 0.3);
}

.copy-reply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 163, 199, 0.4);
}

/* 移动端复制按钮强制可见 */
@media (max-width: 768px) {
    .copy-reply-btn {
        opacity: 1 !important;
    }
}

/* ========== Toast 提示 ========== */
.bbs-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px 10px 17px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    white-space: nowrap;
    border-left: 3px solid transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.bbs-toast.success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.bbs-toast.warn {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.bbs-toast.info {
    background: #1e3a5f;
    color: #bfdbfe;
    border-left-color: #3b82f6;
}

/* ========== 示例模态框 ========== */
.bbs-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100001;
    backdrop-filter: blur(3px);
}

.bbs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.bbs-modal-content {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    box-shadow: 0 12px 40px rgba(240, 147, 251, 0.25);
}

.bbs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f093fb 0%, #fda085 100%);
    color: white;
    flex-shrink: 0;
}

.bbs-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.bbs-modal-close {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbs-modal-close:hover {
    background: rgba(255,255,255,0.5);
}

.bbs-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-content: start;
}

.example-card {
    padding: 14px;
    background: linear-gradient(135deg, #fff5fb 0%, #fff8f0 100%);
    border: 1.5px solid #f5c8d8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #f093fb;
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.2);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #fce4f5 0%, #fff0e8 100%);
}

.example-card-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #8b4570;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 11px;
    color: #c090b0;
    line-height: 1.4;
}

/* ========== 暗黑模式（body.dark 前缀） ========== */
body.dark .bbs-container {
    background: linear-gradient(135deg, #1a0f25 0%, #1e1030 50%, #1a0f20 100%);
}

body.dark .bbs-toolbar {
    background: linear-gradient(135deg, #6a2080 0%, #3d2060 30%, #4a2030 70%, #3a2000 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #f0c0e8;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    color: #fce4f5;
}

body.dark .toolbar-btn-primary {
    background: rgba(240, 147, 251, 0.2);
    color: #f0c0f8 !important;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.2);
}

body.dark .toolbar-btn-primary:disabled {
    background: rgba(240, 147, 251, 0.08);
    color: rgba(240, 192, 248, 0.4) !important;
    box-shadow: none;
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark .bbs-history-panel {
    background: #1e1030;
    border-right-color: #3d2060;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #241238, #1e0f30);
    border-bottom-color: #3d2060;
}

body.dark .history-panel-header h3 {
    color: #d070d0;
}

body.dark .history-search input {
    background: #1a0f28;
    border-color: #4a2060;
    color: #e0c0e0;
}

body.dark .history-search input::placeholder {
    color: #7a5080;
}

body.dark .history-list {
    background: #1e1030;
}

body.dark .history-empty {
    color: #7a5080;
}

body.dark .history-item {
    background: #241238;
    border-color: #4a2060;
    color: #e0c0e0;
}

body.dark .history-item:hover {
    background: #2e1848;
    border-color: #7a40a0;
}

body.dark .history-item.active {
    background: #2a1040;
    border-color: #9040b0;
    box-shadow: 0 1px 5px rgba(144, 64, 176, 0.3);
}

body.dark .history-item-title {
    color: #e0a0d0;
}

body.dark .history-item-meta {
    color: #907090;
}

body.dark .history-count {
    background: #4a2060;
    color: #d090d0;
}

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

body.dark .history-item-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

body.dark .bbs-input-panel {
    background: #1e1030;
    border-right-color: #3d2060;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #241238, #1e1030);
    border-bottom-color: #3d2060;
}

body.dark .panel-header h3 {
    color: #d070d0;
}

body.dark .panel-tip {
    color: #907090;
}

body.dark .bbs-input-body {
    background: #1e1030;
}

body.dark .form-group label {
    color: #c090b0;
}

body.dark .label-tip {
    color: #806080;
}

body.dark .bbs-input,
body.dark .bbs-textarea,
body.dark .bbs-select {
    background: #2a1040;
    border-color: #4a2060;
    color: #e0c0e0;
}

/* 暗黑模式 select 下拉选项正确渲染 */
body.dark .bbs-select {
    color-scheme: dark;
}

body.dark .bbs-input:focus,
body.dark .bbs-textarea:focus,
body.dark .bbs-select:focus {
    border-color: #9040b0;
    box-shadow: 0 0 0 3px rgba(144, 64, 176, 0.2);
}

body.dark .bbs-input::placeholder,
body.dark .bbs-textarea::placeholder {
    color: #7a5080;
}

body.dark .theme-tag {
    background: #2a1040;
    border-color: #4a2060;
    color: #c090c0;
}

body.dark .theme-tag:hover {
    background: #351050;
    border-color: #8040a0;
}

body.dark .theme-tag.active {
    background: linear-gradient(135deg, #7030a0 0%, #9040b0 100%);
}

body.dark .age-btn,
body.dark .length-btn {
    background: #2a1040;
    border-color: #4a2060;
    color: #c090c0;
}

body.dark .age-btn:hover,
body.dark .length-btn:hover {
    background: #351050;
    border-color: #8040a0;
}

body.dark .age-btn.active,
body.dark .length-btn.active {
    background: linear-gradient(135deg, #7030a0 0%, #9060a0 100%);
}

body.dark .scenario-btn {
    background: linear-gradient(135deg, #241238 0%, #2a1040 100%);
    border-color: #4a2060;
    color: #d090c0;
}

body.dark .scenario-btn:hover {
    background: linear-gradient(135deg, #351050 0%, #3a1848 100%);
    border-color: #8040a0;
}

body.dark .bbs-result-panel .panel-header {
    border-bottom-color: #3d2060;
}

body.dark .bbs-result-body {
    background: linear-gradient(160deg, #1a0f25 0%, #1e1030 100%);
}

body.dark .placeholder-title {
    color: #d070c0;
}

body.dark .placeholder-desc {
    color: #94a3b8;
}

body.dark .story-tag {
    background: linear-gradient(135deg, #241238 0%, #2a1040 100%);
    border-color: #4a2060;
    color: #c090c0;
}

body.dark .story-tag:hover {
    background: linear-gradient(135deg, #351050 0%, #3a1838 100%);
    border-color: #8040a0;
}

body.dark .loading-text {
    color: #b070a0;
}

body.dark .story-content {
    color: #ddb0d0;
    font-family: "Georgia", "Microsoft YaHei", "PingFang SC", serif;
}

body.dark .story-content .story-title {
    color: #d070c0;
}

body.dark .story-content .story-title::after {
    background: linear-gradient(90deg, transparent, #7030a0, #5a2080, transparent);
}

body.dark .story-content .story-paragraph:first-of-type::first-letter {
    color: #c060d0;
}

body.dark .story-footer {
    background: linear-gradient(to bottom, rgba(30, 16, 48, 0), rgba(30, 10, 40, 0.9));
    border-top-color: #3d2060;
}

body.dark .story-footer-decoration {
    color: #7a5080;
}

body.dark .copy-reply-btn {
    background: linear-gradient(135deg, #7030a0, #5a2080);
    box-shadow: 0 2px 8px rgba(112, 48, 160, 0.35);
}

body.dark .copy-reply-btn:hover {
    box-shadow: 0 4px 12px rgba(112, 48, 160, 0.5);
}

body.dark .result-tag {
    background: rgba(144, 64, 176, 0.2);
    border-color: rgba(144, 64, 176, 0.3);
    color: #d090d0;
}

body.dark .result-time {
    color: #94a3b8;
}

body.dark .generate-hint {
    color: #806080;
}

/* 暗黑模式主按钮 */
body.dark .generate-main-btn {
    background: linear-gradient(135deg, #7030a0 0%, #9040b0 50%, #6a20a0 100%);
    box-shadow: 0 4px 15px rgba(112, 48, 160, 0.4);
}

body.dark .generate-main-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(112, 48, 160, 0.55);
}

/* 暗黑模式主按钮 disabled 降级 */
body.dark .generate-main-btn:disabled {
    background: rgba(144, 64, 176, 0.25);
    box-shadow: none;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 暗黑模式滚动条 */
body.dark .bbs-result-body::-webkit-scrollbar-thumb,
body.dark .story-content::-webkit-scrollbar-thumb,
body.dark .bbs-input-body::-webkit-scrollbar-thumb,
body.dark .history-list::-webkit-scrollbar-thumb {
    background: #4a2060;
}

body.dark .bbs-result-body::-webkit-scrollbar-thumb:hover,
body.dark .story-content::-webkit-scrollbar-thumb:hover,
body.dark .bbs-input-body::-webkit-scrollbar-thumb:hover,
body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #7030a0;
}

/* 暗黑模式模态框 */
body.dark .bbs-modal-content {
    background: #1e1030;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

body.dark .bbs-modal-body {
    background: #1e1030;
}

body.dark .example-card {
    background: linear-gradient(135deg, #241238 0%, #2a1030 100%);
    border-color: #4a2060;
}

body.dark .example-card:hover {
    border-color: #8040a0;
    background: linear-gradient(135deg, #351050 0%, #3a1838 100%);
}

body.dark .example-card-title {
    color: #d090c0;
}

body.dark .example-card-desc {
    color: #907090;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .bbs-history-panel {
        display: none;
    }

    .bbs-input-panel {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .bbs-container {
        height: auto;
        min-height: auto;
        border-radius: 0;
    }

    .bbs-main-content {
        flex-direction: column;
    }

    .bbs-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f5c8d8;
        max-height: 450px;
    }

    body.dark .bbs-input-panel {
        border-bottom-color: #3d2060;
    }

    .bbs-result-panel {
        min-height: 400px;
    }

    .story-content {
        padding: 20px;
    }

    .bbs-toolbar {
        padding: 6px 10px;
    }

    .toolbar-title {
        display: none;
    }

    .quick-scenarios {
        grid-template-columns: 1fr 1fr;
    }

    /* 移动端历史删除按钮强制可见 */
    .history-item-delete {
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .bbs-modal {
        width: 95%;
    }

    .bbs-modal-body {
        grid-template-columns: 1fr 1fr;
    }
}
