/*
Theme Name: 习近平档案馆
Theme URI: https://www.threads.net/@dandan22101
Author: 习近平档案馆
Description: 单栏信息流风格的个人存档主题：深色/浅色模式、帖子卡片、内置点赞（公开计数，无需插件）、评论、转发到 Threads、分享、多图横滑和竖屏视频适配。A single-column, feed-style archive theme with built-in likes.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xi-archive
Tags: blog, one-column, custom-colors, custom-logo, custom-menu, featured-images, post-formats, threaded-comments, translation-ready
*/

:root{--bg:#ffffff;--text:#101010;--muted:#8a8a8a;--border:#e6e6e6;--soft:#f3f3f3;--like:#ff3040;--link:#0095f6;--col:620px}
html[data-theme="dark"]{--bg:#101010;--text:#f3f5f7;--muted:#777777;--border:#2b2b2b;--soft:#1e1e1e;color-scheme:dark}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]){--bg:#101010;--text:#f3f5f7;--muted:#777777;--border:#2b2b2b;--soft:#1e1e1e;color-scheme:dark}}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--text);font:normal 400 15px -apple-system, BlinkMacSystemFont, PingFang SC, Noto Sans SC, Microsoft YaHei, sans-serif;line-height:1.6;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
svg{display:block}
.wrap{max-width:var(--col);margin:0 auto;padding:0 16px}
.section,.widget{margin:0;padding:0}
.widget ul{list-style:none;margin:0;padding:0}
/* top bar */
.topbar{position:sticky;top:0;z-index:20;background:var(--bg);background:color-mix(in srgb,var(--bg) 88%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;height:58px}
.logo,.icon-btn{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--text)}
.icon-btn:hover,.logo:hover{background:var(--soft)}
.logo svg,.icon-btn svg{width:24px;height:24px}
.topbar-title{font-weight:700;font-size:16px;letter-spacing:.02em}
.ico-sun{display:none}
html[data-theme="dark"] .ico-sun{display:block}
html[data-theme="dark"] .ico-moon{display:none}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]) .ico-sun{display:block}html:not([data-theme="light"]) .ico-moon{display:none}}
/* profile header */
.profile{padding:16px 0 0}
.profile-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.Header h1,.Header .brand{font:normal 700 24px -apple-system, BlinkMacSystemFont, PingFang SC, Noto Sans SC, Microsoft YaHei, sans-serif;margin:0;line-height:1.25}
.handle{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:15px}
.handle .pill{font-size:12px;color:var(--muted);background:var(--soft);border-radius:30px;padding:2px 9px}
.tagline{margin:14px 0 0;font-size:15px}
.avatar-lg{flex:none;width:72px;height:72px;border-radius:50%;background:var(--text);color:var(--bg);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:30px;overflow:hidden}
.avatar-lg img{width:100%;height:100%;object-fit:cover}
.links{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin-top:14px;color:var(--muted);font-size:14px}
.links a{display:inline-flex;align-items:center;gap:6px}
.links a:hover{color:var(--text)}
.links svg{width:16px;height:16px}
.profile-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.btn{display:flex;align-items:center;justify-content:center;height:36px;border-radius:10px;border:1px solid var(--border);font-weight:600;font-size:14px}
.btn-solid{background:var(--text);color:var(--bg);border-color:var(--text)}
/* tabs */
.tabs{margin-top:14px;border-bottom:1px solid var(--border)}
.tabs ul{display:flex;overflow-x:auto;scrollbar-width:none}
.tabs ul::-webkit-scrollbar{display:none}
.tabs li{flex:1 0 auto}
.tabs a{display:block;text-align:center;padding:12px 14px;color:var(--muted);font-weight:600;font-size:15px;border-bottom:1px solid transparent;margin-bottom:-1px;white-space:nowrap}
.tabs a:hover{color:var(--text)}
.tabs a.active{color:var(--text);border-bottom-color:var(--text)}
/* feed */
.status-msg{padding:14px 0;color:var(--muted);font-size:14px;border-bottom:1px solid var(--border)}
.thread{display:flex;gap:12px;padding:16px 0 12px;border-bottom:1px solid var(--border)}
.thread-side{flex:none;width:40px;display:flex;flex-direction:column;align-items:center}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--text);color:var(--bg);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px}
.thread-main{flex:1;min-width:0}
.thread-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:15px;line-height:1.4}
.thread-name{font-weight:600}
.thread-name:hover{text-decoration:underline}
.thread-time,.thread-tag{color:var(--muted)}
.thread-tag:hover{color:var(--text)}
.thread-title{font-size:15px;font-weight:600;margin:4px 0 0;line-height:1.5}
.item-view .thread-title{font-size:20px;font-weight:700}
.post-body{margin-top:2px;font-size:15px;line-height:1.75;word-wrap:break-word;overflow-wrap:anywhere}
.item-view .post-body{font-size:16.5px;line-height:1.9}
.post-body p{margin:0 0 .6em}
.post-body a{color:var(--link)}
.post-body img,.post-body video{max-width:100%;height:auto;border-radius:12px;border:1px solid var(--border);display:block}
.post-body .separator{margin:10px 0!important;text-align:left!important}
.post-body .separator a,.post-body a[imageanchor]{margin:0!important;display:inline-block}
.post-body .separator[style]{clear:none!important}
.post-body iframe,.post-body .media-ph{display:block;width:100%!important;max-width:100%;height:auto!important;aspect-ratio:16/9;border:0;border-radius:12px;margin:10px 0;background:#000}
.post-body iframe.vertical,.post-body .media-ph.vertical{aspect-ratio:9/16;max-width:340px}
.post-body blockquote{margin:10px 0;padding:2px 0 2px 14px;border-left:3px solid var(--border);color:var(--muted)}
.post-body table.tr-caption-container{margin:10px 0!important}
.post-body .tr-caption{font-size:13px;color:var(--muted);text-align:left!important}
.media-row{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;margin:10px 0;scrollbar-width:none}
.media-row::-webkit-scrollbar{display:none}
.media-row>*{flex:none;scroll-snap-align:start;margin:0!important}
.media-row img{height:260px;width:auto;max-width:none;object-fit:cover}
.more-link{display:inline-block;margin-top:4px;color:var(--muted);font-size:14px}
.thread-labels{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.thread-labels a{font-size:13px;padding:3px 10px;border-radius:30px;background:var(--soft);color:var(--text)}
.thread-actions{display:flex;gap:4px;margin:8px 0 0 -8px}
.act{display:inline-flex;align-items:center;gap:4px;height:34px;padding:0 9px;border-radius:30px;color:var(--text);font-size:13px}
.act:hover{background:var(--soft)}
.act svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.act .n:empty{display:none}
.like.on{color:var(--like)}
.like.on svg{fill:var(--like);stroke:var(--like)}
.like.pop svg{animation:pop .35s ease}
@keyframes pop{40%{transform:scale(1.3)}}
/* pager */
.pager{display:flex;justify-content:space-between;gap:10px;padding:20px 0}
.pager a{flex:1;text-align:center;padding:10px;border:1px solid var(--border);border-radius:12px;font-weight:600;font-size:14px}
.pager a:hover{background:var(--soft)}
.no-posts{padding:40px 0;text-align:center;color:var(--muted)}
/* comments (Blogger built-in markup) */
.comments{padding:14px 0 24px;border-bottom:1px solid var(--border)}
.comments h3,.comments .title{font-size:15px;font-weight:700;margin:0 0 8px}
.comments .comment-thread ol{list-style:none;margin:0;padding:0}
.comments .comment-thread li.comment{padding:12px 0;border-top:1px solid var(--border)}
.comments .avatar-image-container{float:left;width:36px;height:36px;border-radius:50%;overflow:hidden;margin-right:10px}
.comments .avatar-image-container img{width:36px;height:36px}
.comments .comment-block{overflow:hidden}
.comments .user{font-weight:600}
.comments .datetime{font-size:12px;color:var(--muted);margin-left:6px}
.comments .comment-content{margin:4px 0;font-size:15px}
.comments .comment-actions a,.comments .continue a{font-size:13px;color:var(--muted);margin-right:10px}
.comments .thread-count,.comments .thread-toggle{font-size:13px;color:var(--muted)}
.comments .comment-replies{margin-left:46px}
.comment-form iframe,#comment-editor{width:100%;border:0}
/* more section */
.more-area{padding:8px 0 10px}
.more-area .widget{padding:18px 0;border-bottom:1px solid var(--border)}
.more-area h3{font-size:13px;letter-spacing:.06em;color:var(--muted);margin:0 0 12px;font-weight:600}
.pop-list li{display:flex;gap:12px;align-items:center;padding:8px 0}
.pop-list .num{flex:none;width:22px;color:var(--muted);font-weight:700}
.pop-list a{font-weight:600;font-size:14.5px;line-height:1.45}
.pop-list img{flex:none;width:56px;height:56px;border-radius:10px;object-fit:cover;margin-left:auto}
.chip-list{display:flex;flex-wrap:wrap;gap:8px}
.chip-list a{padding:5px 12px;border:1px solid var(--border);border-radius:30px;font-size:14px}
.chip-list a:hover{background:var(--soft)}
.chip-list .count{color:var(--muted);font-size:12px;margin-left:4px}
.archive-year summary{cursor:pointer;font-weight:600;padding:6px 0}
.archive-year ul{padding-left:14px!important}
.archive-year li{padding:3px 0;font-size:14px}
.archive-year .count,.Profile .muted{color:var(--muted);font-size:12px}
.prof{display:flex;gap:12px;align-items:center}
.prof img,.prof .ph{width:56px;height:56px;border-radius:50%;object-fit:cover;background:var(--soft);flex:none}
.prof-name{font-weight:700}
.prof-about{margin:10px 0 0;font-size:14px;color:var(--muted)}
.site-footer{padding:22px 0 60px;color:var(--muted);font-size:12.5px;text-align:center;line-height:1.8}
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);background:var(--text);color:var(--bg);padding:9px 18px;border-radius:30px;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:50}
.toast.show{opacity:1;transform:translate(-50%,0)}
.hidden{display:none}
@media (max-width:480px){.wrap{padding:0 14px}.Header h1,.Header .brand{font-size:22px}.avatar-lg{width:64px;height:64px;font-size:26px}.thread-side{width:36px}.media-row img{height:220px}}

/* ---------- WordPress additions ---------- */
.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}
.screen-reader-text:focus{background:var(--bg);clip:auto!important;clip-path:none;display:block;height:auto;left:8px;padding:12px 20px;top:8px;width:auto;z-index:100000}
.brand{font:normal 700 24px -apple-system,BlinkMacSystemFont,PingFang SC,Noto Sans SC,Microsoft YaHei,sans-serif;margin:0;line-height:1.25}
.avatar-lg img,.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.avatar{overflow:hidden}
.custom-logo-link{display:block;width:100%;height:100%}
.tabs .menu{display:flex;overflow-x:auto;scrollbar-width:none;list-style:none;margin:0;padding:0}
.tabs .menu::-webkit-scrollbar{display:none}
.tabs .current-menu-item>a,.tabs .current-cat>a{color:var(--text);border-bottom-color:var(--text)}
.back-bar{display:flex;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--border);font-weight:600}
.back-bar svg{width:20px;height:20px}
.page-head{padding:16px 0;border-bottom:1px solid var(--border)}
.page-head h1{font-size:20px;margin:0}
.page-head p{margin:4px 0 0;color:var(--muted);font-size:14px}
.post-body>*:first-child{margin-top:0}
.post-body h2,.post-body h3{font-size:1.1em;margin:1em 0 .4em}
.post-body figure{margin:10px 0}
.post-body figcaption,.post-body .wp-caption-text{font-size:13px;color:var(--muted);margin-top:4px}
.post-body .wp-caption{max-width:100%}
.post-body .alignleft,.post-body .alignright,.post-body .aligncenter{float:none;margin:10px 0}
.post-body .wp-block-embed__wrapper{position:static}
.post-body .wp-block-embed__wrapper:before{display:none!important}
.post-body .wp-has-aspect-ratio iframe{position:static!important}
.post-body .wp-embed-aspect-9-16 iframe,.post-body iframe.vertical,.post-body video.vertical,.post-body .media-ph.vertical{aspect-ratio:9/16;max-width:340px;width:100%!important}
.post-body .wp-video,.post-body .wp-block-video{width:100%!important;max-width:100%}
.post-body .wp-video.vertical{max-width:340px}
.post-body video{width:100%;background:#000}
.post-body .mejs-container{border-radius:12px;overflow:hidden}
.thread-thumb{margin:10px 0}
.thread-thumb img{width:100%;height:auto;border-radius:12px;border:1px solid var(--border);display:block}
/* galleries → swipe row */
.post-body .wp-block-gallery,.post-body .gallery{display:flex!important;flex-wrap:nowrap!important;gap:8px!important;overflow-x:auto;scroll-snap-type:x mandatory;margin:10px 0!important;padding:0;scrollbar-width:none}
.post-body .wp-block-gallery::-webkit-scrollbar,.post-body .gallery::-webkit-scrollbar{display:none}
.post-body .wp-block-gallery>figure,.post-body .wp-block-gallery .wp-block-image,.post-body .gallery .gallery-item{flex:none!important;width:auto!important;max-width:none!important;margin:0!important;scroll-snap-align:start}
.post-body .wp-block-gallery img,.post-body .gallery img{height:260px!important;width:auto!important;max-width:none;object-fit:cover}
.post-body .gallery br{display:none}
.media-row>figure,.media-row>p{flex:none}
.media-row>p img,.media-row>figure img{height:260px;width:auto;max-width:none;object-fit:cover}
/* likes */
.like[disabled]{opacity:.6}
.like .n{min-width:0}
/* comments */
.comments-area{padding:6px 0 24px}
.comments-title{font-size:15px;font-weight:700;margin:16px 0 4px}
.comment-list,.comment-list .children{list-style:none;margin:0;padding:0}
.comment-list .children{margin-left:48px}
.c-item{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid var(--border)}
.c-avatar img{width:36px;height:36px;border-radius:50%;display:block}
.c-main{flex:1;min-width:0}
.c-head{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:15px}
.c-author{font-weight:600}
.c-time,.c-pending{color:var(--muted);font-size:14px}
.c-text{font-size:15px;line-height:1.7;margin-top:2px;overflow-wrap:anywhere}
.c-text p{margin:0 0 .4em}
.c-actions{display:flex;gap:14px;margin-top:4px;font-size:13px;color:var(--muted)}
.c-actions a:hover{color:var(--text)}
.bypostauthor>.c-item .c-author:after{content:"作者";font-size:11px;font-weight:600;margin-left:6px;padding:1px 6px;border-radius:20px;background:var(--soft);color:var(--muted)}
.comment-respond{padding:16px 0}
.comment-reply-title{font-size:15px;margin:0 0 10px;display:flex;justify-content:space-between}
.comment-reply-title small a{font-size:13px;color:var(--muted)}
.comment-form p{margin:0 0 10px}
.comment-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px}
.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url],.comment-form textarea{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--bg);color:var(--text);font:inherit;font-size:16px}
.comment-form textarea{min-height:96px;resize:vertical}
.comment-form .comment-form-cookies-consent{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--muted)}
.comment-form .comment-form-cookies-consent label{display:inline;margin:0}
.comment-notes,.logged-in-as{font-size:13px;color:var(--muted)}
.form-submit .submit{background:var(--text);color:var(--bg);border:0;border-radius:10px;padding:9px 20px;font-weight:600;font-size:14px;cursor:pointer}
.no-comments{color:var(--muted);font-size:14px}
/* pagination & misc */
.nav-links{display:flex;justify-content:space-between;gap:10px;padding:20px 0}
.nav-links a,.nav-links .page-numbers{padding:9px 14px;border:1px solid var(--border);border-radius:12px;font-weight:600;font-size:14px}
.nav-links .current{background:var(--text);color:var(--bg);border-color:var(--text)}
.pagination .nav-links{justify-content:center;flex-wrap:wrap}
.search-form{display:flex;gap:8px;margin:14px 0}
.search-form .search-field{flex:1;padding:10px 14px;border:1px solid var(--border);border-radius:12px;background:var(--soft);color:var(--text);font:inherit;font-size:16px}
.search-form .search-submit{border-radius:12px;padding:0 16px;background:var(--text);color:var(--bg);border:0;font-weight:600}
.more-area .widget ul li{padding:5px 0;font-size:14.5px}
.more-area .widget-title{font-size:13px;letter-spacing:.06em;color:var(--muted);margin:0 0 12px;font-weight:600}
.sticky-badge{font-size:12px;color:var(--muted)}
.notfound{padding:50px 0;text-align:center}
.notfound h1{font-size:40px;margin:0}
@media (max-width:640px){.post-body .wp-block-gallery,.post-body .gallery,.media-row{margin-right:-14px!important;padding-right:14px!important}}
