/* 浅色主题（默认） */
:root {
    --bg-dark: #f8fafc;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --panel-bg: rgba(255, 255, 255, 0.98);
    --glass-border: rgba(124, 58, 237, 0.12);
    --accent-color: #7c3aed;
    --accent-hover: #8b5cf6;
    --accent-light: rgba(124, 58, 237, 0.1);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #059669;
    --danger: #dc2626;
}

body {
    background: radial-gradient(circle at top right, #ede9fe, #f8fafc);
}

/* 深色主题 */
:root.dark-theme {
    --bg-dark: #0f111a;
    --sidebar-bg: rgba(20, 22, 33, 0.7);
    --panel-bg: rgba(30, 32, 48, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-color: #8b5cf6;
    --accent-hover: #a78bfa;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
}

/* 深色主题背景 */
:root.dark-theme body {
    background: radial-gradient(circle at top right, #1a1c29, #0f111a);
}

/* 深色主题特定样式覆盖 */
:root.dark-theme .viewport::before {
    background: rgba(15, 17, 26, 0.92);
}

:root.dark-theme .top-header {
    background: rgba(15, 17, 26, 0.8);
}

:root.dark-theme .sidebar {
    background: rgba(20, 22, 33, 0.7);
}

:root.dark-theme .chat-controls,
:root.dark-theme .notes-header,
:root.dark-theme .notes-footer,
:root.dark-theme .chat-input-area {
    background: rgba(0, 0, 0, 0.2);
}

:root.dark-theme select,
:root.dark-theme textarea,
:root.dark-theme #notes-textarea {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme select:hover,
:root.dark-theme textarea:focus {
    border-color: var(--accent-color);
}

:root.dark-theme select,
:root.dark-theme textarea {
    background: rgba(0, 0, 0, 0.3);
}

:root.dark-theme select option {
    background: #0f111a;
    color: #f8fafc;
}

:root.dark-theme .secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

:root.dark-theme .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-muted);
}

:root.dark-theme .message.system {
    background: rgba(255, 255, 255, 0.05);
}

:root.dark-theme .message.ai {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .gallery {
    background: rgba(0, 0, 0, 0.4);
}

:root.dark-theme .stt-result-area {
    background: rgba(0, 0, 0, 0.4);
}

:root.dark-theme .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

:root.dark-theme .modal-content {
    background: rgba(30, 32, 48, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

:root.dark-theme .markdown-body pre {
    background: #0d1117;
}

:root.dark-theme .markdown-body blockquote {
    background: rgba(255, 255, 255, 0.05);
}

:root.dark-theme .markdown-body code:not(pre code) {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

:root.dark-theme .markdown-body blockquote {
    background: rgba(255, 255, 255, 0.05);
}

:root.dark-theme .ratio-box {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .ratio-option input:checked ~ .ratio-box {
    background: rgba(139, 92, 246, 0.1);
}

:root.dark-theme .mode-card {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .mode-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

:root.dark-theme .mode-card.active {
    background: rgba(139, 92, 246, 0.2);
}

:root.dark-theme .upload-btn {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-color);
}

:root.dark-theme .upload-btn:hover {
    background: rgba(139, 92, 246, 0.25);
}

:root.dark-theme .mic-circle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .mic-circle:hover {
    background: rgba(139, 92, 246, 0.1);
}

:root.dark-theme .mic-circle.recording {
    background: rgba(239, 68, 68, 0.1);
}

:root.dark-theme .stt-meta span {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .user-info {
    background: rgba(30, 32, 48, 0.6);
}

:root.dark-theme .quota-badge {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

:root.dark-theme .markdown-body code:not(pre code) {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

:root.dark-theme .markdown-body pre {
    background: #0d1117;
}

:root.dark-theme .markdown-body blockquote {
    background: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1a1c29, #0f111a);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* 触摸优化 */
button,
.nav-item,
.mode-card,
.ratio-option {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 防止移动端双击缩放 */
button,
a {
    touch-action: manipulation;
}

/* 应用主容器 (仪表盘布局) */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 20px rgba(124, 58, 237, 0.05);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent-color);
}

.version {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-left: 30px;
}

.sidebar-nav {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航栏样式 */
.top-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    position: relative;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quota-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: help;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel-bg);
    padding: 6px 16px 6px 6px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

#user-name {
    font-size: 14px;
    font-weight: 600;
}

.quota-text {
    font-size: 11px;
    color: var(--success);
    margin-top: 2px;
}

/* 模块视图区样式 */
.viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: url('https://www.svgbackgrounds.com/wp-content/uploads/2021/05/liquid-cheese-background.svg') center/cover no-repeat;
}

/* SVG 动态背景遮罩 */
.viewport::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(248, 250, 252, 0.9); /* 浅色背景遮罩 */
    z-index: 0;
}

.module-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 30px;
    display: none;
    z-index: 1;
    overflow-y: auto;
}

.module-view.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

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

.module-layout {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(124, 58, 237, 0.12), 0 8px 25px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.module-layout.full-height {
    height: 100%;
}

.split-view {
    flex-direction: row;
    height: 100%;
}

.left-panel {
    flex: 1;
    padding: 30px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.right-panel {
    flex: 1.5;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.left-panel h3, .right-panel h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-main);
    font-weight: 600;
}

/* 通用 UI 控件 */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.control-group label {
    font-size: 13px;
    color: var(--text-muted);
}

select, textarea {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

select {
    appearance: none;
    cursor: pointer;
}

select:hover, textarea:focus {
    border-color: var(--accent-color);
}

select option {
    background: var(--panel-bg);
    color: var(--text-main);
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

/* 按钮组件 */
button {
    border: none;
    font-family: inherit;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.secondary-btn {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    font-size: 14px;
}

.secondary-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-color);
}

.secondary-btn.small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.icon-btn {
    background: transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
}

.icon-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.full-width {
    width: 100%;
}

.mode-cards {
    display: flex;
    gap: 12px;
}

.mode-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.mode-card:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-main);
}

.mode-card.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-color);
    color: var(--text-main);
}

.mode-card.active i {
    color: var(--accent-color);
}

/* 智能中枢模块样式 */
.chat-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(124, 58, 237, 0.03);
}

.chat-display {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
}

.message.system {
    align-self: center;
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-muted);
    font-size: 13px;
    border-radius: 20px;
    padding: 8px 16px;
}

.message.user {
    align-self: flex-end;
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.read-aloud-btn {
    position: absolute;
    right: -40px;
    bottom: 0;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0;
}

.message.ai:hover .read-aloud-btn {
    opacity: 1;
}

.read-aloud-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.chat-input-area {
    padding: 20px 30px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(124, 58, 237, 0.03);
}

#chat-attachment-preview {
    display: flex;
    align-items: center;
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

#chat-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#chat-remove-attachment {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

#chat-input {
    flex: 1;
    min-height: 50px;
    max-height: 150px;
    margin: 0;
    padding: 14px;
}

#chat-send-btn {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    padding: 0;
    font-size: 18px;
    flex-shrink: 0;
}

.typing-indicator {
    display: inline-block;
    width: 6px;
    height: 16px;
    background: var(--accent-color);
    margin-left: 4px;
    animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* 视觉工坊模块样式 */
.ratio-selector {
    display: flex;
    gap: 12px;
}

.ratio-option {
    flex: 1;
    cursor: pointer;
}

.ratio-option input {
    display: none;
}

.ratio-box {
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: 0.2s;
}

.ratio-box.square { width: 100%; }
.ratio-box.landscape { width: 100%; height: 40px; margin-top: 10px; margin-bottom: 18px; }
.ratio-box.portrait { width: 60%; margin: 0 auto 8px auto; }
.ratio-box.portrait-34 { width: 75%; height: 60px; margin: 0 auto 8px auto; }

.ratio-option input:checked ~ .ratio-box {
    border-color: var(--accent-color);
    background: rgba(139, 92, 246, 0.1);
}

.ratio-option span {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.ratio-option input:checked ~ span {
    color: var(--accent-color);
    font-weight: 600;
}

.prompt-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.05);
    border-radius: 0 20px 20px 0;
}

.gallery-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.gallery-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

#img-result-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#img-result {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.image-actions {
    display: flex;
    gap: 16px;
}

/* 声音实验室模块样式 */
.stt-container {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.mic-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    margin: 40px auto 20px auto;
    flex-shrink: 0;
}

.mic-circle:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.mic-circle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.mic-circle:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.mic-circle.recording {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

#stt-status {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.stt-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

.stt-meta span {
    min-width: 74px;
    padding: 5px 10px;
    text-align: center;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
}

.stt-result-area {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.stt-result {
    flex: 1;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.6;
    overflow-y: auto;
    color: var(--text-main);
    white-space: pre-wrap;
}

.stt-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.stt-summary {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.stt-summary h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-hover);
}

.stt-summary-text {
    margin-top: 10px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.7;
}

.stt-summary-text ul,
.stt-summary-text ol {
    margin-left: 18px;
}

/* 云端生产力模块样式 */
.notes-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(124, 58, 237, 0.03);
}

.notes-header h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.notes-editor {
    flex: 1;
    display: flex;
}

#notes-textarea {
    flex: 1;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
}

#notes-textarea:focus {
    box-shadow: none;
}

.notes-footer {
    padding: 16px 30px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(124, 58, 237, 0.03);
}

/* 全局弹窗遮罩样式 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    padding: 30px 40px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(124, 58, 237, 0.15), 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.modal-content i {
    color: var(--accent-color);
}

/* Markdown 渲染样式 */
.markdown-body {
    font-size: 15px;
    line-height: 1.6;
}

.markdown-body p {
    margin-bottom: 12px;
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body code:not(pre code) {
    background: rgba(124, 58, 237, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 13px;
    color: var(--accent-color);
}

.markdown-body pre {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto !important;
    position: relative;
    white-space: pre !important;
    word-wrap: normal !important;
}

.markdown-body pre code {
    font-family: Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
}

.markdown-body ul, .markdown-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 12px;
    color: var(--text-muted);
    margin: 12px 0;
    background: rgba(124, 58, 237, 0.05);
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 0 8px 8px 0;
}

/* 代码复制按钮样式 */
.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
}

.markdown-body pre:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 文件上传相关样式 */
.stt-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-option {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 2px dashed var(--accent-color);
    color: var(--accent-color);
    padding: 16px 32px;
    font-weight: 600;
    font-size: 14px;
}

.upload-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

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

/* 文件预览区域样式 */
#file-preview {
    animation: slideDown 0.3s ease;
}

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

.icon-btn.small {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

#file-preview-player {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

/* 移动端响应式样式 */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        backdrop-filter: blur(20px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar-close {
        display: flex;
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }
    
    .main-content {
        width: 100%;
    }
    
    .top-header {
        height: auto;
        min-height: 60px;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .mobile-menu-toggle {
        display: flex;
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header-left h2 {
        font-size: 16px;
    }
    
    .module-view {
        padding: 16px;
        position: relative;
        height: auto;
        overflow: visible;
    }
    
    .module-layout {
        max-width: 100%;
        border-radius: 16px;
        height: auto;
        overflow: visible;
    }
    
    .split-view {
        flex-direction: column;
    }
    
    .left-panel,
    .right-panel {
        padding: 20px 16px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        overflow-y: visible;
        height: auto;
        position: relative;
    }
    
    .right-panel {
        border-bottom: none;
    }
    
    /* 聊天模块 */
    .chat-controls {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .mode-cards {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mode-card {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .chat-display {
        padding: 16px;
    }
    
    .message {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .chat-input-area {
        padding: 16px;
    }
    
    .chat-input-wrapper {
        gap: 10px;
    }
    
    #chat-input {
        font-size: 14px;
        padding: 12px;
    }
    
    #chat-send-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    /* 比例选择器 */
    .ratio-selector {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ratio-option {
        flex: 1 1 calc(50% - 4px);
    }
    
    /* 图片画廊 */
    .gallery {
        border-radius: 0 0 16px 16px;
        min-height: 300px;
        position: relative;
        z-index: 1;
    }
    
    #img-result {
        max-height: 60vh;
    }
    
    .image-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    /* 语音模块 */
    .mic-circle {
        width: 100px;
        height: 100px;
        font-size: 32px;
        margin: 20px auto;
    }
    
    .upload-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .stt-options {
        gap: 16px;
    }
    
    .stt-result-area {
        padding: 16px;
        min-height: 0;
        height: auto;
    }
    
    .stt-container {
        min-height: 0;
        height: auto;
    }
    
    /* 聊天模块额外修复 */
    .chat-display {
        overflow-y: auto;
        min-height: 200px;
    }
    
    .module-layout.full-height {
        height: auto;
        min-height: 400px;
    }
    
    /* 笔记模块 */
    .notes-header {
        padding: 16px;
    }
    
    .notes-header h3 {
        font-size: 16px;
    }
    
    .notes-header .sub-text {
        font-size: 12px;
    }
    
    #notes-textarea {
        padding: 16px;
        font-size: 14px;
    }
    
    .notes-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .notes-footer > div {
        justify-content: center;
    }
    
    /* 用户信息 */
    .user-info {
        padding: 6px 12px;
        gap: 8px;
    }
    
    .user-info img {
        width: 32px;
        height: 32px;
    }
    
    #user-name {
        font-size: 13px;
    }
    
    .quota-text {
        font-size: 10px;
    }
    
    /* 按钮 */
    .primary-btn,
    .secondary-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
    }
    
    /* 模态框 */
    .modal-content {
        padding: 24px 20px;
        margin: 20px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 10px 12px;
    }
    
    .header-left h2 {
        font-size: 14px;
    }
    
    .module-view {
        padding: 12px;
    }
    
    .left-panel,
    .right-panel {
        padding: 16px 12px;
    }
    
    .mode-card {
        flex: 1 1 100%;
    }
    
    .message {
        max-width: 95%;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .chat-input-area {
        padding: 12px;
    }
    
    #chat-input {
        font-size: 13px;
        padding: 10px;
    }
    
    #chat-send-btn {
        width: 44px;
        height: 44px;
    }
    
    .mic-circle {
        width: 90px;
        height: 90px;
        font-size: 28px;
    }
    
    select,
    textarea {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .primary-btn,
    .secondary-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .notes-footer > div {
        flex-wrap: wrap;
    }
}

/* 密码验证界面样式 */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #ede9fe, #f8fafc);
    padding: 20px;
}

.password-content {
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(124, 58, 237, 0.15), 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.5s ease;
}

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

.password-header i {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 16px;
}

.password-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.password-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-form input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.password-form input[type="password"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.password-form button {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    gap: 10px;
}

.password-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 8px;
    min-height: 20px;
    transition: opacity 0.3s ease;
}

.password-error:not(:empty) {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* 深色主题密码验证样式 */
:root.dark-theme .password-modal {
    background: radial-gradient(circle at top right, #1a1c29, #0f111a);
}

:root.dark-theme .password-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

:root.dark-theme .password-form input[type="password"] {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

:root.dark-theme .password-form input[type="password"]:focus {
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* 确保桌面端显示正常 */
@media (min-width: 1025px) {
    .mobile-menu-toggle,
    .sidebar-close {
        display: none;
    }

    .sidebar {
        transform: translateX(0) !important;
    }
}

/* 移动端密码验证适配 */
@media (max-width: 480px) {
    .password-content {
        padding: 32px 24px;
    }

    .password-header h1 {
        font-size: 20px;
    }

    .password-form input[type="password"],
    .password-form button {
        font-size: 15px;
        padding: 14px 16px;
    }
}
