/* ═══════════════════════════════════════════════════════════
   site.css — 办公工具教程网 v1.0
   主题：blue（默认） | dark | warm
   ═══════════════════════════════════════════════════════════ */

/* ── CSS 变量（blue 主题默认值） ─────────────────────────── */
:root {
  --accent:       #1a73e8;
  --accent-dark:  #1558b0;
  --accent-light: #e8f0fe;
  --bg:           #f5f7fa;
  --bg-card:      #ffffff;
  --bg-header:    #ffffff;
  --text:         #1f2937;
  --text-muted:   #6b7280;
  --text-inv:     #ffffff;
  --border:       #e5e7eb;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.12);
  --radius:       8px;
  --radius-lg:    12px;
  --header-h:     60px;
  --sidebar-w:    300px;
  --font:         "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-code:    "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* ── 深色主题 ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --accent:       #4f9df8;
  --accent-dark:  #2f7ae0;
  --accent-light: #1e2d45;
  --bg:           #111827;
  --bg-card:      #1f2937;
  --bg-header:    #1a2332;
  --text:         #e5e7eb;
  --text-muted:   #9ca3af;
  --text-inv:     #111827;
  --border:       #374151;
  --shadow:       0 2px 8px rgba(0,0,0,.4);
}

/* ── 暖色主题 ─────────────────────────────────────────────── */
[data-theme="warm"] {
  --accent:       #d97706;
  --accent-dark:  #b45309;
  --accent-light: #fef3c7;
  --bg:           #fffbf5;
  --bg-card:      #ffffff;
  --bg-header:    #fff8ee;
  --text:         #1c1917;
  --text-muted:   #78716c;
  --text-inv:     #ffffff;
  --border:       #e7d9c5;
  --shadow:       0 2px 8px rgba(0,0,0,.07);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── 阅读进度条 ──────────────────────────────────────────── */
#read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 9999;
  transition: width .1s linear;
}

/* ── Container ───────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── Header / Navbar ─────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 800;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-container {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); max-width: 1200px; margin: 0 auto; padding: 0 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.15rem; font-weight: 700; color: var(--text); white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }
.logo-icon { font-size: 1.3rem; }
.logo-text  { }

/* ── 导航菜单 ────────────────────────────────────────────── */
.nav-menu {
  display: flex; align-items: center; gap: 4px;
  list-style: none; flex: 1; margin: 0; padding: 0;
}
.nav-menu > li { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: .95rem; color: var(--text); white-space: nowrap;
  transition: background .15s;
}
.nav-link:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.arrow { font-size: .75rem; opacity: .6; }

/* 大导航 Mega Menu */
.mega-menu {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 780px; padding: 16px 24px;
  z-index: 900;
}
.has-mega:hover .mega-menu { display: flex; gap: 24px; }
/* 网格平铺变体：Grid auto-fit 自动列数，居中对齐触发项 */
.has-mega:hover .mega-menu.mega-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px 24px;
  padding: 14px 20px;
  width: 500px;
  box-sizing: border-box;
  left: 50%;
  transform: translateX(-50%);
}
.mega-grid .mega-group {
  padding: 4px 0;
  min-width: 0;
}
.mega-inner { display: contents; }
.mega-col { flex: 1; min-width: 130px; white-space: nowrap; }
.mega-title {
  display: block; font-size: .88rem; font-weight: 700;
  color: var(--accent); margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.mega-title:hover { text-decoration: none; }
.mega-group { margin-bottom: 6px; }
.mega-l2 { display: block; font-size: .88rem; font-weight: 600; color: var(--text); padding: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-l2:hover { color: var(--accent); text-decoration: none; }
.mega-l3 { display: block; font-size: .8rem; color: var(--text-muted); padding: 1px 0 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-l3:hover { color: var(--accent); text-decoration: none; }

/* 工具大菜单（右对齐网格，6分类各一列） */
.has-mega:hover .mega-menu.mega-tools {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 4px 16px;
  padding: 16px;
  width: 820px;
  box-sizing: border-box;
  left: auto;
  right: 0;
  transform: none;
}
.mega-tools .mega-group { padding: 4px 0; min-width: 0; }
.mega-cat-head {
  display: block;
  font-size: .82rem; font-weight: 700;
  color: var(--accent);
  padding: 2px 0 5px;
  margin-bottom: 3px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 工具下拉 */
.dropdown {
  display: none;
  position: absolute; top: 100%; left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 6px 0; z-index: 900;
  list-style: none;
}
.has-drop:hover .dropdown { display: block; }
/* L2 \u53ef\u70b9\u51fb\u94fe\u63a5\uff08\u51b3\u4e3a\u4e00\u4e2a\u5206\u7ec4\u6807\u9898\uff09 */
.drop-l2 {
  display: block; padding: 7px 14px 4px;
  font-size: .9rem; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.drop-l2:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
/* L3 \u5c0f\u4e00\u7ea7\u5185\u5bb9 */
.drop-l3 {
  display: block; padding: 3px 14px 3px 24px;
  font-size: .83rem; color: var(--text-muted); white-space: nowrap;
}
.drop-l3:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
/* \u517c\u5bb9\u65e7 .drop-cat-name / .drop-tool */
.drop-cat-name {
  display: block; padding: 4px 14px 2px;
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.drop-tool { display: block; padding: 6px 14px; font-size: .9rem; color: var(--text); white-space: nowrap; }
.drop-tool:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.drop-group + .drop-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

/* ── 右侧操作区 & 主题切换 ──────────────────────────────── */
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.theme-switcher { display: flex; gap: 2px; }
.theme-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent; background: none;
  cursor: pointer; font-size: 1rem; line-height: 1;
  transition: border-color .15s, transform .1s;
  padding: 0;
}
.theme-btn.active, .theme-btn:hover { border-color: var(--accent); transform: scale(1.15); }

/* ── 汉堡菜单（移动端） ─────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; padding: 6px; cursor: pointer;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端导航面板 */
.mobile-nav {
  display: none;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 8px 16px 16px;
  position: absolute; width: 100%;
  box-shadow: var(--shadow-lg); z-index: 700;
}
.mobile-nav.open { display: block; }
.mobile-menu { list-style: none; padding: 0; margin: 0; }
.mobile-group { padding: 8px 0; border-bottom: 1px solid var(--border); }
.mobile-group:last-child { border-bottom: none; }
.mobile-group-title { display: block; font-weight: 700; font-size: .95rem; color: var(--text); padding: 4px 0 6px; }
.mobile-group-title:hover { color: var(--accent); text-decoration: none; }
.mobile-l1 { display: block; padding: 5px 0 5px 8px; font-size: .9rem; color: var(--text); }
.mobile-l1:hover { color: var(--accent); text-decoration: none; }
.mobile-l2 { display: block; padding: 3px 0 3px 20px; font-size: .85rem; color: var(--text-muted); }
.mobile-l2:hover { color: var(--accent); text-decoration: none; }

/* ── 页面布局 ─────────────────────────────────────────────── */
.page-layout {
  display: grid; grid-template-columns: 1fr var(--sidebar-w);
  gap: 24px; padding: 24px 16px; align-items: start;
}
.content-area { min-width: 0; }

/* ── 广告横幅 ────────────────────────────────────────────── */
.ad-banner-wrap {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; padding: 10px 16px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.ad-banner-wrap .ad-wrap {
  flex: 1 1 260px; max-width: 420px !important;
}
.ad-banner-wrap .ad-placeholder {
  width: 100% !important;
}
.ad-banner-wrap a img {
  width: 100%; height: auto; display: block;
}
@media (max-width: 640px) {
  .ad-banner-wrap .ad-wrap {
    flex: 0 0 100%; max-width: 100% !important;
  }
}

/* ── 广告位占位 ──────────────────────────────────────────── */
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    45deg, var(--bg), var(--bg) 5px, var(--bg-card) 5px, var(--bg-card) 10px
  );
  padding: 16px; text-align: center; color: var(--text-muted);
  margin: 12px auto;
}
.ad-placeholder .ad-ph-name { font-weight: 600; font-size: .95rem; }
.ad-placeholder .ad-ph-size { font-size: .8rem; }
.ad-placeholder .ad-ph-price { color: var(--accent); font-weight: 600; font-size: 1rem; margin: 4px 0; }
.ad-ph-cta {
  margin-top: 6px; padding: 4px 14px;
  background: var(--accent); color: var(--text-inv);
  border-radius: 4px; font-size: .82rem;
}
.ad-image-slot img { max-width: 100%; border-radius: var(--radius); }

/* ── 面包屑 ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: .85rem; color: var(--text-muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ── 标题 ────────────────────────────────────────────────── */
.page-h1 { font-size: 1.7rem; margin-bottom: 8px; }
.page-h1 small { font-size: .8em; font-weight: 400; color: var(--text-muted); }
.page-sub { color: var(--text-muted); margin-bottom: 20px; }

/* ── 分类描述 ────────────────────────────────────────────── */
.cat-desc { color: var(--text-muted); margin-bottom: 18px; font-size: .95rem; }

/* ── 子分类格 ────────────────────────────────────────────── */
.sub-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 24px; }
.sub-cat-card {
  padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); transition: all .15s;
}
.sub-cat-card:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.sub-cat-card strong { display: block; font-size: .95rem; }
.sub-cat-card span { font-size: .8rem; color: var(--text-muted); }

/* ── 教程卡片网格 ────────────────────────────────────────── */
.tutorial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tutorial-grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tutorial-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  color: var(--text); transition: all .2s;
  box-shadow: var(--shadow);
}
.tutorial-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-2px); }
.tutorial-card.small { padding: 12px; }
.tc-cat { font-size: .75rem; color: var(--accent); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.tc-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.tc-summary { font-size: .85rem; color: var(--text-muted); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tc-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: .78rem; color: var(--text-muted); }

/* ── 教程列表（单列） ──────────────────────────────────────── */
.tutorial-list { display: flex; flex-direction: column; gap: 12px; }
.tutorial-list-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color .15s;
}
.tutorial-list-item:hover { border-color: var(--accent); }
.tli-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.tli-title { font-weight: 600; color: var(--text); font-size: .98rem; }
.tli-title:hover { color: var(--accent); }
.tli-date { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.tli-summary { font-size: .88rem; color: var(--text-muted); margin-bottom: 8px; }
.tli-meta { display: flex; gap: 12px; font-size: .82rem; color: var(--text-muted); }
.tli-cat { color: var(--accent); }

/* ── 分页 ────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0; }
.page-btn {
  padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .9rem; transition: all .15s;
}
.page-btn:hover { background: var(--accent); color: var(--text-inv); border-color: var(--accent); text-decoration: none; }
.page-info { font-size: .9rem; color: var(--text-muted); }

/* ── 空提示 ──────────────────────────────────────────────── */
.empty-tip {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: 1rem;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* ── 右侧边栏 ────────────────────────────────────────────── */
.sidebar-right { min-width: 0; }
.sidebar-widget { margin-bottom: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.widget-title { padding: 12px 16px; font-size: .95rem; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--accent-light); color: var(--accent); }
.widget-body { padding: 14px 16px; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  display: inline-block; padding: 3px 10px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 99px; font-size: .8rem;
  transition: background .15s;
}
.tag-pill:hover { background: var(--accent); color: var(--text-inv); text-decoration: none; }

/* 推荐列表 */
.rec-list { display: flex; flex-direction: column; gap: 6px; }
.rec-item { font-size: .88rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.rec-item:last-child { border-bottom: none; }
.rec-item a { color: var(--text); }
.rec-item a:hover { color: var(--accent); }
.rec-item-meta { font-size: .75rem; color: var(--text-muted); }
.rec-more-toggle { display: block; text-align: center; padding: 6px; font-size: .82rem; color: var(--accent); cursor: pointer; }
.rec-hidden { display: none; }

/* 工具推荐 */
.tool-rec-list { display: flex; flex-direction: column; gap: 8px; }
.tool-rec-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tool-rec-item:last-child { border-bottom: none; }
.tool-rec-icon { font-size: 1.4rem; }
.tool-rec-info h4 { font-size: .88rem; font-weight: 600; }
.tool-rec-info p  { font-size: .78rem; color: var(--text-muted); }

/* ── 文章详情 ────────────────────────────────────────────── */
.article-header { margin-bottom: 24px; }
.article-title { font-size: 1.9rem; line-height: 1.35; margin-bottom: 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.article-meta .meta-cat { color: var(--accent); font-weight: 600; }
.article-summary { font-size: 1rem; color: var(--text-muted); border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--accent-light); border-radius: 0 var(--radius) var(--radius) 0; }

/* Markdown 正文 */
.markdown-body { font-size: 1rem; line-height: 1.85; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 1.6em 0 .6em;
  line-height: 1.3;
  color: var(--text);
}
.markdown-body h1 { font-size: 1.7rem; }
.markdown-body h2 { font-size: 1.4rem; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 1.15rem; }
.markdown-body p { margin-bottom: .9em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin-bottom: .9em; }
.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body li { margin-bottom: .3em; }
.markdown-body blockquote {
  border-left: 4px solid var(--accent); padding: 8px 14px;
  background: var(--accent-light); border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1em 0; color: var(--text-muted);
}
.markdown-body code {
  font-family: var(--font-code); font-size: .88em;
  background: var(--bg); padding: 2px 6px;
  border-radius: 4px; border: 1px solid var(--border);
}
.markdown-body pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; overflow-x: auto;
  margin-bottom: 1em;
}
.markdown-body pre code { background: none; border: none; padding: 0; font-size: .9rem; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--accent-light); font-weight: 600; }
.markdown-body tr:nth-child(even) { background: var(--bg); }
.markdown-body img { border-radius: var(--radius); margin: .5em 0; }
.markdown-body a { color: var(--accent); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* 标签 */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 20px 0; }
.article-tags > span { color: var(--text-muted); font-size: .9rem; }

/* 上一篇/下一篇 */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.prev-link a, .next-link a {
  display: flex; flex-direction: column;
  padding: 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: border-color .15s;
}
.prev-link a:hover, .next-link a:hover { border-color: var(--accent); text-decoration: none; }
.next-link { text-align: right; }
.next-link a { align-items: flex-end; }
.pn-label { font-size: .78rem; color: var(--text-muted); }
.pn-title { font-size: .9rem; font-weight: 600; }

/* 系列文章 */
.series-section { margin: 20px 0; padding: 16px; background: var(--accent-light); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.series-section h3 { font-size: 1rem; margin-bottom: 10px; }
.series-list { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; list-style: disc; }
.series-list li a { font-size: .9rem; color: var(--text); }
.series-list li a:hover { color: var(--accent); }

/* 相关分类 */
.related-cats { margin: 20px 0; }
.related-cats h3 { margin-bottom: 10px; }
.rel-cat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-cat-chip {
  padding: 5px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .88rem; color: var(--text);
  transition: all .15s;
}
.rel-cat-chip:hover { background: var(--accent); color: var(--text-inv); border-color: var(--accent); text-decoration: none; }

/* TOC浮动目录 */
.toc-panel {
  display: none;
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
  margin-bottom: 20px; order: -1;
}
.toc-title { font-weight: 600; font-size: .95rem; margin-bottom: 10px; color: var(--text-muted); }
.toc-list { display: flex; flex-direction: column; gap: 2px; padding-left: 0; }
.toc-l1 a { font-weight: 600; padding: 3px 0; }
.toc-l2 { padding-left: 12px; }
.toc-l2 a { font-size: .88rem; padding: 2px 0; }
.toc-l3 { padding-left: 22px; }
.toc-l3 a { font-size: .82rem; padding: 1px 0; }
.toc-link { color: var(--text-muted); display: block; }
.toc-link:hover, .toc-link.active { color: var(--accent); }
/* 防止粘性导航遮住标题锚点 */
.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

@media (min-width: 1100px) {
  .has-toc.page-layout { grid-template-columns: 220px 1fr var(--sidebar-w); }
  .toc-panel { display: block; }
}

/* 推荐区 */
.recommend-section { margin: 24px 0; }
.recommend-section h3 { margin-bottom: 14px; }

/* ── 工具相关 ────────────────────────────────────────────── */
.tool-section { margin-bottom: 32px; }
.tool-cat-h2 { font-size: 1.3rem; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.tool-cat-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 14px; }
.tool-grid-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tool-card-lg {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); transition: all .2s;
}
.tool-card-lg:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.tool-icon-lg { font-size: 2rem; flex-shrink: 0; }
.tool-info { flex: 1; min-width: 0; }
.tool-info h3 { font-size: .95rem; font-weight: 600; margin-bottom: 3px; }
.tool-info p { font-size: .82rem; color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool-arrow { color: var(--text-muted); flex-shrink: 0; }

/* ―― 首页在线工具区（紧凑多列 + CSS Tooltip）――――――――――――― */
.home-tool-section { margin: 0 0 12px; }
.home-tool-cat {
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
  margin: 12px 0 5px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .03em;
}
.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1px 4px;
}
.home-tool-link {
  position: relative;
  display: block;
  padding: 4px 6px;
  font-size: .87rem;
  color: var(--text);
  border-radius: var(--radius);
  transition: background .12s, color .12s;
}
.home-tool-link:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.htl-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 工具名悬停提示框 */
.home-tool-link::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: .78rem;
  color: var(--text);
  white-space: normal;
  width: max-content;
  max-width: 220px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  pointer-events: none;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
}
.home-tool-link:hover::after { opacity: 1; visibility: visible; }

/* 工具详情 */
.tool-detail-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tool-icon-xl { font-size: 3rem; flex-shrink: 0; }
.tool-detail-title { font-size: 1.6rem; margin-bottom: 6px; }
.tool-detail-summary { color: var(--text-muted); font-size: .95rem; margin-bottom: 8px; }
.tool-workspace { margin-bottom: 24px; }
.tool-placeholder-wrap {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-card); border: 2px dashed var(--border);
  border-radius: var(--radius-lg); padding: 40px; text-align: center;
}
.tool-placeholder-icon { font-size: 3rem; margin-bottom: 12px; }
.tool-placeholder-wrap h2 { font-size: 1.4rem; margin-bottom: 8px; }
.tool-placeholder-wrap p { color: var(--text-muted); margin-bottom: 6px; }
.tool-ph-desc { max-width: 400px; }
.tool-ph-features { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.tool-ph-feat { padding: 6px 14px; background: var(--accent-light); color: var(--accent); border-radius: 99px; font-size: .85rem; }

/* ── 工具功能区通用样式 ──────────────────────────────────── */
.tool-func-wrap { max-width: 860px; }
.tool-section-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; color: var(--text-muted); letter-spacing: .02em; }

/* 输入行 */
.conv-input-row { display: flex; gap: 10px; margin-bottom: 20px; align-items: stretch; }
.conv-num-input {
  flex: 1; padding: 11px 14px; font-size: 1.2rem; font-weight: 600;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); min-width: 0;
}
.conv-num-input:focus { outline: none; border-color: var(--accent); }
.conv-unit-sel {
  padding: 11px 14px; font-size: .95rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); cursor: pointer;
}
.conv-unit-sel:focus { outline: none; border-color: var(--accent); }

/* 结果网格 */
.conv-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 24px; }
.conv-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .12s;
}
.conv-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.conv-card.is-source { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.conv-card-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 3px; }
.conv-card-val { font-size: 1.1rem; font-weight: 700; color: var(--text); word-break: break-all; line-height: 1.3; }
.conv-card-unit { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }

/* 参考表 */
.conv-ref { margin-top: 8px; }
.conv-ref table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.conv-ref th { background: var(--bg-card); padding: 7px 10px; text-align: left; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-muted); }
.conv-ref td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.conv-ref tr:last-child td { border-bottom: none; }
.conv-ref tr:nth-child(even) td { background: var(--bg-card); }

/* 温度换算专用 */
.temp-formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 20px; }
.temp-formula-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.temp-formula-card .tf-from { font-size: .82rem; color: var(--text-muted); }
.temp-formula-card .tf-val { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 4px 0; }
.temp-formula-card .tf-unit { font-size: .9rem; color: var(--text-muted); }

/* ── 文本/编码工具双栏布局 ──────────────────────────────── */
.proc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proc-col { display: flex; flex-direction: column; gap: 8px; }
.proc-mode-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.proc-btn { padding: 5px 14px; border: 1.5px solid var(--border); border-radius: 99px; background: var(--bg); color: var(--text); cursor: pointer; font-size: .85rem; transition: all .15s; }
.proc-btn.active, .proc-btn:focus-visible { background: var(--accent); color: var(--text-inv); border-color: var(--accent); outline: none; }
.proc-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.proc-textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: .88rem; font-family: 'Menlo','Consolas','Courier New',monospace; resize: vertical; line-height: 1.55; min-height: 180px; }
.proc-textarea:focus { outline: none; border-color: var(--accent); }
.proc-textarea.proc-textarea-lg { min-height: 260px; }
.proc-act-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proc-out-head { display: flex; justify-content: space-between; align-items: center; }
.proc-out-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.proc-copy-btn { padding: 4px 12px; border: 1.5px solid var(--border); border-radius: 99px; background: var(--bg); color: var(--text-muted); cursor: pointer; font-size: .82rem; transition: all .15s; }
.proc-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 单栏宽文本工具（word-count, id-parser, regex, cron 等） */
.proc-single { max-width: 100%; }
.proc-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 4px; }
.proc-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.proc-stat-val { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.proc-stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

/* ── 计算器工具布局 ────────────────────────────────────── */
.calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; }
.calc-field { display: flex; flex-direction: column; gap: 5px; }
.calc-field label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.calc-input { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: .95rem; width: 100%; box-sizing: border-box; }
.calc-input:focus { outline: none; border-color: var(--accent); }
.calc-select { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: .92rem; width: 100%; box-sizing: border-box; cursor: pointer; }
.calc-result-area { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.calc-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.calc-res-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.calc-res-val { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.calc-res-label { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }
.calc-res-main { font-size: 2rem; font-weight: 700; color: var(--accent); }
.calc-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 14px; }
.calc-table th { background: var(--bg-card); padding: 7px 10px; text-align: left; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-muted); }
.calc-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.calc-table tr:last-child td { border-bottom: none; }

/* ── 开发者专用工具 ──────────────────────────────────────── */
.hash-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.hash-row:last-child { border-bottom: none; }
.hash-label { font-size: .82rem; font-weight: 700; color: var(--text-muted); min-width: 70px; }
.hash-val { font-family: 'Menlo','Consolas',monospace; font-size: .82rem; word-break: break-all; flex: 1; color: var(--text); }
.hash-copy { padding: 2px 9px; border: 1px solid var(--border); border-radius: 99px; background: var(--bg); cursor: pointer; font-size: .76rem; color: var(--text-muted); transition: all .12s; flex-shrink: 0; }
.hash-copy:hover { border-color: var(--accent); color: var(--accent); }
.regex-match { background: color-mix(in srgb, #f59e0b 25%, transparent); border-radius: 2px; cursor: pointer; }
.regex-result-box { font-family: 'Menlo','Consolas',monospace; font-size: .88rem; white-space: pre-wrap; word-break: break-all; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-card); min-height: 120px; line-height: 1.6; }
.cron-next-row { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: .88rem; font-family: 'Menlo','Consolas',monospace; }
.cron-next-row:last-child { border-bottom: none; }
.pw-card { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; }
.pw-val { flex: 1; font-family: 'Menlo','Consolas',monospace; font-size: .9rem; word-break: break-all; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; }
.qr-img { border: 2px solid var(--border); border-radius: var(--radius); background: #fff; padding: 8px; max-width: 260px; }
.ip-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.ip-info-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.ip-info-key { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.ip-info-val { font-size: 1rem; font-weight: 600; margin-top: 3px; }

/* ── 颜色工具 ──────────────────────────────────────────── */
.color-swatch { width: 60px; height: 60px; border-radius: var(--radius); border: 2px solid var(--border); flex-shrink: 0; }
.color-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.color-row:last-child { border-bottom: none; }
.color-key { font-size: .82rem; font-weight: 700; color: var(--text-muted); min-width: 50px; }
.color-val { font-family: 'Menlo','Consolas',monospace; font-size: .9rem; flex: 1; }

/* ── 图片工具 ────────────────────────────────────────────── */
.img-drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: border-color .15s; color: var(--text-muted); }
.img-drop-zone:hover, .img-drop-zone.drag-over { border-color: var(--accent); color: var(--accent); }
.img-drop-icon { font-size: 2.5rem; margin-bottom: 8px; }
.img-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.img-preview-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; }
.img-preview-box img, .img-preview-box canvas { max-width: 100%; max-height: 300px; border-radius: 4px; }
.img-preview-label { font-size: .82rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }

/* 移动端响应式 */
@media (max-width: 640px) {
  .proc-wrap { grid-template-columns: 1fr; }
  .img-preview-row { grid-template-columns: 1fr; }
}

/* ── 移动端底部广告 ──────────────────────────────────────── */
.mobile-sticky-ad { display: none; }

/* ── 友情链接 ────────────────────────────────────────────── */
.friend-links { margin: 32px 0; }
.friend-links h3 { margin-bottom: 12px; }
.fl-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-link {
  padding: 5px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .88rem; color: var(--text-muted);
  transition: all .15s;
}
.fl-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { padding: 48px 16px; text-align: center; }
.hero-title { font-size: 2.4rem; font-weight: 700; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 28px; }
.hero-btns { display: flex; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius); font-size: .95rem;
  font-weight: 500; border: none; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--text-inv); }
.btn-primary:hover { background: var(--accent-dark); color: var(--text-inv); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--text-inv); text-decoration: none; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; text-decoration: none; }
.btn-full { width: 100%; }

/* 分类格 */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.cat-card {
  display: flex; flex-direction: column;
  padding: 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); transition: all .2s;
}
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-2px); }
.cat-icon { font-size: 2rem; margin-bottom: 8px; }
.cat-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.cat-count { font-size: .8rem; color: var(--text-muted); }
.cat-sub-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.cat-sub-list a { font-size: .78rem; color: var(--accent); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-header); border-top: 1px solid var(--border);
  padding: 32px 16px 16px; margin-top: 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px; margin-bottom: 20px;
}
.footer-brand .footer-logo { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.footer-desc { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
.footer-links h4 { font-size: .9rem; font-weight: 700; margin-bottom: 10px; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li a { display: block; font-size: .85rem; color: var(--text-muted); padding: 3px 0; }
.footer-links li a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center; font-size: .82rem; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 14px;
}

/* 回顶按钮 */
.back-top {
  position: fixed; bottom: 28px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: var(--text-inv);
  border: none; font-size: 1.2rem; font-weight: 700;
  box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { background: var(--accent-dark); }

/* ── 管理后台 ────────────────────────────────────────────── */
.admin-body { background: #0f172a; color: #e2e8f0; font-family: var(--font); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #1e293b; border-right: 1px solid #334155;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.admin-logo { padding: 20px 16px; font-size: 1.1rem; font-weight: 700; color: #60a5fa; border-bottom: 1px solid #334155; }
.admin-nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; }
.admin-nav a { padding: 10px 12px; border-radius: 6px; color: #94a3b8; font-size: .92rem; transition: all .15s; }
.admin-nav a:hover, .admin-nav a.active { background: #334155; color: #e2e8f0; text-decoration: none; }
.logout-link { color: #f87171 !important; margin-top: auto; }
.admin-main { flex: 1; min-width: 0; padding: 24px; overflow-y: auto; }
.admin-topbar { margin-bottom: 20px; }
.admin-topbar h1 { font-size: 1.4rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 18px 14px; text-align: center; }
.stat-num { font-size: 2rem; font-weight: 700; color: #60a5fa; }
.stat-label { font-size: .82rem; color: #94a3b8; margin-top: 4px; }
.admin-action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.admin-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 20px; }
.admin-card h3 { font-size: 1rem; margin-bottom: 8px; }
.admin-card p { font-size: .88rem; color: #94a3b8; margin-bottom: 8px; }
.admin-card code { background: #0f172a; padding: 2px 6px; border-radius: 4px; font-size: .85em; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .88rem; margin-bottom: 5px; color: #94a3b8; }
.form-input {
  width: 100%; padding: 9px 12px;
  background: #0f172a; border: 1px solid #334155; border-radius: 6px;
  color: #e2e8f0; font-size: .95rem; font-family: inherit;
}
.form-input:focus { outline: none; border-color: #60a5fa; }
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .92rem; }
.alert-error { background: #7f1d1d; border: 1px solid #ef4444; color: #fecaca; }
.alert-success { background: #14532d; border: 1px solid #22c55e; color: #bbf7d0; }
.text-muted { color: #94a3b8; font-size: .88rem; }
.mt-lg { margin-top: 20px; }
.code-block { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 14px; overflow-x: auto; }
.code-block pre { font-family: var(--font-code); font-size: .82rem; color: #a5b4fc; white-space: pre; }

/* 管理员登录 */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; }
.admin-login-box { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 40px; width: 100%; max-width: 380px; }
.admin-login-box .admin-logo { padding: 0 0 20px; border: none; text-align: center; font-size: 1.4rem; }
.admin-login-box h2 { text-align: center; margin-bottom: 24px; font-size: 1.1rem; color: #94a3b8; }

/* ── 响应式 ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-menu, .mega-menu, .dropdown { display: none !important; }
  .hamburger { display: flex; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar-right { display: none; }
  .prev-next { grid-template-columns: 1fr; }
  .mobile-sticky-ad { display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 600; }
  .admin-sidebar { display: none; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .latest-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-title { font-size: 1.6rem; }
  .article-title { font-size: 1.4rem; }
  .tutorial-grid { grid-template-columns: 1fr; }
  .tool-grid-lg { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 首页最新发布 3列网格 ────────────────────────────────── */
.two-col-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 768px) { .two-col-layout { grid-template-columns: 1fr; } }

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 16px;
}
.latest-item3 {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  min-width: 0;
  transition: color .12s;
}
.latest-item3:hover { color: var(--accent); text-decoration: none; }
.li3-date {
  flex-shrink: 0;
  color: var(--text-muted); font-size: .78rem;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.li3-cat {
  flex-shrink: 0;
  font-size: .72rem; color: var(--accent);
  background: var(--accent-light); padding: 1px 5px; border-radius: 3px;
  white-space: nowrap;
}
.li3-title {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── 友情链接区块 ────────────────────────────────────────── */
.friendlink-section { padding-top: 20px; padding-bottom: 24px; }
.fl-grid { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }
.fl-link {
  padding: 5px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .88rem; color: var(--text-muted);
  transition: all .15s; text-decoration: none;
}
.fl-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── 管理：友情链接表格 ─────────────────────────────────── */
.fl-add-form .fl-form-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.fl-form-row .form-group { flex: 1; min-width: 160px; }
.fl-form-row .form-group-sm { flex: 0 0 110px; min-width: 90px; }
.fl-form-row .form-group-btn { flex: 0 0 auto; min-width: auto; }
.fl-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.admin-table th, .admin-table td {
  padding: 8px 10px; border-bottom: 1px solid #334155; text-align: left;
}
.admin-table th { color: #94a3b8; font-weight: 600; white-space: nowrap; background: #0f172a; }
.admin-table tr:hover td { background: #1e293b; }
.fl-row-disabled td { opacity: .5; }
.fl-name-link { color: #60a5fa; font-weight: 500; }
.fl-name-link:hover { text-decoration: underline; }
.fl-url-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-actions { display: flex; gap: 6px; }
.fl-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #14532d; color: #86efac; }
.badge-muted   { background: #1e293b; color: #64748b; }
.btn-xs {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: .78rem; cursor: pointer; border: 1px solid transparent;
  background: none; font-family: inherit;
}
.btn-xs-ok   { border-color: #22c55e; color: #22c55e; }
.btn-xs-ok:hover { background: #14532d; }
.btn-xs-warn { border-color: #f59e0b; color: #f59e0b; }
.btn-xs-warn:hover { background: #451a03; }
.btn-xs-del  { border-color: #ef4444; color: #ef4444; }
.btn-xs-del:hover { background: #7f1d1d; }
.required { color: #f87171; }
