/* ============================================================
   LiteLog 默认模板样式 v1.2
   - 三栏布局（左插件栏 / 主内容 / 右侧栏）
   - 支持小工具（Widget）系统
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    background: #f6f7f9;
    line-height: 1.7;
}
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   页头
   ============================================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 0;
}
.site-header .logo { margin: 0; font-size: 26px; }
.site-header .logo a { color: #1a1a1a; }
.site-header .desc { margin: 4px 0 12px; color: #888; font-size: 14px; }
.nav a { margin-right: 16px; font-size: 14px; color: #555; }
.nav a:hover { color: #1a73e8; }

/* ============================================================
   三栏布局
   ============================================================ */
.layout {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    align-items: flex-start;
}
.left-col  { width: 200px; flex-shrink: 0; min-width: 0; }
.main-col  { flex: 1; min-width: 0; }
.side-col  { width: 280px; flex-shrink: 0; min-width: 0; }

/* ============================================================
   Widget 通用样式
   ============================================================ */
.widget {
    background: #fff;
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.widget:last-child { margin-bottom: 0; }
.widget-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.widget-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
    border-radius: 2px;
}
.widget-content { font-size: 14px; color: #334155; }

.wg-empty { color: #94a3b8; font-size: 13px; padding: 6px 0; margin: 0; }

/* 列表 */
.widget .wg-list { list-style: none; padding: 0; margin: 0; }
.widget .wg-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    font-size: 13.5px;
    overflow: hidden;
}
.widget .wg-list li a {
    color: #475569;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .15s;
}
.widget .wg-list li a:hover { color: #2563eb; }
.widget .wg-list li .wg-date,
.widget .wg-list li .wg-count {
    flex-shrink: 0;
    font-size: 11.5px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

/* 评论列表 */
.widget .wg-comment-list li {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px dashed #f1f5f9;
}
.widget .wg-comment-list li:last-child { border-bottom: 0; }
.widget .wg-comment-head { font-size: 12.5px; color: #64748b; margin-bottom: 2px; }
.widget .wg-comment-head b { color: #2563eb; font-weight: 500; }
.widget .wg-comment-text { font-size: 13px; color: #475569; line-height: 1.55; }

/* 标签云 */
.widget .wg-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.widget .wg-tag-cloud a {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 12px;
    font-size: 12.5px;
    text-decoration: none;
    transition: all .15s;
}
.widget .wg-tag-cloud a:hover {
    background: #dbeafe;
    color: #2563eb;
    text-decoration: none;
}

/* 左侧栏中 widget 稍微紧凑 */
.left-col .widget { padding: 14px 16px; font-size: 13.5px; }
.left-col .widget-title { font-size: 14px; }

/* 论坛专用小工具样式（插件可能扩展） */
.widget.wg-forum_boards .widget-title::before,
.widget.wg-forum_latest .widget-title::before {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* ============================================================
   文章列表
   ============================================================ */
.post-item,
.post-single,
.comment-section {
    background: #fff;
    padding: 22px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.post-item { padding: 0; overflow: hidden; transition: box-shadow .25s, transform .25s; }
.post-item:hover { box-shadow: 0 6px 22px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.post-item.no-cover { padding: 22px; }
.post-item h3 { margin: 0 0 8px; }
.post-item h3 a { color: #1a1a1a; }
.meta { color: #888; font-size: 13px; margin-bottom: 10px; }
.meta span { margin-right: 14px; }
.excerpt { color: #555; }
.readmore { display: inline-block; margin-top: 8px; font-size: 14px; }
.empty { text-align: center; padding: 60px 20px; color: #999; }
.page-title { font-size: 20px; margin: 0 0 18px; color: #1a1a1a; }

/* 分页 */
.pagination { margin: 20px 0; text-align: center; }
.pagination a,
.pagination .current {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 3px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #333;
}
.pagination a:hover { border-color: #1a73e8; color: #1a73e8; text-decoration: none; }
.pagination .current { background: #1a73e8; color: #fff; border-color: #1a73e8; }

/* 文章详情 */
.post-single h1 { margin: 0 0 12px; font-size: 26px; line-height: 1.35; color: #1a1a1a; }
.post-cover {
    width: 100%; max-height: 420px; object-fit: cover;
    border-radius: 8px; margin-bottom: 18px; display: block; background: #f1f5f9;
}

.content { font-size: 16px; color: #2b2b2b; word-wrap: break-word; }
.content p { margin: 12px 0; }
.content h1, .content h2, .content h3,
.content h4, .content h5, .content h6 {
    margin: 22px 0 12px; line-height: 1.35; color: #1a1a1a;
}
.content h1 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid #eef1f4; }
.content h2 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid #eef1f4; }
.content h3 { font-size: 17px; }
.content blockquote {
    border-left: 4px solid #cbd5e1; padding: 8px 16px; margin: 14px 0;
    color: #666; background: #f8fafc; border-radius: 0 6px 6px 0;
}
.content ul, .content ol { padding-left: 26px; margin: 12px 0; }
.content li { margin: 5px 0; }
.content hr { border: 0; border-top: 1px solid #e5e9f0; margin: 22px 0; }
.content img { max-width: 100%; height: auto; border-radius: 6px; }
.content table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 14px; }
.content th, .content td { border: 1px solid #e5e9f0; padding: 9px 14px; text-align: left; }
.content th { background: #f8fafc; font-weight: 600; }
.content del { color: #94a3b8; }
.content a { color: #1a73e8; border-bottom: 1px solid rgba(26,115,232,.3); }
.content a:hover { border-bottom-color: #1a73e8; text-decoration: none; }
.content .align-left    { text-align: left; }
.content .align-center  { text-align: center; }
.content .align-right   { text-align: right; }
.content .align-justify { text-align: justify; }
.content [align="left"]    { text-align: left; }
.content [align="center"]  { text-align: center; }
.content [align="right"]   { text-align: right; }
.content [align="justify"] { text-align: justify; }
.content input[type="checkbox"] { margin-right: 7px; vertical-align: middle; accent-color: #1a73e8; }
.content video {
    display: block; width: 100%; max-width: 640px;
    margin: 14px auto; border-radius: 8px; background: #000;
}

/* 上下篇 */
.post-nav {
    display: flex; justify-content: space-between;
    margin-bottom: 16px; font-size: 14px; gap: 16px;
}
.post-nav .next { margin-left: auto; text-align: right; }

/* 评论 */
.comment-section h3 { margin: 0 0 16px; font-size: 16px; color: #1a1a1a; }
.comment-form input,
.comment-form textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb;
    border-radius: 6px; margin-bottom: 8px; font-family: inherit;
    font-size: 14px; box-sizing: border-box;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: 0; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26, 115, 232, .1);
}
.comment-form .row { display: flex; gap: 8px; }
.comment-form button {
    background: #1a73e8; color: #fff; border: 0; padding: 9px 20px;
    border-radius: 6px; cursor: pointer; font-size: 14px;
    font-family: inherit; transition: background .15s;
}
.comment-form button:hover { background: #1666c9; }
.comment { border-bottom: 1px dashed #eee; padding: 10px 0; }
.comment:last-child { border-bottom: 0; }
.comment-meta { font-size: 13px; color: #888; }
.comment-meta strong { color: #333; margin-right: 8px; }
.comment-body { margin-top: 4px; color: #444; }

/* 页脚 */
.site-footer { text-align: center; color: #999; font-size: 13px; padding: 28px 0; }
.site-footer p { margin: 0; }

/* ============================================================
   代码块
   ============================================================ */
.content code:not(pre code) {
    background: #f1f5f9; color: #db2777; padding: 2px 7px;
    border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, "Cascadia Code", monospace;
    font-size: 0.9em; word-break: break-word;
}
.content pre {
    position: relative; background: #1e293b; color: #e2e8f0;
    padding: 44px 22px 18px; border-radius: 10px; overflow-x: auto;
    margin: 18px 0; font-size: 13.5px; line-height: 1.7;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
    -webkit-overflow-scrolling: touch; box-sizing: border-box;
}
.content pre::-webkit-scrollbar { height: 8px; }
.content pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 4px; }
.content pre::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
.content pre::before {
    content: attr(data-lang);
    position: absolute; top: 0; left: 0; right: 0; height: 34px;
    padding: 0 20px; line-height: 34px;
    background: #0f172a; color: #94a3b8;
    font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
    text-transform: uppercase; letter-spacing: .06em;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    pointer-events: none;
}
.content pre[data-lang=""]::before,
.content pre:not([data-lang])::before { content: "CODE"; }
.content pre code {
    background: none; color: inherit; padding: 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Code", monospace;
    font-size: inherit; white-space: pre; display: block;
}
.content .c-comment { color: #64748b; font-style: italic; }
.content .c-string  { color: #a5d6a7; }
.content .c-keyword { color: #93c5fd; font-weight: 600; }
.content .c-number  { color: #fbbf24; }
.content .c-var     { color: #f9a8d4; }
.code-copy {
    position: absolute; top: 4px; right: 10px; z-index: 2;
    background: rgba(255, 255, 255, .08); color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 5px;
    padding: 3px 10px; font-size: 12px; font-family: inherit;
    line-height: 1.6; cursor: pointer; transition: all .15s; user-select: none;
}
.code-copy:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.code-copy:active { transform: scale(.96); }
.code-copy.copied { background: #10b981; border-color: #10b981; color: #fff; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
    .layout .left-col { display: none; }
}
@media (max-width: 900px) {
    .layout .side-col { display: none; }
    .layout .left-col { display: none; }
    .layout { flex-direction: column; }
    .main-col { width: 100%; }
}
@media (max-width: 768px) {
    .layout { flex-direction: column; gap: 16px; padding: 18px 0; }
    .main-col  { order: 1; width: 100%; }
    .side-col  { order: 2; width: 100%; display: block; }
    .left-col  { order: 3; width: 100%; display: block; }
    .container { padding: 0 14px; }
    .site-header { padding: 18px 0; }
    .site-header .logo { font-size: 22px; }
    .nav a { margin-right: 12px; font-size: 13.5px; }
    .post-single h1 { font-size: 22px; }
    .content { font-size: 15px; }
    .content pre { font-size: 12.5px; padding: 42px 16px 14px; border-radius: 8px; }
    .content pre::before { padding: 0 14px; font-size: 11px; border-radius: 8px 8px 0 0; }
    .post-nav { flex-direction: column; gap: 8px; }
    .post-nav .next { margin-left: 0; text-align: left; }
    .comment-form .row { flex-direction: column; gap: 0; }
}
@media (max-width: 480px) {
    .site-header .logo { font-size: 20px; }
    .post-single h1 { font-size: 19px; }
    .content h1 { font-size: 20px; }
    .content h2 { font-size: 17px; }
    .content h3 { font-size: 15.5px; }
}

/* ============================================================
   小工具高 DPI 清晰度修复（user_center / 论坛模式通用）
   ============================================================ */

/* 1. 全局字体抗锯齿 */
body,
.widget,
.ucwg-card,
.ucsg-box,
.forum-mode {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 2. 小工具里的头像：锐利渲染 */
.ucwg-card-avatar .uc-avatar,
.ucwg-card .uc-avatar,
.ucsg-box .uc-avatar,
.widget .uc-avatar,
.widget .ug-avatar,
.forum-mode .uc-avatar,
.forum-mode .ug-avatar,
.forum-mode .forum-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 3. 小工具里的 SVG 图标：几何精度 */
.ucwg-card svg,
.ucsg-box svg,
.widget svg,
.forum-mode svg {
    shape-rendering: geometricPrecision;
    flex-shrink: 0;
}

/* 4. 徽章 / 按钮：不要亚像素抖动 */
.ucwg-badge,
.ucwg-btn,
.ucwg-btn-done,
.ucsg-btn,
.ucsg-btn-done,
.ucsg-cal-cell,
.ucsg-cal-cell.signed {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 5. 论坛模式卡片：GPU 合成 */
.forum-mode .forum-card,
.forum-mode .forum-board,
.forum-mode .forum-thread {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 6. 去掉可能引起模糊的 filter */
.forum-mode {
    filter: none;
}

/* ============================================================
   ★ 主内容区覆盖模式：屏蔽左右栏，主栏占满全宽
   ============================================================ */
.layout.layout-single {
    display: block;
    padding: 28px 0;
    gap: 0;
}
.layout.layout-single .main-col {
    width: 100%;
    max-width: none;
    min-width: 0;
}

@media (max-width: 900px) {
    .layout.layout-single { padding: 18px 0; }
}