/* ============================================================
   缠中说禅博客 · 阅读优化样式（Apple 设计风格）
   统一页面最大宽度 1200px，优化正文与评论的可读性
   ============================================================ */

:root {
    --bg: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --accent: #0071e3;
    --border: rgba(0, 0, 0, 0.10);
    --fill: #f5f5f7;
    --fill-hover: #e8e8ed;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 48px 72px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                 "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
                 "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* 链接 */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 站点头部：缠中说禅 ============ */
.site-header { margin: 0 0 28px; }
.site-header a {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
}
.site-header a:hover { text-decoration: none; }

/* ============ 翻页导航按钮 ============ */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0;
}
.pager a.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--fill);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s ease, transform .05s ease;
}
.pager a.btn:hover { background: var(--fill-hover); text-decoration: none; }
.pager a.btn:active { transform: scale(0.97); }
.pager a.btn .icon {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--text-secondary);
}

/* ============ 文章标题 ============ */
h1 {
    font-size: 1.85em;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    margin: 8px 0 6px;
    color: var(--text);
}

/* 时间戳 */
.pubtime { font-size: 12px; color: var(--text-tertiary); }

/* ============ 正文 ============ */
.articalContent {
    font-size: 17px;
    line-height: 1.9;
    overflow-wrap: break-word;
    margin-top: 16px;
}
.articalContent p { margin: 0.9em 0; }
.articalContent img { max-width: 100%; height: auto; border-radius: 8px; }

/* ============ 评论 ============ */
#divReply h2 { font-size: 1.3em; font-weight: 700; margin: 28px 0 12px; }
#divReply fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 12px 0;
    padding: 12px 18px;
    background: var(--fill);
}
#divReply .divReplyIsHostTrue fieldset {
    background: #fff5f5;
    border-color: rgba(255, 59, 48, 0.25);
}
/* 访客评论占位符（默认隐藏，懒加载后替换为真实评论） */
#divReply .g { display: none; }
/* 访客回复计数提示 */
.guest-count { font-size: 12px; color: var(--text-tertiary); margin-left: 6px; }
.author { font-weight: 600; color: var(--text); }
.divReplyIsHostTrue .author { color: #d70015; }

/* ============ 分割线 ============ */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* ============ 页脚 ============ */
.site-footer {
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.9;
    color: var(--text-tertiary);
    text-align: center;
}
.site-footer a { color: var(--text-tertiary); }
.site-footer a:hover { color: var(--accent); }

/* ============ 移动端响应式 ============ */
@media (max-width: 768px) {
    body {
        padding: 20px 16px 56px;
    }
    h1 {
        font-size: 1.5em;
        line-height: 1.4;
    }
    .site-header a {
        font-size: 20px;
    }
    .articalContent {
        font-size: 16.5px;
        line-height: 1.85;
    }
    .pager a.btn {
        font-size: 13px;
        padding: 6px 11px;
    }
    .pager {
        gap: 6px;
    }
}


/* ============ 明暗主题（dark mode） ============ */
:root[data-theme="dark"] {
    --bg: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;
    --accent: #0a84ff;
    --border: rgba(255, 255, 255, 0.14);
    --fill: #2c2c2e;
    --fill-hover: #3a3a3c;
}
:root[data-theme="dark"] #divReply .divReplyIsHostTrue fieldset {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.35);
}
:root[data-theme="dark"] #divReply .divReplyIsHostTrue .author { color: #ff6961; }
:root[data-theme="dark"] #backToTop {
    background: rgba(40, 40, 42, 0.72);
    color: #c7c7cc;
}
:root[data-theme="dark"] #collapse-all {
    background: rgba(40, 40, 42, 0.72);
    color: #c7c7cc;
}
:root[data-theme="dark"] #collapse-all:hover {
    background: rgba(58, 58, 60, 0.95);
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.22);
}

/* ============ 统一文字颜色（monochrome，仅正文） ============ */
:root[data-monochrome="1"] .articalContent,
:root[data-monochrome="1"] .articalContent * {
    color: var(--text) !important;
}

/* ============ 悬浮主题控制按钮 ============ */
.theme-controls {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.theme-controls.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
}
.theme-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.theme-control:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}
.theme-control .ic { width: 17px; height: 17px; display: block; }

/* 明暗：亮色显示月亮（点击切暗），暗色显示太阳 */
.theme-control .ic-sun { display: none; }
:root[data-theme="dark"] .theme-control .ic-sun { display: block; }
:root[data-theme="dark"] .theme-control .ic-moon { display: none; }

/* 颜色：默认彩色圆点，统一后灰色描边圆点 */
.theme-control .ic-color-off { display: none; }
:root[data-monochrome="1"] .theme-control .ic-color-on { display: none; }
:root[data-monochrome="1"] .theme-control .ic-color-off { display: block; }

:root[data-theme="dark"] .theme-control {
    background: rgba(40, 40, 42, 0.72);
    color: #c7c7cc;
}
:root[data-theme="dark"] .theme-control:hover {
    background: rgba(58, 58, 60, 0.95);
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.22);
}
