/* 前台扩展 */
.hero { background: white; border-radius: 16px; padding: 28px; margin-bottom: 24px; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.hero h2 { font-size: 1.5rem; margin-bottom: 10px; }

.search-form { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.search-form input[type=search] {
  flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 24px; font-size: .95rem; outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
  padding: 10px 20px; border: none; border-radius: 24px;
  background: var(--accent); color: white; cursor: pointer; font-family: inherit;
}

.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cat-filter a {
  padding: 6px 14px; border-radius: 16px; background: #f1f5f9;
  color: var(--text); text-decoration: none; font-size: .85rem;
}
.cat-filter a.active, .cat-filter a:hover { background: var(--accent); color: white; }

.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.chapter-card {
  background: white; border-radius: 12px; padding: 16px; border: 1px solid var(--border);
  display: block; color: inherit; text-decoration: none; transition: box-shadow .2s;
}
.chapter-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); text-decoration: none; }
.chapter-card .num { font-size: .75rem; color: var(--accent); font-weight: bold; }
.chapter-card h3 { font-size: 1rem; margin: 6px 0; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 28px 0; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; background: white; border: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: .9rem;
}
.pagination a:hover { background: #eff6ff; border-color: var(--accent); }
.pagination .current { background: var(--accent); color: white; border-color: var(--accent); }
.pagination .dots { border: none; background: none; }

.search-results { display: flex; flex-direction: column; gap: 16px; }
.search-group {
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 8px;
  overflow: hidden;
}
.search-group .search-item { border-radius: 0; border: none; border-bottom: 1px solid var(--border, #eee); }
.search-group .search-item:last-child { border-bottom: none; }
.search-item.search-section { padding-left: 20px; background: #fafbfc; }
.search-item.search-section h3 { font-size: .95rem; font-weight: 600; }
.search-item.search-chapter h3 { font-size: 1.05rem; }
.search-item {
  display: block; background: white; padding: 16px; border-radius: 12px;
  border: 1px solid var(--border); text-decoration: none; color: inherit;
}
.search-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.search-item h3 { color: var(--accent); margin-bottom: 4px; }
.search-item .meta { font-size: .8rem; color: var(--muted); }
.search-item p { font-size: .9rem; color: #555; margin-top: 6px; }
.search-tip {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 10px 14px; font-size: .85rem; color: #1e40af; margin-bottom: 16px;
}

.sidebar-contact {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px 14px;
  border-top: 1px solid #334155;
  background: #172033;
  text-align: center;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.sidebar-contact-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 4px 0;
  border: none;
  background: none;
  font-size: .82rem;
  color: #94a3b8;
  line-height: 1.4;
  cursor: pointer;
  transition: color .15s;
}
.sidebar-contact-toggle:hover {
  color: #cbd5e1;
}
.sidebar-contact-chevron {
  font-size: .65rem;
  transition: transform .2s;
}
.sidebar-contact.expanded .sidebar-contact-chevron {
  transform: rotate(180deg);
}
.sidebar-contact-qr-wrap {
  display: none;
  width: 100%;
}
.sidebar-contact.expanded .sidebar-contact-qr-wrap {
  display: block;
}
.sidebar-contact-qr {
  display: block;
  width: 96px;
  height: 96px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  margin: 0 auto;
  box-sizing: border-box;
}
.sidebar-contact-phone {
  display: block;
  width: 100%;
  color: #93c5fd !important;
  text-decoration: none !important;
  font-size: .88rem;
  line-height: 1.4;
  word-break: break-all;
}
.sidebar-contact-phone:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

/* 兼容旧类名 */
.sidebar-wechat {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 16px;
  border-top: 1px solid #334155;
  text-align: center;
}
.sidebar-wechat p { font-size: .85rem; color: #94a3b8; margin: 0; }
.sidebar-wechat img { display: block; width: 112px; margin: 0 auto; border-radius: 8px; background: white; padding: 4px; }
.sidebar-wechat small { display: block; width: 100%; }
.sidebar-wechat small a { color: #93c5fd; text-decoration: none; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0 0 12px; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li { display: inline; }
.breadcrumb a { color: var(--accent); }

article { margin-bottom: 20px; }

.chapter-hub { margin-bottom: 20px; }
.section-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.section-link-card {
  display: block; background: white; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; color: inherit; text-decoration: none;
  transition: box-shadow .2s, border-color .2s;
}
.section-link-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--accent); text-decoration: none; }
.section-link-card .section-num { display: block; font-size: .75rem; color: var(--accent); font-weight: bold; margin-bottom: 4px; }
.section-link-card .section-name { font-size: .95rem; font-weight: 600; }
.section-parent-link { margin-bottom: 12px; font-size: .9rem; }
.section-title { font-size: 1.45rem; margin-bottom: 8px; }
