/* 全局样式 - 温暖浅色调配色方案 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebe8 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    height: calc(100vh - 40px);
}

/* 左侧工作区 */
.workspace {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 6px;
    font-weight: 700;
}

.subtitle {
    font-size: 13px;
    opacity: 0.95;
    margin-bottom: 12px;
}

/* 设置栏 */
.settings-bar {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap; /* Desktop wraps, mobile overrides to nowrap */
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-group label {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.setting-select {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-select:hover {
    background: rgba(255, 255, 255, 0.3);
}

.setting-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.35);
}

.setting-select option {
    background: #457b9d;
    color: white;
}

/* 聊天容器 */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 22px;
}

.welcome-message p {
    color: #666;
    font-size: 15px;
    margin-bottom: 30px;
}

.info-cards {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-card {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 150px;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-icon {
    font-size: 30px;
    margin-bottom: 8px;
}

.info-text {
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

/* 聊天消息 */
.message {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

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

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-image {
    max-width: 100%;
    margin-top: 10px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

/* 编辑区 */
.edit-section {
    background: #fff9e6;
    border-top: 3px solid #f4a261;
    padding: 20px;
    margin: 0 20px 20px;
    border-radius: 12px;
    max-height: 60vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.edit-header h3 {
    color: #e76f51;
    margin-bottom: 8px;
    font-size: 17px;
}

.edit-header p {
    color: #666;
    font-size: 13px;
    margin-bottom: 14px;
}

.final-edit-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #f4a261;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.final-edit-textarea:focus {
    outline: none;
    border-color: #e76f51;
}

.image-section {
    margin-bottom: 16px;
}

.image-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.image-section-header h4 {
    font-size: 15px;
    color: #555;
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.edit-image-preview img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.image-prompt-display {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #a8dadc;
}

.image-prompt-display small {
    color: #666;
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.prompt-text {
    font-size: 12px;
    color: #333;
    line-height: 1.5;
    font-style: italic;
}

.image-regenerate-box {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    border: 2px dashed #ccc;
    margin-top: 10px;
}

.image-regenerate-box textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.image-regenerate-box textarea:focus {
    outline: none;
    border-color: #a8dadc;
}

.image-regenerate-box .btn {
    width: 100%;
}

.edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* 输入容器 */
.input-container {
    border-top: 1px solid #e0e0e0;
    padding: 14px 20px;
    background: white;
    flex-shrink: 0;
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

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

#userInput {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

#userInput:focus {
    outline: none;
    border-color: #a8dadc;
}

/* 按钮样式 */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn-primary:disabled,
.btn-success:disabled {
    background: #cbd5e0 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn-primary:disabled:hover,
.btn-success:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-success {
    background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
    color: white;
}

.btn-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 218, 220, 0.4);
}

.send-icon {
    font-size: 15px;
}

/* 右侧边栏 */
.sidebar {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #52b788 0%, #2d6a4f 100%);
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(180deg);
}

.posts-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #fafafa;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

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

/* 帖子卡片 - 精简版 */
.post-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.post-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-date {
    font-size: 11px;
    color: #999;
}

.btn-delete {
    background: #ef233c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #d90429;
}

.post-summary {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
    border-left: 3px solid #52b788;
    line-height: 1.4;
}

.post-content {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 8px;
    white-space: pre-wrap;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.post-image {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 6px;
}

/* Posts Filter */
.posts-filter {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.filter-date {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.filter-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.filter-date:focus {
    outline: none;
    border-color: #a8dadc;
}

.filter-separator {
    color: #999;
    font-size: 12px;
    font-weight: bold;
}

.btn-filter-clear {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-filter-clear:hover {
    background: #ff5252;
}

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

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 16px;
    font-size: 15px;
    font-weight: 500;
}

/* 滚动条样式 */
.chat-container::-webkit-scrollbar,
.posts-list::-webkit-scrollbar,
.edit-section::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track,
.posts-list::-webkit-scrollbar-track,
.edit-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb,
.posts-list::-webkit-scrollbar-thumb,
.edit-section::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover,
.posts-list::-webkit-scrollbar-thumb:hover,
.edit-section::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .sidebar {
        max-height: 350px;
    }
}

/* OLD MOBILE STYLES REMOVED - Replaced with new mobile responsive design below */

/* Settings Button */
.btn-settings {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.btn-settings:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000; /* 高于移动端侧边栏(10000)，低于Custom Dialog(15000) */
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.modal-close {
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-right: 24px; /* Align with modal-body padding */
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 16px;
}

.settings-section label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    margin-top: 12px;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.settings-input:focus {
    outline: none;
    border-color: #a8dadc;
}

.prompt-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.prompt-tab {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.prompt-tab:hover {
    border-color: #a8dadc;
}

.prompt-tab.active {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    border-color: #457b9d;
}

.prompt-editor {
    margin-top: 12px;
}

.prompt-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #a8dadc;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    min-width: 180px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.context-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.context-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

/* Image with context menu capability */
.edit-image-preview img,
.message-image {
    cursor: context-menu;
}


/* Edit Modal Styles */
.edit-section-modal h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.version-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.version-select:focus {
    outline: none;
    border-color: #a8dadc;
}

.edit-image-preview-modal {
    margin-top: 15px;
    text-align: center;
}

.edit-image-preview-modal img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* View Post Modal Styles */
.view-post-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.view-post-image {
    text-align: center;
}

.full-post-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn-view {
    padding: 4px 10px;
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(69, 123, 157, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 8px;
}

/* Info Cards Clickable */
.info-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.info-card:active {
    transform: translateY(-1px);
}

/* Theme Card Descriptions */
.info-desc {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
    text-align: center;
}

/* Theme Editors */
.theme-editors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
}

.theme-editor {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.theme-editor h4 {
    margin-bottom: 12px;
    color: #457b9d;
    font-size: 14px;
}

.theme-editor label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.settings-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    resize: vertical;
    font-family: inherit;
}

.settings-textarea:focus {
    outline: none;
    border-color: #a8dadc;
}

/* Two-Step Edit Styles */
.edit-step h3 {
    margin-bottom: 20px;
    color: #457b9d;
}

.version-selection label,
.draft-editor label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.image-checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.image-checkbox-item {
    margin: 8px 0;
}

.image-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.image-checkbox-item label:hover {
    background: #f5f5f5;
}

.image-checkbox-item input[type="checkbox"] {
    margin-right: 10px;
}

.image-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.draft-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.draft-textarea:focus {
    outline: none;
    border-color: #a8dadc;
}

.draft-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    min-height: 100px;
}

.draft-image-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.draft-image-card:hover {
    border-color: #a8dadc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.draft-image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
}

.draft-image-actions {
    padding: 8px;
    background: white;
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
}

.btn-small.btn-delete {
    background: #ef476f;
    color: white;
}

.btn-small.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

/* Image Zoom Modal */
.image-zoom-content {
    max-width: 95vw;
    max-height: 95vh;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.image-zoom-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.image-zoom-content .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

/* Make chat images clickable with cursor pointer */
.chat-image {
    cursor: pointer;
    transition: opacity 0.2s;
}

.chat-image:hover {
    opacity: 0.9;
}

/* View post timestamp */
.view-post-timestamp {
    margin-top: 15px;
    margin-left: 0;
    padding-top: 15px;
    padding-left: 24px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
}

/* Theme tabs */
.theme-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.theme-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.theme-tab:hover {
    color: #457b9d;
}

.theme-tab.active {
    color: #457b9d;
    border-bottom-color: #457b9d;
    font-weight: 600;
}

/* Emoji picker */
.emoji-picker-container {
    margin-bottom: 15px;
}

.emoji-display {
    font-size: 24px;
    text-align: center;
    cursor: default;
    margin-bottom: 10px;
}

.emoji-options {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.emoji-option {
    font-size: 24px;
    padding: 8px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-option:hover {
    border-color: #a8dadc;
    transform: scale(1.1);
}

.emoji-option:active {
    transform: scale(0.95);
}
/* Custom Dialog System */
.custom-dialog-modal {
    z-index: 15000; /* 高于所有覆盖层，确保始终在最上层 */
    animation: fadeIn 0.2s ease;
}

.custom-dialog-content {
    max-width: 450px;
    width: 90%;
    padding: 30px;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-dialog-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.custom-dialog-message {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.custom-dialog-input-container {
    margin-bottom: 25px;
}

.custom-dialog-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.custom-dialog-input:focus {
    outline: none;
    border-color: #a8dadc;
}

.custom-dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-dialog-button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.custom-dialog-button-primary {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
}

.custom-dialog-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 218, 220, 0.4);
}

.custom-dialog-button-secondary {
    background: #e9ecef;
    color: #495057;
}

.custom-dialog-button-secondary:hover {
    background: #dee2e6;
}

.custom-dialog-button:active {
    transform: translateY(0);
}

/* Sidebar Toggle Button (Mobile) */
.sidebar-toggle {
    display: none; /* Hidden by default, shown on mobile */
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    z-index: 100;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

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

/* Sidebar Actions (Close button for mobile) */
.sidebar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-close {
    display: none; /* Hidden by default, shown on mobile */
    background: rgba(255, 255, 255, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.sidebar-close:active {
    transform: scale(0.95);
}

/* Horizontal Scrollable Wrappers */
.settings-bar-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.settings-bar-wrapper::-webkit-scrollbar {
    height: 6px;
}

.settings-bar-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.settings-bar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.settings-bar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Note: flex-wrap handled per media query */
.settings-bar {
    min-width: min-content;
}

/* Info Cards Wrapper (Horizontal Scroll) */
.info-cards-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}

.info-cards-wrapper::-webkit-scrollbar {
    height: 8px;
}

.info-cards-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.info-cards-wrapper::-webkit-scrollbar-thumb {
    background: #a8dadc;
    border-radius: 4px;
}

.info-cards-wrapper::-webkit-scrollbar-thumb:hover {
    background: #457b9d;
}

/* Quick Actions Wrapper (Horizontal Scroll) */
.quick-actions-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}

.quick-actions-wrapper::-webkit-scrollbar {
    height: 6px;
}

.quick-actions-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.quick-actions-wrapper::-webkit-scrollbar-thumb {
    background: #a8dadc;
    border-radius: 3px;
}

.quick-actions-wrapper::-webkit-scrollbar-thumb:hover {
    background: #457b9d;
}

/* Removed - handled in media queries */

/* Image Upload Placeholder */
.draft-image-upload-placeholder {
    width: 150px;
    height: 150px;
    border: 3px dashed #a8dadc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.draft-image-upload-placeholder:hover {
    border-color: #457b9d;
    background: #e9f5f6;
    transform: scale(1.05);
}

.draft-image-upload-placeholder:active {
    transform: scale(0.95);
}

.upload-placeholder-icon {
    font-size: 64px;
    color: #a8dadc;
    transition: color 0.3s;
    font-weight: 300;
}

.draft-image-upload-placeholder:hover .upload-placeholder-icon {
    color: #457b9d;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
    }

    .container {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        height: 100vh !important;
        max-width: 100% !important;
    }

    /* Header adjustments */
    .header {
        position: relative !important;
        padding: 15px 20px !important;
    }

    .header h1 {
        font-size: 20px !important;
        padding-right: 50px !important; /* Space for toggle button */
        margin-bottom: 6px !important;
    }

    .subtitle {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }

    /* Show sidebar toggle button */
    .sidebar-toggle {
        display: block !important;
    }

    /* Settings bar horizontal scroll */
    .settings-bar {
        display: flex !important;
        justify-content: center !important; /* Center on mobile */
        gap: 15px !important;
        padding-right: 10px;
        flex-wrap: nowrap !important;
        width: max-content !important;
        min-width: 100% !important;
    }

    .setting-group {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .settings-bar-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* Workspace */
    .workspace {
        border-radius: 0 !important;
        height: 100vh !important;
        width: 100% !important;
    }

    /* Chat container */
    .chat-container {
        flex: 1;
        overflow-y: auto;
    }

    /* Theme cards horizontal scroll */
    .info-cards {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 15px !important;
        padding-bottom: 10px;
        justify-content: flex-start !important;
        width: max-content !important;
        min-width: 100% !important;
    }

    .info-card {
        flex-shrink: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
    }

    .info-cards-wrapper {
        overflow-x: auto !important;
        margin: 0 -20px !important;
        padding: 0 20px !important;
    }

    /* Quick actions buttons responsive */
    .quick-actions {
        display: flex !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        width: max-content !important;
        min-width: 100% !important;
    }

    .quick-actions .btn {
        flex-shrink: 0 !important;
        min-width: 180px !important;
        max-width: 48% !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    .quick-actions-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* Input container */
    .input-container {
        padding: 12px !important;
    }

    .input-box {
        flex-direction: row !important; /* Keep horizontal: textarea left, button right */
        gap: 8px !important;
        align-items: stretch !important;
    }

    .input-box textarea {
        font-size: 14px !important;
        flex: 1 !important;
    }

    .btn-send {
        width: auto !important;
        min-width: 60px !important;
        padding: 8px 16px !important;
    }

    /* Hide desktop sidebar completely on mobile - use overlay instead */
    .sidebar {
        display: none !important;
    }

    /* Show close button in sidebar */
    .sidebar-close {
        display: block !important;
        background: rgba(255, 255, 255, 0.35) !important;
        border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
        font-size: 18px !important;
        padding: 8px 14px !important;
        color: white !important;
    }

    .sidebar-header {
        justify-content: space-between !important;
    }

    /* Modal adjustments - More compact for mobile */
    .modal-content {
        width: 92% !important;
        max-width: 92% !important;
        margin: 4vh auto !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }

    .modal-body {
        padding: 15px !important;
        max-height: calc(92vh - 120px) !important;
        overflow-y: auto !important;
    }

    .modal-header {
        padding: 15px !important;
    }

    .modal-header h2 {
        font-size: 18px !important;
    }

    .modal-actions {
        padding: 12px 15px !important;
    }

    .draft-images {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 10px !important;
    }

    .draft-image-card img {
        width: 120px !important;
        height: 120px !important;
    }

    .draft-image-upload-placeholder {
        width: 120px !important;
        height: 120px !important;
    }

    .upload-placeholder-icon {
        font-size: 48px !important;
    }

    /* Settings Modal Optimizations for Mobile */
    .settings-section {
        margin-bottom: 20px !important;
    }

    .settings-section h3 {
        font-size: 15px !important;
        margin-bottom: 12px !important;
    }

    .settings-input,
    .settings-textarea,
    .prompt-textarea {
        font-size: 14px !important;
        padding: 10px !important;
    }

    /* Theme tabs horizontal scroll */
    .theme-tabs {
        display: flex !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 5px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }

    .theme-tab {
        flex-shrink: 0 !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* Prompt tabs horizontal scroll */
    .prompt-tabs {
        display: flex !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 5px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }

    .prompt-tab {
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    /* Emoji picker responsive grid */
    .emoji-options {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 6px !important;
        padding: 8px !important;
    }

    .emoji-option {
        font-size: 20px !important;
        padding: 6px !important;
    }

    .emoji-display {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }

    /* Theme editor fields */
    .theme-editor label {
        font-size: 12px !important;
        margin-top: 10px !important;
    }

    .theme-editor input[type="text"],
    .theme-editor textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tag Groups Management mobile optimization */
    #tagGroupsList > div {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    #tagGroupsList h4 {
        font-size: 14px !important;
        word-break: break-word !important;
    }

    #tagGroupsList input[type="text"] {
        font-size: 14px !important;
        padding: 8px !important;
    }

    #tagGroupsList .btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    #tagGroupsList > div > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    #tagGroupsList > div > div:last-child {
        flex-direction: column !important;
        gap: 8px !important;
    }

    #tagGroupsList > div > div:last-child input {
        width: 100% !important;
    }

    #tagGroupsList > div > div:last-child button {
        width: 100% !important;
    }

    /* Tags display - wrap on mobile */
    #tagGroupsList span[style*="display: inline-block"] {
        font-size: 12px !important;
        padding: 3px 6px !important;
        margin: 2px !important;
    }

    /* New group creation on mobile */
    #newGroupName {
        font-size: 14px !important;
    }

    .settings-section > div > div {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .settings-section > div > div input[type="text"] {
        width: 100% !important;
    }

    .settings-section > div > div button {
        width: 100% !important;
    }

    /* Sidebar must fill full screen */
    .sidebar-header {
        flex-shrink: 0 !important;
    }

    .posts-filter {
        flex-shrink: 0 !important;
    }

    .sidebar .posts-list {
        flex: 1 !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
}

/* Tablet responsive styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        grid-template-columns: 1fr 300px;
    }

    .sidebar {
        width: 300px;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .quick-actions .btn {
        min-width: 160px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header h1 {
        font-size: 18px !important;
    }

    .subtitle {
        font-size: 11px !important;
    }

    .setting-select {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    .info-card {
        width: 240px !important;
        min-width: 240px !important;
        padding: 15px !important;
    }

    .info-icon {
        font-size: 36px !important;
    }

    .info-text {
        font-size: 15px !important;
    }

    .info-desc {
        font-size: 11px !important;
    }

    .quick-actions .btn {
        min-width: 150px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }

    .modal-content {
        width: 98% !important;
        max-width: 98% !important;
    }
}
