/* ============================================
   凡星社 10秒AI矩阵 - 主样式表
   ============================================ */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    
    --bg-dark: #0a0a1a;
    --bg-card: #ffffff;
    --bg-elevated: #1a1a2e;
    --bg-chat: #f8f9fa;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --text-muted: rgba(255,255,255,0.5);
    --text-dark: #1f2937;
    --text-dark-secondary: #6b7280;
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height: 64px;
}

html {
    scroll-behavior: smooth;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   主内容区
   ============================================ */
.main-content-mobile {
    padding: 16px;
    padding-bottom: 80px;
}

.header-mobile {
    text-align: center;
    margin-bottom: 20px;
}

.header-mobile h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.header-mobile p {
    font-size: 13px;
    color: var(--text-muted);
}

.header-user {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.header-user a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 8px;
}
.header-user a:hover { text-decoration: underline; }
.header-points { margin-left: 6px; color: var(--text-muted); font-size: 0.8rem; }

/* 个人中心二级弹层 */
.profile-panel-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.profile-panel-card {
    background: var(--bg-elevated);
    border-radius: 16px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
}
.profile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.profile-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.profile-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.profile-panel-close:hover { color: var(--text-primary); }
.profile-panel-body {
    padding: 20px;
}
.profile-panel-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}
.profile-panel-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.profile-panel-points { font-size: 0.9rem; color: var(--text-muted); }
.profile-panel-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.profile-panel-link {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.profile-panel-link:hover { background: rgba(255,255,255,0.1); }
.profile-panel-link.profile-panel-logout {
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
}
.profile-panel-guest {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.profile-panel-btn {
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 10px;
}
.profile-panel-btn:hover { opacity: 0.9; }
.profile-panel-btn-secondary {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ============================================
   流式输出动画（AI打字机效果）
   ============================================ */
.message-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  text-indent: 0;
  padding-left: 0;
}

.typewriter-cursor {
  animation: blink 1.5s infinite; /* 降低闪烁频率，更柔和 */
  font-weight: normal; /* 光标不要太粗 */
  opacity: 0.8; /* 降低不透明度，避免刺眼 */
}

/* 打字时保持常亮，不闪烁 */
.typewriter-typing .typewriter-cursor {
  animation: none;
  opacity: 1;
}

@keyframes blink {
  0%, 40% { opacity: 1; }
  60%, 100% { opacity: 0; }
}

/* ============================================
   记忆模块
   ============================================ */
.memory-section {
    background: var(--bg-elevated);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}

.memory-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 标签页说明文案 */
.memory-tab-description {
    padding: 4px 16px 12px;
    background: var(--bg-elevated);
}

.desc-text {
    font-size: 12px;
    color: #999999;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.memory-tab.active {
    background: rgba(102, 126, 234, 0.1);
    color: white;
    border-bottom: 2px solid var(--primary-color);
}

.memory-tab span:first-child {
    font-size: 24px;
}

.memory-tab span:nth-child(2) {
    font-size: 14px;
    font-weight: 600;
}

.memory-tab small {
    font-size: 10px;
    opacity: 0.7;
}

.memory-content {
    min-height: 400px;
}

.memory-library,
.memory-gallery {
    display: flex;
    min-height: 400px;
}

.memory-sidebar {
    width: 140px;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.memory-category {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.memory-category:hover {
    background: rgba(255, 255, 255, 0.05);
}

.memory-category.active {
    background: var(--primary-gradient);
    color: white;
}

.memory-main-area {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

/* 上传区域 */
.memory-upload-zone {
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(102, 126, 234, 0.05);
}

.memory-upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.memory-upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.15);
}

.upload-icon-large {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--primary-color);
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 记忆列表 */
.memory-list-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: var(--text-secondary);
}

.item-count {
    color: var(--text-muted);
}

.memory-list {
    max-height: 300px;
    overflow-y: auto;
}

.memory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.memory-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.item-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.item-tags {
    font-size: 11px;
    color: #999999;
    margin: 4px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.item-tags .tag {
    cursor: pointer;
    transition: color 0.2s;
}

.item-tags .tag:hover {
    color: var(--primary-color);
}

/* 标签分类 */
.tag-section {
    margin-top: 16px;
}

.section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

.section-title {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 16px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-container {
    padding: 0 12px;
}

.tag-item {
    font-size: 12px;
    padding: 8px 16px;
    margin-bottom: 2px;
}

.tag-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-delete {
    opacity: 0.5;
}

.btn-delete:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
}

/* 空状态 */
.memory-empty-state,
.memory-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.memory-empty-state span,
.memory-empty span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.memory-empty-state p,
.memory-empty p {
    font-size: 14px;
    margin-bottom: 8px;
}

.memory-empty-state small,
.memory-empty small {
    font-size: 12px;
    opacity: 0.7;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* 毛玻璃弹窗（记忆、通用工具） */
.glass-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.glass-modal {
    background: rgba(26, 26, 46, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.glass-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tool-unified-header .glass-modal-title { flex: 0 0 auto; }
.tool-unified-header .tool-unified-gender-in-header { margin: 0 12px; flex: 0 0 auto; margin-bottom: 0; }
.tool-unified-header .tool-unified-gender-in-header .tool-unified-gender-tabs { margin-top: 0; }
.tool-unified-header .glass-modal-close { flex: 0 0 auto; }

.glass-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.glass-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.glass-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 登录/注册弹窗（与主页风格一致） */
.auth-modal-overlay { align-items: center; justify-content: center; padding: 16px; }
.auth-modal .glass-modal-body { max-height: 75vh; }
.auth-modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.auth-main-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.auth-main-tabs .auth-tab {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
}
.auth-main-tabs .auth-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.auth-block { display: none; }
.auth-block.active { display: block; }
.auth-modal-body .auth-tabs {
    display: flex;
    margin-bottom: 14px;
    gap: 6px;
}
.auth-modal-body .auth-tab {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
}
.auth-modal-body .auth-tab.active {
    background: rgba(99,102,241,0.35);
    border-color: var(--primary-color);
    color: #fff;
}
.auth-modal-body .auth-panel { display: none; }
.auth-modal-body .auth-panel.active { display: block; }
.auth-modal-body .auth-form label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.auth-modal-body .auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 14px;
    box-sizing: border-box;
}
.auth-modal-body .auth-form input::placeholder { color: var(--text-muted); }
.auth-form-row-wrap { margin-bottom: 14px; }
.auth-form-row {
    display: flex;
    gap: 10px;
}
.auth-form-row input { flex: 1; margin-bottom: 0; }
.auth-modal-body .auth-btn-code {
    flex: 0 0 100px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(99,102,241,0.3);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}
.auth-modal-body .auth-btn-code:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-modal-body .auth-form button[type="submit"] {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}
.auth-modal-body .auth-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-modal-body .auth-error {
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 20px;
}
.auth-modal-body .auth-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.auth-modal-body .auth-footer-link {
    background: none;
    border: none;
    padding: 0;
    margin-left: 4px;
    color: var(--primary-color);
    cursor: pointer;
    font-size: inherit;
    text-decoration: none;
}
.auth-modal-body .auth-footer-link:hover { text-decoration: underline; }

.glass-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

/* 文字记忆弹窗内容 */
.memory-text-modal .glass-modal-body { padding-bottom: 24px; }
.memory-text-section { margin-bottom: 20px; }
.memory-text-section-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
}
.memory-text-section-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    line-height: 1.4;
}
.memory-text-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.memory-text-upload-zone:hover { border-color: rgba(99, 102, 241, 0.5); background: rgba(99, 102, 241, 0.08); }
.memory-text-upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}
.memory-text-upload-icon { font-size: 28px; }
.memory-text-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.memory-tag {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s;
}
.memory-tag:hover { background: rgba(99, 102, 241, 0.4); }
.memory-text-list, .memory-tree-list {
    min-height: 48px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
.memory-text-empty { padding: 12px 0; color: rgba(255, 255, 255, 0.5); font-size: 13px; }
.memory-tree-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.memory-tree-tab {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.memory-tree-tab:hover { background: rgba(255, 255, 255, 0.1); }
.memory-tree-tab.active { background: rgba(99, 102, 241, 0.3); border-color: rgba(99, 102, 241, 0.5); }
.memory-text-note {
    padding: 12px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.memory-text-note p { font-size: 12px; color: rgba(255, 255, 255, 0.8); line-height: 1.5; margin: 0; }

/* 图片记忆弹窗内容 */
.memory-image-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 14px;
    line-height: 1.5;
}
.memory-image-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}
.memory-image-upload-zone:hover { border-color: rgba(99, 102, 241, 0.5); background: rgba(99, 102, 241, 0.08); }
.memory-image-upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}
.memory-image-upload-icon { font-size: 32px; }
.memory-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-height: 80px;
}
.memory-image-empty { padding: 16px; color: rgba(255, 255, 255, 0.5); font-size: 13px; grid-column: 1 / -1; }

/* 通用工具弹窗 */
.tool-generic-desc { font-size: 13px; color: rgba(255, 255, 255, 0.7); margin-bottom: 14px; line-height: 1.5; }
.tool-generic-placeholder {
    padding: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.tool-image-prompt-wrap { margin-bottom: 16px; text-align: left; }
.tool-image-ref-wrap { margin-bottom: 14px; }
.tool-work-sort-scenes-wrap { margin-bottom: 14px; }
.tool-work-sort-scenes-wrap .tool-image-prompt-label { margin-bottom: 8px; }
.tool-work-sort-scenes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tool-work-sort-scenes .tool-work-sort-scene-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.tool-work-sort-scenes .tool-work-sort-scene-btn:hover {
    background: rgba(255,255,255,0.1);
}
.tool-work-sort-scenes .tool-work-sort-scene-btn.active {
    background: rgba(99,102,241,0.35);
    border-color: var(--primary-color);
    color: #fff;
}
.tool-generic-result-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    padding: 12px 0;
    max-height: 60vh;
    overflow-y: auto;
}
.tool-image-ref-area {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    min-height: 80px;
    transition: border-color 0.2s, background 0.2s;
}
.tool-image-ref-area:hover { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.06); }
.tool-image-ref-placeholder { font-size: 13px; color: rgba(255,255,255,0.5); }
.tool-image-ref-preview { max-width: 100%; max-height: 120px; border-radius: 8px; margin-top: 8px; display: block; margin-left: auto; margin-right: auto; }
.tool-image-ref-clear { margin-top: 8px; padding: 4px 12px; border-radius: 8px; font-size: 12px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); cursor: pointer; }
.tool-image-ref-clear:hover { background: rgba(255,255,255,0.12); }
.tool-unified-gender-wrap { margin-bottom: 14px; }
.tool-unified-gender-tabs { display: flex; gap: 10px; margin-top: 6px; }
.tool-unified-gender-tab { padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.tool-unified-gender-tab:hover { background: rgba(255,255,255,0.1); }
.tool-unified-gender-tab.active { background: rgba(99,102,241,0.3); border-color: rgba(99,102,241,0.5); color: rgba(255,255,255,0.95); }
.tool-unified-form .tool-image-prompt-wrap { margin-bottom: 12px; }
.tool-image-prompt-label { display: block; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 8px; }
.tool-image-prompt-input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.95);
    font-size: 14px;
    resize: vertical;
    min-height: 72px;
    box-sizing: border-box;
}
.tool-image-prompt-input:focus { outline: none; border-color: rgba(99,102,241,0.5); }
.tool-image-generate-btn {
    margin-top: 10px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.tool-image-generate-btn:hover:not(:disabled) { opacity: 0.9; }
.tool-image-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tool-generic-bottom-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }
.tool-image-result-wrap { margin-top: 16px; text-align: center; }
.tool-image-result-img-wrap { border-radius: 12px; overflow: hidden; margin-bottom: 10px; max-height: 320px; }
.tool-image-result-img-wrap img { max-width: 100%; height: auto; display: block; }
.tool-image-result-hint { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.tool-poster-result-wrap { margin-top: 16px; }
.tool-poster-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tool-poster-result-item { text-align: center; }
.tool-poster-result-item img { width: 100%; border-radius: 8px; display: block; margin-bottom: 6px; }
.tool-poster-result-item a { font-size: 12px; color: var(--primary-color); text-decoration: none; }
.tool-poster-result-item .avatar-result-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.tool-poster-result-item a + a { margin-left: 8px; }
.tool-image-save-origin { font-size: 13px; color: rgba(99,102,241,0.95); text-decoration: none; }
.tool-image-save-origin:hover { text-decoration: underline; }
.sexy-shot-loading, .tool-generic-loading { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 12px; }

.modal-content {
    background: var(--bg-elevated);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.sexy-shot-modal {
    text-align: left;
    max-width: 420px;
}

.sexy-shot-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.sexy-shot-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sexy-shot-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #f97316, #db2777);
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.5);
}

.sexy-shot-modal-title div > div {
    font-size: 15px;
    font-weight: 600;
}

.sexy-shot-modal-title small {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.sexy-shot-modal-body {
    margin-top: 8px;
}

.sexy-shot-upload-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.sexy-shot-credits {
    margin: 10px 0 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* 10秒有声PPT 弹窗（与 10 秒系列统一：毛玻璃、圆角、间距、发光） */
.voice-ppt-modal {
    max-width: 480px;
}
.voice-ppt-header-text {
    flex: 1;
    min-width: 0;
}
.voice-ppt-header-text .glass-modal-title { margin-bottom: 4px; }
.voice-ppt-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.45;
    margin: 0;
}
.voice-ppt-section .tool-image-prompt-label { margin-bottom: 8px; display: block; }
.voice-ppt-input-glowing {
    min-height: 80px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.voice-ppt-input-glowing:focus {
    outline: none;
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15), 0 0 20px rgba(99,102,241,0.1);
}
.voice-ppt-style-section { margin-top: 16px; margin-bottom: 14px; }
.voice-ppt-style-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.voice-ppt-style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.voice-ppt-style-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.voice-ppt-style-btn.active {
    border-color: var(--primary-color);
    background: rgba(99,102,241,0.2);
    color: #fff;
}
.voice-ppt-style-thumb {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}
.voice-ppt-style-thumb.business { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.voice-ppt-style-thumb.tech { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); }
.voice-ppt-style-thumb.literary { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%); }
.voice-ppt-style-thumb.poster { background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 50%, #b45309 100%); }
.voice-ppt-style-thumb.minimalist { background: linear-gradient(135deg, #1f2937 0%, #4b5563 50%, #9ca3af 100%); }
.voice-ppt-style-name { white-space: nowrap; }
.voice-ppt-voice-section { margin-top: 16px; margin-bottom: 14px; }
.voice-ppt-voice-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.voice-ppt-voice-btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.voice-ppt-progress {
    padding: 16px 0;
    text-align: center;
}
.voice-ppt-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.voice-ppt-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), rgba(139,92,246,0.9));
    border-radius: 4px;
    transition: width 0.35s ease;
}
.voice-ppt-progress-text {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}
.voice-ppt-result-wrap { margin-top: 12px; }
.voice-ppt-pages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.voice-ppt-page-card {
    position: relative;
    background: rgba(255,255,255,0.06);
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}
.voice-ppt-page-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}
.voice-ppt-page-card .voice-ppt-page-title,
.voice-ppt-page-card .voice-ppt-page-head,
.voice-ppt-page-card .voice-ppt-page-points { position: relative; z-index: 1; }
.voice-ppt-page-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.voice-ppt-page-head {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.voice-ppt-page-points {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}
.voice-ppt-player { margin-bottom: 14px; }
.voice-ppt-slide-wrap {
    border-radius: 12px;
    overflow: hidden;
    min-height: 160px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}
.voice-ppt-slide {
    position: relative;
    min-height: 160px;
    background: linear-gradient(135deg, rgba(30,30,50,0.95), rgba(20,20,40,0.98));
    background-size: cover;
    background-position: center;
}
.voice-ppt-slide-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.65) 100%);
    pointer-events: none;
}
.voice-ppt-slide-inner {
    position: relative;
    z-index: 1;
    padding: 20px;
}
.voice-ppt-slide-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.voice-ppt-slide-points {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.voice-ppt-slide-num {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}
.voice-ppt-controls, .voice-ppt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.voice-ppt-ctrl-btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
}
.voice-ppt-ctrl-btn.primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
}
.voice-ppt-ctrl-btn.secondary {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}
.voice-ppt-ctrl-btn.link-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.voice-ppt-result-voice {
    margin-bottom: 12px;
}
.voice-ppt-result-voice .tool-image-prompt-label { margin-bottom: 6px; }
.voice-ppt-memory-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    line-height: 1.5;
}

.sexy-shot-placeholder {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-content.modal-large {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-content > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    padding: 10px 20px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger-low {
    padding: 10px 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-danger-low:hover {
    background: rgba(239, 68, 68, 0.2);
}

.markdown-preview {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================
   记忆图库样式
   ============================================ */
.gallery-search {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: 10px;
}

.search-icon {
    font-size: 16px;
    opacity: 0.5;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-tag.active {
    background: var(--primary-gradient);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px;
    background: linear-gradient(transparent 60%, rgba(0,0,0,0.7));
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gallery-item-tags .tag {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 10px;
    color: white;
}

.gallery-item-size {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    font-size: 10px;
    color: #00ff88;
    font-weight: 500;
}

.gallery-item-auto-category {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 4px;
    font-size: 9px;
    color: #00ff88;
    font-weight: 500;
}

.gallery-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.gallery-empty span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.gallery-empty p {
    font-size: 14px;
    margin-bottom: 8px;
}

.gallery-empty small {
    font-size: 12px;
    opacity: 0.7;
}

/* 图片预览弹窗 */
.modal-image {
    padding: 0;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.5);
}

.image-info {
    padding: 16px;
}

.auto-category-info {
    font-size: 12px;
    color: #00ff88;
    margin-bottom: 12px;
    text-align: center;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.tag-item {
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.tag-item:hover {
    background: rgba(102, 126, 234, 0.3);
}

.no-tags {
    font-size: 12px;
    color: var(--text-muted);
}

/* 标签输入 */
.tag-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 16px;
}

.tag-input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.tag-input-area input:focus {
    border-color: var(--primary-color);
}

.tag-input-area button {
    padding: 8px 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tag-input-area button:hover {
    opacity: 0.9;
}

/* 自动归档提示 */
.gallery-item-auto-category {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 4px;
    font-size: 9px;
    color: #00ff88;
    font-weight: 500;
}

.image-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Toast */
.toast-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: fadeInUp 0.3s ease;
}

/* ============================================
   智能 AI 聊天框 - 现代版（气泡、间距、输入框聚焦）
   ============================================ */
.chat-app {
    margin: 20px 0;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.chat-app-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-app-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a85ff, #8a5cf0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.chat-app-avatar svg {
    width: 20px;
    height: 20px;
    border-radius: 0;
    display: block;
}

.chat-app-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.02em;
    flex: 1;
    min-width: 0;
}

.chat-voice-broadcast-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chat-voice-broadcast-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}
.chat-voice-broadcast-btn:active {
    transform: scale(0.92);
}
.chat-voice-broadcast-btn.off {
    color: #ef4444;
}
.chat-voice-broadcast-btn.off:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.chat-voice-broadcast-btn .chat-voice-broadcast-icon {
    width: 20px;
    height: 20px;
    pointer-events: none;
}
.chat-voice-broadcast-btn .chat-voice-broadcast-icon.on { display: block; }
.chat-voice-broadcast-btn .chat-voice-broadcast-icon.off { display: none; }
.chat-voice-broadcast-btn.off .chat-voice-broadcast-icon.on { display: none !important; }
.chat-voice-broadcast-btn.off .chat-voice-broadcast-icon.off { display: block !important; }

.chat-app-body {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.chat-app-messages {
    flex: 1;
    padding: 20px 24px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-app-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-app-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-welcome {
    padding: 8px 0;
}

.chat-welcome-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.chat-app-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-app-footer-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-app-footer-row input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    font-size: 15px;
    line-height: 1.5;
    outline: none;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.chat-app-footer input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-app-footer input:focus {
    outline: none;
    border-color: #6a85ff;
    background: rgba(255, 255, 255, 0.08);
}

.chat-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a85ff, #8a5cf0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(106, 133, 255, 0.4);
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(106, 133, 255, 0.4);
}

.chat-send:active {
    transform: scale(0.98);
}

.chat-send svg {
    width: 18px;
    height: 18px;
}

.chat-voice-hint {
    min-height: 22px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-voice-hint:empty {
    display: none;
}

.chat-voice-hint .voice-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 18px;
}

.chat-voice-hint .voice-waveform span {
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #6a85ff, #8a5cf0);
    animation: voiceBar 0.6s ease-in-out infinite;
}

.chat-voice-hint .voice-waveform span:nth-child(1) { animation-delay: 0s; height: 8px; }
.chat-voice-hint .voice-waveform span:nth-child(2) { animation-delay: 0.1s; height: 12px; }
.chat-voice-hint .voice-waveform span:nth-child(3) { animation-delay: 0.2s; height: 16px; }
.chat-voice-hint .voice-waveform span:nth-child(4) { animation-delay: 0.3s; height: 10px; }
.chat-voice-hint .voice-waveform span:nth-child(5) { animation-delay: 0.4s; height: 14px; }

@keyframes voiceBar {
    0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.chat-mic {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-mic:hover {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
}

.chat-mic.active {
    background: linear-gradient(135deg, #6a85ff, #8a5cf0);
    color: white;
    box-shadow: 0 2px 12px rgba(106, 133, 255, 0.4);
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(106, 133, 255, 0.4); }
    50% { box-shadow: 0 2px 20px rgba(106, 133, 255, 0.6); }
}

.chat-mic svg {
    width: 18px;
    height: 18px;
}

.chat-camera {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.chat-camera:hover {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
}
.chat-camera svg {
    width: 20px;
    height: 20px;
}

.chat-stop {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.chat-stop:hover {
    background: #ef4444;
    transform: scale(1.05);
}
.chat-stop svg {
    width: 18px;
    height: 18px;
}

.hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* 聊天框内消息气泡（圆角、行高、动画） */
.chat-app-messages .message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    animation: chatFadeIn 0.3s ease;
}

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

.chat-app-messages .message.user-message {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.chat-app-messages .message.assistant-message {
    justify-content: flex-start;
}

.chat-app-messages .message.assistant-message.streaming {
    opacity: 1;
}

.chat-app-messages .message-content {
    width: 100%;
    max-width: 100%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
    text-indent: 0;
}
.chat-app-messages .message-content p {
    margin: 0 0 0.6em 0;
    text-indent: 0;
}
.chat-app-messages .message-content p:last-child {
    margin-bottom: 0;
}

.chat-app-messages .user-message .message-content {
    background: linear-gradient(135deg, #6a85ff, #8a5cf0);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-app-messages .assistant-message .message-content {
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    border: none;
}

.chat-app-messages .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: rgba(255, 255, 255, 0.9);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

.chat-app-messages .typing-indicator .message-content {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
}

.chat-app-messages .typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

/* 消息气泡（深色主题） */
.message {
    margin-bottom: 12px;
    display: flex;
}

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

.message.assistant-message {
    justify-content: flex-start;
}

.message.assistant-message.streaming {
    opacity: 1;
}

.message-content {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.52;
    text-indent: 0;
}
.message-content p {
    margin: 0 0 0.5em 0;
    text-indent: 0;
}
.message-content p:last-child {
    margin-bottom: 0;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgba(255, 255, 255, 0.98);
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

/* 聊天内容内 Markdown 表格 */
.message-content .chat-table-wrap {
    overflow-x: auto;
    margin: 12px 0;
    -webkit-overflow-scrolling: touch;
}
.message-content table {
    border-collapse: collapse;
    width: 100%;
    min-width: 200px;
    font-size: 14px;
}
.message-content table th,
.message-content table td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    text-align: left;
}
.message-content table th {
    background: rgba(0, 0, 0, 0.25);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}
.message-content table td {
    color: rgba(255, 255, 255, 0.88);
}

/* 每条 AI 回复下方的操作与建议（已移除，保留选择器避免遗留 DOM 错位） */
.message-actions,
.next-steps {
    display: none !important;
}

/* 流式输出光标 */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: rgba(255, 255, 255, 0.9);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 打字动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 工具链接 */
.tool-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

/* ============================================
   全部工具 - 突出展示卡片（紧接聊天框下方）
   ============================================ */
.tools-section-title {
    margin-top: 16px;
    margin-bottom: 12px;
}

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

.tool-hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 18px;
    background: radial-gradient(circle at 0 0, rgba(248, 113, 113, 0.35), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(244, 114, 182, 0.3), transparent 55%),
                var(--bg-elevated);
    border: 1px solid rgba(248, 113, 113, 0.45);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(248, 113, 113, 0.7);
}

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

.tool-hero-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: radial-gradient(circle at 30% 0, #fed7aa, transparent 60%),
                linear-gradient(135deg, #f97316, #db2777);
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.5);
}

.tool-hero-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: white;
}
.tool-hero-icon-svg svg { width: 100%; height: 100%; }
.tool-hero-icon-emoji { font-size: 28px; }

.tool-hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-hero-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.tool-hero-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
}

.tool-hero-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

.tool-hero-tag {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(248, 250, 252, 0.08);
    border: 1px solid rgba(248, 250, 252, 0.2);
    color: rgba(255,255,255,0.85);
}

/* 所有卡片与 10秒性感大片 统一风格，保留 class 兼容 */
.tool-hero-card-sexy {
    background: radial-gradient(circle at 0 0, rgba(248, 113, 113, 0.35), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(244, 114, 182, 0.3), transparent 55%),
                var(--bg-elevated);
    border-color: rgba(248, 113, 113, 0.45);
}

.tool-hero-card-sexy:hover {
    border-color: rgba(248, 113, 113, 0.7);
}

.tool-hero-card-sexy .tool-hero-icon {
    background: radial-gradient(circle at 30% 0, #fed7aa, transparent 60%),
                linear-gradient(135deg, #f97316, #db2777);
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.5);
}

/* ============================================
   工具卡片网格（旧版，保留兼容）
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tool-card {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-card:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.2);
}

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

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 动画 */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   分类导航（顶部标签栏：统一大小、排满顶部、底部对齐、选中高亮）
   ============================================ */
.category-scroll-container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 24px;
    margin-left: 0;
    margin-right: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.category-scroll {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px 12px 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
    scroll-snap-align: none;
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.category-pill:active {
    transform: scale(0.98);
}

.category-pill.active {
    background: linear-gradient(135deg, #6a85ff, #8a5cf0);
    color: #ffffff;
    font-weight: 600;
}

.category-pill.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6a85ff, #8a5cf0);
}

.pill-icon {
    font-size: 24px;
    margin-bottom: 0;
}

.pill-text {
    font-size: 12px;
    white-space: nowrap;
    font-weight: 500;
}

.pill-sub {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

/* ============================================
   记忆页面（数字灵魂 · 独立页，不占工具卡片）
   ============================================ */
.memory-page-wrap {
    padding: 20px 0 32px;
}

.memory-page-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 28px;
    letter-spacing: 0.02em;
}

.memory-page-entries {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.memory-entry-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    text-align: left;
    color: inherit;
    font: inherit;
}

.memory-entry-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.memory-entry-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.memory-entry-icon-text {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.memory-entry-icon-image {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.35), rgba(59, 130, 246, 0.35));
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.memory-entry-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    display: block;
    margin-bottom: 4px;
}

.memory-entry-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* ============================================
   AI助手对话框
   ============================================ */
.ai-assistant-section {
    margin-bottom: 24px;
}

.ai-chat-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
}

.ai-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ai-info {
    flex: 1;
}

.ai-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.ai-info p {
    font-size: 12px;
    opacity: 0.9;
}

.ai-status {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-weight: 500;
}

.ai-chat-messages {
    padding: 16px;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-chat);
}

.ai-message {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

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

.ai-avatar-small {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ai-message.user .ai-avatar-small {
    background: #e5e7eb;
}

.ai-message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: calc(100% - 50px);
}

.ai-message.user .ai-message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.ai-chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    color: var(--text-dark);
}

.ai-chat-input-area input:focus {
    border-color: var(--primary-color);
    background: white;
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

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

/* 打字动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* ============================================
   快捷入口
   ============================================ */
.quick-actions {
    margin-bottom: 24px;
}

.quick-actions-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.quick-actions-scroll::-webkit-scrollbar {
    display: none;
}

.quick-action-card {
    flex-shrink: 0;
    width: 100px;
    padding: 16px 12px;
    background: var(--bg-card);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    scroll-snap-align: start;
}

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

.quick-action-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.quick-action-name {
    font-size: 12px;
    color: #1f2937;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   工具卡片
   ============================================ */
.tools-section {
    margin-bottom: 24px;
}

.grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.card-mobile {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.card-mobile:active {
    transform: scale(0.97);
}

.card-mobile:active::before {
    transform: scaleX(1);
}

.card-icon-mobile {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.card-mobile h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-mobile p {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-color);
    font-size: 9px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

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

/* 页脚 */
.footer-mobile {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   底部导航栏
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 998;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* ============================================
   工具模态框
   ============================================ */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.tool-modal.active {
    display: flex;
}

.tool-modal-header {
    background: var(--bg-elevated);
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.back-to-matrix-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-matrix-btn:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.95);
}

.btn-icon {
    font-size: 14px;
}

.tool-modal-header h2 {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-modal-close {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-modal-close:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.95);
}

.tool-iframe-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

#tool-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 加载提示 */
.tool-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.loading-error {
    text-align: center;
    color: var(--text-secondary);
}

/* ============================================
   桌面端适配
   ============================================ */
@media (min-width: 769px) {
    .main-content-mobile {
        max-width: 600px;
        margin: 0 auto;
        padding: 40px;
    }
    
    .grid-mobile {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 40px;
    }
    
    .ai-chat-messages {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }
}

/* ============================================
   记忆图库弹窗样式（三种关闭方式）
   ============================================ */

/* 遮罩层：覆盖整个页面，点击可关闭 */
.memory-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.memory-modal-overlay.active {
    display: flex;
}

/* 弹窗主体 */
.memory-modal {
    position: relative;
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* 关闭按钮：右上角 */
.memory-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.3s;
    z-index: 10;
}

.memory-modal-close-btn:hover {
    color: var(--primary-color);
}

/* 弹窗内容 */
.memory-modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    padding-right: 30px;
}

/* Typewriter 光标样式 */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 十秒成为本地人 */
.local-people-modal .sexy-shot-modal-body { padding: 20px; }
.local-people-upload-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.local-people-upload-row .tool-image-ref-area { flex: 1; min-width: 120px; }
.local-people-countries-wrap { margin-bottom: 16px; }
.local-people-countries { display: flex; flex-wrap: wrap; gap: 8px; }
.local-people-countries .local-people-country-btn {
    padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06); color: var(--text-primary); font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
}
.local-people-countries .local-people-country-btn:hover { border-color: var(--primary-color); background: rgba(102,126,234,0.15); }
.local-people-countries .local-people-country-btn.active { border-color: var(--primary-color); background: var(--primary-gradient); color: #fff; }
.local-people-result-wrap .tool-poster-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.local-people-result-wrap .tool-poster-result-item img { width: 100%; border-radius: 8px; display: block; }
.local-people-result-wrap .tool-poster-result-item a { display: inline-block; margin-top: 6px; color: var(--primary-color); font-size: 0.85rem; }

/* 10秒换发型 */
.hairstyle-modal .sexy-shot-modal-body { padding: 20px; }
.hairstyle-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.hairstyle-credits { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

/* 10秒电影大片 */
.movie-blockbuster-modal .sexy-shot-modal-body { padding: 20px; }
.movie-blockbuster-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.movie-blockbuster-credits { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

/* 10秒写真大片 */
.portrait-studio-modal .sexy-shot-modal-body { padding: 20px; }
.portrait-studio-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.portrait-studio-credits { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

/* 10秒女神海报 */
.goddess-poster-modal .sexy-shot-modal-body { padding: 20px; }
.goddess-poster-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.portrait-blockbuster-modal .sexy-shot-modal-body { padding: 20px; }
.portrait-blockbuster-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.portrait-blockbuster-credits { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 12px; line-height: 1.4; }
.couple-glam-modal .sexy-shot-modal-body { padding: 20px; }
.couple-glam-upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 12px; line-height: 1.4; }
.couple-glam-credits { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 12px; line-height: 1.4; }
.goddess-poster-credits { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

/* 首页底部毛玻璃悬浮工具栏 */
.fx-floating-toolbar {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(460px, 92%);
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    gap: 8px;
    z-index: 40;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.6);
}

.fx-floating-btn {
    flex: 1;
    border-radius: 999px;
    height: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fx-floating-btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}

.fx-floating-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.6);
}

.fx-floating-btn-secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-primary);
}

.fx-floating-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .fx-floating-toolbar {
        bottom: 12px;
        padding-inline: 10px;
    }
    .fx-floating-btn {
        height: 38px;
        font-size: 0.85rem;
    }
}

/* 全部工具二级弹窗（毛玻璃） */
.fx-tools-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.fx-tools-modal {
    width: min(960px, 92vw);
    max-height: 86vh;
    background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.22), transparent 55%),
                radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.18), transparent 55%),
                rgba(15, 23, 42, 0.92);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
    padding: 20px 22px 18px;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
}

.fx-tools-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fx-tools-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.fx-tools-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.6);
    color: #e5e7eb;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fx-tools-modal-close:hover {
    background: rgba(30, 64, 175, 0.9);
    border-color: transparent;
}

.fx-tools-modal-body {
    overflow-y: auto;
    padding-top: 4px;
    padding-right: 4px;
}

.fx-tools-modal-body::-webkit-scrollbar {
    width: 6px;
}

.fx-tools-modal-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.7);
    border-radius: 3px;
}

.fx-tools-modal-section {
    margin-bottom: 16px;
}

.fx-tools-modal-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(209, 213, 219, 0.9);
    margin-bottom: 8px;
}

.fx-tools-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fx-tools-modal-card {
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.82);
    cursor: pointer;
    transition: all 0.18s ease;
    color: inherit;
}

.fx-tools-modal-card:hover {
    border-color: rgba(129, 140, 248, 0.9);
    background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.24), transparent 55%),
                rgba(15, 23, 42, 0.96);
    transform: translateY(-1px);
}

.fx-tools-modal-card-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.fx-tools-modal-card-sub {
    margin-top: 2px;
    font-size: 0.75rem;
    color: rgba(156, 163, 175, 0.9);
}

@media (max-width: 640px) {
    .fx-tools-modal {
        padding-inline: 16px;
        border-radius: 18px;
    }
    .fx-tools-modal-grid {
        grid-template-columns: 1fr;
    }
}
