/* ========================================
   World Travel Guide - 响应式CSS样式表
   ========================================
   
   屏幕尺寸分级：
   - 移动端：≤768px
   - 平板端：769px-1024px  
   - 电脑端：1025px-1599px
   - 大屏幕：≥1600px
   
   作者：AI Assistant
   版本：2.0
   更新时间：2025-08-20
   
   功能特性：
   - 响应式布局设计
   - 4级屏幕尺寸适配
   - 字体和间距分级优化
   - 编辑器布局适配
   - 移动端优化
   ======================================== */

/* ========================================
   1. 全局样式重置和基础设置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 颜色变量 */
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    --border-color: #e1e8ed;
    
    /* 阴影变量 */
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 25px rgba(0,0,0,0.2);
    
    /* 圆角变量 */
    --border-radius: 12px;
    --border-radius-small: 8px;
    
    /* 过渡动画 */
    --transition: all 0.3s ease;
    
    /* 渐变背景 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-travel: linear-gradient(135deg, #74b9ff 0%, #0984e3 50%, #6c5ce7 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--light-bg);
    font-size: 16px;
}

/* ========================================
   2. 导航栏样式
   ======================================== */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--light-bg);
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link.logout {
    background: var(--accent-color);
    color: var(--white);
}

.nav-link.logout:hover {
    background: #c0392b;
    color: var(--white);
}

/* ========================================
   3. Flash消息样式
   ======================================== */
.flash-messages {
    position: sticky;
    top: 64px;
    z-index: 999;
    margin-bottom: 0;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin-bottom: 8px;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-light);
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.close-alert {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: var(--transition);
}

.close-alert:hover {
    opacity: 1;
}

/* ========================================
   4. 主要内容区域
   ======================================== */
.main-content {
    min-height: calc(100vh - 140px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   5. 英雄区域样式
   ======================================== */
.hero-section {
    background: var(--gradient-travel);
    padding: 80px 0;
    text-align: center;
    color: var(--white);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-title i {
    display: block;
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.9;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
}

/* ========================================
   6. 区域标题样式
   ======================================== */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 600;
    margin: 48px 0 32px 0;
    color: var(--text-primary);
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* ========================================
   7. 文件网格样式
   ======================================== */
.files-section {
    margin-bottom: 64px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.file-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.card-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    font-size: 24px;
    color: var(--primary-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content {
    padding: 16px 24px;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    gap: 12px;
}

.file-type {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--light-bg);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-footer {
    padding: 16px 24px 24px 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* ========================================
   8. 空状态样式
   ======================================== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.tips {
    margin-top: 32px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.tips h4 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.tips ul {
    list-style: none;
}

.tips li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.tips li i {
    width: 20px;
    color: var(--primary-color);
}

/* ========================================
   9. 功能特色区域
   ======================================== */
.features-section {
    margin-bottom: 64px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: var(--white);
    font-size: 2rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* ========================================
   10. 查看器页面样式
   ======================================== */
.viewer-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 32px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb i.fa-chevron-right {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.document-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 16px;
}

.document-title i {
    color: var(--primary-color);
}

.document-meta {
    display: flex;
    gap: 24px;
    color: var(--text-secondary);
}

.filename {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* 查看器容器 */
.viewer-container {
    padding: 48px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 48px;
    align-items: start;
}

/* ========================================
   11. 目录样式
   ======================================== */
.table-of-contents {
    position: sticky;
    top: 120px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.toc-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.toc-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-content {
    padding: 16px 0;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin: 0;
}

.toc-item.indent-1 {
    padding-left: 24px;
}

.toc-item.indent-2 {
    padding-left: 48px;
}

.toc-link {
    display: block;
    padding: 8px 24px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.toc-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.toc-link.active {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.no-toc {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   12. Markdown内容样式（电脑端默认）
   ======================================== */
.markdown-content {
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.travel-guide {
    padding: 48px;
    line-height: 1.8;
}

/* 标题样式 */
.travel-guide h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 16px;
}

.travel-guide h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 48px 0 24px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.travel-guide h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: var(--text-primary);
}

/* 段落和文本样式 */
.travel-guide p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.travel-guide strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 表格样式 */
.travel-guide .table-wrapper {
    overflow-x: auto;
    margin: 32px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.travel-guide table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin: 0;
    background: var(--white);
}

.travel-guide th {
    background: #0984e3;
    color: var(--white);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.travel-guide td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.travel-guide tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

.travel-guide tr:last-child td {
    border-bottom: none;
}

/* 列表样式 */
.travel-guide ul, .travel-guide ol {
    margin: 16px 0;
    padding-left: 32px;
}

.travel-guide li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.travel-guide li strong {
    color: var(--text-primary);
}

/* Checkbox样式 */
.travel-guide .task-list {
    list-style: none;
    padding-left: 0;
}

.travel-guide .task-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.travel-guide .task-list-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.travel-guide .task-list-item input[type="checkbox"]:checked {
    accent-color: #27ae60;
}

.travel-guide .task-list-item input[type="checkbox"]:disabled {
    cursor: default;
    opacity: 0.8;
}

/* 图片样式 */
.travel-guide img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-light);
    margin: 16px 0;
    display: block;
}

.travel-guide img[style*="width"] {
    max-width: none;
}

/* ========================================
   13. 浮动操作按钮
   ======================================== */
.floating-actions {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.fab-button:hover {
    background: #357abd;
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

/* ========================================
   14. 页脚样式
   ======================================== */
.footer {
    background: var(--text-primary);
    color: var(--white);
    padding: 32px 0;
    text-align: center;
    margin-top: 64px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   15. 编辑器样式
   ======================================== */
/* 统一的编辑器高度样式 */
.form-group textarea,
#contentEditor {
    min-height: 60vh !important;
    height: calc(100vh - 250px) !important;
    max-height: calc(100vh - 200px) !important;
}

/* 电脑端编辑器样式 */
#contentEditorDesktop {
    flex: 1;
    border: none;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: var(--white);
    color: var(--text-primary);
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

/* 确保编辑器容器能够充分利用空间 */
.editor-wrapper {
    height: calc(100vh - 200px) !important;
    min-height: 60vh !important;
}

.editor-content {
    height: calc(100vh - 150px) !important;
    min-height: 65vh !important;
}

.tab-pane {
    height: 100% !important;
}

/* 编辑器进一步优化 */
.editor-workspace .editor-main {
    height: 100%;
}

/* 确保页面布局充分利用可用空间 */
.editor-workspace {
    height: calc(100vh - 80px);
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr;
}

/* 电脑端强制保持网格布局 */
@media (min-width: 769px) {
    .editor-workspace {
        display: grid !important;
        grid-template-columns: 280px 1fr !important;
        grid-template-rows: 1fr !important;
        height: calc(100vh - 80px) !important;
    }
    
    .editor-sidebar {
        width: 280px !important;
        max-width: 280px !important;
        order: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .editor-main {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
    }
}

/* 移动端/电脑端布局控制 */
.mobile-layout {
    display: none;
}
.desktop-layout {
    display: block;
}

/* 电脑端分栏布局 */
.desktop-split-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    gap: 1px;
    background: var(--border-color);
}

.editor-panel,
.preview-panel {
    background: var(--white);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.editor-panel .editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.editor-panel .editor-stats {
    flex-shrink: 0;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 8px 20px;
    display: flex;
    gap: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.preview-panel .preview-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ========================================
   16. 响应式设计 - 严格按照4个级别设置
   ======================================== */

/* ========================================
   16.1 移动端样式 (≤768px)
   ======================================== */
@media (max-width: 768px) {
    /* 布局调整 */
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .table-of-contents {
        position: static;
        order: 1;
        max-height: none;
    }
    
    .markdown-content {
        order: 2;
    }
    
    /* 导航栏调整 */
    .container {
        padding: 0 16px;
    }
    
    .nav-container {
        padding: 0 16px;
        flex-wrap: nowrap;
        min-height: 64px;
        height: auto;
        padding: 8px 16px;
        gap: 12px;
    }
    
    .nav-brand {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .nav-brand span {
        display: none;
    }
    
    .nav-links {
        flex-wrap: nowrap;
        gap: 8px;
        flex: 1;
        justify-content: flex-end;
        min-width: 0;
    }
    
    .user-menu {
        gap: 8px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    .user-info {
        padding: 6px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .nav-link.logout {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* 标题调整 */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-title i {
        font-size: 3rem;
    }
    
    /* 编辑器布局适配 */
    .editor-workspace {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 0 !important;
    }
    
    .editor-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        order: -1 !important;
        flex-shrink: 0 !important;
        margin-bottom: 16px !important;
    }
    
    .editor-main {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        flex: 1 !important;
    }
    
    /* 移动端正文padding */
    .travel-guide {
        padding: 24px;
    }
    
    /* 移动端字体优化 */
    .travel-guide h1 {
        font-size: 1.8rem;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom-width: 2px;
    }
    
    .travel-guide h2 {
        font-size: 1.5rem;
        margin: 28px 0 16px 0;
    }
    
    .travel-guide h3 {
        font-size: 1.2rem;
        margin: 20px 0 12px 0;
    }
    
    .travel-guide p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 12px;
    }
    
    .travel-guide li {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 6px;
    }
    
    .travel-guide ul, .travel-guide ol {
        margin: 12px 0;
        padding-left: 24px;
    }
    
    /* 移动端表格字体优化 */
    .travel-guide th {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    
    .travel-guide td {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    
    /* 移动端页面标题优化 */
    .document-title h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .document-title i {
        font-size: 1.4rem;
    }
    
    /* 移动端目录标题优化 */
    .toc-header h3 {
        font-size: 0.9rem;
    }
    
    .toc-link {
        font-size: 0.8rem;
        padding: 6px 16px;
    }
    
    /* 移动端布局控制 */
    .mobile-layout {
        display: block;
    }
    
    .desktop-layout {
        display: none;
    }
    
    /* 移动端编辑器布局修复 */
    .editor-workspace {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 0 !important;
    }
    
    .editor-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        order: -1 !important;
        flex-shrink: 0 !important;
        margin-bottom: 16px !important;
    }
    
    .editor-main {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        flex: 1 !important;
    }
    
    /* 移动端内容区域宽度控制 */
    .mobile-layout {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .editor-content {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .tab-pane {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* ========================================
   16.2 超小屏幕优化 (≤480px)
   ======================================== */
@media (max-width: 480px) {
    .nav-container {
        padding: 4px 8px;
        gap: 6px;
        flex-wrap: nowrap !important;
        min-height: 56px;
    }
    
    .nav-brand {
        font-size: 14px;
        flex-shrink: 0;
        min-width: 60px;
    }
    
    .nav-links {
        gap: 2px;
        flex: 1;
        justify-content: flex-end;
        min-width: 0;
        flex-wrap: nowrap !important;
    }
    
    .nav-link {
        padding: 3px 6px;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .nav-link.logout {
        padding: 3px 5px;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    
    .user-info {
        padding: 3px 6px;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 0;
    }
    
    .user-menu {
        gap: 2px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        flex-wrap: nowrap !important;
    }
    
    /* 隐藏用户名中的图标以节省空间 */
    .user-info i {
        display: none;
    }
    
    /* 确保导航链接不会换行 */
    .nav-links > * {
        flex-shrink: 0;
    }
    
    /* 超小屏幕正文padding */
    .travel-guide {
        padding: 16px;
    }
    
    /* 超小屏幕字体优化 */
    .travel-guide h1 {
        font-size: 1.6rem;
        margin-bottom: 16px;
        padding-bottom: 8px;
    }
    
    .travel-guide h2 {
        font-size: 1.3rem;
        margin: 20px 0 12px 0;
    }
    
    .travel-guide h3 {
        font-size: 1.1rem;
        margin: 16px 0 10px 0;
    }
    
    .travel-guide p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    
    .travel-guide li {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 5px;
    }
    
    /* 超小屏幕表格字体优化 */
    .travel-guide th {
        font-size: 0.75rem;
        padding: 8px 10px;
    }
    
    .travel-guide td {
        font-size: 0.75rem;
        padding: 8px 10px;
    }
    
    /* 超小屏幕页面标题优化 */
    .document-title h1 {
        font-size: 1.4rem;
        margin-bottom: 6px;
        gap: 8px;
    }
    
    .document-title i {
        font-size: 1.2rem;
    }
    
    /* 超小屏幕目录标题优化 */
    .toc-header h3 {
        font-size: 0.8rem;
    }
    
    .toc-link {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
}

/* ========================================
   16.3 平板端样式 (769px-1024px)
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    /* 平板端编辑器优化 */
    .form-group textarea,
    #contentEditor,
    #contentEditorDesktop {
        height: calc(100vh - 200px) !important;
        min-height: 50vh !important;
    }
    
    .editor-wrapper {
        height: calc(100vh - 180px) !important;
        min-height: 50vh !important;
    }
    
    .editor-content {
        height: calc(100vh - 120px) !important;
        min-height: 55vh !important;
    }
    
    /* 平板端正文padding */
    .travel-guide {
        padding: 36px;
    }
    
    /* 平板端字体优化 */
    .travel-guide h1 {
        font-size: 2.2rem;
        margin-bottom: 28px;
        padding-bottom: 14px;
    }
    
    .travel-guide h2 {
        font-size: 1.8rem;
        margin: 40px 0 20px 0;
    }
    
    .travel-guide h3 {
        font-size: 1.4rem;
        margin: 28px 0 14px 0;
    }
    
    .travel-guide p {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 14px;
    }
    
    .travel-guide li {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 7px;
    }
    
    /* 平板端表格字体优化 */
    .travel-guide th {
        font-size: 0.9rem;
        padding: 14px 18px;
    }
    
    .travel-guide td {
        font-size: 0.9rem;
        padding: 14px 18px;
    }
    
    /* 平板端页面标题优化 */
    .document-title h1 {
        font-size: 2.2rem;
        margin-bottom: 10px;
        gap: 14px;
    }
    
    .document-title i {
        font-size: 1.8rem;
    }
}

/* ========================================
   16.4 大屏幕样式 (≥1600px)
   ======================================== */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .nav-container {
        max-width: 1600px;
    }
    
    .footer-content {
        max-width: 1600px;
    }
    
    .content-wrapper {
        grid-template-columns: 320px 1fr;
        gap: 56px;
    }
    
    .travel-guide {
        padding: 64px;
    }
    
    /* 大屏幕字体优化 */
    .travel-guide h1 {
        font-size: 2.5rem;
        margin-bottom: 40px;
        padding-bottom: 20px;
    }
    
    .travel-guide h2 {
        font-size: 2.0rem;
        margin: 56px 0 32px 0;
    }
    
    .travel-guide h3 {
        font-size: 1.5rem;
        margin: 40px 0 20px 0;
    }
    
    .travel-guide p {
        font-size: 1.1rem;
        line-height: 1.9;
        margin-bottom: 20px;
    }
    
    .travel-guide li {
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 10px;
    }
    
    /* 大屏幕表格字体优化 */
    .travel-guide th {
        font-size: 1rem;
        padding: 20px 24px;
    }
    
    .travel-guide td {
        font-size: 1rem;
        padding: 20px 24px;
    }
    
    /* 大屏幕页面标题优化 */
    .document-title h1 {
        font-size: 3.0rem;
        margin-bottom: 16px;
        gap: 20px;
    }
    
    .document-title i {
        font-size: 3rem;
    }
}

/* ========================================
   16.5 超大屏幕优化 (≥1400px)
   ======================================== */
@media (min-width: 1400px) {
    .form-group textarea,
    #contentEditor,
    #contentEditorDesktop {
        height: calc(100vh - 280px) !important;
        min-height: 70vh !important;
    }
    
    .editor-wrapper {
        height: calc(100vh - 220px) !important;
        min-height: 70vh !important;
    }
    
    .editor-content {
        height: calc(100vh - 180px) !important;
        min-height: 75vh !important;
    }
}

/* ===== 悬浮通知系统 ===== */

/* 通知容器 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

/* 通知项 */
.toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    border-left: 4px solid;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* 通知类型样式 */
.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.toast.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

/* 通知图标 */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.toast.success .toast-icon {
    background: #10b981;
    color: white;
}

.toast.error .toast-icon {
    background: #ef4444;
    color: white;
}

.toast.warning .toast-icon {
    background: #f59e0b;
    color: white;
}

.toast.info .toast-icon {
    background: #3b82f6;
    color: white;
}

/* 通知内容 */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: #1f2937;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* 关闭按钮 */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* 进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    transition: width linear;
}

.toast.success .toast-progress-bar {
    background: #10b981;
}

.toast.error .toast-progress-bar {
    background: #ef4444;
}

.toast.warning .toast-progress-bar {
    background: #f59e0b;
}

.toast.info .toast-progress-bar {
    background: #3b82f6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        margin-bottom: 8px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    #toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 10px 14px;
        margin-bottom: 6px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

