/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3A4A3A;
    --primary-light: #5A7247;
    --primary-dark: #2A3A2A;
    --accent-gold: #C9A96E;
    --accent-gold-light: #D4B88A;
    --text-primary: #3A3A3A;
    --text-secondary: #5A6A5A;
    --text-light: #8A8A8A;
    --bg-light: #F5F3EF;
    --bg-white: #FAFAF7;
    --border-color: #E5E0D8;
    --shadow-sm: 0 2px 8px rgba(58, 58, 58, 0.06);
    --shadow-md: 0 4px 16px rgba(58, 58, 58, 0.10);
    --shadow-lg: 0 8px 32px rgba(58, 58, 58, 0.14);
    --chat-bg: #F8F6F2;
    --message-bg: #FAFAF7;
    --ai-message-bg: #F0EDE8;
    --user-message-bg: #3A4A3A;
    --user-text: #F5F3EF;
    --panel-border: #E5E0D8;

    /* 龙潭品牌色彩 */
    --longtan-moss: #5A7247;
    --longtan-water: #7BA7BC;
    --longtan-stone: #C4B5A3;
    --longtan-copper: #5E8B7E;
    --longtan-clay: #A0634B;
    --longtan-tea: #C9A96E;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* ===== 应用容器 ===== */
.app-container {
    display: flex;
    height: 100vh;
    background: #f8f9fa;
}

/* ===== 左侧聊天面板 ===== */
.chat-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
}

.chat-panel.with-document {
    width: 50%;
    border-right: 1px solid #e9ecef;
}

/* ===== 聊天头部 ===== */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.avatar-icon {
    font-size: 18px;
    font-weight: 600;
    color: var(--bg-white);
}

.header-info h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--bg-white);
    margin-bottom: 4px;
}

.header-info .subtitle {
    font-size: 14px;
    color: var(--accent-gold);
    font-weight: 300;
    letter-spacing: 2px;
}

/* ===== 语言切换按钮 ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
}

.lang-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: var(--accent-gold);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 14px;
    color: var(--bg-white);
    font-weight: 500;
}

/* ===== 聊天消息区域 ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-white);
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ===== 消息样式 ===== */
.message {
    display: flex;
    margin-bottom: 24px;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.message-avatar .avatar-icon {
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-white);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-bubble {
    background: var(--ai-message-bg);
    padding: 16px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
    position: relative;
    max-width: 80%;
}

.user-message .message-bubble {
    background: var(--user-message-bg);
    color: var(--user-text);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

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

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 12px;
    background: var(--primary-color);
}

.message-bubble p {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.6;
}

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

.message-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* ===== 文档卡片样式 ===== */
.document-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.document-card:hover {
    background: #f1f3f4;
    border-color: var(--primary-color);
}

.document-card.selected {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.document-icon {
    width: 24px;
    height: 24px;
    background: #6c757d;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

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

.document-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-time {
    font-size: 12px;
    color: #6c757d;
}

.document-open-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.document-open-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* ===== 故事主题卡片样式 ===== */
.theme-selection-counter {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    text-align: center;
}

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

.selected-count {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 16px;
}

.theme-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.theme-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.theme-card:hover::before {
    transform: scaleY(1);
}

.theme-card.selected {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
}

.theme-card.selected::before {
    background: var(--accent-gold);
    transform: scaleY(1);
}

.theme-card.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--accent-gold);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.theme-main-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.theme-sub-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.theme-elements {
    margin-bottom: 12px;
}

.theme-elements-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.theme-elements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.theme-element {
    padding: 4px 10px;
    background: var(--bg-light);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: 12px;
}

.theme-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 聊天输入区域 ===== */
.chat-input {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    flex-shrink: 0;
}

.input-container {
    max-width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.message-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-light);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 38, 58, 0.1);
    background: var(--bg-white);
}

.send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

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

.send-icon {
    color: var(--bg-white);
    font-size: 18px;
    font-weight: bold;
}

/* ===== 快捷操作按钮 ===== */
.quick-actions {
    display: flex;
    justify-content: center;
}

.quick-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--primary-dark);
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    letter-spacing: 2px;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.4);
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(201, 169, 110, 0.5);
    background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
    color: var(--primary-dark);
}

.quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
}

/* ===== 打字指示器 ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--ai-message-bg);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    margin: 0 0 24px 52px;
    max-width: 200px;
    box-shadow: var(--shadow-sm);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typingDot 1.4s infinite ease-in-out;
}

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

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(2px);
}

.btn-primary.disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary.disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary.disabled .btn-icon {
    transform: none;
}

/* ===== 右侧文档面板 ===== */
.document-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.document-panel.closing {
    animation: slideOutRight 0.3s ease-in-out forwards;
}

.document-header {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.document-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.document-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.document-status {
    padding: 6px 12px;
    background: #e9ecef;
    border-radius: 16px;
    font-size: 12px;
    color: #6c757d;
}

.document-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #e9ecef;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #6c757d;
}

.document-close-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.close-icon {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.document-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    background: var(--bg-white);
}

.document-content::-webkit-scrollbar {
    width: 6px;
}

.document-content::-webkit-scrollbar-track {
    background: transparent;
}

.document-content::-webkit-scrollbar-thumb {
    background: #e9ecef;
    border-radius: 3px;
}

.document-content::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ===== 空状态 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-light);
}

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

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

/* ===== 文档内容样式 ===== */
.document-section {
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
}

.document-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.document-section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.document-section-content p {
    margin-bottom: 12px;
}

.document-section-content p:last-child {
    margin-bottom: 0;
}

.document-section-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.document-section-content li {
    margin-bottom: 8px;
}

/* ===== 文档表格样式 ===== */
.document-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.document-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid #e9ecef;
}

.document-table th.highlight {
    background: #e3f2fd;
    color: var(--primary-color);
}

.document-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    color: var(--text-secondary);
    vertical-align: top;
}

.document-table tr:hover {
    background: #f8f9fa;
}

.document-table tr:last-child td {
    border-bottom: none;
}

/* ===== 选定主题样式 ===== */
.selected-themes {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.selected-theme {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
}

.theme-number {
    width: 32px;
    height: 32px;
    background: var(--accent-gold);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.theme-info {
    flex: 1;
}

.theme-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* ===== Markdown文档样式 ===== */
.markdown-document {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
}

.markdown-header {
    border-bottom: 3px solid var(--accent-gold);
    padding-bottom: 20px;
    margin-bottom: 32px;
}

.document-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.3;
}

.document-summary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.03) 100%);
    border-left: 4px solid var(--accent-gold);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
}

.document-summary p {
    margin: 0;
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.markdown-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.markdown-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.markdown-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 一级标题：历史文化调研、商业经济历史发展调研等 */
.section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 32px 0 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 38, 58, 0.05) 0%, rgba(0, 38, 58, 0.02) 100%);
    border-left: 6px solid var(--accent-gold);
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 38, 58, 0.06);
}

.section-title::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.08) 100%);
    border-radius: 0 12px 12px 0;
    pointer-events: none;
}

/* 可折叠标题样式 */
.collapsible-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.collapsible-title:hover {
    background: linear-gradient(135deg, rgba(0, 38, 58, 0.08) 0%, rgba(0, 38, 58, 0.04) 100%);
    transform: translateX(2px);
}

.collapsible-title:active {
    transform: translateX(4px);
}

.collapse-icon {
    font-size: 18px;
    color: var(--accent-gold);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.title-text {
    flex: 1;
}

/* 折叠状态的section */
.collapsible-section.collapsed .section-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.collapsible-section .section-content {
    overflow: visible;
    max-height: none;
    transition: max-height 0.3s ease-in;
}

.section-content {
    font-size: 15px;
    line-height: 1.8;
}

.subsection-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 16px 0;
    padding-left: 16px;
    border-left: 3px solid var(--accent-gold);
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

.paragraph {
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-align: justify;
}

.paragraph:last-child {
    margin-bottom: 0;
}

.list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-left: 8px;
}

.bullet {
    color: var(--accent-gold);
    font-weight: bold;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.list-item:last-child {
    margin-bottom: 0;
}

/* ===== 选定主题的markdown样式 ===== */
.selected-themes-markdown {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.selected-theme-markdown {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.selected-theme-markdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
}

.theme-number-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.theme-subtitle-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-style: italic;
}

.theme-elements-markdown {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.theme-elements-markdown strong {
    color: var(--text-primary);
}

.theme-description-markdown {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.theme-description-markdown p {
    margin: 0;
    text-align: justify;
}

/* ===== Markdown文本格式化样式 ===== */
.markdown-document strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-document em {
    font-style: italic;
    color: var(--text-secondary);
}

.markdown-document code {
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

/* ===== 增强的内容格式化样式 ===== */

/* 内容分隔符 */
.content-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-gold) 50%, transparent 100%);
    margin: 24px 0;
    position: relative;
}

.content-divider::before {
    content: '✦';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-white);
    color: var(--accent-gold);
    padding: 0 12px;
    font-size: 16px;
}

/* 一级标题：# 主要章节标题 */
.main-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 32px 0 20px 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.04) 100%);
    border-left: 6px solid var(--accent-gold);
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.main-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.15) 100%);
    border-radius: 0 12px 12px 0;
    pointer-events: none;
}

/* 二级标题：## 或 一、二、三...... */
.chinese-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 16px 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(212, 175, 55, 0.02) 100%);
    border-left: 4px solid var(--accent-gold);
    border-radius: 0 8px 8px 0;
    position: relative;
}

.chinese-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.08) 100%);
    border-radius: 0 8px 8px 0;
    pointer-events: none;
}

/* 三级标题：### 或 1、2、3...... */
.numbered-subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 12px 0;
    padding: 10px 16px 10px 20px;
    background: var(--bg-light);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    position: relative;
}

.numbered-subsection-title::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: var(--accent-gold);
    border-radius: 50%;
}

/* 列表组样式 */
.list-group {
    background: rgba(248, 250, 252, 0.6);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.list-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.list-content {
    flex: 1;
    line-height: 1.6;
}

.bullet {
    color: var(--accent-gold);
    font-weight: bold;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 14px;
}

/* 特殊段落样式 */
.reference-paragraph {
    background: linear-gradient(135deg, rgba(116, 139, 164, 0.05) 0%, rgba(116, 139, 164, 0.02) 100%);
    border-left: 3px solid #748ba4;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.timeline-paragraph {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
    border-left: 3px solid var(--accent-gold);
    padding: 10px 16px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    font-weight: 500;
    color: var(--text-primary);
}

/* 文本标记样式 */
.time-marker {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(238, 90, 36, 0.3);
}

.dynasty-marker {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(108, 92, 231, 0.3);
}

.person-marker {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(0, 184, 148, 0.3);
}

.location-marker {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(253, 203, 110, 0.3);
}

.citation {
    background: rgba(116, 139, 164, 0.1);
    color: #748ba4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-style: italic;
    margin: 0 2px;
    border: 1px solid rgba(116, 139, 164, 0.2);
}

.concept-marker {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #e6c866 100%);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(212, 175, 55, 0.3);
}

/* 段落间距优化 */
.paragraph {
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-align: justify;
    line-height: 1.8;
}

.paragraph:last-child {
    margin-bottom: 0;
}

/* 悬停效果 */
.list-item:hover {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 6px;
    margin: 8px -8px;
    padding: 8px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.reference-paragraph:hover,
.timeline-paragraph:hover {
    transform: translateX(4px);
    transition: transform 0.2s ease;
}

/* 标记元素悬停效果 */
.time-marker:hover,
.dynasty-marker:hover,
.person-marker:hover,
.location-marker:hover,
.concept-marker:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
    cursor: default;
}

/* ===== 移除旧的表格样式（保持向后兼容） ===== */
.document-table {
    display: none;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .chat-panel,
    .chat-panel.with-document,
    .document-panel {
        width: 100%;
    }

    .chat-panel {
        height: 100vh;
    }

    .chat-panel.with-document {
        display: none;
    }

    .document-panel {
        height: 100vh;
    }
}

@media (max-width: 768px) {
    .chat-header {
        padding: 10px 16px;
    }

    .header-content {
        gap: 10px;
    }

    .ai-avatar {
        width: 36px;
        height: 36px;
    }

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

    .header-info h1 {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .header-info .subtitle {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .header-right {
        gap: 10px;
    }

    .language-toggle {
        padding: 2px;
    }

    .lang-btn {
        padding: 4px 10px;
        font-size: 12px;
    }

    .status-indicator {
        display: none;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 20px));
    }

    .message-bubble {
        max-width: 90%;
    }

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

    .quick-actions {
        justify-content: center;
    }

    .quick-btn {
        padding: 16px 44px;
        font-size: 16px;
        width: 100%;
    }

    .typing-indicator {
        margin-left: 44px;
    }
    
    .document-header {
        padding: 16px 20px;
    }
    
    .document-content {
        padding: 20px;
    }

    /* Markdown文档响应式样式 */
    .document-title {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 21px;
        padding: 16px 20px;
    }
    
    .collapse-icon {
        font-size: 16px;
        width: 18px;
    }
    
    .collapsible-title {
        gap: 10px;
    }
    
    .subsection-title {
        font-size: 16px;
        padding: 10px 14px;
    }
    
    .main-section-title {
        font-size: 22px;
        padding: 16px 20px;
        margin: 28px 0 18px 0;
    }
    
    .chinese-section-title {
        font-size: 18px;
        padding: 12px 16px;
    }
    
    .numbered-subsection-title {
        font-size: 15px;
        padding: 8px 14px 8px 18px;
    }
    
    .markdown-section {
        padding: 20px;
    }
    
    .markdown-content {
        gap: 24px;
    }
    
    .selected-theme-markdown {
        padding: 16px;
    }
    
    .theme-number-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        height: 100vh;
    }

    .chat-header {
        padding: 8px 12px;
    }

    .ai-avatar {
        width: 32px;
        height: 32px;
    }

    .avatar-icon {
        font-size: 13px;
    }

    .header-info h1 {
        font-size: 16px;
        margin-bottom: 0;
    }

    .header-info .subtitle {
        display: none;
    }

    .chat-messages {
        padding: 10px;
    }

    .chat-input {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 20px));
    }

    .quick-btn {
        padding: 14px 36px;
        font-size: 15px;
        width: 100%;
    }
    
    .document-header {
        padding: 12px 16px;
    }
    
    .document-content {
        padding: 16px 20px;
    }

    /* 小屏幕Markdown文档样式 */
    .document-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 19px;
        padding: 14px 16px;
    }
    
    .collapse-icon {
        font-size: 14px;
        width: 16px;
    }
    
    .collapsible-title {
        gap: 8px;
    }
    
    .subsection-title {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .main-section-title {
        font-size: 20px;
        padding: 14px 16px;
        margin: 24px 0 16px 0;
    }
    
    .chinese-section-title {
        font-size: 17px;
        padding: 10px 14px;
    }
    
    .numbered-subsection-title {
        font-size: 14px;
        padding: 8px 12px 8px 16px;
    }
    
    .markdown-section {
        padding: 16px;
    }
    
    .markdown-content {
        gap: 20px;
    }
    
    .selected-theme-markdown {
        padding: 12px;
    }
    
    .theme-number-title {
        font-size: 16px;
    }
    
    .theme-subtitle-text {
        font-size: 14px;
    }
    
    .theme-elements-markdown {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .paragraph {
        font-size: 14px;
    }
    
    .section-content {
        font-size: 14px;
    }
}

/* ===== 哈尔滨中央大街主题样式 ===== */
.harbin-theme {
    background: linear-gradient(135deg, var(--harbin-ice) 0%, var(--bg-white) 100%);
}

.harbin-theme .theme-card {
    border-left: 4px solid var(--harbin-blue);
    background: linear-gradient(135deg, var(--harbin-ice) 0%, var(--bg-white) 100%);
    position: relative;
    overflow: hidden;
}

.harbin-theme .theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--harbin-stone) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, var(--harbin-stone) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
    pointer-events: none;
}

.harbin-theme .theme-card:hover {
    border-left-color: var(--harbin-gold);
    box-shadow: 0 8px 32px rgba(74, 144, 164, 0.15);
    transform: translateY(-2px);
}

.harbin-theme .theme-card.selected {
    border-left-color: var(--harbin-red);
    background: linear-gradient(135deg, var(--harbin-ice) 0%, rgba(168, 49, 47, 0.05) 100%);
}

.harbin-theme .theme-main-title {
    color: var(--harbin-blue);
    text-shadow: 0 1px 2px rgba(74, 144, 164, 0.1);
    position: relative;
}

.harbin-theme .theme-main-title::after {
    content: '❄';
    position: absolute;
    top: 0;
    right: -20px;
    color: var(--harbin-blue);
    font-size: 14px;
    opacity: 0.6;
}

.harbin-theme .theme-element {
    background: linear-gradient(90deg, var(--harbin-stone) 0%, var(--harbin-gold) 100%);
    color: var(--bg-white);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px 8px;
    margin: 2px;
}

.harbin-theme .document-header {
    background: linear-gradient(135deg, var(--harbin-blue) 0%, var(--primary-color) 100%);
}

.harbin-theme .section-title {
    color: var(--harbin-blue);
    border-left: 4px solid var(--harbin-gold);
    padding-left: 12px;
    position: relative;
}

.harbin-theme .section-title::before {
    background: linear-gradient(90deg, var(--harbin-gold) 0%, var(--harbin-blue) 100%);
}

/* 冰雪效果动画 */
.ice-effect {
    background: linear-gradient(135deg, 
        var(--harbin-ice) 0%, 
        rgba(232, 244, 248, 0.8) 25%,
        var(--bg-white) 50%,
        rgba(232, 244, 248, 0.8) 75%,
        var(--harbin-ice) 100%);
    background-size: 200% 200%;
    animation: iceShimmer 3s ease-in-out infinite;
}

@keyframes iceShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 面包石路纹理效果 */
.stone-texture {
    position: relative;
    background: var(--bg-white);
}

.stone-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            var(--harbin-stone) 10px,
            var(--harbin-stone) 11px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            var(--harbin-stone) 10px,
            var(--harbin-stone) 11px
        );
    opacity: 0.1;
    pointer-events: none;
}

/* 俄式建筑装饰 */
.russian-ornament {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.russian-ornament::after {
    content: '🏛️';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 16px;
    opacity: 0.3;
}

/* 哈尔滨特色按钮样式 */
.harbin-btn {
    background: linear-gradient(135deg, var(--harbin-blue) 0%, var(--harbin-gold) 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.harbin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.harbin-btn:hover::before {
    left: 100%;
}

.harbin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 164, 0.3);
}

/* 文档内容的哈尔滨主题样式 */
.harbin-theme .markdown-section {
    border-left: 3px solid var(--harbin-blue);
    background: linear-gradient(135deg, var(--harbin-ice) 0%, var(--bg-white) 100%);
}

.harbin-theme .markdown-section:hover {
    border-left-color: var(--harbin-gold);
    box-shadow: 0 4px 16px rgba(74, 144, 164, 0.1);
}

.harbin-theme .subsection-title {
    color: var(--harbin-blue);
    font-weight: 600;
}

.harbin-theme .paragraph strong {
    color: var(--harbin-red);
}

/* 响应式调整 */
/* ===== 增强内容格式化的响应式设计 ===== */
@media (max-width: 768px) {
    .section-title {
        font-size: 21px;
        padding: 16px 20px;
        margin: 24px 0 20px 0;
    }
    
    .collapse-icon {
        font-size: 16px;
        width: 18px;
    }
    
    .collapsible-title {
        gap: 10px;
    }
    
    .chinese-section-title {
        font-size: 18px;
        padding: 12px 16px;
        margin: 20px 0 14px 0;
    }
    
    .numbered-subsection-title {
        font-size: 15px;
        padding: 8px 14px 8px 18px;
    }
    
    .list-group {
        padding: 12px;
        margin: 12px 0;
    }
    
    .content-divider {
        margin: 16px 0;
    }
    
    .content-divider::before {
        font-size: 14px;
        padding: 0 8px;
    }
    
    .reference-paragraph,
    .timeline-paragraph {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .time-marker,
    .dynasty-marker,
    .person-marker,
    .location-marker,
    .citation,
    .concept-marker {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .harbin-theme .theme-main-title::after {
        right: -15px;
        font-size: 12px;
    }
    
    .russian-ornament::after {
        font-size: 14px;
        top: 6px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 19px;
        padding: 14px 16px;
        margin: 20px 0 16px 0;
    }
    
    .section-title::before {
        width: 60px;
    }
    
    .collapse-icon {
        font-size: 14px;
        width: 16px;
    }
    
    .collapsible-title {
        gap: 8px;
    }
    
    .main-section-title {
        font-size: 20px;
        padding: 14px 16px;
        margin: 24px 0 16px 0;
    }
    
    .chinese-section-title {
        font-size: 17px;
        padding: 10px 14px;
        margin: 16px 0 12px 0;
    }
    
    .chinese-section-title::before {
        width: 40px;
    }
    
    .numbered-subsection-title {
        font-size: 14px;
        padding: 8px 12px 8px 16px;
    }
    
    .list-group {
        padding: 8px;
        margin: 8px 0;
    }
    
    .list-item {
        padding: 6px 0;
        margin-bottom: 8px;
    }
    
    .bullet {
        margin-right: 8px;
        font-size: 12px;
    }
    
    .content-divider {
        margin: 12px 0;
    }
    
    .content-divider::before {
        font-size: 12px;
        padding: 0 6px;
    }
    
    .reference-paragraph,
    .timeline-paragraph {
        padding: 6px 10px;
        font-size: 12px;
        margin: 8px 0;
    }
    
    .time-marker,
    .dynasty-marker,
    .person-marker,
    .location-marker,
    .citation,
    .concept-marker {
        font-size: 10px;
        padding: 1px 3px;
        margin: 0 1px;
    }
    
    .paragraph {
        line-height: 1.7;
        margin-bottom: 12px;
    }
}

/* ===== 详细故事内容样式 ===== */
.detailed-stories-container {
    margin-top: 20px;
}

.detailed-story-section {
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.story-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--accent-gold);
}

.story-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: 'Noto Serif SC', serif;
}

.story-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
    font-family: 'Noto Serif SC', serif;
}

.story-content {
    line-height: 1.8;
    font-size: 15px;
    color: var(--text-primary);
}

.story-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 32px 0 20px 0;
    font-family: 'Noto Serif SC', serif;
    border-bottom: 3px solid var(--accent-gold);
    padding-bottom: 12px;
}

.story-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 28px 0 16px 0;
    font-family: 'Noto Serif SC', serif;
    position: relative;
    padding-left: 16px;
}

.story-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.story-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 24px 0 12px 0;
    font-family: 'Noto Serif SC', serif;
}

.story-content p {
    margin-bottom: 16px;
    text-align: justify;
    text-indent: 2em;
}

.story-content em {
    color: var(--text-secondary);
    font-style: italic;
    border-bottom: 1px dotted var(--accent-gold);
}

.story-separator {
    margin: 48px 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    position: relative;
}

.story-separator::after {
    content: '❋';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-white);
    color: var(--accent-gold);
    padding: 0 16px;
    font-size: 18px;
}

/* 增强现有的markdown内容样式 */
.story-content .time-marker,
.story-content .dynasty-marker,
.story-content .person-marker,
.story-content .location-marker,
.story-content .reference-marker {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    margin: 0 2px;
    display: inline-block;
}

/* 为故事内容添加特殊的引用样式 */
.story-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--bg-light);
    border-left: 4px solid var(--accent-gold);
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 8px 8px 0;
}

/* 故事内容的特殊段落样式 */
.story-content .verse {
    font-family: 'Noto Serif SC', serif;
    font-style: italic;
    text-align: center;
    margin: 24px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* 详细故事内容的移动端优化 */
@media (max-width: 768px) {
    .detailed-story-section {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .story-title {
        font-size: 20px;
    }
    
    .story-subtitle {
        font-size: 14px;
    }
    
    .story-content {
        font-size: 14px;
        line-height: 1.7;
    }
    
    .story-content h1 {
        font-size: 22px;
        margin: 24px 0 16px 0;
    }
    
    .story-content h2 {
        font-size: 18px;
        margin: 20px 0 12px 0;
    }
    
    .story-content h3 {
        font-size: 16px;
        margin: 16px 0 8px 0;
    }
    
    .story-content p {
        text-indent: 1.5em;
        margin-bottom: 12px;
    }
    
    .story-content .time-marker,
    .story-content .dynasty-marker,
    .story-content .person-marker,
    .story-content .location-marker,
    .story-content .reference-marker {
        font-size: 11px;
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .detailed-story-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .story-title {
        font-size: 18px;
    }
    
    .story-subtitle {
        font-size: 13px;
    }
    
    .story-content {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .story-content h1 {
        font-size: 20px;
        margin: 20px 0 12px 0;
    }
    
    .story-content h2 {
        font-size: 16px;
        margin: 16px 0 10px 0;
        padding-left: 12px;
    }
    
    .story-content h2::before {
        width: 3px;
        height: 16px;
    }
    
    .story-content h3 {
        font-size: 15px;
        margin: 12px 0 6px 0;
    }
    
    .story-content p {
        text-indent: 1em;
        margin-bottom: 10px;
    }
}

/* ===== 新的故事文档样式 ===== */
.story-document-container {
    padding: 24px;
    max-width: 100%;
    margin: 0 auto;
}

.story-document-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--accent-gold);
}

.story-document-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    line-height: 1.4;
}

.story-document-summary {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* 主题导航栏 */
.story-themes-nav {
    margin-bottom: 32px;
}

.themes-nav-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    text-align: center;
}

/* 导航行容器 */
.themes-nav-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.themes-nav-row:last-child {
    margin-bottom: 0;
}

/* 第一行和第三行（单个按钮）的样式 */
.themes-nav-row:first-of-type .theme-nav-tab,
.themes-nav-row:last-of-type .theme-nav-tab {
    min-width: 400px;
    max-width: 600px;
}

/* 保留旧的class以兼容 */
.themes-nav-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.theme-nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 240px;
    max-width: 400px;
    text-align: left;
}

.theme-nav-tab:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-nav-tab.active {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

.theme-nav-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.theme-nav-tab.active .theme-nav-number {
    background: var(--bg-white);
    color: var(--primary-color);
}

.theme-nav-content {
    flex: 1;
}

.theme-nav-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.theme-nav-subtitle {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.4;
}

/* 故事内容区域 */
.story-content-area {
    position: relative;
}

.story-theme-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.story-theme-panel.active {
    display: block;
}

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

.story-theme-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.story-theme-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.story-theme-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
}

.story-theme-elements {
    font-size: 14px;
    color: var(--text-light);
    padding: 12px 20px;
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* 故事结构导航 */
.story-structure-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.story-nav-btn {
    padding: 12px 24px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.story-nav-btn:hover {
    border-color: var(--accent-gold);
    color: var(--primary-color);
}

.story-nav-btn.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

/* 故事内容区域 */
.story-section {
    display: none;
    padding: 24px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease-out;
}

.story-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 主故事样式 */
.story-main-content {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-primary);
}

/* 主线故事标题区域 */
.main-story-title-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--accent-gold);
}

.main-story-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.4;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 小故事样式 */
.substory-item {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--accent-gold);
}

.substory-item:last-child {
    margin-bottom: 0;
}

.substory-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.substory-content {
    line-height: 1.7;
    font-size: 15px;
    color: var(--text-primary);
}

/* 设计灵感样式 */
.design-inspiration-content {
    max-width: 100%;
}

.inspiration-intro {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
}

.inspiration-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.inspiration-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.color-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.inspiration-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.inspiration-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    color: var(--text-primary);
}

.inspiration-list li:last-child {
    border-bottom: none;
}

.inspiration-list li:before {
    content: "▸";
    color: var(--accent-gold);
    font-weight: bold;
    margin-right: 8px;
}

.space-designs, .experience-designs {
    display: grid;
    gap: 12px;
}

.space-item, .experience-item {
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
}

.space-item p, .experience-item p {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 新样式的响应式适配 */
@media (max-width: 768px) {
    .story-document-container {
        padding: 16px;
    }
    
    .story-document-title {
        font-size: 22px;
    }
    
    .themes-nav-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .themes-nav-row {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .theme-nav-tab {
        min-width: 280px;
        max-width: 100%;
    }
    
    /* 移动端第一行和第三行也使用相同宽度 */
    .themes-nav-row:first-of-type .theme-nav-tab,
    .themes-nav-row:last-of-type .theme-nav-tab {
        min-width: 280px;
        max-width: 100%;
    }
    
    .story-structure-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .story-nav-btn {
        width: 100%;
        text-align: center;
    }
    
    .color-palette {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .story-document-container {
        padding: 12px;
    }
    
    .story-document-title {
        font-size: 20px;
    }
    
    .theme-nav-tab {
        min-width: 100%;
        padding: 12px 16px;
    }
    
    .story-section {
        padding: 16px;
    }
    
    .substory-item {
        padding: 16px;
    }
    
    .inspiration-section {
        padding: 16px;
    }
}

/* ===== 详细设计灵感样式 ===== */
.detailed-design-inspiration {
    width: 100%;
    max-width: 100%;
}

.design-content {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.markdown-content {
    font-family: 'Noto Sans SC', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-white);
    padding: 24px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.markdown-content::-webkit-scrollbar {
    width: 8px;
}

.markdown-content::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.design-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0;
}

.copy-design-btn,
.download-design-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.copy-design-btn {
    background: var(--primary-color);
    color: white;
}

.copy-design-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.download-design-btn {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.download-design-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

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

/* ===== 通知样式 ===== */
.notification {
    font-family: 'Noto Sans SC', sans-serif;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-icon {
    font-size: 16px;
}

.notification-message {
    font-size: 14px;
    font-weight: 500;
}

/* ===== 详细设计灵感响应式样式 ===== */
@media (max-width: 768px) {
    .design-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .copy-design-btn,
    .download-design-btn {
        width: 100%;
        justify-content: center;
    }
    
    .markdown-content {
        font-size: 13px;
        padding: 16px;
        max-height: 400px;
    }
}