/* ==========================================================================
   磁力狗 btcldog.com —— 蓝色科技卡片风
   全站内容由 PHP 服务端渲染，本文件只负责视觉表现（含移动端适配）
   ========================================================================== */

:root {
  --brand: #1e5eff;
  --brand-2: #00c2ff;
  --brand-soft: #eef4ff;
  --brand-line: #dbe7fb;
  --bg: #f2f6fd;
  --card: #ffffff;
  --text: #16233a;
  --muted: #6b7c96;
  --border: #e3ebf7;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(30, 94, 255, .07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 18px; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.logo-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; }
/* 站点 Logo（后台可替换：/assets/images/logo.png 或 /uploads/xxx.png / 外链） */
.logo-img { width: 38px; height: 38px; flex: none; object-fit: contain; border-radius: 9px; }
.logo-text {
  font-size: 21px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.header-nav { display: flex; gap: 6px; }
.header-nav a {
  font-size: 14px; color: var(--muted); padding: 7px 14px; border-radius: 999px; transition: .2s;
}
.header-nav a:hover { color: var(--brand); background: var(--brand-soft); }
.header-nav a.active { color: #fff; background: linear-gradient(120deg, var(--brand), var(--brand-2)); }

/* ---------------- 主区域 / 搜索 ---------------- */
.main-wrap { flex: 1 0 auto; padding: 22px 18px 46px; }

.hero {
  background: linear-gradient(135deg, #e9f1ff 0%, #f8fbff 60%, #eefaff 100%);
  border: 1px solid var(--brand-line);
  border-radius: 22px;
  padding: 34px 26px 26px;
  margin-bottom: 24px;
  text-align: center;
}
.hero h1 { font-size: 25px; margin: 0 0 8px; letter-spacing: .3px; }
.hero-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.search-form { max-width: 680px; margin: 0 auto; }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--brand-line); border-radius: 14px;
  padding: 4px 6px 4px 14px; box-shadow: 0 4px 14px rgba(30, 94, 255, .06);
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 5px rgba(30, 94, 255, .1); }
.search-icon { flex: none; color: #9aabc5; display: inline-flex; }
.search-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  height: 46px; font-size: 15px; color: var(--text); font-family: inherit;
}
.search-input::placeholder { color: #a7b4c9; }
.search-btn {
  flex: none; border: 0; cursor: pointer; font-family: inherit;
  height: 42px; padding: 0 26px; border-radius: 10px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 15px; font-weight: 600;
  transition: filter .2s, transform .1s;
}
.search-btn:hover { filter: brightness(1.06); }
.search-btn:active { transform: translateY(1px); }

.search-tab { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tab {
  font-size: 13px; padding: 5px 16px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1px solid var(--brand-line); color: var(--muted); transition: .2s;
}
.tab:hover { color: var(--brand); border-color: var(--brand); }
.tab.active { background: linear-gradient(120deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }

/* ---------------- 分组卡片 ---------------- */
.nav-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.nav-group {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 8px; box-shadow: var(--shadow); min-width: 0;
}
.group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-width: 0; }
.gt-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.gt-main { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.gt-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gt-more { margin-left: auto; font-size: 12px; color: var(--brand); white-space: nowrap; }
.gt-more:hover { text-decoration: underline; }

.group-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.group-links li { min-width: 0; }
.group-links a {
  display: block; height: 40px; line-height: 40px; padding: 0 8px;
  background: var(--brand-soft); border-radius: 9px;
  font-size: 13.5px; color: #33456b; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .2s, color .2s, transform .15s;
}
.group-links a:hover {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff; transform: translateY(-1px);
}

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; padding: 20px 0; margin-top: auto; }
.footer-inner { text-align: center; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 3px 0; }
.footer-note { font-size: 12px; color: #9aa8bd; }

/* ==========================================================================
   资讯页 / 详情页
   ========================================================================== */
/* 面包屑导航 */
.breadcrumb { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: '/'; margin: 0 7px; color: #b9c6d9; }
.breadcrumb a { color: var(--brand); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] span { color: var(--muted); }

.articles-page { padding-top: 24px; }
.page-title { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.title-bar { width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }

.articles-wrap { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 18px; align-items: start; }

.article-nav { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.article-nav h3 { font-size: 14px; margin: 0 0 10px; color: var(--brand); }
.article-nav-list { list-style: none; margin: 0; padding: 0; }
.article-nav-list li { border-bottom: 1px dashed var(--border); }
.article-nav-list li:last-child { border-bottom: 0; }
.article-nav-list a { display: block; padding: 9px 2px; font-size: 13.5px; color: #3d4f6d; transition: .2s; }
.article-nav-list a:hover { color: var(--brand); padding-left: 6px; }
.muted { color: var(--muted); font-size: 12px; }

.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.article-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(30, 94, 255, .12); border-color: var(--brand-line); }
.article-card h3 { font-size: 16.5px; margin: 0 0 8px; line-height: 1.5; }
.article-card h3 a:hover { color: var(--brand); }
.article-card p { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.article-meta { font-size: 12px; color: var(--muted); }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 18px 0 4px; }
.pagination a, .pagination span { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 9px; font-size: 14px; background: #fff; border: 1px solid var(--border); }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }

.article-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); min-width: 0; word-break: break-word; }
.article-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.article-head h1 { font-size: 23px; line-height: 1.45; margin: 0 0 12px; }
.article-detail .article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.article-detail .article-meta .meta-cat { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 11px; font-size: 12px; }

.article-summary { background: #f7faff; border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 0 0 20px; font-size: 14px; color: #55688a; }
.article-content { font-size: 15px; line-height: 1.9; color: #29364c; word-break: break-word; }
.article-content > *:first-child { margin-top: 0; }
.article-content > *:last-child { margin-bottom: 0; }
.article-content p { margin: 0 0 14px; }
.article-content h1, .article-content h2 { font-size: 18px; margin: 24px 0 12px; padding-left: 11px; border-left: 4px solid var(--brand); }
.article-content h3 { font-size: 16px; margin: 20px 0 10px; }
.article-content h4 { font-size: 15px; margin: 16px 0 8px; }
.article-content ul, .article-content ol { margin: 0 0 14px; padding-left: 24px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 6px; }
.article-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.article-content strong, .article-content b { color: #0f1c33; }
.article-content blockquote { margin: 0 0 14px; padding: 10px 16px; background: #f7faff; border-left: 3px solid var(--brand-line); border-radius: 0 10px 10px 0; color: #55688a; }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 8px auto; }
.article-content iframe, .article-content video { max-width: 100%; border-radius: 12px; }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.article-content code { background: #f2f6fd; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-family: Consolas, Menlo, monospace; font-size: .92em; color: #0b6bcb; }
.article-content pre { background: #101f3a; color: #dbe7fb; border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; font-size: 13px; line-height: 1.7; overflow-x: auto; }
.article-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.article-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-content th { background: #f7faff; }

.article-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.article-tags .tags-label { color: var(--muted); margin-right: 6px; }
.article-tag { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 13px; font-size: 12px; margin: 0 8px 8px 0; }
.article-foot { margin-top: 20px; }
.back-link { display: inline-block; color: var(--brand); font-size: 14px; }
.back-link:hover { text-decoration: underline; }
.empty-tip { text-align: center; padding: 54px 20px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 980px) {
  .nav-grid { grid-template-columns: minmax(0, 1fr); }
  .articles-wrap { grid-template-columns: minmax(0, 1fr); }
  .article-nav { position: static; }
  .article-nav-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .article-nav-list li { border: 1px solid var(--border); border-radius: 999px; }
  .article-nav-list a { padding: 5px 13px; }
  .article-nav-list a:hover { padding-left: 13px; }
}
@media (max-width: 760px) {
  .header-inner { height: 58px; }
  .logo-text { font-size: 18px; }
  .hero { padding: 24px 16px 20px; border-radius: 18px; }
  .hero h1 { font-size: 20px; }
  .hero-sub { font-size: 13px; }
  .search-btn { padding: 0 18px; font-size: 14px; }
  .article-detail { padding: 18px 16px; }
  .article-head h1 { font-size: 19px; }
  .article-content { font-size: 14px; }
  .page-title { font-size: 19px; }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .main-wrap { padding: 16px 14px 36px; }
  .group-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-nav a { padding: 6px 10px; font-size: 13px; }
}
