/*
Theme Name: codease
Version: 1.0.1
Description: 面向中文技术博客的响应式主题，含工具索引、文章列表和年份归档。
Requires at least: 6.4
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: codease
*/
:root{--ink:#1e293b;--body:#334155;--muted:#596b80;--accent:#246bc7;--accent-hover:#184fa0;--line:#e2e9f0;--paper:white;--bg:#f8fafc;--soft:#edf5ff;--radius:10px;color-scheme:light}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif}a{color:inherit;text-decoration:none}a:hover{color:var(--accent)}button,input{font:inherit;color:inherit}button{cursor:pointer}a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #367cca;outline-offset:3px}.i{width:18px;height:18px;display:inline-block;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.wrap{width:min(1216px,calc(100% - 64px));margin:auto}
.site-header{background:white;border-bottom:1px solid var(--line)}.bar{display:flex;align-items:center;gap:clamp(18px,3vw,48px);min-height:64px}.brand{display:inline-flex;align-items:center;gap:9px;flex:none;font-size:19px;font-weight:650}.brand img{width:32px;height:32px;border-radius:8px}.nav{display:flex;align-items:center;gap:6px}.nav a{display:flex;align-items:center;gap:7px;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:500;line-height:20px;white-space:nowrap}.nav a:hover,.nav a[aria-current]{color:var(--accent);background:var(--soft)}.nav .i{width:16px;height:16px}.site-search{margin-left:auto;display:flex;align-items:center;gap:9px;background:#f1f5f9;padding:0 13px;height:38px;border-radius:8px;color:var(--muted);width:218px}.site-search input{min-width:0;border:0;background:transparent;width:100%;font-size:14px;outline-offset:0}.crumb{display:flex;gap:10px;align-items:center;color:var(--muted);font-size:13px;min-height:40px;margin:24px 0 20px;padding:8px 15px;background:#f0f5fb;border-radius:7px}.crumb .i{width:15px}.crumb span{color:#718399}.layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(255px,26%);gap:28px;align-items:start}main,aside{min-width:0}.sheet,.side,.tool{background:white;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 2px 3px #172c2105}.section-title{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:600;line-height:28px;margin:0 0 15px}.section-title .i{color:var(--accent)}.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:24px}.tool{display:flex;gap:11px;align-items:center;padding:16px;background:linear-gradient(115deg,var(--wash),white 94%);position:relative;transition:border-color .15s}.tool:hover{border-color:var(--tone)}.tool b,.tool small{display:block}.tool b{font-size:18px;font-weight:600;line-height:28px}.tool small{color:var(--muted);margin-top:3px;font-size:12px}.tile{display:grid;place-items:center;flex:none;border-radius:8px;width:34px;height:34px;background:white;color:var(--tone);border:1px solid var(--line)}.tile .i{height:23px;width:23px}.tool .arrow{margin-left:auto;color:var(--tone)}
.sheethead{padding:18px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}.sheethead h1{font-size:30px;font-weight:700;line-height:36px;margin:0}.filters{display:flex;gap:4px}.filters a{padding:6px 9px;border-radius:5px;color:var(--muted);font-size:13px}.filters a[aria-current]{background:var(--soft);color:var(--accent);font-weight:600}.row{display:flex;align-items:center;gap:22px;margin:0 24px;padding:20px 0;border-bottom:1px solid var(--line)}.row:last-child{border:0}.cover{width:26%;max-width:212px;flex:none;display:grid;place-items:center}.cover img{display:block;width:100%;height:auto;max-height:120px;object-fit:contain;border-radius:6px}.copy{min-width:0}.meta{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}.cat{font-weight:500;color:var(--accent)}.sep{width:3px;height:3px;background:#a7b3ad;border-radius:50%}.copy h2 a{color:var(--accent)}.copy h2 a:hover,.copy h2 a:focus-visible{color:var(--accent-hover);text-decoration:underline;text-underline-offset:3px}.copy h2{font-size:18px;line-height:28px;font-weight:600;margin:0 0 5px;text-wrap:pretty}.copy p{margin:7px 0 0;color:var(--body);font-size:14px;line-height:1.7;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.side{overflow:hidden;margin-bottom:16px}.scene{height:94px;background:#f9f8f1 url("assets/mountain-trail.webp") center 66%/cover no-repeat}.bio{padding:0 20px 19px}.bio img{display:block;margin-top:-19px;position:relative;width:43px;height:43px;border:3px solid white;border-radius:11px}.bio h2{margin:9px 0 2px;font-size:18px;font-weight:600;line-height:28px}.bio p{margin:6px 0 13px;font-size:14px;line-height:1.75;color:var(--muted)}.bio a,.readlink{font-size:14px;color:var(--accent);font-weight:600}.sidebody{padding:17px 20px}.side h3{display:flex;align-items:center;gap:9px;font-size:18px;font-weight:600;line-height:28px;margin:0 0 9px}.side h3 .i{color:var(--accent);width:16px}.sideitem{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-top:1px solid var(--line);font-size:14px}.sideitem small{color:var(--muted);font:12px "Segoe UI",sans-serif}.doc{padding:32px clamp(24px,2.25vw,34px) 36px;color:var(--body);overflow-wrap:break-word}.doc h1{margin:0 0 16px;font-size:30px;line-height:36px;font-weight:700;color:var(--ink);text-wrap:pretty}.doc .meta{margin-bottom:23px}.doc p{font-size:16px;line-height:1.75;margin:0 0 20px}.doc p:last-child{margin-bottom:0}.doc .lead{color:var(--muted);margin-bottom:28px}.doc h2,.doc h3{margin:34px 0 18px;line-height:1.4;font-weight:600;color:var(--ink)}.doc h3{font-size:20px;line-height:28px}.doc h2{font-size:24px;line-height:32px;padding-bottom:10px;border-bottom:1px solid var(--line)}.doc p a{color:var(--accent);text-decoration:underline;text-underline-offset:3px;text-decoration-color:#95b8e4}.doc pre{background:#f1f5fa;padding:15px;overflow:auto;border-radius:8px}.article-cover img{display:block;max-width:100%;max-height:220px;margin:20px auto}.toc a{display:block;padding:7px 0;font-size:14px}.empty{padding:30px}.foot{margin:32px auto 0;padding:20px 0;border-top:1px solid var(--line);color:var(--muted);font-size:13px;display:flex;justify-content:space-between}
@media(max-width:1000px){.wrap{width:calc(100% - 36px)}.layout{grid-template-columns:minmax(0,1fr) 235px;gap:16px}.bar{gap:12px}.nav a{padding:10px 8px}.tool{padding:15px 10px;gap:7px}.tool .arrow{display:none}.site-search{width:165px}}
@media(max-width:790px){.layout{grid-template-columns:minmax(0,1fr)}.bar{flex-wrap:wrap;gap:0;min-height:0;padding-top:10px}.nav{width:100%;order:3;gap:3px;padding:7px 0 4px;overflow:auto}.nav a{min-height:44px;padding:7px 12px}.site-search{width:min(40%,190px)}.crumb{margin:16px 0 14px;padding:7px 12px;min-height:34px}.layout aside{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.side{margin:0}.section-title{font-size:18px}}
@media(max-width:540px){.wrap{width:calc(100% - 24px)}.brand{font-size:18px}.brand img{width:30px;height:30px}.nav a{font-size:13px;padding:6px 9px}.tool-grid{gap:6px;margin-bottom:15px}.tool{display:block;padding:10px;border-radius:8px}.tile{width:28px;height:28px;border-radius:7px;margin-bottom:7px}.tile .i{width:18px;height:18px}.tool b{font-size:16px;line-height:24px}.tool small{font-size:11px}.sheethead{align-items:flex-start;flex-wrap:wrap;padding:15px;gap:8px}.sheethead h1{font-size:24px;line-height:32px}.filters a{display:inline-flex;align-items:center;min-height:38px}.row{margin:0 15px;padding:17px 0;gap:13px}.cover{width:26%}.copy h2{font-size:16px;line-height:22px}.copy p{font-size:13px;-webkit-line-clamp:1}.meta{font-size:12px;gap:7px}.layout aside{display:block}.side{margin-bottom:12px}.doc{padding:23px 18px 26px}.doc h1{font-size:24px;line-height:32px}.doc h3{font-size:18px;line-height:26px}.doc h2{font-size:20px;line-height:28px;margin:27px 0 15px}.doc p{line-height:1.8;margin-bottom:18px}.foot{margin-top:16px}}


/* Native WordPress menus, article blocks, pagination and comments. */
.screen-reader-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip-link:focus{z-index:20;top:8px;left:8px;width:auto;height:auto;padding:8px 16px;background:white;clip-path:none}
.nav{min-width:0}
.nav ul,.years{list-style:none;margin:0;padding:0}
.nav>ul{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.nav li{position:relative}
.nav .current-menu-item>a,.nav .current-menu-ancestor>a{background:var(--soft);color:var(--accent)}
.nav .sub-menu{position:absolute;z-index:5;top:100%;left:0;min-width:10rem;padding:5px;background:white;border:1px solid var(--line);border-radius:7px;box-shadow:0 5px 16px #1e293b14;display:none}
.nav .sub-menu .sub-menu{position:static;margin-left:8px;box-shadow:none;border:0}
.nav li:focus-within>.sub-menu,.nav li:hover>.sub-menu{display:block}
.nav .sub-menu a{white-space:normal}
.site-search button{border:0;background:transparent;padding:0;color:inherit;cursor:pointer}
.filters,.sheethead,.meta{flex-wrap:wrap}
.tool{--tone:#4772bd;--wash:#ecf3ff;min-width:0}
.tool:nth-child(3n+2){--tone:#178573;--wash:#e8faf4}
.tool:nth-child(3n){--tone:#a2662e;--wash:#fff6e4}
.tool b,.tool small,.copy h2{overflow-wrap:anywhere}
.years li{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:8px 0;font-size:13px;color:var(--muted)}
.years a{font-size:14px;color:var(--ink)}
.article-cover{display:block}
.article-cover img{width:auto;height:auto;object-fit:contain}
.entry-content img,.entry-content video,.entry-content iframe{max-width:100%}
.entry-content img,.entry-content video{height:auto}
.entry-content figure{max-width:100%;margin-inline:0}
.entry-content table{display:block;max-width:100%;overflow-x:auto}
.entry-content a{color:var(--accent);text-underline-offset:3px}
.entry-content .wp-element-button,.entry-content .wp-block-button__link{color:inherit}
.entry-content:after{content:"";display:table;clear:both}
.alignleft{float:left;margin:0 16px 12px 0}
.alignright{float:right;margin:0 0 12px 16px}
.aligncenter{display:block;margin-inline:auto}
.wp-caption-text,.gallery-caption,.wp-element-caption{font-size:14px;color:var(--muted)}
.toc .nested{padding-left:12px}
.pagination,.comment-navigation{padding:14px 24px}
.nav-links{display:flex;flex-wrap:wrap;gap:10px}
.page-numbers{display:inline-block;padding:4px 9px}
.page-numbers.current{background:var(--soft);color:var(--accent);border-radius:5px}
.discussion{padding:22px;margin-top:18px;overflow-wrap:anywhere}
.discussion h2{font-size:20px}
.comment-list,.comment-list .children{padding-left:20px}
.comment-list li{margin:12px 0}
.comment-author img{border-radius:50%;vertical-align:middle}
.comment-metadata,.reply{font-size:13px}
.comment-form label{display:block}
.comment-form input:not([type=checkbox]),.comment-form textarea,.post-password-form input{max-width:100%;padding:8px;border:1px solid var(--line);border-radius:5px;font:inherit}
.comment-form textarea{width:100%}
.comment-form .submit{cursor:pointer;background:var(--accent);color:white}
.bypostauthor>.comment-body .fn{color:var(--accent)}
@media(max-width:790px){
 .nav{overflow:visible}
 .nav>ul{width:100%}
 .nav .sub-menu{max-width:min(220px,85vw)}
 .nav>ul>li:last-child>.sub-menu{left:auto;right:0}
}
@media(max-width:540px){
 .bar{justify-content:space-between}
 .brand{min-width:0;max-width:58%;overflow-wrap:anywhere}
 .site-search{flex-shrink:0}
 .sheethead .filters{row-gap:0}
}
.nav .has-toggle{padding-right:27px}
.submenu-toggle{position:absolute;right:0;top:0;height:100%;max-height:40px;width:27px;border:0;background:transparent;font:inherit;color:var(--muted);cursor:pointer}
.nav .has-toggle>.sub-menu{display:none}
.nav .submenu-toggle[aria-expanded=true]+.sub-menu{display:block}
