/* ==========================================================================
   TechFlow 主题样式 —— 科技感 / 四套配色 / 响应式
   ========================================================================== */

/* ---------- 配色变量（默认深蓝） ---------- */
:root {
  --tf-primary: #123a7a;
  --tf-primary-dark: #0b2450;
  --tf-accent: #f97316;
  --tf-hero-grad: linear-gradient(135deg, #123a7a 0%, #1e56b8 100%);
}

body.tf-scheme-red {
  --tf-primary: #8c1d2f;
  --tf-primary-dark: #5c1220;
  --tf-accent: #f59e0b;
  --tf-hero-grad: linear-gradient(135deg, #8c1d2f 0%, #c23a52 100%);
}
body.tf-scheme-orange {
  --tf-primary: #c2570c;
  --tf-primary-dark: #7c3707;
  --tf-accent: #123a7a;
  --tf-hero-grad: linear-gradient(135deg, #c2570c 0%, #e8823a 100%);
}
body.tf-scheme-green {
  --tf-primary: #14532d;
  --tf-primary-dark: #0b331c;
  --tf-accent: #f97316;
  --tf-hero-grad: linear-gradient(135deg, #14532d 0%, #1f7a45 100%);
}

/* ---------- 顶部细栏 ---------- */
.tf-topbar {
  background: var(--tf-primary-dark);
  color: #dbeafe;
  font-size: 13px;
}
.tf-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
}
.tf-topbar a { color: #dbeafe; }
.tf-topbar a:hover { color: #fff; }
.tf-dot { margin: 0 8px; opacity: .5; }

/* ---------- 品牌区 ---------- */
.tf-header { background: #fff; box-shadow: 0 2px 12px rgba(15, 40, 80, .08); }
.tf-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
}
.tf-brand-logo img { max-height: 72px; width: auto; }
.tf-brand-name {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--tf-primary);
}
.tf-brand-tagline { display: block; color: var(--tf-muted); font-size: 14px; margin-top: 2px; }
.tf-brand-ad { flex: 0 1 460px; }

/* ---------- 导航栏 ---------- */
.tf-navbar { background: var(--tf-primary); }
.tf-navbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 50px;
}
.tf-primary-menu-list,
.tf-cat-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tf-primary-menu-list > li,
.tf-cat-menu > .tf-cat-item { position: relative; }
.tf-primary-menu-list a,
.tf-cat-menu a {
  display: block;
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  transition: background .2s;
}
.tf-primary-menu-list a:hover,
.tf-cat-menu a:hover { background: rgba(255, 255, 255, .12); }

/* 下拉细分类 */
.tf-sub-menu, .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  border-radius: 0 0 10px 10px;
  display: none;
  z-index: 60;
}
.tf-cat-item.open .tf-sub-menu,
.tf-primary-menu li:hover > .tf-sub-menu,
.tf-primary-menu li:hover > .sub-menu,
.menu-item-has-children.open > .sub-menu,
.tf-cat-item.open .sub-menu { display: block; }
.tf-sub-menu a, .sub-menu a { color: var(--tf-text) !important; padding: 10px 16px !important; }
.tf-sub-menu a:hover, .sub-menu a:hover { background: var(--tf-bg) !important; }
.tf-cat-toggle {
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 0 6px;
  font-size: 13px;
}

.tf-navbar-extra { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tf-search-toggle { background: none; border: 0; cursor: pointer; font-size: 18px; }

.tf-search-panel { display: none; padding: 10px 0; }
.tf-search-panel.open { display: block; }
.tf-search-panel form { display: flex; gap: 8px; }
.tf-search-panel input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--tf-border);
}
.tf-search-panel button {
  border: 0;
  background: var(--tf-accent);
  color: #fff;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
}

/* ---------- 语言切换 ---------- */
.tf-lang-switch { display: flex; gap: 6px; }
.tf-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
}
.tf-lang-btn.is-active { background: #fff; color: var(--tf-primary); }
.tf-lang-btn img { border-radius: 2px; }

/* ---------- 页面布局 ---------- */
.tf-main { padding: 26px 0; }
.tf-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

/* ---------- 通用卡片 ---------- */
.tf-card {
  background: var(--tf-card);
  border-radius: var(--tf-radius);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 40, 80, .08);
  transition: transform .2s, box-shadow .2s;
}
.tf-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15, 40, 80, .14); }
.tf-card-media { display: block; overflow: hidden; }
.tf-card-media img { width: 100%; object-fit: cover; }
.tf-card-body { padding: 18px; }
.tf-card-title { font-size: 19px; margin-bottom: 8px; }
.tf-card-title a { color: var(--tf-text); }
.tf-card-title a:hover { color: var(--tf-primary); }
.tf-card-excerpt { color: var(--tf-muted); font-size: 14px; margin-bottom: 10px; }
.tf-card-meta { color: var(--tf-muted); font-size: 13px; }

.tf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.tf-loop-grid { margin: 22px 0; }

/* ---------- 首页 Hero 轮播 ---------- */
.tf-hero { position: relative; margin-bottom: 26px; border-radius: var(--tf-radius); overflow: hidden; }
.tf-hero-slider { display: flex; transition: transform .5s ease; }
.tf-hero-slide { position: relative; min-width: 100%; }
.tf-hero-slide-media img { width: 100%; height: 420px; object-fit: cover; }
.tf-hero-slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
  color: #fff;
}
.tf-hero-slide-caption h2 { font-size: 26px; margin-bottom: 6px; }
.tf-hero-slide-caption h2 a { color: #fff; }
.tf-hero-meta { font-size: 13px; opacity: .85; }
.tf-hero-dots { position: absolute; right: 20px; bottom: 18px; display: flex; gap: 8px; z-index: 5; }
.tf-hero-dots button {
  width: 10px; height: 10px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .5); cursor: pointer;
}
.tf-hero-dots button.active { background: var(--tf-accent); }

/* ---------- 特色分栏 ---------- */
.tf-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; margin-bottom: 26px; }
.tf-recent-list { display: flex; flex-direction: column; gap: 16px; }
.tf-section-title { font-size: 18px; margin-bottom: 14px; color: var(--tf-primary); }
.tf-recent-item { display: flex; gap: 12px; background: var(--tf-card); border-radius: 12px; padding: 10px; box-shadow: 0 2px 10px rgba(15, 40, 80, .06); }
.tf-recent-thumb { flex: 0 0 96px; }
.tf-recent-thumb img { border-radius: 8px; width: 96px; height: 72px; object-fit: cover; }
.tf-recent-body h4 { font-size: 15px; margin-bottom: 4px; }
.tf-recent-body h4 a { color: var(--tf-text); }
.tf-recent-meta { font-size: 12px; color: var(--tf-muted); }

/* ---------- 图文列表行 ---------- */
.tf-list-rows { display: flex; flex-direction: column; gap: 18px; margin: 26px 0; }
.tf-row-item { display: flex; gap: 16px; background: var(--tf-card); border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px rgba(15, 40, 80, .06); }
.tf-row-thumb { flex: 0 0 160px; }
.tf-row-thumb img { border-radius: 10px; width: 160px; height: 110px; object-fit: cover; }
.tf-row-body h3 { font-size: 17px; margin-bottom: 6px; }
.tf-row-body h3 a { color: var(--tf-text); }
.tf-row-excerpt { color: var(--tf-muted); font-size: 14px; margin-bottom: 6px; }
.tf-row-meta { font-size: 13px; color: var(--tf-muted); }

/* ---------- 推荐阅读 ---------- */
.tf-recommended { margin: 26px 0; }
.tf-reco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tf-reco-card { background: var(--tf-card); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(15, 40, 80, .06); }
.tf-reco-media img { width: 100%; height: 160px; object-fit: cover; }
.tf-reco-card h4 { padding: 12px 14px 16px; font-size: 15px; }
.tf-reco-card h4 a { color: var(--tf-text); }

/* ---------- 侧边栏 ---------- */
.tf-sidebar { display: flex; flex-direction: column; gap: 22px; }
.widget { background: var(--tf-card); border-radius: var(--tf-radius); padding: 18px; box-shadow: 0 2px 12px rgba(15, 40, 80, .06); }
.widget-title { font-size: 16px; color: var(--tf-primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--tf-bg); }

.tf-widget-search form { display: flex; gap: 8px; }
.tf-widget-search input[type="search"] {
  flex: 1; padding: 10px 12px; border: 1px solid var(--tf-border); border-radius: 10px;
}
.tf-widget-search button { border: 0; background: var(--tf-primary); color: #fff; border-radius: 10px; padding: 0 14px; cursor: pointer; }

.tf-social { display: flex; gap: 10px; flex-wrap: wrap; }
.tf-social-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tf-bg); color: var(--tf-primary); font-weight: 700;
}
.tf-social-btn:hover { background: var(--tf-primary); color: #fff; }

.tf-news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tf-news-grid-item img { border-radius: 8px; width: 100%; height: 84px; object-fit: cover; }

.tf-widget-list { list-style: none; margin: 0; padding: 0; }
.tf-widget-list li { padding: 8px 0; border-bottom: 1px dashed var(--tf-border); }
.tf-widget-list li:last-child { border-bottom: 0; }
.tf-widget-list a { color: var(--tf-text); }
.tf-widget-list a:hover { color: var(--tf-primary); }

.tf-popular-list { list-style: none; margin: 0; padding: 0; }
.tf-popular-list li { padding: 10px 0; border-bottom: 1px dashed var(--tf-border); }
.tf-popular-list li:last-child { border-bottom: 0; }
.tf-popular-list a { color: var(--tf-text); display: block; margin-bottom: 2px; }
.tf-popular-meta { font-size: 12px; color: var(--tf-muted); }

.tf-tag-cloud a {
  display: inline-block;
  background: var(--tf-bg);
  color: var(--tf-primary);
  border-radius: 8px;
  padding: 4px 10px;
  margin: 0 6px 8px 0;
  font-size: 13px;
}
.tf-contact-list { list-style: none; margin: 0; padding: 0; }
.tf-contact-list li { padding: 6px 0; font-size: 14px; }

.tf-ip-card { background: var(--tf-hero-grad); color: #fff; }
.tf-ip-card .widget-title { color: #fff; border-bottom-color: rgba(255, 255, 255, .25); }
.tf-ip-value { font-size: 22px; font-weight: 700; letter-spacing: 1px; margin: 0; }

/* ---------- 文章详情 ---------- */
.tf-breadcrumbs { font-size: 13px; color: var(--tf-muted); margin-bottom: 16px; }
.tf-single-header { margin-bottom: 20px; }
.tf-single-title { font-size: 32px; line-height: 1.3; }
.tf-single-meta { color: var(--tf-muted); font-size: 14px; display: flex; gap: 10px; }
.tf-single-thumb { border-radius: var(--tf-radius); overflow: hidden; margin-bottom: 22px; }
.tf-single-content { font-size: 16px; }
.tf-single-content img { border-radius: 10px; margin: 12px 0; }
.tf-single-footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--tf-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.tf-single-share a { margin-left: 10px; color: var(--tf-primary); }

.tf-related { margin-top: 34px; }

/* ---------- 评论 ---------- */
.tf-comments { margin-top: 34px; }
.tf-comment-list { list-style: none; padding: 0; }
.tf-comment-list li { padding: 14px 0; border-bottom: 1px solid var(--tf-border); }
.comment-author img { border-radius: 50%; float: left; margin-right: 12px; }
.comment-meta { font-size: 13px; color: var(--tf-muted); }
.comment-form label { display: block; font-size: 14px; margin-bottom: 4px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--tf-border); border-radius: 10px; margin-bottom: 14px;
}
.comment-form .submit { background: var(--tf-primary); color: #fff; border: 0; border-radius: 10px; padding: 12px 28px; cursor: pointer; }

/* ---------- 广告位 ---------- */
.tf-ad { margin: 18px 0; }
.tf-ad-placeholder {
  display: block; text-align: center; padding: 24px;
  border: 1px dashed var(--tf-border); border-radius: 10px; color: var(--tf-muted); font-size: 13px;
}

/* ---------- 徽章 / 按钮 ---------- */
.tf-badge {
  display: inline-block; font-size: 12px; border-radius: 6px; padding: 3px 10px; margin-bottom: 8px;
}
.tf-badge-featured { background: var(--tf-accent); color: #fff; }
.tf-badge-video { background: #111827; color: #fff; }
.tf-btn {
  display: inline-block; background: var(--tf-primary); color: #fff;
  padding: 10px 22px; border-radius: 10px; margin-top: 10px;
}
.tf-btn:hover { background: var(--tf-primary-dark); color: #fff; }

/* ---------- 归档 / 空状态 ---------- */
.tf-archive-header { margin-bottom: 22px; }
.tf-archive-title { font-size: 26px; }
.tf-empty { background: var(--tf-card); border-radius: var(--tf-radius); padding: 50px 24px; text-align: center; }
.tf-404 h1 { font-size: 64px; color: var(--tf-primary); margin: 0; }

/* ---------- 页脚 ---------- */
.tf-footer { background: var(--tf-primary-dark); color: #cbd5e1; margin-top: 40px; }
.tf-footer-inner { padding: 34px 0 20px; }
.tf-footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.tf-footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 20px; }
.tf-footer-links a { color: #cbd5e1; }
.tf-footer-links a:hover { color: #fff; }
.tf-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px;
}

/* ==========================================================================
   响应式：平板
   ========================================================================== */
@media (max-width: 992px) {
  .tf-page-grid { grid-template-columns: 1fr 280px; }
  .tf-split { grid-template-columns: 1fr; }
  .tf-hero-slide-media img { height: 340px; }
}

/* ==========================================================================
   响应式：手机
   ========================================================================== */
@media (max-width: 768px) {
  .tf-brand-row { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px 0; }
  .tf-brand-ad { width: 100%; flex: none; }

  .tf-navbar-inner { flex-wrap: wrap; padding: 8px 0; }
  .tf-nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .tf-nav-toggle span { width: 22px; height: 2px; background: #fff; display: block; }
  .tf-nav-toggle em { font-style: normal; font-size: 12px; color: #fff; }
  .tf-primary-menu { display: none; width: 100%; }
  .tf-primary-menu.open { display: block; }
  .tf-primary-menu-list, .tf-cat-menu { flex-direction: column; }
  .tf-sub-menu, .sub-menu { position: static; box-shadow: none; border-radius: 0; }

  .tf-page-grid { grid-template-columns: 1fr; }
  .tf-grid-2 { grid-template-columns: 1fr; }
  .tf-reco-grid { grid-template-columns: 1fr 1fr; }
  .tf-row-item { flex-direction: column; }
  .tf-row-thumb { flex: none; }
  .tf-row-thumb img { width: 100%; height: 170px; }
  .tf-hero-slide-media img { height: 240px; }
  .tf-hero-slide-caption { padding: 18px; }
  .tf-hero-slide-caption h2 { font-size: 19px; }
  .tf-footer-widgets { grid-template-columns: 1fr; }
  .tf-single-title { font-size: 24px; }
  .tf-topbar-inner { font-size: 12px; }
}

@media (max-width: 480px) {
  .tf-reco-grid { grid-template-columns: 1fr; }
  .tf-news-grid { grid-template-columns: repeat(2, 1fr); }
}
