/**
 * 全屏阅读样式
 */

/* 全屏阅读按钮 */
.fullscreen-reading-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-reading-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.fullscreen-reading-btn i {
    font-size: 16px;
}

/* 全屏容器 */
.fullscreen-reading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* 全屏头部 */
.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.font-size-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* 全屏内容区域 */
.fullscreen-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
    background: #ffffff;
    line-height: 1.6;
    font-size: 16px;
}

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

.fullscreen-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.fullscreen-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.fullscreen-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 全屏内容样式 */
.fullscreen-content h1,
.fullscreen-content h2,
.fullscreen-content h3,
.fullscreen-content h4,
.fullscreen-content h5,
.fullscreen-content h6 {
    color: #2d3748;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.fullscreen-content h1 {
    font-size: 2.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.3em;
}

.fullscreen-content h2 {
    font-size: 2em;
    color: #4a5568;
}

.fullscreen-content h3 {
    font-size: 1.5em;
    color: #4a5568;
}

.fullscreen-content p {
    margin-bottom: 1.5em;
    color: #4a5568;
    text-align: justify;
}

.fullscreen-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    color: #718096;
    background: rgba(102, 126, 234, 0.05);
    padding: 1.5em;
    border-radius: 0 8px 8px 0;
}

.fullscreen-content ul,
.fullscreen-content ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.fullscreen-content li {
    margin-bottom: 0.5em;
    color: #4a5568;
}

.fullscreen-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.fullscreen-content a:hover {
    border-bottom-color: #667eea;
}

.fullscreen-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 2em 0;
}

.fullscreen-content code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: #667eea;
}

.fullscreen-content pre {
    background: #f7fafc;
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid #e2e8f0;
}

.fullscreen-content pre code {
    background: none;
    padding: 0;
    color: #2d3748;
}

/* 代码块展开功能 */
.fullscreen-content figure.highlight {
    position: relative;
    margin: 2em 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* 代码块折叠样式 - 与主题保持一致 */
.fullscreen-content figure.highlight.folded .highlight-body {
    height: 0 !important;
    overflow: hidden !important;
    transition: height 0.3s ease;
}

.fullscreen-content figure.highlight .highlight-body {
    transition: height 0.3s ease;
}

.fullscreen-content figure.highlight.foldable .level-left {
    cursor: pointer;
}

.fullscreen-content figure.highlight figcaption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #4a5568;
}

.fullscreen-content figure.highlight .fold {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.fullscreen-content figure.highlight .fold:hover {
    background: rgba(102, 126, 234, 0.1);
}

.fullscreen-content figure.highlight .fold i {
    font-size: 14px;
    color: #667eea;
}

.fullscreen-content figure.highlight .copy {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.fullscreen-content figure.highlight .copy:hover {
    background: #667eea;
    color: white;
}

.fullscreen-content figure.highlight .highlight-body {
    overflow-x: auto;
    background: #f7fafc;
}

.fullscreen-content figure.highlight table {
    margin: 0;
    border-collapse: collapse;
    width: 100%;
}

.fullscreen-content figure.highlight .gutter {
    background: #e2e8f0;
    border-right: 1px solid #cbd5e0;
    padding: 0 8px;
    text-align: right;
    user-select: none;
    min-width: 40px;
}

.fullscreen-content figure.highlight .line-number {
    display: block;
    line-height: 1.5;
    color: #718096;
    font-size: 12px;
}

/* Prism.js 行号样式 */
.fullscreen-content pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

.fullscreen-content pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.fullscreen-content .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em; /* works for line-numbers below 1000 lines */
    letter-spacing: -1px;
    border-right: 1px solid #e2e8f0;
    user-select: none;
    counter-reset: linenumber;
    background: #f1f5f9;
    padding: 1.5em 0.8em;
}

.fullscreen-content .line-numbers-rows > span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber;
    line-height: 1.6;
    color: #94a3b8;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.85em;
    text-align: right;
}

.fullscreen-content .line-numbers-rows > span:before {
    content: counter(linenumber);
}

.fullscreen-content figure.highlight .code {
    padding: 16px;
    background: #f7fafc;
    overflow-x: auto;
}

.fullscreen-content figure.highlight .code .line {
    line-height: 1.5;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
}

/* 黑暗主题 */
.fullscreen-content.theme-dark {
    background: #1a202c;
    color: #e2e8f0;
}

.fullscreen-content.theme-dark h1,
.fullscreen-content.theme-dark h2,
.fullscreen-content.theme-dark h3,
.fullscreen-content.theme-dark h4,
.fullscreen-content.theme-dark h5,
.fullscreen-content.theme-dark h6 {
    color: #f7fafc;
}

.fullscreen-content.theme-dark p,
.fullscreen-content.theme-dark li {
    color: #cbd5e0;
}

.fullscreen-content.theme-dark blockquote {
    background: rgba(102, 126, 234, 0.1);
    color: #a0aec0;
    border-left-color: #90cdf4;
}

.fullscreen-content.theme-dark a {
    color: #90cdf4;
}

.fullscreen-content.theme-dark a:hover {
    border-bottom-color: #90cdf4;
}

.fullscreen-content.theme-dark code {
    background: rgba(102, 126, 234, 0.2);
    color: #90cdf4;
}

.fullscreen-content.theme-dark pre {
    background: #2d3748;
    border-color: #4a5568;
}

.fullscreen-content.theme-dark pre code {
    color: #e2e8f0;
}

/* 黑暗主题下的代码块 */
.fullscreen-content.theme-dark figure.highlight {
    border-color: #4a5568;
}

.fullscreen-content.theme-dark figure.highlight figcaption {
    background: #2d3748;
    border-bottom-color: #4a5568;
    color: #a0aec0;
}

.fullscreen-content.theme-dark figure.highlight .fold:hover {
    background: rgba(102, 126, 234, 0.2);
}

.fullscreen-content.theme-dark figure.highlight .fold i {
    color: #90cdf4;
}

.fullscreen-content.theme-dark figure.highlight .copy {
    background: rgba(102, 126, 234, 0.2);
    color: #90cdf4;
}

.fullscreen-content.theme-dark figure.highlight .copy:hover {
    background: #667eea;
    color: white;
}

.fullscreen-content.theme-dark figure.highlight .highlight-body {
    background: #2d3748;
}

.fullscreen-content.theme-dark figure.highlight .gutter {
    background: #4a5568;
    border-right-color: #718096;
}

.fullscreen-content.theme-dark figure.highlight .line-number {
    color: #a0aec0;
}

/* Prism.js 深色主题行号样式 */
.fullscreen-content.theme-dark .line-numbers-rows {
    background: #4a5568;
    border-right-color: #718096;
}

.fullscreen-content.theme-dark .line-numbers-rows > span {
    color: #a0aec0;
}

.fullscreen-content.theme-dark figure.highlight .code {
    background: #2d3748;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fullscreen-reading-btn {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .fullscreen-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .fullscreen-controls {
        gap: 8px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .font-size-display {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .fullscreen-content {
        padding: 20px;
    }
    
    .fullscreen-content h1 {
        font-size: 2em;
    }
    
    .fullscreen-content h2 {
        font-size: 1.5em;
    }
    
    .fullscreen-content h3 {
        font-size: 1.25em;
    }
}

/* 全屏状态下的body样式 */
body.fullscreen-reading-active {
    overflow: hidden;
}

/* 动画效果 */
.fullscreen-reading-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 打印样式 */
@media print {
    .fullscreen-header {
        display: none;
    }
    
    .fullscreen-content {
        padding: 0;
        margin: 0;
        max-width: none;
        width: 100%;
    }
}
