/**
 * QXTool 公共样式
 * 亮色 + 暗色双主题
 */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #ea580c;
  
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: #ffffff;
  --bg-footer: #1e293b;
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  
  --radius: 12px;
  --radius-sm: 8px;
}

/* 暗色主题 */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-header: #1e293b;
  --bg-footer: #020617;
  
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}
[data-theme="dark"] .nav-list { background: rgba(255,255,255,0.04); }

/* 暗色模式全局覆盖 Bootstrap 硬编码文字色 */
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .text-secondary { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-dark { color: var(--text) !important; }

* { box-sizing: border-box; }
body {
  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;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; padding-top: 16px; }

/* ============ 顶部导航（新版参考图风格）============ */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-header);
  z-index: 1000;
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: var(--shadow-lg); }

/* 第一行容器 */
.header-top { background: var(--bg-header); }
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

/* 右侧 group：搜索框 + 图标 */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  font-size: 2rem;
  line-height: 1;
}
.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.logo-title {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.5px;
}
.site-logo:hover .logo-title { color: var(--primary); }

/* 搜索框 */
.header-search {
  width: 470px;
  max-width: 470px;
  min-width: 300px;
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 30px;
  overflow: visible;
  height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.search-engine-select {
  position: relative;
  display: flex;
}
.engine-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.engine-btn:hover { color: var(--primary); }
.engine-caret { font-size: 0.7rem; color: var(--text-muted); }
.engine-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  margin-top: 8px;
  display: none;
  z-index: 9999;
}
.engine-dropdown.show { display: block; }
.engine-option {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}
.engine-option:hover { background: rgba(37,99,235,0.08); color: var(--primary); }
.engine-option.active { color: var(--primary); font-weight: 600; }

.search-input {
  flex: 1;
  border: none;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  min-width: 0;
}
.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  padding: 0 22px;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 0 28px 28px 0;
}
.search-btn:hover { background: var(--primary-hover); }

/* 右侧图标区 */
.header-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
/* 手机端：没有搜索框时，图标强制靠右 */
@media (max-width: 767.98px) {
  .header-icons { margin-left: auto; }
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 1rem;
}
.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37,99,235,0.05);
  transform: translateY(-1px);
}

/* 微信弹窗 */
.icon-wrapper { position: relative; }
.wechat-popup {
  position: absolute;
  top: 50px;
  right: -10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: none;
  z-index: 1100;
  min-width: 160px;
  text-align: center;
}
.wechat-popup.show { display: block; animation: popIn 0.2s ease; }
.wechat-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px; height: 10px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.wechat-popup img {
  width: 140px; height: 140px;
  border-radius: 8px;
  object-fit: cover;
}
.wechat-tip { padding: 10px 0; }
.wechat-tip i { font-size: 2rem; color: #07c160; margin-bottom: 8px; }
.wechat-tip p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* 分类导航行 */
.header-nav {
  padding: 0;
}
.header-nav .container {
  padding-top: 0;
  padding-bottom: 0;
}

/* 压缩面包屑和内容顶部间距 */
.container > nav[aria-label="breadcrumb"] { margin-bottom: 12px !important; }
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 0;
  overflow-x: auto;
  white-space: nowrap;
  background: rgb(171 150 150 / 6%);
  border-radius: 8px;
}
.nav-item a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-item a:hover {
  color: var(--primary);
  background: rgba(37,99,235,0.08);
}
.nav-item.active a {
  color: var(--primary);
  background: rgba(37,99,235,0.1);
}
.nav-icon { font-size: 0.95rem; }

/* 移动端搜索框（独立一行，居中） */
.mobile-search-bar {
  padding: 0 0 4px 0;
}
.mobile-search-inner {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  height: 40px;
}
.mobile-engine-select {
  max-width: 80px;
  border: none;
  border-right: 1px solid var(--border);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 12px 12px;
  -webkit-appearance: none;
  appearance: none;
  font-size: 0.85rem;
  padding: 0 20px 0 8px;
  color: var(--text);
}
[data-theme="dark"] .mobile-engine-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.mobile-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  padding: 0 12px;
  color: var(--text);
}
.mobile-search-btn {
  border: none;
  border-radius: 0;
  padding: 0 16px;
}

/* 移动端菜单 */
.mobile-menu {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: none;
}
.mobile-menu.show { display: block; animation: slideDown 0.25s ease; }
.mobile-search { margin-bottom: 16px; }
.mobile-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.mobile-nav a:hover { color: var(--primary); border-color: var(--primary); }

@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Hero ============ */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #ede9fe 100%);
  border-radius: var(--radius);
  margin-bottom: 40px;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2a4a 50%, #2d1b4e 100%);
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}
.hero-stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============ 分类卡片 ============ */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--primary);
  text-decoration: none;
}
.section-title a:hover { text-decoration: underline; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.cat-card {
  padding: 24px;
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}
.cat-card:hover {
  transform: translateY(-4px);
  color: white;
  box-shadow: var(--shadow-lg);
}
.cat-card-icon { font-size: 2rem; margin-bottom: 8px; }
.cat-card-name { font-size: 1.1rem; font-weight: 700; }
.cat-card-count { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }

/* ============ 工具卡片 ============ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  display: block;
  position: relative;
  overflow: visible;
}
.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--text);
}
.tool-card-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  margin-right: 10px;
  flex-shrink: 0;
  vertical-align: middle;
}
.tool-card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.tool-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  display: inline;
  line-height: 36px;
  vertical-align: middle;
  word-break: break-all;
}
.tool-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  min-height: 1.2em;
}
.tool-card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tool-card-stats i { margin-right: 3px; }

/* 置顶徽章 */
.tool-top .tool-top-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #fbbf24;
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

/* 右上角角标组（上新 / 置顶，约三分之一突出卡片顶角） */
.tool-card-badges {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  gap: 4px;
  z-index: 6;
}
.tool-card-badges .tool-top-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: #fbbf24;
  color: #fff;
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}
.tool-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.tool-card-badge { display: none; }

/* ============ 热门工具横向滚动 ============ */
.hot-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.hot-scroll::-webkit-scrollbar { height: 6px; }
.hot-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hot-card {
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}
.hot-card:hover { border-color: var(--primary); color: var(--primary); }
.hot-card .rank {
  display: inline-block;
  width: 20px; height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 0.7rem;
  border-radius: 50%;
  margin-right: 6px;
  background: #f1f5f9;
  color: var(--text-muted);
}
.hot-card:nth-child(1) .rank { background: #ef4444; color: white; }
.hot-card:nth-child(2) .rank { background: #f97316; color: white; }
.hot-card:nth-child(3) .rank { background: #eab308; color: white; }

/* ============ 分类 section ============ */
.category-section {
  margin-bottom: 28px;
}
.category-section .section-title {
  margin: 0;
  padding: 16px 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.category-section .section-title a {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s;
}
.category-section .section-title a:hover {
  text-decoration: underline;
}
.category-section .tool-grid {
  padding: 12px 0 0;
  margin: 0;
}

/* ============ 首页热门 / 最新 Tab 切换 ============ */
.home-hot-tabs {
  display: inline-flex;
  gap: 20px;
}
.home-hot-tab {
  position: relative;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 4px 8px;
  cursor: pointer;
  transition: color .25s ease;
}
.home-hot-tab:hover {
  color: var(--primary);
}
.home-hot-tab.active {
  color: var(--primary);
}
/* 选中标题下方的指示线 */
.home-hot-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #764ba2);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.home-hot-tab.active::after {
  transform: scaleX(1);
}
.home-hot-tab:active { transform: scale(.96); }
.home-hot-panel { display: none; }
.home-hot-panel.active {
  display: block;
  animation: homeHotFade .38s cubic-bezier(.22,.61,.36,1);
}
@keyframes homeHotFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .home-hot-tab, .home-hot-panel.active { transition: none; animation: none; }
}
@media (max-width: 576px) {
  .home-hot-tabs { gap: 16px; }
  .home-hot-tab { font-size: .88rem; padding: 4px 6px 6px; }
}

/* ============ 工具详情页 ============ */
.tool-detail-header {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 24px;
}
.tool-detail-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.tool-detail-desc { color: var(--text-secondary); margin-bottom: 16px; }
.tool-meta { color: var(--text-muted); font-size: 0.85rem; }
.tool-meta a { text-decoration: none; }
.tool-meta a:hover { text-decoration: none; opacity: .8; }

.tool-body {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 24px;
}

.tool-usage {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
}
.tool-usage h3 { font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; color: var(--primary); }
.tool-usage h4 { font-weight: 600; font-size: .95rem; margin: 14px 0 6px; }
.tool-usage p { color: var(--text-secondary); margin-bottom: 8px; font-size: .9rem; line-height: 1.75; }
.tool-usage ol, .tool-usage ul { padding-left: 20px; color: var(--text-secondary); font-size: .9rem; line-height: 1.75; }
.tool-usage ol li, .tool-usage ul li { margin-bottom: 4px; }

/* ============ 点赞 & 打赏 ============ */
.tool-like-reward {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  margin-bottom: 24px;
  border: none;
}
.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: #f3f4f6;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .88rem;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}
.btn-like:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.07);
}
.btn-like.liked {
  background: #ef4444;
  color: white;
  cursor: default;
}
.btn-reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: #f3f4f6;
  color: #d97706;
  font-weight: 500;
  font-size: .88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-reward:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}
/* 暗色主题：浅灰底改为半透明白 */
[data-theme="dark"] .btn-like:not(.liked),
[data-theme="dark"] .btn-reward {
  background: rgba(255, 255, 255, 0.08);
}
/* 电脑端评分星星缩小（内联 22px 需 important 覆盖） */
.tool-rating { font-size: .82rem; }
.star-rating i { font-size: 18px !important; }

/* 上一篇 / 下一篇：无边框、小尺寸 */
.tool-prev-next { margin-top: 14px !important; margin-bottom: 14px !important; }
.tool-prev-next .btn {
  border: none;
  background: #f3f4f6;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.tool-prev-next .btn:hover {
  color: var(--primary);
  background: #e9eaee;
}

/* ============ 相关推荐 ============ */
.related-section {
  margin-bottom: 16px;
}
.related-art-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 24px;
}
.related-art-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px dashed var(--border);
}
.related-art-item:hover { color: var(--primary); }
.related-art-item i { color: var(--primary); flex-shrink: 0; font-size: 0.8rem; }
.related-art-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .related-art-list { grid-template-columns: 1fr; gap: 0; }
}

/* ============ 评论区 ============ */
.comments-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 24px;
}
.comment-form textarea {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
}
.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card-hover, #f1f5f9);
}
.comment-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-user { font-weight: 600; color: var(--primary); }
.comment-time { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; }
.comment-admin-badge {
  background: #ff5722;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 7px;
}
.comment-content { color: var(--text-secondary); }
.comment-reply-btn {
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.reply-list {
  margin-left: 24px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-top: 8px;
}

@media (max-width: 576px) {
  .comment-item {
    gap: 8px;
    padding: 12px 0;
  }
  .comment-avatar {
    width: 32px;
    height: 32px;
  }
  .reply-list {
    margin-left: 4px;
    padding-left: 10px;
  }
  .reply-list .comment-head {
    flex-wrap: wrap;
    row-gap: 2px;
    margin-bottom: 4px;
  }
  .reply-list .comment-user {
    max-width: calc(100% - 58px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .reply-list .comment-admin-badge {
    padding: 1px 6px;
    font-size: 0.68rem;
    border-radius: 5px;
    white-space: nowrap;
  }
  .reply-list .comment-time {
    flex: 0 0 100%;
    margin-left: 0;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

/* ============ 文章 ============ */
.article-list-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 0;
  padding: 0 0 16px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.article-list-item:hover {
  color: var(--primary);
}
.article-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.article-summary { color: var(--text-secondary); font-size: 0.9rem; }

.article-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.article-content h1, .article-content h2, .article-content h3 { font-weight: 700; margin: 24px 0 12px; }
.article-content p { margin-bottom: 12px; color: var(--text-secondary); }
.article-content pre { background: #1e293b; color: #f1f5f9; padding: 16px; border-radius: 8px; overflow-x: auto; }
.article-content code { background: rgba(37,99,235,0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.article-content img { max-width: 100%; border-radius: 8px; }
.article-content blockquote { border-left: 4px solid var(--primary); padding-left: 16px; color: var(--text-secondary); }

/* ============ 侧边栏 ============ */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.sidebar-card h5 { font-weight: 700; margin-bottom: 12px; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 6px; }
.sidebar-list a { color: var(--text-secondary); text-decoration: none; display: flex; justify-content: space-between; }
.sidebar-list a:hover { color: var(--primary); }
.sidebar-list .count { color: var(--text-muted); font-size: 0.8rem; }

/* ============ 搜索 ============ */
.search-form .form-control {
  border-radius: 20px 0 0 20px;
  border-color: var(--border);
  padding: 10px 20px;
}
.search-engines {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.search-engines .btn { border-radius: 20px; font-size: 0.85rem; }

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-footer);
  color: #cbd5e1;
  padding: 40px 0 20px;
  margin-top: 60px;
}
.footer-title { color: white; font-weight: 700; margin-bottom: 16px; font-size: 1rem; }
.footer-desc { color: #94a3b8; font-size: 0.9rem; }
.footer-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.footer-cat-link { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; }
.footer-cat-link:hover { color: white; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: white; }
.footer-bottom {
  padding-top: 16px;
  margin-top: 4px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}
/* 新 footer 布局 */
.footer-main { margin-bottom: 8px; }
.footer-about-box { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 12px 14px; }
.footer-about-box .footer-desc { line-height: 1.6; margin: 0; }
.footer-contact-list { list-style: none; padding: 0; margin: 0; }
.footer-contact-list li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-contact-list li a, .footer-contact-list li { color: #cbd5e1; text-decoration: none; }
.footer-contact-list li a:hover { color: #fff; }
.footer-contact-list i { width: 18px; color: #94a3b8; }
.footer-qr { max-width: 130px; width: 100%; border-radius: 8px; }
/* 标题与二维码左对齐：收缩包裹后整体仍居中 */
.footer-qr-box { display: inline-block; text-align: left; }
.footer-qr-box .footer-title { text-align: left; }
.footer-qr-placeholder { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 20px 10px; color: #64748b; }
.footer-friend-links { padding: 14px 0; }
.footer-friend-links a { color: #94a3b8; text-decoration: none; font-size: 0.85rem; }
.footer-friend-links a:hover { color: #fff; }
.footer-fl-label { color: #cbd5e1; font-weight: 600; font-size: 0.85rem; margin-right: 4px; }
.footer-divider { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 16px 0 12px; }
.footer-bottom p { margin: 0 0 4px; }
.footer-bottom a { color: #64748b; text-decoration: none; }
.footer-bottom a:hover { color: #cbd5e1; }
.footer-custom-html { margin-top: 8px; }
/* 手机端微调 */
@media (max-width: 768px) {
  .footer-main .footer-title { margin-bottom: 10px; font-size: 0.9rem; }
  .footer-qr { max-width: 100px; }
}

/* ============ 工具页通用组件 ============ */
.tool-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
.tool-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
/* 200px 最小高度仅给多行文本框；单行输入框/下拉框保持正常控件高度，避免被强行撑大 */
textarea.tool-input { min-height: 200px; resize: vertical; }
input.tool-input,
select.tool-input { min-height: 38px; padding: 7px 12px; }
select.tool-input { font-family: inherit; }
/* 短控件不撑满整行（仅桌面端，手机端保持满宽）：
   tool-input 系默认收窄；处于栅格多列（.col / col-*）内时豁免、填满所在列。
   form-control / form-select 系自定义布局多，仅纯单列 col-12（无任何断点栅格类）容器收窄。 */
@media (min-width: 768px) {
  select.tool-input { max-width: 220px; }
  input.tool-input[type="number"] { max-width: 170px; }
  input.tool-input[type="file"] { max-width: 520px; }
  input.tool-input[type="color"] { max-width: 52px; }
  input.tool-input[type="date"],
  input.tool-input[type="time"],
  input.tool-input[type="datetime-local"],
  input.tool-input[type="month"],
  input.tool-input[type="week"] { max-width: 200px; }
  /* 栅格多列布局内短控件保持填满列宽（任意包裹层级），不收窄 */
  body [class~="col"] .tool-input,
  body [class*="col-"]:not([class~="col-12"]) .tool-input,
  body [class*="col-sm-"]:not([class~="col-sm-12"]) .tool-input,
  body [class*="col-md-"]:not([class~="col-md-12"]) .tool-input,
  body [class*="col-lg-"]:not([class~="col-lg-12"]) .tool-input,
  body [class*="col-xl-"]:not([class~="col-xl-12"]) .tool-input,
  body [class*="col-xxl-"]:not([class~="col-xxl-12"]) .tool-input,
  /* 工具自定义多列/并排容器内短控件保持原状（共808个容器类，自动扫描生成） */
  body .abpm-result .tool-input, body .abpm-tabs .tool-input, body .ac-dms .tool-input, body .ac-row .tool-input, body .acut-inline .tool-input, body .ad2-bar .tool-input,
  body .ad2-tool .tool-input, body .aefx-inline .tool-input, body .al-grid .tool-input, body .al-row .tool-input, body .alm-grid .tool-input, body .alm-row .tool-input,
  body .amrg-ops .tool-input, body .amrg-row .tool-input, body .amtp-beats .tool-input, body .amtp-inline .tool-input, body .an-group .tool-input, body .an-row .tool-input,
  body .ann-grid .tool-input, body .ann-row .tool-input, body .ap-grid .tool-input, body .ap-row .tool-input, body .ap-tabs .tool-input, body .apirl-tool .tool-input,
  body .aptc-inline .tool-input, body .aspq-inline .tool-input, body .ast-info .tool-input, body .atun-scale .tool-input, body .atun-targets .tool-input, body .av-bar .tool-input,
  body .av-grid .tool-input, body .av-tool .tool-input, body .avol-ctl .tool-input, body .awv-inline .tool-input, body .bc-chart .tool-input, body .bc-head .tool-input,
  body .bc-hours .tool-input, body .bc-tip .tool-input, body .bc-tool .tool-input, body .bd-check .tool-input, body .bd-line .tool-input, body .bd-stage .tool-input,
  body .be-grid .tool-input, body .be-row .tool-input, body .bech-row .tool-input, body .bf-grid .tool-input, body .bf-tool .tool-input, body .bg-line .tool-input,
  body .bg-stage .tool-input, body .bl .tool-input, body .blend-controls .tool-input, body .blend-tool .tool-input, body .bmr-cards .tool-input, body .bmr-grid .tool-input,
  body .bmr-tool .tool-input, body .bn-preview .tool-input, body .bn-row .tool-input, body .br-line .tool-input, body .br-stage .tool-input, body .bs-line .tool-input,
  body .bs-stage .tool-input, body .bsa-cards .tool-input, body .bsa-grid .tool-input, body .bsa-tool .tool-input, body .bsfam-row .tool-input, body .bt-ctrl .tool-input,
  body .bt-fields .tool-input, body .bt-grid .tool-input, body .bt-row .tool-input, body .bt-tool .tool-input, body .btr-info .tool-input, body .bts-info .tool-input,
  body .calc-grid .tool-input, body .cc-bar .tool-input, body .cc-grid .tool-input, body .cc-row .tool-input, body .ccc-board .tool-input, body .ccc-cell .tool-input,
  body .ccc-info .tool-input, body .ccc-piece .tool-input, body .cd-target .tool-input, body .cd-units .tool-input, body .ch-h .tool-input, body .chk .tool-input,
  body .chm-check .tool-input, body .chm-grid .tool-input, body .ci-grid .tool-input, body .ci-item .tool-input, body .ci-row .tool-input, body .cit-grid .tool-input,
  body .cit-row .tool-input, body .ck-preview .tool-input, body .cl-grid .tool-input, body .cl-row .tool-input, body .clamp-grid .tool-input, body .clamp-tool .tool-input,
  body .clc-bar .tool-input, body .clc-tabs .tool-input, body .clip-preview-wrap .tool-input, body .clip-tool .tool-input, body .clr-copyrow .tool-input, body .clr-pickrow .tool-input,
  body .clr-slider .tool-input, body .clr-tri .tool-input, body .cm-cats .tool-input, body .cm-grid .tool-input, body .cn-row .tool-input, body .co-row .tool-input,
  body .cols-controls .tool-input, body .cols-tool .tool-input, body .coord-grid .tool-input, body .coord-row .tool-input, body .cp-row .tool-input, body .cq-row .tool-input,
  body .cquery-tool .tool-input, body .cr-grid .tool-input, body .cr-row .tool-input, body .cron-chips .tool-input, body .crw-board .tool-input, body .crw-cell .tool-input,
  body .crw-info .tool-input, body .csvcols-pick .tool-input, body .csvedit-bar .tool-input, body .csvex-bar .tool-input, body .csvhtml-bar .tool-input, body .csvmd-bar .tool-input,
  body .csvmock-bar .tool-input, body .csvmock-col .tool-input, body .csvpivot-bar .tool-input, body .csvsamp-bar .tool-input, body .csvsplit-bar .tool-input, body .csvsql-bar .tool-input,
  body .csvvc-bar .tool-input, body .ct-grid .tool-input, body .ct-panel .tool-input, body .ct-result .tool-input, body .ct-row .tool-input, body .ct-rule .tool-input,
  body .curlb-check .tool-input, body .curlb-hrow .tool-input, body .cv-form .tool-input, body .cv-row .tool-input, body .cv-summary .tool-input, body .cv-tabs .tool-input,
  body .cx-row .tool-input, body .db-grid .tool-input, body .db-row .tool-input, body .dbbl-chks .tool-input, body .dbcs-grid .tool-input, body .dbcs-tool .tool-input,
  body .dc-bar .tool-input, body .dc-dice .tool-input, body .dc-die .tool-input, body .dc-grid .tool-input, body .dc-row .tool-input, body .dc-tool .tool-input,
  body .dc2l-chk .tool-input, body .dca-grid .tool-input, body .dca-row .tool-input, body .dcalc-grid .tool-input, body .dcon-btns .tool-input, body .dcov-cards .tool-input,
  body .dcyx-cards .tool-input, body .ddpa-cards .tool-input, body .dgan-row .tool-input, body .diff-grid .tool-input, body .dist-grid .tool-input, body .dist-row .tool-input,
  body .djest-chks .tool-input, body .dl .tool-input, body .dmee-row .tool-input, body .dms-grid .tool-input, body .dms-row .tool-input, body .dosepair .tool-input,
  body .dp-ctrl .tool-input, body .dp-grid .tool-input, body .dp-items .tool-input, body .dp-row .tool-input, body .dprt-preset .tool-input, body .dr-grid .tool-input,
  body .dr-row .tool-input, body .drip-grid .tool-input, body .drip-row .tool-input, body .drlp-checks .tool-input, body .ds-row .tool-input, body .dsbk-chks .tool-input,
  body .dsbk-subchks .tool-input, body .dt-row .tool-input, body .dt-tabs .tool-input, body .dt2-bar .tool-input, body .dt2-tool .tool-input, body .dtsc-checks .tool-input,
  body .dtsc-preset .tool-input, body .dv-check .tool-input, body .dv-line .tool-input, body .dv-row .tool-input, body .dwpk-checks .tool-input, body .eb-grid .tool-input,
  body .eb-row .tool-input, body .ec-grid .tool-input, body .ec-row .tool-input, body .eg-row .tool-input, body .el-grid .tool-input, body .el-row .tool-input,
  body .em-dim .tool-input, body .em-meta .tool-input, body .em-scale .tool-input, body .em-tool .tool-input, body .em2-bar .tool-input, body .em2-tool .tool-input,
  body .emoj-bar .tool-input, body .emoj-grid .tool-input, body .en-bar .tool-input, body .en-meta .tool-input, body .en-scale .tool-input, body .en-tool .tool-input,
  body .ep-row .tool-input, body .eq-coef .tool-input, body .eq-coefs .tool-input, body .eq-row .tool-input, body .fa2-grid .tool-input, body .fa2-li .tool-input,
  body .fa2-list .tool-input, body .fa2-tool .tool-input, body .fam-cards .tool-input, body .fam-sub .tool-input, body .fam-tool .tool-input, body .fb-row .tool-input,
  body .fby-cards .tool-input, body .fby-tool .tool-input, body .fcc-cards .tool-input, body .fcc-tool .tool-input, body .fd-row .tool-input, body .ffg-grid .tool-input,
  body .ffg-to-row .tool-input, body .ffm-cards .tool-input, body .ffm-tool .tool-input, body .fib-grid .tool-input, body .fib-row .tool-input, body .fin-cards .tool-input,
  body .fin-tool .tool-input, body .fld-row .tool-input, body .fm-grid .tool-input, body .fm-inline .tool-input, body .fm-rrow .tool-input, body .fop-cards .tool-input,
  body .fop-tool .tool-input, body .fp-func-item .tool-input, body .fp-row .tool-input, body .fpen-cards .tool-input, body .fpen-tool .tool-input, body .fpf-cards .tool-input,
  body .fpf-tool .tool-input, body .fpp-cards .tool-input, body .fpp-tool .tool-input, body .fq-grid .tool-input, body .fq-row .tool-input, body .fr-row .tool-input,
  body .ft-grid .tool-input, body .ft-row .tool-input, body .funAcg-item .tool-input, body .funAcg-list .tool-input, body .funAcg-tabs .tool-input, body .funAcg-tool .tool-input,
  body .funBz-pillars .tool-input, body .funBz-tool .tool-input, body .funCa-btns .tool-input, body .funCa-tool .tool-input, body .funCg-row .tool-input, body .funCg-tool .tool-input,
  body .funEat-chips .tool-input, body .funEat-display .tool-input, body .funEat-tool .tool-input, body .funFt-item .tool-input, body .funFt-tool .tool-input, body .funLp-bar .tool-input,
  body .funLp-tool .tool-input, body .funLy-line .tool-input, body .funLy-tool .tool-input, body .funLy-yao .tool-input, body .funPt-controls .tool-input, body .funPt-tool .tool-input,
  body .funQn-item .tool-input, body .funQn-list .tool-input, body .funQn-tool .tool-input, body .funSl-opt .tool-input, body .funSl-tool .tool-input, body .funWx-cards .tool-input,
  body .funWx-tool .tool-input, body .funZd-grid .tool-input, body .funZd-tool .tool-input, body .fv-preview .tool-input, body .fv-row .tool-input, body .fwr-row .tool-input,
  body .fwrule-tool .tool-input, body .fx-item .tool-input, body .fx-line .tool-input, body .fx-preview .tool-input, body .fxp-cards .tool-input, body .fxp-rates .tool-input,
  body .fxp-tool .tool-input, body .g2048-cell .tool-input, body .g2048-grid .tool-input, body .g2048-info .tool-input, body .gbbl-btns .tool-input, body .gbbl-next .tool-input,
  body .gbrk-btns .tool-input, body .gcar-logo .tool-input, body .gcar-options .tool-input, body .gcar-progress .tool-input, body .gd-item .tool-input, body .gd-line .tool-input,
  body .gflg-flag .tool-input, body .gflg-options .tool-input, body .gflg-progress .tool-input, body .gidm-inputs .tool-input, body .gidm-progress .tool-input, body .gifFrames-grid .tool-input,
  body .gifmake-item .tool-input, body .gifmake-list .tool-input, body .gifmerge-list .tool-input, body .gifmerge-parts .tool-input, body .gifmerge-tabs .tool-input, body .gifrev-compare .tool-input,
  body .gl-line .tool-input, body .gl-stage .tool-input, body .glnk-btns .tool-input, body .gm-grid .tool-input, body .gm-row .tool-input, body .gm-track .tool-input,
  body .gmk-board .tool-input, body .gmk-cell .tool-input, body .gmk-info .tool-input, body .gmth-btns .tool-input, body .gp-line .tool-input, body .gp-stop .tool-input,
  body .gpln-btns .tool-input, body .gps-grid .tool-input, body .gps-row .tool-input, body .gqls-tool .tool-input, body .gr-ctrl .tool-input, body .gr-node .tool-input,
  body .grid-progress .tool-input, body .grpcs-tool .tool-input, body .gs-bar-lab .tool-input, body .gs-cards .tool-input, body .gs-cities .tool-input, body .gs-row .tool-input,
  body .gt-line .tool-input, body .gt-stage .tool-input, body .gtet-btns .tool-input, body .gtet-next .tool-input, body .gw-line .tool-input, body .gw-stage .tool-input,
  body .gz-grid .tool-input, body .gz-row .tool-input, body .gz-tabs .tool-input, body .hbpr-checkrow .tool-input, body .hbpr-seg .tool-input, body .hcbl-opts .tool-input,
  body .histo-stat .tool-input, body .hp-arr .tool-input, body .hp-cell .tool-input, body .hp-ctrl .tool-input, body .hp-node .tool-input, body .hrea-results .tool-input,
  body .hrea-tabs .tool-input, body .hslb-opts .tool-input, body .ht-bucket .tool-input, body .ht-chain .tool-input, body .ht-ctrl .tool-input, body .ht-item .tool-input,
  body .ht-row .tool-input, body .htcm-bar-row .tool-input, body .htcm-opts .tool-input, body .hvis-arrows .tool-input, body .hvis-stage .tool-input, body .hw-row .tool-input,
  body .ibbd-list .tool-input, body .ibmr-inline .tool-input, body .ibmr-row .tool-input, body .ic-btns .tool-input, body .ic-grid .tool-input, body .ic-pal .tool-input,
  body .ic-preview .tool-input, body .ic-row .tool-input, body .ic-sizes .tool-input, body .ic2-bar .tool-input, body .ic2-tool .tool-input, body .ictm-preview .tool-input,
  body .ictm-slider-row .tool-input, body .idth-preview .tool-input, body .ifye-preview .tool-input, body .ifye-slider-row .tool-input, body .ig-row .tool-input, body .igbl-preview .tool-input,
  body .igbl-slider-row .tool-input, body .ii-bar .tool-input, body .ii-tool .tool-input, body .ii-types .tool-input, body .imadj-ctl .tool-input, body .imadj-grid .tool-input,
  body .imas-ctl .tool-input, body .imav-ctl .tool-input, body .imbt-row .tool-input, body .imcpr-ctl .tool-input, body .imcrp-ctl .tool-input, body .imdt-ctl .tool-input,
  body .imdt-presets .tool-input, body .imflt-btns .tool-input, body .imflt-ctl .tool-input, body .imgcv-ctl .tool-input, body .immsc-btns .tool-input, body .immsc-ctl .tool-input,
  body .impx-ctl .tool-input, body .imrd-ctl .tool-input, body .imrsz-ctl .tool-input, body .imsl-ctl .tool-input, body .imst-ctl .tool-input, body .imst-thumbs .tool-input,
  body .imwmk-ctl .tool-input, body .imwmk-grid .tool-input, body .imwmk-tabs .tool-input, body .inf-grid .tool-input, body .inf-row .tool-input, body .inmp-preview .tool-input,
  body .inmp-slider-row .tool-input, body .ipst-preview .tool-input, body .ipst-slider-row .tool-input, body .iq-row .tool-input, body .iqtz-preview .tool-input, body .iqtz-stats .tool-input,
  body .irr-grid .tool-input, body .irr-row .tool-input, body .ishp-preview .tool-input, body .ishp-slider-row .tool-input, body .it-grid .tool-input, body .it-row .tool-input,
  body .iv-card .tool-input, body .iv-pickrow .tool-input, body .iw-grid .tool-input, body .iw-row .tool-input, body .iw-tool .tool-input, body .jd-grid .tool-input,
  body .jd-row .tool-input, body .jd-tabs .tool-input, body .jos-info .tool-input, body .jos-person .tool-input, body .kb-count .tool-input, body .kb-key .tool-input,
  body .kb-row .tool-input, body .kf-preview .tool-input, body .krow .tool-input, body .lap-row .tool-input, body .lbc-row .tool-input, body .lbc-tool .tool-input,
  body .ld-preview .tool-input, body .lg-grid .tool-input, body .lg-line .tool-input, body .lg-row .tool-input, body .lg-stage .tool-input, body .lifeCo-row .tool-input,
  body .lifeColor-grid .tool-input, body .lifeColor-sw .tool-input, body .lifeDyn-head .tool-input, body .lifeHol-bar .tool-input, body .lifeHol-row .tool-input, body .lifeKin-chain .tool-input,
  body .lifeKin-pad .tool-input, body .lifeKin-result .tool-input, body .lifePaper-row .tool-input, body .lifeTcm-head .tool-input, body .lifeTier-chips .tool-input, body .lifeTier-label .tool-input,
  body .lifeTier-tabs .tool-input, body .lifeTs-icon .tool-input, body .lifeTs-row .tool-input, body .lifeTs-tabs .tool-input, body .ll-box .tool-input, body .ll-ctrl .tool-input,
  body .ll-node .tool-input, body .ll-stage .tool-input, body .lm-row .tool-input, body .ln-row .tool-input, body .ln-tabs .tool-input, body .ln-tags .tool-input,
  body .lp-panel .tool-input, body .lpr-grid .tool-input, body .lpr-row .tool-input, body .lr-grid .tool-input, body .lr-row .tool-input, body .lrc-bar .tool-input,
  body .lrc-mbtns .tool-input, body .lrc-row .tool-input, body .lt-line .tool-input, body .lt-tool .tool-input, body .lt-types .tool-input, body .m-row .tool-input,
  body .maca-check .tool-input, body .maz-info .tool-input, body .mb-dim .tool-input, body .mb-meta .tool-input, body .mb-opt .tool-input, body .mb-tool .tool-input,
  body .mb-track .tool-input, body .mcm-inline .tool-input, body .mcm-tool .tool-input, body .mdd-grid .tool-input, body .mdd-row .tool-input, body .mg-grid .tool-input,
  body .mg-row .tool-input, body .mg-stop .tool-input, body .mgocs-tool .tool-input, body .mk-avatar .tool-input, body .mk-rows .tool-input, body .mk-tool .tool-input,
  body .ml-grid .tool-input, body .ml-row .tool-input, body .mmc-inline .tool-input, body .mmc-tool .tool-input, body .mmod-row .tool-input, body .mmod-tool .tool-input,
  body .mnd-inline .tool-input, body .mnd-tool .tool-input, body .mni-inline .tool-input, body .mni-tool .tool-input, body .mq-line .tool-input, body .mq-quick .tool-input,
  body .ms-btns .tool-input, body .ms-dim .tool-input, body .ms-meta .tool-input, body .ms-row .tool-input, body .ms-scale .tool-input, body .ms-tool .tool-input,
  body .ms-tz .tool-input, body .mst-ctrl .tool-input, body .mst-node .tool-input, body .mt-row .tool-input, body .mth-door .tool-input, body .mth-doors .tool-input,
  body .mth-stats .tool-input, body .mx-result .tool-input, body .mx-row .tool-input, body .mx-scale .tool-input, body .mx-slider .tool-input, body .nbk-grid .tool-input,
  body .nbk-info .tool-input, body .nk-bar .tool-input, body .nk-chip .tool-input, body .nk-grid .tool-input, body .nk-tabs .tool-input, body .nk-tool .tool-input,
  body .nm-line .tool-input, body .nm-stage .tool-input, body .nm2-bar .tool-input, body .nm2-tool .tool-input, body .npv-grid .tool-input, body .npv-row .tool-input,
  body .ns-row .tool-input, body .nsl-cell .tool-input, body .nsl-info .tool-input, body .nz-line .tool-input, body .nz-stage .tool-input, body .oapi-tabs .tool-input,
  body .oapi-tool .tool-input, body .ol-grid .tool-input, body .ol-row .tool-input, body .ops .tool-input, body .ot-grid .tool-input, body .ot-row .tool-input,
  body .pb-grid .tool-input, body .pb-row .tool-input, body .pc-inputs .tool-input, body .pc-row .tool-input, body .pcb-grid .tool-input, body .pcb-row .tool-input,
  body .peps-grid .tool-input, body .peps-row .tool-input, body .pg-grid .tool-input, body .pg-row .tool-input, body .ph2-bar .tool-input, body .ph2-tool .tool-input,
  body .picker-grid .tool-input, body .picker-row .tool-input, body .pl-grid .tool-input, body .pl-pickrow .tool-input, body .pno-black .tool-input, body .pno-info .tool-input,
  body .pno-keyboard .tool-input, body .pno-scale .tool-input, body .pom-btns .tool-input, body .pom-grid .tool-input, body .pom-row .tool-input, body .pos-grid .tool-input,
  body .pos-row .tool-input, body .pq-dim .tool-input, body .pq-dots .tool-input, body .pq-meta .tool-input, body .pq-opts .tool-input, body .pq-q .tool-input,
  body .pq-tool .tool-input, body .pr-cards .tool-input, body .pr-grid .tool-input, body .pr-marks .tool-input, body .pr-tool .tool-input, body .pr-tri .tool-input,
  body .prnt-checks .tool-input, body .prnt-tool .tool-input, body .ps-bar .tool-input, body .pt-grid .tool-input, body .pt-legend .tool-input, body .pt-lg .tool-input,
  body .pt-row .tool-input, body .pvfv-grid .tool-input, body .pvfv-row .tool-input, body .pw-grid .tool-input, body .pw-row .tool-input, body .pzl-info .tool-input,
  body .que-cell .tool-input, body .que-ctrl .tool-input, body .que-lab .tool-input, body .que-stage .tool-input, body .r .tool-input, body .ra-dim .tool-input,
  body .ra-meta .tool-input, body .ra-scale .tool-input, body .ra-tool .tool-input, body .rb-more .tool-input, body .rb-tool .tool-input, body .rbt-rule .tool-input,
  body .rbt-tool .tool-input, body .rc-bands .tool-input, body .rc-cards .tool-input, body .rc-colors .tool-input, body .rc-lock .tool-input, body .rc-row .tool-input,
  body .rc-swatch .tool-input, body .rc-tool .tool-input, body .rd-grid .tool-input, body .rd-stage .tool-input, body .rd-tags .tool-input, body .rd-tool .tool-input,
  body .rent-grid .tool-input, body .rent-row .tool-input, body .reset-checks .tool-input, body .reset-tool .tool-input, body .ret-grid .tool-input, body .ret-row .tool-input,
  body .rf-filters .tool-input, body .rf-tags .tool-input, body .rf-tool .tool-input, body .rg-chip .tool-input, body .rg-chips .tool-input, body .rg-num .tool-input,
  body .rg-opts .tool-input, body .rg-row .tool-input, body .rg-tool .tool-input, body .rl-grid .tool-input, body .rm-filters .tool-input, body .rm-row .tool-input,
  body .rm-tool .tool-input, body .rp-grid .tool-input, body .rp-item .tool-input, body .rp-mode .tool-input, body .rp-row .tool-input, body .rq-filters .tool-input,
  body .rq-tool .tool-input, body .rr-grid .tool-input, body .rr-row .tool-input, body .rs-row2 .tool-input, body .rs-stage .tool-input, body .rs-tool .tool-input,
  body .rt-grid .tool-input, body .rt-row .tool-input, body .rt-stage .tool-input, body .rt-tool .tool-input, body .rtra-filters .tool-input, body .rtra-tool .tool-input,
  body .rub-controls .tool-input, body .sa-meta .tool-input, body .sa-scale .tool-input, body .sa-tool .tool-input, body .sc-grid .tool-input, body .sc-row .tool-input,
  body .sd-meta .tool-input, body .sd-scale .tool-input, body .sd-tool .tool-input, body .sech-ctl .tool-input, body .sech-item-head .tool-input, body .sech-tool .tool-input,
  body .sed-btns .tool-input, body .sed-grid .tool-input, body .sed-row .tool-input, body .sh-grid .tool-input, body .sh-row .tool-input, body .show .tool-input,
  body .shp-grid .tool-input, body .shp-row .tool-input, body .sht-grid .tool-input, body .sht-row .tool-input, body .si-grid .tool-input, body .si-row .tool-input,
  body .sie-cell .tool-input, body .sie-info .tool-input, body .snap-card .tool-input, body .snap-controls .tool-input, body .snap-demo .tool-input, body .snap-tool .tool-input,
  body .sp-ctrl .tool-input, body .sp-preview .tool-input, body .sp-result .tool-input, body .sp-row .tool-input, body .sr-row .tool-input, body .srt-bars .tool-input,
  body .srt-info .tool-input, body .ss-grid .tool-input, body .ss-legend .tool-input, body .ss-row .tool-input, body .st-grid .tool-input, body .st-row .tool-input,
  body .stk-cell .tool-input, body .stk-ctrl .tool-input, body .sv-preview .tool-input, body .sv-row .tool-input, body .svged-ck .tool-input, body .sym-cell .tool-input,
  body .sym-grid .tool-input, body .sym-tabs .tool-input, body .tabext-bar .tool-input, body .tabhtml-bar .tool-input, body .tabhtml-tabs .tool-input, body .tabmulti-bar .tool-input,
  body .tabmulti-tabs .tool-input, body .tabrep-bar .tool-input, body .tabrep-rule .tool-input, body .tabtrans-bar .tool-input, body .tb-grid .tool-input, body .tb-row .tool-input,
  body .tbgen-opt .tool-input, body .tcp-grid .tool-input, body .td-cards .tool-input, body .td-goal .tool-input, body .td-grid .tool-input, body .td-tool .tool-input,
  body .tg-grid .tool-input, body .tg-preview .tool-input, body .tg-row .tool-input, body .tgrad-controls .tool-input, body .tgrad-tool .tool-input, body .tl-grid .tool-input,
  body .tl-row .tool-input, body .tp-line .tool-input, body .tp-stage .tool-input, body .tr-grid .tool-input, body .tr-line .tool-input, body .tr-row .tool-input,
  body .tr-stage .tool-input, body .truby-opt .tool-input, body .ts-controls .tool-input, body .tspl-opt .tool-input, body .tstroke-tool .tool-input, body .tts-row .tool-input,
  body .ttt-board .tool-input, body .ttt-cell .tool-input, body .ttt-info .tool-input, body .tuf-bar .tool-input, body .tuf-grid .tool-input, body .tw-ncell .tool-input,
  body .tw-near .tool-input, body .tw-pickrow .tool-input, body .tw-shades .tool-input, body .tz-add .tool-input, body .tz-item .tool-input, body .tz-row .tool-input,
  body .tzt-grid .tool-input, body .tzt-row .tool-input, body .uap-row .tool-input, body .uc-grid .tool-input, body .uc-row .tool-input, body .ucd-tool .tool-input,
  body .uf-grid .tool-input, body .uf-row .tool-input, body .urd-tool .tool-input, body .utc-grid .tool-input, body .utc-row .tool-input, body .uvi-tool .tool-input,
  body .vat-grid .tool-input, body .vat-row .tool-input, body .vc-row .tool-input, body .vd-grid .tool-input, body .vd-row .tool-input, body .ve-row .tool-input,
  body .ve-tabs .tool-input, body .vo-row .tool-input, body .vssc-inline .tool-input, body .vssc-list .tool-input, body .vt-controls .tool-input, body .vthg-inline .tool-input,
  body .vtrans-tool .tool-input, body .wc-add .tool-input, body .wc-city .tool-input, body .wc-grid .tool-input, body .wd-grid .tool-input, body .wd-row .tool-input,
  body .xrow .tool-input, body .yb-grid .tool-input, body .yb-row .tool-input, body .zalg-row .tool-input,
  /* 无类名的内联并排容器（style="display:flex/grid"）同样豁免，恢复满宽 */
  body [style*="display: flex"] .tool-input, body [style*="display:flex"] .tool-input,
  body [style*="display: inline-flex"] .tool-input, body [style*="display:inline-flex"] .tool-input,
  body [style*="display: grid"] .tool-input, body [style*="display:grid"] .tool-input,
  body [style*="display: inline-grid"] .tool-input, body [style*="display:inline-grid"] .tool-input { max-width: none; }
  /* form-control / form-select：纯单列 col-12 容器内收窄（同样兼容 label / 无class包裹层） */
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > select.form-select,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > select.form-control,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > select.form-select,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > select.form-control,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > select.form-select,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > select.form-control { max-width: 220px; }
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="number"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="number"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="number"] { max-width: 170px; }
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="file"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="file"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="file"] { max-width: 520px; }
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="color"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control.form-control-color,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="color"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control.form-control-color,
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="color"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control.form-control-color { max-width: 52px; }
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="date"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="time"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="datetime-local"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="month"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > input.form-control[type="week"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="date"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="time"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="datetime-local"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="month"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > label > input.form-control[type="week"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="date"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="time"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="datetime-local"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="month"],
  [class~="col-12"]:not([class*="col-sm-"]):not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]):not([class*="col-xxl-"]) > div:not([class]) > input.form-control[type="week"] { max-width: 200px; }
}
/* 复选框/单选钮/滑块/取色器/文件选择等特殊控件不套用文本框尺寸（页面各自内联控制） */
input.tool-input[type="checkbox"],
input.tool-input[type="radio"],
input.tool-input[type="range"],
input.tool-input[type="color"],
input.tool-input[type="file"],
input.tool-input[type="button"],
input.tool-input[type="submit"],
input.tool-input[type="reset"] { min-height: auto; padding: 0; }
.tool-buttons { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
/* 双列工具模板：按钮块移入 .row 后，桌面端独占整行；手机端按 DOM 顺序显示在输入框与结果框之间 */
.row.g-3 > .tool-buttons { width: 100%; }
@media (min-width: 768px) {
  .row.g-3 > .tool-buttons { flex: 0 0 100%; max-width: 100%; }
}
.tool-buttons .btn {
  padding: 5px 12px;
  font-size: .82rem;
  font-weight: 500;
  border-radius: 8px;
}
.tool-buttons .btn i { font-size: .8rem; margin-right: 2px; }
/* 相关推荐标题：居中，两侧短分割线 */
.related-section .section-title.related-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.related-section .section-title.related-title::before,
.related-section .section-title.related-title::after {
  content: '';
  width: 42px;
  height: 1px;
  background: #d1d5db;
}
/* 相关推荐卡片：只留图标 + 标题同一行（工具页/网址页），内边距收紧 */
.related-section .tool-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  text-align: left;
}
.related-section .tool-card-badges,
.related-section .tool-card-desc,
.related-section .tool-card-stats { display: none !important; }
.related-section .tool-card-icon { margin: 0; flex-shrink: 0; }
.related-section .tool-card-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 评论区标题 */
.comments-section > h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 14px; }
/* 发表评论按钮 */
.comment-form > .btn { padding: 6px 16px; font-size: .85rem; border-radius: 8px; }
/* 昵称框宽度为区域 1/3 */
.comment-form input[name="username"] { width: 33.333%; }
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ============ 分页（与后台工具列表同款：无边框无背景，选中页下小横线，居中） ============ */
.pagination { display: flex; justify-content: center; margin-top: 24px; }
.pagination-list {
  display: flex;
  list-style: none;
  gap: 2px;
  padding: 0;
  margin: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination-list li { display: inline-block; }
.pagination-list a {
  display: inline-block;
  position: relative;
  padding: 6px 9px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  border: none;
  background: none;
  border-radius: 0;
}
.pagination-list a:hover { color: var(--primary); background: none; border: none; }
.pagination-list li.active a { color: var(--primary); font-weight: 600; background: none; border: none; }
.pagination-list li.active a::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1px;
  width: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.pagination-list .page-dots { color: var(--text-secondary); opacity: .6; padding: 0 4px; font-size: 0.85rem; }

/* ============ 广告位 ============ */
.ad-slot {
  text-align: center;
  padding: 16px;
  margin: 16px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 广告按设备显示：电脑端默认可见，手机端 ≤768px 可见 */
.ad-slot.ad-pc { display: block; }
.ad-slot.ad-mobile { display: none; }
@media (max-width: 768px) {
  .ad-slot.ad-pc { display: none; }
  .ad-slot.ad-mobile { display: block; }
}

/* ============ 404 ============ */
.page-404 {
  text-align: center;
  padding: 100px 0;
}
.page-404 h1 { font-size: 6rem; font-weight: 900; color: var(--primary); }

/* ============ 详情页“标签”字样：图标+文字小号灰色、不加粗 ============ */
.tags-label {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
}
.tags-label i {
  font-size: 0.76rem;
  margin-right: 3px;
}
.tag-badge {
  font-weight: 400;
  color: #4b5563;
}

/* ============ 响应式 ============ */
@media (max-width: 992px) {
  .site-main { padding-top: 70px; }
  .hero-title { font-size: 2rem; }
  .header-row { padding: 12px 0; gap: 12px; }
  .search-btn span { display: none; }
  .search-btn { padding: 0 16px; }
  .engine-btn { padding: 0 10px; font-size: 0.85rem; }
  .engine-label { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 768px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  /* 顶栏：LOGO 区域可收缩，保证网站名称可见（过长省略号） */
  .site-logo { flex: 1 1 auto; min-width: 0; gap: 6px; }
  .header-right { flex-shrink: 0; }
  .logo-img { height: 30px; flex-shrink: 0; }
  .logo-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tool-detail-header { padding: 0 0 4px; margin-bottom: 4px; }
  .tool-body, .tool-usage { padding: 0; }
  /* 移动端压缩上下间距 */
  .site-main { padding-top: 4px; }
  .container > nav[aria-label="breadcrumb"] { margin-bottom: 8px !important; }
  .category-section { margin-bottom: 12px; }
  /* 移动端卡片：缩小图标与文字 */
  .tool-card { padding: 8px; }
  .tool-card-desc { font-size: 0.7rem; }
  .tool-card-stats { font-size: 0.66rem; margin-top: 3px; }
  .tool-card-icon {
    width: 28px; height: 28px; font-size: 0.9rem;
    margin-right: 6px; margin-bottom: 0;
    border-radius: 6px;
    vertical-align: middle;
  }
  .tool-card-icon img { width: 18px; height: 18px; }
  /* 图标与标题强制同一行，标题单行显示、超出省略号 */
  .tool-card-name {
    display: inline-block;
    max-width: calc(100% - 34px);
    line-height: 28px;
    font-size: 0.82rem;
    vertical-align: middle;
    white-space: nowrap;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 点赞 / 打赏 / 评分 同一行（文章页/网址页的点赞打赏条同步压缩） */
  .tool-like-reward, .like-reward-bar { flex-wrap: nowrap; gap: 6px; margin-bottom: 14px; }
  .btn-like, .btn-reward { padding: 6px 10px; font-size: .78rem; border-radius: 18px; gap: 4px; white-space: nowrap; }
  .btn-like i, .btn-reward i { font-size: .78rem; }
  .tool-rating { gap: 3px !important; }
  .tool-rating > .small { display: none; }              /* 隐藏“评分：” */
  .star-rating i { font-size: 16px !important; }
  .tool-rating .small.text-muted { display: none; }      /* 隐藏“(x/5·n人评)” */
}
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 8px; }
  .header-row { padding: 10px 0; gap: 8px; }
  .logo-icon { font-size: 1.5rem; }
  .logo-title { font-size: 0.95rem; }
  .icon-btn { width: 32px; height: 32px; font-size: 0.8rem; }
  .icon-btn i { font-size: 0.85rem; }
  .header-search { height: 40px; border-radius: 26px; }
  .engine-btn { padding: 0 10px; font-size: 0.8rem; }
  .search-btn { padding: 0 14px; }
}

/* ============ 首页工具卡片 · 手机端图标式布局（后台首页设置开关；电脑端/网址导航不受影响） ============ */
@media (max-width: 768px) {
  .tool-grid-icon {
    grid-template-columns: repeat(var(--icon-cols, 4), minmax(0, 1fr));
    gap: 16px 8px;
  }
  .category-section .tool-grid-icon { padding: 14px 0 0; }
  .tool-grid-icon > .tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: transparent;
    border: none;
    padding: 0;
  }
  .tool-grid-icon > .tool-card:hover {
    background: transparent;
    border: none;
    opacity: 0.75;
  }
  .tool-grid-icon .tool-card-icon {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.12);
    font-size: 1.45rem;
  }
  .tool-grid-icon .tool-card-icon img { width: 28px; height: 28px; }
  .tool-grid-icon .tool-card-name {
    display: block;
    max-width: 100%;
    margin-top: 8px;
    line-height: 1.3;
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tool-grid-icon .tool-card-desc,
  .tool-grid-icon .tool-card-stats,
  .tool-grid-icon .tool-card-badges { display: none; }
}

/* ================================================
   公告弹窗动画
   ================================================ */
.ann-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ann-modal {
  background: white; border-radius: 16px;
  max-width: 480px; width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
  opacity: 0;
}
.ann-modal.ann-show { opacity: 1; }
.ann-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: #f1f5f9; color: #64748b;
  font-size: 16px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.ann-close:hover { background: #e2e8f0; color: #334155; }
.ann-body { padding: 32px 28px 20px; max-height: 60vh; overflow-y: auto; }
.ann-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; color: #1e293b; }
.ann-content { color: #475569; line-height: 1.7; font-size: 0.95rem; word-break: break-word; }
.ann-content a { color: #2563eb; text-decoration: underline; }
.ann-content img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.ann-content p { margin-bottom: 8px; }
.ann-footer { padding: 12px 28px 24px; text-align: right; border-top: 1px solid #f1f5f9; }
.ann-btn-primary {
  padding: 10px 28px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; font-weight: 600; cursor: pointer; font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ann-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(102,126,234,0.4); }

/* 动画 1: slide-up 从底部升起 */
.ann-modal.ann-slide-up { transform: translateY(100px); }
.ann-modal.ann-slide-up.ann-show { transform: translateY(0); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s; }

/* 动画 2: slide-down 从顶部滑下 */
.ann-modal.ann-slide-down { transform: translateY(-100px); }
.ann-modal.ann-slide-down.ann-show { transform: translateY(0); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s; }

/* 动画 3: zoom 缩放弹出 */
.ann-modal.ann-zoom { transform: scale(0.5); }
.ann-modal.ann-zoom.ann-show { transform: scale(1); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s; }

/* 动画 4: shake 抖动 */
.ann-modal.ann-shake { transform: scale(0.8); }
.ann-modal.ann-shake.ann-show {
  transform: scale(1); opacity: 1;
  animation: ann-shake 0.55s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes ann-shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-8px); }
  40%,60% { transform: translateX(8px); }
}

/* 动画 5: fade 淡入 */
.ann-modal.ann-fade {}
.ann-modal.ann-fade.ann-show { transition: opacity 0.4s ease; }

/* 弹窗暗色主题适配 */
[data-theme="dark"] .ann-modal { background: #1e293b; }
[data-theme="dark"] .ann-title { color: #f1f5f9; }
[data-theme="dark"] .ann-content { color: #cbd5e1; }
[data-theme="dark"] .ann-close { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .ann-close:hover { background: #475569; }
[data-theme="dark"] .ann-footer { border-top-color: #334155; }

/* ============ 右下角悬浮按钮 ============ */
.floating-tools {
  position: fixed;
  right: 16px;
  bottom: 60px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ft-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--primary);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}
.ft-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.ft-btn.ft-top:hover {
  background: var(--primary);
  color: #fff;
}
.ft-btn.ft-wechat {
  background: #07c160;
  color: #fff;
}
.ft-btn.ft-wechat:hover {
  background: #06ad56;
  box-shadow: 0 4px 14px rgba(7,193,96,0.4);
}

/* 微信弹窗 */
.ft-wrap { position: relative; }
.ft-popup {
  position: absolute;
  right: 46px;
  bottom: 0;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}
.ft-wrap.open .ft-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.ft-popup img {
  width: 140px;
  height: 140px;
  border-radius: 6px;
  display: block;
}
.ft-popup-contact {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}
.ft-popup-tip {
  width: 140px;
  text-align: center;
  padding: 8px 0;
}
.ft-popup-tip i {
  font-size: 26px;
  color: #07c160;
  margin-bottom: 6px;
  display: block;
}
.ft-popup-tip p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* 暗色 */
[data-theme="dark"] .ft-btn {
  background: #1e293b;
  color: #60a5fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-theme="dark"] .ft-btn.ft-top:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .ft-popup { background: #1e293b; border-color: #334155; }

/* 移动端底部避让 */
@media (max-width: 768px) {
  .floating-tools { bottom: 20px; right: 12px; gap: 6px; }
  .ft-btn { width: 34px; height: 34px; font-size: 14px; }
  .ft-popup { right: 42px; }
  .ft-popup img { width: 120px; height: 120px; }
}

/* ============ 首页文章分类面板（独立布局，区别于工具卡片） ============ */
.home-article-row { margin-bottom: 24px; }
.art-panel {
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: box-shadow .2s, border-color .2s;
}
.art-panel:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.art-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.art-panel-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.art-panel-more { font-size: .85rem; color: #16a34a; text-decoration: none; white-space: nowrap; }
.art-panel-more:hover { color: #15803d; text-decoration: underline; }
[data-theme="dark"] .art-panel-more { color: #4ade80; }

/* 面板内纵向文章列表 */
.art-item-list { list-style: none; margin: 0; padding: 0; }
.art-item-list li { border-bottom: 1px solid var(--border); }
.art-item-list li:last-child { border-bottom: none; }
.art-item { display: flex; gap: 12px; padding: 12px 0; text-decoration: none; }
.art-item-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  border-radius: 8px;
  background: rgba(22,163,74,.1);
}
.art-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.art-item-title {
  font-size: .92rem; font-weight: 600; color: #15803d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.art-item:hover .art-item-title { text-decoration: underline; }
[data-theme="dark"] .art-item-title { color: #4ade80; }
.art-item-summary {
  font-size: .82rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-item-meta {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: .75rem; color: var(--text-muted); margin-top: 2px;
}

/* 单个文章分类通栏时：文章一排3篇的紧凑卡片网格 */
.art-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 12px;
}
.art-compact-card {
  display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.art-top-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: #fbbf24;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  z-index: 6;
}
.art-compact-card:hover { border-color: #16a34a; box-shadow: 0 4px 14px rgba(22,163,74,.12); transform: translateY(-2px); }
.art-compact-title {
  font-size: .92rem; font-weight: 600; color: #15803d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.art-compact-card:hover .art-compact-title { text-decoration: underline; }
[data-theme="dark"] .art-compact-title { color: #4ade80; }
.art-compact-summary {
  font-size: .82rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}

/* 手机端：分类面板一排一个；通栏文章网格也一排一篇 */
@media (max-width: 768px) {
  .art-panel { padding: 14px 16px; }
  .art-compact-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* ============ 网址导航卡片（只显示 ICO + 名称，行列数复用 .tool-grid） ============ */
.nav-site-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-width: 0;
}
.nav-site-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(37,99,235,.1);
  transform: translateY(-2px);
  color: var(--primary);
}
.nav-site-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-card-hover);
  overflow: hidden;
}
.nav-site-icon img { width: 22px; height: 22px; object-fit: contain; }
.nav-site-icon-fallback i { font-size: 1.1rem; color: var(--text-muted); }
.nav-site-name {
  flex: 1; min-width: 0;
  font-size: .9rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-site-direct { flex: 0 0 auto; font-size: .7rem; color: var(--text-muted); }
.nav-top-badge {
  position: absolute; top: 4px; right: 6px;
  font-size: .6rem; color: #f59e0b;
}
/* 网址列表卡片右上角角标组（约三分之一突出顶角） */
.nav-card-badges {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  gap: 4px;
  z-index: 6;
}
.nav-card-badges .nav-top-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 0;
  background: #fbbf24;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}
.nav-site-card.nav-top { border-color: rgba(245,158,11,.45); }

/* ============ 网址导航详情页 ============ */
.nav-detail-head .card-body { padding: 24px 28px; }
.nav-detail-title { font-size: 1.3rem; font-weight: 600; margin: 0 0 8px; }
.nav-detail-subtitle { font-size: .95rem; }
.nav-detail-meta { display: flex; flex-direction: column; gap: 8px; font-size: .88rem; color: var(--text-secondary); }
.nav-detail-meta i { width: 16px; color: var(--text-muted); margin-right: 4px; }
.nav-tag { font-size: .8rem; font-weight: 400; padding: .35em .7em; }
.nav-detail-visit { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.nav-detail-logo {
  width: 96px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card-hover);
  overflow: hidden;
}
.nav-detail-logo img { max-width: 80%; max-height: 80%; object-fit: contain; }
.nav-detail-logo i { font-size: 2rem; color: var(--text-muted); }
.nav-visit-btn { background: #22c55e; border-color: #22c55e; border-radius: 8px; font-weight: 600; }
.nav-visit-btn:hover { background: #16a34a; border-color: #16a34a; }

/* 超期未更新黄色提醒 */
.nav-stale-tip {
  background: #fef8e7;
  border: 1px solid #f7df9e;
  color: #92610a;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: .95rem;
  line-height: 1.6;
}
.nav-stale-icon { margin-right: 8px; }
[data-theme="dark"] .nav-stale-tip { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #fcd34d; }

/* 「网站简介」标题下的点状分隔线（参考图样式） */
.nav-section-title {
  font-size: 1.02rem; font-weight: 600; padding-bottom: 8px; margin-bottom: 12px;
}
@media (max-width: 768px) {
  .nav-detail-head .card-body { padding: 16px; }
  .nav-detail-visit { width: 100%; flex-direction: row; justify-content: space-between; }
}
