/*
Theme Name: TechFront（技术前线）
Author: TechFront 主题开发
Description: 原创资讯类 WordPress 主题，面向科技资讯站点。全宽扁平化设计、响应式布局，内置三套首页风格（深色极客 / 浅色阅读流 / 杂志混排），可在“外观-自定义-主题显示设置”中切换。支持快讯条、热读榜、浏览计数、栏目配置、ICP 备案与统计代码等后台选项。本主题全部代码为原创编写。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techfront
Tags: news, blog, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   基础与主题变量（三套风格共用结构，靠变量换肤）
   ========================================================= */
*{margin:0;padding:0;box-sizing:border-box}
html{font-size:15px}
body{font-family:"Microsoft YaHei","PingFang SC","Segoe UI",Arial,sans-serif;background:var(--tf-bg);color:var(--tf-ink);line-height:1.7}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none}
ul,ol{list-style:none}
button{font-family:inherit;cursor:pointer;border:0;background:none}
input,textarea,select{font-family:inherit}

body.style-dark{--tf-bg:#0d1220;--tf-head-bg:#10151f;--tf-panel:#131a2b;--tf-panel-2:#182136;--tf-ink:#e8edf5;--tf-sub:#93a0b6;--tf-border:#232c40}
body.style-light{--tf-bg:#f5f6f8;--tf-head-bg:#ffffff;--tf-panel:#ffffff;--tf-panel-2:#f7f8fa;--tf-ink:#1c2333;--tf-sub:#667085;--tf-border:#e5e8ee}
body.style-magazine{--tf-bg:#f8f7f4;--tf-head-bg:#ffffff;--tf-panel:#ffffff;--tf-panel-2:#f7f5f0;--tf-ink:#1c2333;--tf-sub:#667085;--tf-border:#e7e4dd}

.tf-wrap{max-width:1400px;margin:0 auto;padding:0 20px}

/* =========================================================
   站点头部（全宽 + 紧凑）
   ========================================================= */
.tf-header{background:var(--tf-head-bg);border-bottom:1px solid var(--tf-border);position:sticky;top:0;z-index:90}
.tf-header-in{max-width:1400px;margin:0 auto;padding:0 20px;display:flex;align-items:center;gap:24px;min-height:58px;flex-wrap:wrap}
.tf-brand{display:flex;align-items:baseline;gap:10px}
.tf-logo{font-size:22px;font-weight:800;letter-spacing:1px;white-space:nowrap}
.tf-logo:hover{color:var(--tf-accent)}
.tf-brand .custom-logo{max-height:44px;width:auto}
.tf-slogan{font-size:12px;color:var(--tf-sub)}
.tf-nav{margin-left:auto}
.tf-menu{display:flex;gap:2px;flex-wrap:wrap}
.tf-menu li a{display:block;padding:8px 13px;font-size:14px;color:var(--tf-sub);border-radius:3px;white-space:nowrap}
.tf-menu li a:hover,
.tf-menu li.current-menu-item a,
.tf-menu li.current_page_item a,
.tf-menu li.current-menu-parent a{color:var(--tf-accent);background:rgba(127,127,127,.08);font-weight:700}
.tf-search{display:flex;border:1px solid var(--tf-border);border-radius:3px;overflow:hidden}
.tf-search input[type=search]{border:0;outline:0;background:transparent;color:var(--tf-ink);padding:7px 10px;font-size:13px;width:150px}
.tf-search button{background:var(--tf-accent);color:#fff;font-size:13px;padding:7px 12px}
.tf-menu-toggle{display:none;width:40px;height:36px;flex-direction:column;justify-content:center;align-items:center;gap:5px}
.tf-menu-toggle span{display:block;width:20px;height:2px;background:var(--tf-ink)}

/* =========================================================
   快讯条
   ========================================================= */
.tf-ticker{background:var(--tf-panel);border-bottom:1px solid var(--tf-border)}
.tf-ticker-in{max-width:1400px;margin:0 auto;padding:0 20px;display:flex;align-items:center}
.tf-ticker-label{background:var(--tf-accent);color:#fff;font-size:12px;padding:6px 12px;flex-shrink:0;letter-spacing:2px}
.tf-ticker-list{display:flex;gap:28px;overflow:hidden;white-space:nowrap;padding:6px 16px;font-size:13px;flex:1}
.tf-ticker-item a{color:var(--tf-sub)}
.tf-ticker-item a:hover{color:var(--tf-accent)}

/* =========================================================
   通用组件：缩略图 / 分类色块 / 元信息 / 栏目头
   ========================================================= */
.tf-thumb{position:relative;overflow:hidden;background:var(--tf-panel-2)}
.tf-thumb img{width:100%;height:100%;object-fit:cover}
.tf-thumb-ph{display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.92);font-size:26px;font-weight:800}
.tf-chip{display:inline-block;color:#fff;font-size:11px;line-height:1;padding:4px 8px;border-radius:2px;white-space:nowrap;flex-shrink:0}
.tf-chip:hover{opacity:.85;color:#fff}
.tf-meta{display:flex;align-items:center;gap:14px;font-size:12px;color:var(--tf-sub);flex-wrap:wrap;margin-top:auto}
.tf-sec-h{display:flex;align-items:center;gap:12px;margin:20px 0 2px;padding-bottom:9px;border-bottom:2px solid var(--tf-border)}
.tf-sec-h h2{font-size:18px;line-height:1.3;position:relative;padding-left:12px}
.tf-sec-h h2::before{content:"";position:absolute;left:0;top:2px;bottom:2px;width:4px;background:var(--tf-accent)}
.tf-sec-h .tf-more{margin-left:auto;font-size:12px;color:var(--tf-sub)}
.tf-sec-h .tf-more:hover{color:var(--tf-accent)}

/* =========================================================
   主区域布局（内容流 + 侧栏）
   ========================================================= */
.tf-main{max-width:1400px;margin:0 auto;padding:18px 20px 6px;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.tf-main.tf-main-full{grid-template-columns:minmax(0,1fr)}
.tf-stream{min-width:0}
.tf-side{min-width:0}

/* 紧凑图文横排条目 */
.tf-row{display:flex;gap:16px;padding:13px 0;border-bottom:1px dashed var(--tf-border)}
.tf-row:last-child{border-bottom:0}
.tf-row-thumb{flex:0 0 232px;aspect-ratio:16/10;display:block;overflow:hidden}
.tf-row-thumb .tf-thumb{width:100%;height:100%}
.tf-row-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.tf-row-top{display:flex;align-items:center;gap:10px}
.tf-row-title{font-size:17px;line-height:1.5;font-weight:700}
.tf-row-title a:hover,.tf-strip h3 a:hover{color:var(--tf-accent)}
.tf-row-sum{font-size:13px;color:var(--tf-sub);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tf-row.rev{flex-direction:row-reverse}

/* 面板与热读榜 */
.tf-panel{background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:14px 16px;margin-bottom:16px}
.tf-panel-t{font-size:15px;font-weight:800;padding-bottom:9px;border-bottom:2px solid var(--tf-accent);margin-bottom:4px}
.tf-rank li{display:flex;gap:10px;padding:8px 0;border-bottom:1px dashed var(--tf-border);align-items:baseline}
.tf-rank li:last-child{border-bottom:0}
.tf-rank i{font-style:normal;font-weight:800;color:var(--tf-sub);min-width:18px;font-size:14px}
.tf-rank li:nth-child(-n+3) i{color:var(--tf-accent)}
.tf-rank a{font-size:13px;line-height:1.5;flex:1;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tf-rank a:hover{color:var(--tf-accent)}

/* 侧栏小工具 */
.tf-side .widget{background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:14px 16px;margin-bottom:16px;font-size:13px}
.tf-side .widget-title{font-size:15px;font-weight:800;padding-bottom:9px;border-bottom:2px solid var(--tf-accent);margin-bottom:6px}
.tf-side .widget ul li{padding:6px 0;border-bottom:1px dashed var(--tf-border)}
.tf-side .widget ul li:last-child{border-bottom:0}
.tf-side .widget a:hover{color:var(--tf-accent)}

/* =========================================================
   顶部大版块：深色头图 / 浅色特写 / 杂志封面
   ========================================================= */
.tf-hero{position:relative;background:var(--tf-panel)}
.tf-hero .tf-hero-img{position:absolute;inset:0}
.tf-hero::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,14,24,.95) 0%,rgba(10,14,24,.7) 45%,rgba(10,14,24,.15) 100%)}
.tf-hero-txt{position:relative;z-index:2;max-width:1400px;margin:0 auto;padding:52px 20px;min-height:360px;display:flex;flex-direction:column;justify-content:center;color:#fff}
.tf-hero-txt h2{font-size:30px;line-height:1.4;margin:10px 0 8px;max-width:660px}
.tf-hero-txt h2 a{color:#fff}
.tf-hero-txt h2 a:hover{color:var(--tf-accent)}
.tf-hero-txt p{max-width:620px;color:#c6d0e0;font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tf-hero-txt .tf-meta{color:#8593aa;margin-top:12px}

.tf-feature{background:var(--tf-panel);border-bottom:1px solid var(--tf-border)}
.tf-feature-in{max-width:1400px;margin:0 auto;padding:22px 20px;display:flex;gap:24px;align-items:center}
.tf-feature .tf-thumb{flex:0 0 46%;aspect-ratio:16/9}
.tf-feature-txt{flex:1;min-width:0}
.tf-feature-txt h2{font-size:25px;line-height:1.45;margin:9px 0 7px}
.tf-feature-txt h2 a:hover{color:var(--tf-accent)}
.tf-feature-txt p{color:var(--tf-sub);font-size:14px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tf-feature-txt .tf-meta{margin-top:10px}

.tf-cover{position:relative}
.tf-cover .tf-cover-img{position:absolute;inset:0}
.tf-cover::after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(15,18,26,.92) 0%,rgba(15,18,26,.25) 60%,rgba(15,18,26,0) 100%)}
.tf-cover-txt{position:relative;z-index:2;max-width:1400px;margin:0 auto;min-height:380px;padding:24px 20px;display:flex;flex-direction:column;justify-content:flex-end;color:#fff}
.tf-cover-kicker{font-size:12px;letter-spacing:3px;color:var(--tf-accent);font-weight:700}
.tf-cover-txt h2{font-size:29px;line-height:1.45;margin:9px 0 7px;max-width:760px}
.tf-cover-txt h2 a{color:#fff}
.tf-cover-txt h2 a:hover{color:var(--tf-accent)}
.tf-cover-txt p{max-width:680px;color:#cfd6e0;font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* =========================================================
   风格 B：快讯文字列表
   ========================================================= */
.tf-quick{background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:14px 18px}
.tf-quick-list{display:grid;grid-template-columns:1fr 1fr;gap:0 32px}
.tf-quick-list li{font-size:13px;padding:7px 0;border-bottom:1px dashed var(--tf-border);display:flex;gap:10px;align-items:baseline}
.tf-quick-list li:nth-last-child(-n+2){border-bottom:0}
.tf-quick-list em{font-style:normal;color:var(--tf-sub);font-size:12px;white-space:nowrap}
.tf-quick-list a:hover{color:var(--tf-accent)}

/* =========================================================
   风格 C：最新动态 / 双栏图文条 / 编号精选
   ========================================================= */
.tf-mag-top{display:grid;grid-template-columns:3fr 2fr;gap:20px;padding-top:18px}
.tf-latest{background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:14px 18px}
.tf-latest-t{font-size:15px;font-weight:800;border-bottom:2px solid var(--tf-accent);padding-bottom:8px;margin-bottom:2px;display:flex;justify-content:space-between;align-items:center}
.tf-latest-t small{font-size:11px;color:var(--tf-sub);font-weight:400;letter-spacing:2px}
.tf-latest-item{padding:9px 0;border-bottom:1px dashed var(--tf-border)}
.tf-latest-item:last-child{border-bottom:0}
.tf-latest-item h3{font-size:14px;line-height:1.55;font-weight:700}
.tf-latest-item h3 a:hover{color:var(--tf-accent)}
.tf-latest-item p{font-size:12px;color:var(--tf-sub);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.tf-strips{display:grid;grid-template-columns:1fr 1fr;gap:0 36px;background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:2px 18px}
.tf-strip{display:flex;gap:16px;padding:13px 0;border-bottom:1px dashed var(--tf-border);align-items:flex-start}
.tf-strip:nth-last-child(-n+2){border-bottom:0}
.tf-strip .tf-row-thumb{flex:0 0 186px}
.tf-strip h3{font-size:15px;line-height:1.5;font-weight:700;margin:4px 0}

.tf-numlist{counter-reset:tfed;display:grid;grid-template-columns:1fr 1fr;gap:0 40px;background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:6px 18px}
.tf-numlist li{counter-increment:tfed;display:flex;gap:12px;padding:11px 0;border-bottom:1px dashed var(--tf-border);align-items:baseline}
.tf-numlist li::before{content:"0" counter(tfed);font-weight:900;font-size:20px;color:var(--tf-border);line-height:1}
.tf-numlist li:nth-child(-n+2)::before{color:var(--tf-accent)}
.tf-numlist h3{font-size:14px;line-height:1.55;font-weight:700}
.tf-numlist h3 a:hover{color:var(--tf-accent)}
.tf-numlist li p{font-size:12px;color:var(--tf-sub);margin-top:2px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}

/* =========================================================
   文章页
   ========================================================= */
.tf-single{max-width:1400px;margin:0 auto;padding:18px 20px 6px;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.tf-single.tf-main-full{grid-template-columns:minmax(0,1fr)}
.tf-single-col{min-width:0}
.tf-single-main{background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:24px 28px}
.tf-single-head h1{font-size:26px;line-height:1.45;margin:10px 0}
.tf-single-head .tf-meta{margin-top:4px}
.tf-single-thumb{margin:14px 0}
.tf-single-thumb img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:4px}
.tf-single-content{font-size:15px;line-height:1.9}
.tf-single-content p{margin:0 0 14px}
.tf-single-content h2{font-size:20px;margin:22px 0 10px}
.tf-single-content h3{font-size:17px;margin:18px 0 8px}
.tf-single-content img{border-radius:3px;margin:8px 0}
.tf-single-content a{color:var(--tf-accent)}
.tf-single-content blockquote{border-left:4px solid var(--tf-accent);padding:8px 14px;color:var(--tf-sub);background:var(--tf-panel-2);margin:0 0 14px}
.tf-single-content pre{background:var(--tf-panel-2);border:1px solid var(--tf-border);padding:12px;overflow:auto;font-size:13px;border-radius:3px;margin:0 0 14px}
.tf-single-content ul,.tf-single-content ol{padding-left:22px;margin:0 0 14px}
.tf-single-content ul{list-style:disc}
.tf-single-content ol{list-style:decimal}
.tf-tags{margin-top:16px;display:flex;flex-wrap:wrap;gap:8px}
.tf-tags a{font-size:12px;background:var(--tf-panel-2);border:1px solid var(--tf-border);padding:4px 10px;border-radius:3px;color:var(--tf-sub)}
.tf-tags a:hover{color:var(--tf-accent);border-color:var(--tf-accent)}
.tf-pn{display:flex;justify-content:space-between;gap:16px;margin-top:18px;padding-top:12px;border-top:1px dashed var(--tf-border);font-size:13px;color:var(--tf-sub)}
.tf-pn a:hover{color:var(--tf-accent)}

/* 评论区 */
.tf-comments{margin-top:20px;background:var(--tf-panel);border:1px solid var(--tf-border);border-radius:4px;padding:18px 22px}
.tf-comments-title{font-size:17px;font-weight:800;margin-bottom:8px}
.tf-comment-list li{padding:12px 0;border-bottom:1px dashed var(--tf-border);font-size:14px}
.tf-comment-list .children{margin-left:24px}
.comment-author{font-weight:700;font-size:13px}
.comment-metadata{font-size:12px}
.comment-metadata a{color:var(--tf-sub)}
.comment-form label{display:block;font-size:13px;margin:8px 0 4px}
.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url],.comment-form textarea{width:100%;max-width:520px;background:var(--tf-panel-2);border:1px solid var(--tf-border);border-radius:3px;padding:8px 10px;color:var(--tf-ink);font-size:13px;outline:0}
.comment-form input:focus,.comment-form textarea:focus{border-color:var(--tf-accent)}
.form-submit .submit{background:var(--tf-accent);color:#fff;border-radius:3px;padding:8px 22px;font-size:14px}
.tf-no-comments{color:var(--tf-sub);font-size:13px}

/* =========================================================
   归档 / 搜索 / 分页 / 空状态
   ========================================================= */
.tf-archive-head{max-width:1400px;margin:0 auto;padding:18px 20px 0}
.tf-archive-head h1{font-size:22px;display:flex;align-items:center;gap:10px}
.tf-archive-head h1::before{content:"";width:6px;height:22px;background:var(--tf-accent)}
.tf-archive-desc{font-size:13px;color:var(--tf-sub);margin-top:6px}
.tf-pagination{margin:18px 0;text-align:center;font-size:13px}
.tf-pagination .nav-links{display:flex;justify-content:center;gap:6px;flex-wrap:wrap}
.tf-pagination .page-numbers{display:inline-block;padding:6px 12px;border:1px solid var(--tf-border);border-radius:3px;color:var(--tf-sub);background:var(--tf-panel)}
.tf-pagination .page-numbers.current{background:var(--tf-accent);border-color:var(--tf-accent);color:#fff}
.tf-pagination a.page-numbers:hover{color:var(--tf-accent);border-color:var(--tf-accent)}
.tf-empty{background:var(--tf-panel);border:1px dashed var(--tf-border);border-radius:4px;padding:44px 20px;text-align:center;color:var(--tf-sub);font-size:14px}
.tf-empty p{margin-bottom:10px}
.tf-empty .tf-search{margin:12px auto 0;max-width:320px}
.tf-empty .tf-back-home{color:var(--tf-accent)}

/* =========================================================
   页脚
   ========================================================= */
.tf-footer{background:var(--tf-head-bg);border-top:1px solid var(--tf-border);margin-top:26px;color:var(--tf-sub);font-size:13px}
.tf-footer-widgets{max-width:1400px;margin:0 auto;padding:18px 20px;display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.tf-footer-col .widget-title{font-size:14px;font-weight:800;color:var(--tf-ink);margin-bottom:8px}
.tf-footer-col ul li{padding:5px 0}
.tf-footer-col a:hover{color:var(--tf-accent)}
.tf-footer-bar{border-top:1px solid var(--tf-border);padding:13px 20px;text-align:center;display:flex;justify-content:center;gap:18px;flex-wrap:wrap}

/* =========================================================
   编辑器对齐等兼容样式
   ========================================================= */
.wp-caption{max-width:100%}
.wp-caption-text{font-size:12px;color:var(--tf-sub);text-align:center;padding-top:4px}
.alignleft{float:left;margin:0 16px 8px 0}
.alignright{float:right;margin:0 0 8px 16px}
.aligncenter{margin:8px auto}
.screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute;height:1px;width:1px;overflow:hidden;word-wrap:normal}
.screen-reader-text:focus{clip:auto;height:auto;width:auto;left:6px;top:6px;z-index:100000;padding:14px 20px;background:var(--tf-panel);color:var(--tf-ink)}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width:1024px){
	.tf-main,.tf-single{grid-template-columns:minmax(0,1fr)}
	.tf-mag-top{grid-template-columns:1fr}
	.tf-strips,.tf-numlist,.tf-quick-list{grid-template-columns:1fr}
	.tf-strip:nth-last-child(2){border-bottom:1px dashed var(--tf-border)}
	.tf-numlist li:nth-last-child(2){border-bottom:1px dashed var(--tf-border)}
	.tf-quick-list li:nth-last-child(2){border-bottom:1px dashed var(--tf-border)}
	.tf-footer-widgets{grid-template-columns:1fr}
	.tf-hero-txt{min-height:300px;padding:40px 20px}
	.tf-hero-txt h2{font-size:24px}
	.tf-cover-txt{min-height:300px}
	.tf-cover-txt h2{font-size:24px}
	.tf-feature-in{flex-direction:column;align-items:stretch}
	.tf-feature .tf-thumb{flex-basis:auto;width:100%}
}
@media (max-width:720px){
	.tf-header-in{gap:10px;padding:8px 16px}
	.tf-menu-toggle{display:flex;margin-left:auto}
	.tf-nav{display:none;width:100%;margin-left:0}
	.tf-nav.open{display:block}
	.tf-menu{flex-direction:column;gap:0}
	.tf-menu li a{padding:9px 4px;border-bottom:1px solid var(--tf-border)}
	.tf-search{display:none}
	.tf-row,.tf-row.rev,.tf-strip{flex-direction:column;gap:10px}
	.tf-row-thumb{flex-basis:auto;width:100%;aspect-ratio:16/9}
	.tf-hero-txt{padding:34px 16px;min-height:250px}
	.tf-hero-txt h2{font-size:20px}
	.tf-cover-txt{min-height:250px}
	.tf-cover-txt h2{font-size:20px}
	.tf-single-main{padding:18px 16px}
	.tf-single-head h1{font-size:21px}
	.tf-pn{flex-direction:column;gap:6px}
	.tf-feature-txt h2{font-size:21px}
}
