/* static/style.css */
/* --- Global & Layout --- */
body {
    background: #f5f5f5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease;
}

/* Navbar Styles */
.compact-navbar {
    padding: 0.5rem 0;
    transition: transform 0.3s ease;
}

.nav-action-btn {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s;
}

.nav-action-btn:hover {
    color: #fff;
}

/* --- Content Box (Reading Page) --- */
.content-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.8;
    font-size: 1.1rem;
    min-height: 60vh;
}

.content-box img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}

/* --- Editor Styles --- */
.editor-textarea {
    width: 100%;
    min-height: 500px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    background-color: #fafafa;
    color: #333;
}

.editor-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.editor-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.hidden { display: none !important; }

.translated { 
    display: block; margin-top: 10px; padding: 10px; 
    background: #f8f9fa; border-left: 3px solid #0d6efd; 
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    body {
        background: #fff; /* 手机端纯白背景 */
    }

    /* 导航栏微调 */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* 调整 Container 边距，解决贴顶问题 */
    main.container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 20px !important; /* 增加顶部间距 */
        max-width: 100%;
    }

    /* 阅读页内容区域去框去阴影 */
    .content-box {
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* --- 手机端大纲页 (Chapters) Plain Style --- */
    /* 针对 ID 为 chapters-card 的容器进行去卡片化处理 */
    #chapters-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    #chapters-card .card-body {
        padding: 0 !important;
    }

    /* 调整大纲页标题栏 */
    #chapters-card .banner {
        padding-bottom: 15px;
        margin-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* 列表项样式微调 */
    .chapter-item {
        border: 1px solid #f0f0f0; /* 轻微边框 */
        border-radius: 4px;
        margin-bottom: 5px;
    }

    /* 按钮组微调 */
    .btn-group .btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .btn-text-responsive {
        display: none;
    }
    
    .btn i {
        margin: 0 !important;
    }
    
    .btn-outline-secondary, .btn-outline-primary {
        border-radius: 20px;
    }
}

/* --- Focus / Edit Mode (Zen Mode) --- */
/* 当 body 拥有 mode-editing 类时触发 */

body.mode-editing {
    background-color: #fff; /* 编辑模式下背景纯白 */
    overflow-y: auto;
}

/* 隐藏干扰元素 */
body.mode-editing .navbar,
body.mode-editing footer,
body.mode-editing .chapter-navigation, /* 底部导航 */
body.mode-editing .reading-header,     /* 顶部标题栏 */
body.mode-editing .audio-player-container {
    display: none !important;
}

/* 调整容器宽度，给予更多编辑空间 */
body.mode-editing main.container {
    max-width: 900px;
    padding-top: 20px !important;
    margin: 0 auto;
}

/* 编辑器全屏优化 */
body.mode-editing .editor-textarea {
    min-height: 85vh; /* 占据大部分屏幕高度 */
    border: none;     /* 移除边框，更沉浸 */
    padding: 0;       /* 移除内边距，对齐 */
    background: transparent;
    box-shadow: none;
    resize: none;     /* 禁止手动调整，自动填满 */
    font-size: 1.1rem;
}

body.mode-editing .editor-input {
    border: none;
    border-bottom: 1px dashed #ccc;
    border-radius: 0;
    padding-left: 0;
    font-size: 1.5rem;
    background: transparent;
    margin-bottom: 20px;
}

/* 编辑模式下的工具栏 */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
}