/*
Theme Name: 认知前沿
Theme URI: https://example.com
Description: 仿 followbot.cn 风格一体化主题：信息差 + 认知课双内容平台，AI 自动采集网络信息源并生成文章（草稿待审），明暗双主题、Hero 渐变、统计计数、可视化数据看板。启用即完成全部安装。
Author: 认知前沿
Version: 2.2.0
License: GPL2
Text Domain: cognition-frontier
*/

:root {
  /* 浅色主题（默认） */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.85);
  --bg-code: #f3f4f6;
  --bg-pre: #1f2937;
  --bg-badge: #f1f5f9;

  --text-primary: #1e293b;
  --text-body: #334155;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-code: #be185d;
  --text-link: #3b82f6;
  --text-link-hover: #2563eb;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.1);
  --accent-bg: rgba(37, 99, 235, 0.08);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(37, 99, 235, 0.1);

  --gradient-hero: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --font-mono: 'JetBrains Mono', 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg-body: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0d0d1f 100%);
  --bg-body-attach: fixed;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --bg-header: rgba(15, 15, 35, 0.85);
  --bg-code: rgba(255, 255, 255, 0.08);
  --bg-pre: #1f2937;
  --bg-badge: rgba(255, 255, 255, 0.08);

  --text-primary: #f1f5f9;
  --text-body: #cbd5e1;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-code: #f472b6;
  --text-link: #60a5fa;
  --text-link-hover: #93c5fd;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.06);

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(129, 140, 248, 0.15);
  --accent-bg: rgba(129, 140, 248, 0.1);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 24px rgba(99, 102, 241, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-body);
  background-attachment: var(--bg-body-attach, scroll);
  color: var(--text-body);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; transition: color .2s; }
a:hover { color: var(--text-link-hover); }
img { max-width: 100%; height: auto; }
code { background: var(--bg-code); color: var(--text-code); padding: 2px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: .9em; }
pre { background: var(--bg-pre); color: #f9fafb; padding: 16px 20px; border-radius: 10px; overflow-x: auto; font-family: var(--font-mono); font-size: 14px; }
pre code { background: none; color: inherit; padding: 0; }
blockquote { margin: 20px 0; padding: 12px 20px; border-left: 4px solid #8b5cf6; background: var(--accent-bg); border-radius: 0 10px 10px 0; color: var(--text-secondary); }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }

/* ========== 顶部导航 ========== */
.cf-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.cf-header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 28px;
}
.cf-logo { font-size: 20px; font-weight: 900; color: var(--text-primary); letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.cf-logo:hover { color: var(--text-primary); }
.cf-logo .dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--gradient-hero);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 900;
}
.cf-nav { display: flex; gap: 6px; flex: 1; }
.cf-nav-ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.cf-nav a {
  color: var(--text-secondary); padding: 6px 14px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500;
}
.cf-nav a:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.cf-nav a.active { color: var(--accent); background: var(--accent-light); }
.cf-header-actions { display: flex; align-items: center; gap: 10px; }
.cf-theme-toggle {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-color); background: var(--bg-card);
  color: var(--text-secondary); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.cf-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.cf-menu-btn { display: none; }

/* ========== Hero ========== */
.cf-hero { position: relative; overflow: hidden; padding: 88px 20px 72px; text-align: center; }
.cf-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(99,102,241,.18), transparent),
    radial-gradient(ellipse 50% 45% at 80% 10%, rgba(168,85,247,.15), transparent);
}
[data-theme="dark"] .cf-hero::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(99,102,241,.28), transparent),
    radial-gradient(ellipse 50% 45% at 80% 10%, rgba(168,85,247,.22), transparent);
}
.cf-hero-inner { position: relative; max-width: 800px; margin: 0 auto; }
.cf-hero-badge {
  display: inline-block; font-size: 13px; letter-spacing: 1px;
  color: #a78bfa; border: 1px solid rgba(139,92,246,.4); border-radius: 20px;
  padding: 5px 16px; margin-bottom: 22px;
  background: rgba(139,92,246,.08);
  font-family: var(--font-mono);
}
.cf-hero h1 { font-size: 48px; line-height: 1.25; margin: 0 0 18px; font-weight: 900; color: var(--text-primary); letter-spacing: 1px; }
.cf-hero h1 .grad {
  background: var(--gradient-hero);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cf-hero p { font-size: 17px; color: var(--text-secondary); margin: 0 0 30px; }
.cf-hero-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px; border-radius: 10px; font-size: 15px; font-weight: 600;
  transition: all .2s; border: 1px solid transparent; cursor: pointer;
}
.cf-btn-primary { background: var(--gradient-hero); color: #fff; box-shadow: 0 4px 16px rgba(139,92,246,.3); }
.cf-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(139,92,246,.4); color: #fff; }
.cf-btn-ghost { border-color: var(--border-color); color: var(--text-secondary); background: var(--bg-card); }
.cf-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ========== 统计条 ========== */
.cf-stats { max-width: 1120px; margin: 0 auto; padding: 0 20px 10px; }
.cf-stats-inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 16px; padding: 26px 20px; box-shadow: var(--shadow-card);
}
.cf-stat { text-align: center; }
.cf-stat .num {
  font-size: 34px; font-weight: 900; font-family: var(--font-mono);
  background: var(--gradient-hero);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cf-stat .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ========== 区块通用 ========== */
.cf-section { max-width: 1120px; margin: 0 auto; padding: 40px 20px 0; }
.cf-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.cf-section-head h2 { font-size: 24px; font-weight: 800; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 10px; }
.cf-section-head .more { font-size: 14px; color: var(--text-secondary); }
.cf-section-head .more:hover { color: var(--accent); }

/* ========== 卡片 ========== */
.cf-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow-card);
  transition: all .25s; display: block; color: var(--text-body);
}
.cf-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: rgba(139,92,246,.35); color: var(--text-body); }

/* 项目/课程卡 */
.cf-projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.cf-project-card .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  background: rgba(16,185,129,.12); color: #10b981; border: 1px solid rgba(16,185,129,.3);
  margin-bottom: 14px;
}
.cf-project-card .badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cf-project-card h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; color: var(--text-primary); }
.cf-project-card p { margin: 0 0 14px; font-size: 14px; color: var(--text-secondary); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cf-project-card .go { font-size: 14px; font-weight: 600; color: var(--accent); }
.cf-project-card .price { font-size: 15px; font-weight: 800; color: #f59e0b; margin-right: 12px; }

/* 分类筛选 */
.cf-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cf-filter a, .cf-filter button {
  font-size: 13.5px; padding: 6px 16px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary);
  transition: all .2s; text-decoration: none;
}
.cf-filter a:hover, .cf-filter button:hover { border-color: var(--accent); color: var(--accent); }
.cf-filter a.active, .cf-filter button.active { background: var(--gradient-hero); color: #fff; border-color: transparent; }

/* 文章网格 */
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.cf-post-card h3 { margin: 10px 0 8px; font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cf-post-card p.excerpt { margin: 0 0 14px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cf-post-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.cf-tag-badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 6px; background: var(--bg-badge); color: var(--text-secondary);
}
.cf-tag-badge.dim { background: rgba(139,92,246,.12); color: #a78bfa; }
.cf-tag-badge.hot { background: rgba(245,158,11,.14); color: #f59e0b; }
.cf-thumb { border-radius: 10px; margin-bottom: 4px; aspect-ratio: 2.2/1; object-fit: cover; width: 100%; }

/* ========== 文章详情 ========== */
.cf-single { max-width: 780px; margin: 0 auto; padding: 40px 20px 60px; }
.cf-single-header { margin-bottom: 30px; }
.cf-single-header .cf-tag-badge { margin-bottom: 14px; }
.cf-single-header h1 { font-size: 32px; font-weight: 900; color: var(--text-primary); line-height: 1.4; margin: 0 0 16px; }
.cf-single-meta { display: flex; gap: 16px; font-size: 13.5px; color: var(--text-muted); flex-wrap: wrap; align-items: center; }
.cf-magnitude { display: inline-flex; align-items: center; gap: 4px; }
.cf-magnitude .stars { color: #f59e0b; letter-spacing: 2px; }
.cf-entry { font-size: 16px; color: var(--text-body); }
.cf-entry h2 { font-size: 22px; color: var(--text-primary); margin: 34px 0 14px; padding-left: 12px; border-left: 4px solid #8b5cf6; }
.cf-entry h3 { font-size: 18px; color: var(--text-primary); margin: 28px 0 12px; }
.cf-source-box {
  margin-top: 34px; padding: 16px 20px; border-radius: 12px;
  background: var(--bg-card); border: 1px dashed var(--border-color);
  font-size: 13.5px; color: var(--text-secondary);
}
/* 课程详情 */
.cf-course-price-box {
  display: flex; align-items: center; gap: 18px; margin: 24px 0;
  padding: 18px 22px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border-color);
}
.cf-course-price-box .price { font-size: 30px; font-weight: 900; color: #f59e0b; font-family: var(--font-mono); }
.cf-course-price-box .price.free { color: #10b981; }
.cf-chapters { margin-top: 26px; }
.cf-chapters h3 { font-size: 18px; color: var(--text-primary); }
.cf-chapter { display: flex; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border-light); font-size: 14.5px; }
.cf-chapter .no { color: var(--accent); font-family: var(--font-mono); font-weight: 700; flex: none; }

/* ========== 分页 ========== */
.cf-pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0; }
.cf-pagination .page-numbers {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color); background: var(--bg-card);
  color: var(--text-secondary); font-size: 14px;
}
.cf-pagination .page-numbers.current { background: var(--gradient-hero); color: #fff; border-color: transparent; }
.cf-pagination .page-numbers:hover:not(.current) { border-color: var(--accent); color: var(--accent); }

/* ========== 用户/支付 ========== */
.cf-auth-box {
  max-width: 420px; margin: 60px auto; padding: 34px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 16px; box-shadow: var(--shadow-card);
}
.cf-auth-box h2 { margin-top: 0; color: var(--text-primary); }
.cf-auth-box input[type="text"], .cf-auth-box input[type="password"], .cf-auth-box input[type="email"] {
  width: 100%; padding: 10px 14px; border-radius: 10px; font-size: 14px;
  border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-primary);
}
.cf-auth-box p { margin: 12px 0; }
.cf-auth-box .forgetmenot { display: inline-block; }
.cf-uc { max-width: 860px; margin: 0 auto; padding: 40px 20px 60px; }
.cf-uc-head {
  display: flex; align-items: center; gap: 16px; padding: 22px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
}
.cf-uc-head h2 { color: var(--text-primary); }
.cf-uc-orders table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cf-uc-orders th, .cf-uc-orders td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.cf-uc-orders th { color: var(--text-muted); font-weight: 600; }
.cf-checkout {
  max-width: 520px; margin: 60px auto; padding: 34px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 16px; box-shadow: var(--shadow-card); color: var(--text-body);
}
.cf-checkout h2 { margin-top: 0; color: var(--text-primary); }
.cf-pay-methods { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.cf-card-form { display: flex; gap: 10px; margin-top: 18px; }
.cf-card-form input[type="text"] {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-primary);
}
.cf-pay-ok { max-width: 520px; margin: 80px auto; text-align: center; font-size: 17px; color: #10b981; }
.cf-paywall { margin: 26px 0; }
.cf-paywall-box {
  text-align: center; padding: 44px 30px; border-radius: 16px;
  background: var(--bg-card); border: 1px dashed var(--border-color);
  position: relative; overflow: hidden;
}
.cf-paywall-box::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--accent-bg), transparent);
}
.cf-paywall-box > * { position: relative; }
.cf-paywall-box .lock { font-size: 40px; }
.cf-paywall-box h3 { margin: 10px 0 6px; font-size: 20px; color: var(--text-primary); }
.cf-paywall-box p { color: var(--text-secondary); margin: 0 0 16px; font-size: 14px; }
.cf-paywall-price {
  font-size: 40px; font-weight: 900; color: #f59e0b; font-family: var(--font-mono);
  margin-bottom: 20px;
}

/* ========== 页脚 ========== */
.cf-footer {
  margin-top: 70px; border-top: 1px solid var(--border-light);
  background: var(--bg-card); padding: 34px 20px; text-align: center;
  font-size: 13.5px; color: var(--text-muted);
}
.cf-footer a { color: var(--text-secondary); }
.cf-footer .beian { margin-top: 8px; font-size: 12px; }

/* ========== 后台看板 ========== */
.cf-admin-wrap { max-width: 1080px; }
.cf-admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 16px 0 24px; }
.cf-admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; }
.cf-admin-card .num { font-size: 28px; font-weight: 800; color: #6366f1; font-family: var(--font-mono); }
.cf-admin-card .label { font-size: 13px; color: #64748b; margin-top: 2px; }
.cf-admin-chart { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.cf-admin-chart h3 { margin: 0 0 16px; font-size: 15px; }
.cf-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.cf-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.cf-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--gradient-hero); min-height: 3px; }
.cf-bar-item .d { font-size: 10px; color: #94a3b8; white-space: nowrap; }
.cf-admin-table { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 6px 0; }
.cf-admin-table table { border: none; }
.cf-admin-table th, .cf-admin-table td { border: none; border-bottom: 1px solid #f1f5f9; padding: 9px 16px; font-size: 13px; }
.cf-admin-table tr:last-child td { border-bottom: none; }
.cf-log-ok { color: #16a34a; } .cf-log-err { color: #dc2626; } .cf-log-info { color: #64748b; }

/* ========== 后台设置页 ========== */
.cf-setting-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px 24px; max-width: 860px; }
.cf-setting-box h2 { margin-top: 0; }
.cf-setting-box table.form-table th { width: 160px; }
.cf-source-help { font-size: 12px; color: #64748b; }

/* ========== 移动端 ========== */
@media (max-width: 768px) {
  .cf-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg-card); border-bottom: 1px solid var(--border-color);
    padding: 10px 20px; gap: 2px;
  }
  .cf-nav.open { display: flex; }
  .cf-nav.open .cf-nav-ul, .cf-nav.open ul { flex-direction: column; gap: 2px; }
  .cf-menu-btn { display: inline-flex; }
  .cf-hero h1 { font-size: 32px; }
  .cf-hero { padding: 56px 20px 48px; }
  .cf-stats-inner { grid-template-columns: repeat(2, 1fr); }
  .cf-stat .num { font-size: 26px; }
  .cf-single-header h1 { font-size: 24px; }
  .cf-section { padding: 32px 16px 0; }
}
