/* ====================================================================
   自定义页面（page.php）样式
   - 容器宽度 = 1200px（与文章页 + 侧边栏同宽）
   - 无侧边栏
   - 复用 single.css 的 article-* 系列样式（因 page.php 不加载 single.css，
     故把所需样式自包含到本文件）
   ==================================================================== */

/* ================== 容器（与文章页同宽：1200px） ================== */
.page-container {
    max-width: 1200px;
    margin: 100px auto;
    padding: 0 20px;
}

@media (max-width: 1024px) {
    .page-container { max-width: 95%; }
}
@media (max-width: 768px) {
    .page-container {
        margin: 80px auto 20px;
        padding: 0 15px;
    }
}
@media (max-width: 480px) {
    .page-container {
        margin: 70px auto 15px;
        padding: 0 10px;
    }
}

/* ================== 页面卡片（与文章页 .article-card 一致） ================== */
.page-article.article-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    padding: 40px;
}

@media (max-width: 480px) {
    .page-article.article-card { padding: 20px; }
}

/* ================== 文章头部（与 single.css .article-header 一致） ================== */
.page-article .article-header {
    text-align: center;
    margin-bottom: 40px;
}

/* 文章标题（与 single.css .article-title 一致） */
.page-article .article-title {
    font-size: 1.5rem;
    color: #1a202c;
    line-height: 1.4;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* 分割线（与 single.css .article-divider 一致） */
.page-article .article-divider {
    height: 3px;
    background: linear-gradient(to right, #3498db, transparent);
    margin: 20px 0;
}

/* 文章元信息（与 single.css .article-meta 一致） */
.page-article .article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: #718096;
    font-size: 0.95rem;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-article .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-article .meta-item i {
    color: #a0aec0;
}

.page-article .meta-text {
    color: #4a5568;
}

/* ================== 特色图（与文章页同款） ================== */
.page-featured-image {
    margin: -40px -40px 30px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}
.page-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 480px;
    object-fit: cover;
}
@media (max-width: 480px) {
    .page-featured-image { margin: -20px -20px 20px; border-radius: 16px 16px 0 0; }
    .page-featured-image img { max-height: 240px; }
}

/* ================== 内容区（与文章页 .article-content 一致） ================== */
.page-content.article-content {
    max-width: 100%;
    margin: 0 auto;
    word-wrap: break-word;
    line-height: 1.85;
    color: #374151;
    font-size: 16px;
}
.page-content p { margin: 1em 0; }
.page-content h2,
.page-content h3,
.page-content h4 {
    color: #0a0e27;
    font-weight: 700;
    line-height: 1.35;
    margin: 1.6em 0 0.6em;
}
.page-content h2 { font-size: 24px; }
.page-content h3 { font-size: 20px; }
.page-content h4 { font-size: 17px; }
.page-content ul,
.page-content ol { margin-left: 2em; }
.page-content img {
    max-width: 100%;
    height: auto;
    margin: 1.6em auto;
    display: block;
    border-radius: 8px;
}
.page-content img.aligncenter { display: block; margin: 1.6em auto; }
.page-content img.alignleft { float: left; margin: 0.4em 1.6em 0.4em 0; }
.page-content img.alignright { float: right; margin: 0.4em 0 0.4em 1.6em; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.page-content table td,
.page-content table th {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
}
.page-content table th { background: #f8faff; color: #0a0e27; font-weight: 600; }
.page-content blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 16px;
    border-left: 4px solid #ddd;
    color: #4b5563;
}
.page-content a {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 1px solid rgba(49, 130, 206, 0.2);
    transition: color 0.2s, border-color 0.2s;
}
.page-content a:hover {
    color: #2c5282;
    border-bottom-color: #2c5282;
}
.page-content :not(pre) > code {
    padding: 2px 6px;
    border-radius: 4px;
    background: #f5f5f5;
    color: #e83e8c;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.92em;
}

/* ================== 代码块 / 工具栏 ================== */
.page-content pre[class*="language-"] {
    margin: 2em 0;
    padding: 1.5em;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.page-content div.code-toolbar > .toolbar {
    opacity: 1;
    top: 0.3em;
    right: 0.3em;
}

/* ================== 分页链接 ================== */
.page-links {
    margin: 30px 0;
    text-align: center;
}
.page-links span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f8f9fa;
}

/* ================== 底部双按钮 ================== */
.page-footer-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #edf2f7;
}
.page-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}
.page-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    color: #3182ce;
    border-color: #3182ce;
}
.page-action-btn-primary {
    background: linear-gradient(135deg, #5b8def 0%, #3b82f6 100%);
    color: #fff;
    border-color: transparent;
}
.page-action-btn-primary:hover {
    color: #fff;
    box-shadow: 0 8px 22px rgba(91, 141, 239, 0.4);
}

/* ================== 移动端（与 single.css 同步） ================== */
@media (max-width: 768px) {
    .page-article .article-meta {
        overflow-x: auto;
        padding-bottom: 5px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-left: 20px;
        padding-right: 20px;
        margin-left: -20px;
        margin-right: -20px;
        mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }
    .page-article .article-meta::-webkit-scrollbar { display: none; }
    .page-article .article-meta {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

@media (max-width: 480px) {
    .page-article .article-title { font-size: 1.3rem; }
    .page-article .article-divider { margin: 20px auto; }
    .page-article .article-meta { margin-top: 15px; gap: 10px; }
    .page-article .meta-item { font-size: 0.75rem; }
}

/* ================== 打印 ================== */
@media print {
    .page-container { padding: 0; }
    .page-article { border: none; box-shadow: none; padding: 0; }
    .page-footer-actions { display: none; }
}
