/* ===== 拉布布风格可爱UI ===== */

/* 基础变量 */
:root {
    /* 糖果色系 */
    --pink: #FF9EC4;
    --pink-light: #FFD4E5;
    --pink-dark: #FF6B9D;
    --purple: #C5A3FF;
    --purple-light: #E8D5FF;
    --blue: #A8D8FF;
    --blue-light: #D4EEFF;
    --cream: #FFF5E6;
    --cream-light: #FFF9F0;
    
    /* 功能色 */
    --success: #7DD3A8;
    --warning: #FFB86B;
    --error: #FF8A9B;
    
    /* 文字色 */
    --text-main: #5A4A5C;
    --text-light: #8B7B8E;
    --text-muted: #B5A8B8;
    
    /* 背景 */
    --bg-gradient: linear-gradient(180deg, #FFF0F5 0%, #F8F0FF 50%, #F0F8FF 100%);
    
    /* 圆角 */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(255, 158, 196, 0.15);
    --shadow-md: 0 4px 16px rgba(255, 158, 196, 0.2);
    --shadow-lg: 0 8px 32px rgba(255, 158, 196, 0.25);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
}

/* ===== 可爱背景装饰 ===== */
.cute-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud, .star, .heart, .sparkle {
    position: absolute;
    font-size: 24px;
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
}

.cloud-1 { top: 10%; left: 10%; animation-delay: 0s; }
.cloud-2 { top: 30%; right: 15%; animation-delay: -5s; }
.cloud-3 { bottom: 20%; left: 20%; animation-delay: -10s; }

.star-1 { top: 15%; right: 10%; animation-delay: -2s; }
.star-2 { top: 45%; left: 5%; animation-delay: -7s; }
.star-3 { bottom: 35%; right: 8%; animation-delay: -12s; }

.heart-1 { top: 25%; left: 8%; animation-delay: -3s; }
.heart-2 { bottom: 15%; right: 12%; animation-delay: -8s; }

.sparkle-1 { top: 60%; right: 5%; animation-delay: -6s; }
.sparkle-2 { bottom: 40%; left: 12%; animation-delay: -11s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(-10px) rotate(-5deg); }
}

/* ===== 主容器 ===== */
.app-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
}

/* ===== 头部 ===== */
.app-header {
    position: relative;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFB6C1 0%, #DDA0DD 50%, #E6E6FA 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    overflow: hidden;
}

/* 拉布布风格背景图案 */
.header-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: 
        radial-gradient(circle at 20% 30%, #FF69B4 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, #DA70D6 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, #FFB6C1 3px, transparent 3px),
        radial-gradient(circle at 30% 80%, #DDA0DD 2px, transparent 2px),
        radial-gradient(circle at 70% 20%, #E6E6FA 2px, transparent 2px),
        radial-gradient(circle at 10% 60%, #FF69B4 1px, transparent 1px),
        radial-gradient(circle at 90% 40%, #DA70D6 1px, transparent 1px);
    background-size: 60px 60px, 80px 80px, 100px 100px, 70px 70px, 90px 90px, 50px 50px, 75px 75px;
    background-position: 0 0, 20px 20px, 40px 40px, 60px 60px, 10px 10px, 30px 30px, 50px 50px;
    animation: patternFloat 20s linear infinite;
}

@keyframes patternFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-60px); }
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.logo-icon {
    font-size: 32px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink-dark) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-size: 20px;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.page {
    display: none;
    height: 100%;
    flex-direction: column;
}

.page.active {
    display: flex;
}

/* ===== 对话页面 ===== */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.bot-message .message-avatar {
    background-image: url('../images/avatar.png');
    background-size: cover;
    background-position: center;
    background-color: transparent;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--purple-light) 100%);
}

.message-bubble {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border-top-left-radius: 4px;
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    line-height: 1.7;
    position: relative;
}

.message-text {
    flex: 1;
}

/* 复制按钮 */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-bubble:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: white;
    color: var(--pink-dark);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: 4px;
}

.user-message .copy-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.user-message .copy-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: white;
}

.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

/* 设置按钮 */
.settings-toggle {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: var(--shadow-md);
    color: var(--pink-dark);
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.settings-toggle:active {
    transform: scale(0.95);
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--pink-light);
    appearance: none;
    outline: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.range-value {
    color: var(--pink-dark);
    font-weight: 600;
}

.setting-group select,
.setting-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: white;
    outline: none;
    transition: border-color 0.3s;
}

.setting-group select:focus,
.setting-group textarea:focus {
    border-color: var(--pink);
}

.setting-group textarea {
    resize: none;
    font-family: inherit;
}

/* 开关样式 */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-label input[type="checkbox"] {
    display: none;
}

.switch-slider {
    width: 48px;
    height: 26px;
    background: var(--pink-light);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.switch-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: var(--shadow-sm);
}

.switch-label input:checked + .switch-slider {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
}

.switch-label input:checked + .switch-slider::after {
    transform: translateX(22px);
}

/* ===== 输入区域 ===== */
.input-area {
    padding: 12px 16px 16px;
    background: white;
    border-top: 1px solid var(--pink-light);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

.input-wrapper textarea:focus {
    border-color: var(--pink);
}

.input-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn {
    background: var(--cream-light);
    color: var(--text-light);
}

.clear-btn:active {
    transform: scale(0.95);
}

.send-btn {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
}

/* ===== 生图页面 ===== */
.image-input-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 24px;
}

.prompt-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
}

.prompt-icon {
    font-size: 20px;
}

.prompt-box textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.6;
}

.prompt-box textarea:focus {
    border-color: var(--pink);
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.quick-btn:active {
    transform: scale(0.95);
}

/* 生图设置 */
.image-settings {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--cream-light);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    font-size: 14px;
    font-weight: 600;
}

.setting-row select {
    padding: 8px 12px;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    outline: none;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--pink-light);
    font-size: 18px;
    cursor: pointer;
    color: var(--text-main);
}

.number-input button:active {
    transform: scale(0.95);
}

.number-input input {
    width: 48px;
    height: 32px;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    outline: none;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.generate-btn:active {
    transform: translateY(2px);
}

.generate-btn:disabled {
    opacity: 0.5;
}

.btn-icon {
    font-size: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

/* 生图结果 */
.image-result-area {
    margin-top: 16px;
    background: white;
    border-radius: var(--radius-lg);
    min-height: 200px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

.empty-hint {
    margin-top: 6px;
    font-weight: 500;
}

/* 生成的图片 */
.generated-images {
    padding: 12px;
}

.image-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.image-card img {
    width: 100%;
    display: block;
}

.image-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--cream-light);
}

.image-card-actions button {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--pink-light);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
}

.image-card-actions button:active {
    transform: scale(0.98);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    display: flex;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF9FB 100%);
    border-top: 2px solid var(--pink-light);
    flex-shrink: 0;
    padding: 8px 0 12px;
    box-shadow: 0 -4px 12px rgba(255, 158, 196, 0.1);
}

.nav-item {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 20px;
    color: var(--text-light);
}

.nav-item.active .nav-icon-wrap {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 158, 196, 0.4);
    transform: translateY(-4px);
}

.nav-item:not(.active):hover .nav-icon-wrap {
    background: var(--pink-light);
    transform: translateY(-2px);
}

.nav-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    transition: all 0.3s;
}

.nav-item.active .nav-label {
    color: var(--pink-dark);
    font-weight: 700;
}

/* ===== 加载动画 ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--pink-light);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 16px;
    color: var(--text-light);
}

/* ===== Toast提示 ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: transform 0.3s;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--error);
}

.toast.success {
    background: var(--success);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--cream-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pink-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pink);
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    .app-container {
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: var(--radius-xl);
        height: calc(100vh - 40px);
        box-shadow: var(--shadow-lg);
    }
}

/* ===== 头部按钮 ===== */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: var(--pink-dark);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:active {
    transform: scale(0.95);
    background: white;
}

/* ===== 历史页面 ===== */
.history-tabs {
    display: flex;
    background: white;
    padding: 12px;
    gap: 8px;
    border-bottom: 1px solid var(--pink-light);
}

.history-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--pink-light);
    background: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.history-tab.active {
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    border-color: var(--pink);
    color: var(--text-main);
}

.history-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-list {
    display: none;
}

.history-list.active {
    display: block;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.history-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.history-empty p {
    font-size: 15px;
}

.history-empty .empty-hint {
    margin-top: 8px;
    font-size: 13px;
}

/* 历史卡片 */
.history-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    cursor: pointer;
}

.history-card:active {
    transform: scale(0.98);
}

.history-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.history-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.history-card-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 12px;
}

.history-card-preview {
    font-size: 13px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
}

.history-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-card-count {
    font-size: 12px;
    color: var(--text-muted);
}

.history-card-actions {
    display: flex;
    gap: 8px;
}

.history-card-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-card-actions .delete-btn {
    background: var(--cream-light);
    color: var(--error);
}

.history-card-actions .delete-btn:active {
    background: var(--error);
    color: white;
}

/* 图片历史卡片 */
.image-history-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.image-history-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--cream-light);
}

.image-history-info {
    padding: 12px;
}

.image-history-prompt {
    font-size: 13px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}

.image-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.image-history-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.image-history-actions button {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--pink-light);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.image-history-actions button:active {
    transform: scale(0.98);
}

/* 数据管理 */
.data-management {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--pink-light);
    display: flex;
    gap: 8px;
}

.data-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--pink-light);
    background: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.data-btn:active {
    transform: scale(0.98);
}

.data-btn i {
    font-size: 18px;
}

.data-btn.danger {
    border-color: var(--error);
    color: var(--error);
}

.data-btn.danger:active {
    background: var(--error);
    color: white;
}

/* ===== 历史侧边栏 ===== */
.history-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.history-sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-item {
    background: var(--cream-light);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-item:active {
    transform: scale(0.98);
    background: var(--pink-light);
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--purple-light) 100%);
}

.sidebar-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.sidebar-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--pink-light);
}

.sidebar-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-btn:active {
    transform: scale(0.98);
}

/* ===== 确认对话框 ===== */
.confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.confirm-dialog.show {
    display: flex;
}

.confirm-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 85%;
    text-align: center;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.confirm-btn.cancel {
    background: var(--cream-light);
    color: var(--text-main);
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: white;
}

.confirm-btn:active {
    transform: scale(0.98);
}
