/* ============================================================
   Teaching System — Final Polished Version
   Scope: .teaching-page (Global Dark Mode System)
   ============================================================ */

/* ── 1. 核心变量 ────────────────────────────────────────── */
.teaching-page {
    --bg: #0f0f10;
    --bg-soft: #161618;
    --text: #f0f0f2;
    --muted: #8b8b99;
    --soft: #5c5c66;
    --accent: #6366f1;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.14);
    --max: 760px; /* 统一正文居中宽度 */

    background-color: var(--bg) !important;
    color: var(--text) !important;
}

/* ── 2. 全局背景与穿透 (彻底消除白块) ───────────────────── */

/* 强制 Body、HTML 及 Astra 核心容器透明化，显露底层深色 */
html, body.teaching-page,
.teaching-page #primary,
.teaching-page #content,
.teaching-page .site-content,
.teaching-page #main,
.teaching-page .ast-separate-container,
.teaching-page .ast-article-single,
.teaching-page .ast-article-post {
    background-color: var(--bg) !important;
    background: var(--bg) !important;
    border: none !important;
    box-shadow: none !important;
}

/* 消除归档页/分类页顶部的“白框”标题区 */
.teaching-page .ast-archive-description,
.teaching-page .ast-archive-description .ast-archive-title,
.teaching-page .page-header,
.teaching-page .ast-container {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ── 3. 统一布局与居中 ──────────────────────────────────── */

/* 让 Astra 原生的列表页和文章页也像自定义模板一样居中 */
.teaching-page .site-content .ast-container,
.teaching-page.archive .site-content .ast-container,
.teaching-page.category .site-content .ast-container,
.teaching-page.single-post .site-content .ast-container {
    max-width: var(--max) !important;
    margin: 0 auto !important;
    padding: 3rem 1.5rem !important;
}

/* ── 4. 页眉与页脚 (Header & Footer) ───────────────────── */

.teaching-page .site-header,
.teaching-page .main-header-bar,
.teaching-page .ast-primary-header-bar,
.teaching-page .site-footer {
    background-color: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
}

.teaching-page .main-header-menu .menu-link,
.teaching-page .site-title a,
.teaching-page .ast-site-identity .site-title a,
.teaching-page .site-footer a {
    color: var(--text) !important;
}

/* ── 5. 文字与标题 (Typography) ────────────────────────── */

/* 统一所有页面（包括 Archive）的标题颜色 */
.teaching-page h1, 
.teaching-page .entry-title, 
.teaching-page .entry-title a,
.teaching-page .page-title,
.teaching-page .ast-archive-description .page-title {
    color: var(--text) !important;
    font-weight: 400 !important;
    text-decoration: none;
}

/* 统一正文颜色 */
.teaching-page .entry-content,
.teaching-page .entry-content p,
.teaching-page .thinking-excerpt,
.teaching-page .ast-excerpt-container p {
    color: var(--muted) !important;
    line-height: 2;
}

/* ── 6. 评论区深度定制 (解决白背景问题) ────────────────── */

.teaching-page .comments-area,
.teaching-page #comments,
.teaching-page .comment-respond,
.teaching-page .comment-list,
.teaching-page .comment-list .comment-body {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--text) !important;
    border: none !important;
}

/* 评论输入框美化 */
.teaching-page .comment-form input[type="text"],
.teaching-page .comment-form input[type="email"],
.teaching-page .comment-form input[type="url"],
.teaching-page .comment-form textarea {
    background-color: var(--bg-soft) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    padding: 12px;
}

.teaching-page .comment-reply-title,
.teaching-page .comment-notes,
.teaching-page .logged-in-as {
    color: var(--muted) !important;
}

/* ── 7. 侧边栏小工具 (Archives/Categories) ─────────────── */

.teaching-page #secondary,
.teaching-page .widget {
    background: transparent !important;
    color: var(--text) !important;
}

.teaching-page .widget-title {
    color: var(--text) !important;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.teaching-page .widget li,
.teaching-page .widget a {
    color: var(--muted) !important;
    text-decoration: none;
}

.teaching-page .widget a:hover {
    color: var(--accent) !important;
}

/* ── 8. 自定义模板专属类名支持 ────────────────────────── */

.teaching-page .shell {
    max-width: var(--max);
    margin: 0 auto;
}

.teaching-page .thinking-card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.teaching-page .thinking-title {
    font-size: 1.4rem;
}

/* ── 9. 响应式适配 ────────────────────────────────────── */

@media (max-width: 768px) {
    .teaching-page .site-content .ast-container,
    .teaching-page .shell {
        padding: 2rem 1.1rem !important;
    }
}