/* H5 移动端 · 站长导航 */
:root {
  --m-primary: #00a870;
  --m-primary-dark: #008f5f;
  --m-primary-soft: rgba(0, 168, 112, 0.12);
  --m-bg: #f4f6f8;
  --m-card: #fff;
  --m-text: #1a1f2e;
  --m-muted: #6b7280;
  --m-border: #e8ecf0;
  --m-header-h: 48px;
  --m-tabbar-h: 56px;
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.m-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  line-height: 1.5;
  padding-bottom: calc(var(--m-tabbar-h) + var(--m-safe-bottom));
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; vertical-align: middle; }

/* 顶栏 */
.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--m-primary) 0%, var(--m-primary-dark) 100%);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}

.m-header-inner {
  display: flex;
  align-items: center;
  height: var(--m-header-h);
  padding: 0 12px;
  gap: 8px;
}

.m-header-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: #fff;
}

.m-logo-icon { font-size: 20px; }

.m-logo-text {
  font-size: 15px;
  font-weight: 700;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-header-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.m-header-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.m-header-pc {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: #fff;
}

/* 主内容 */
.m-main { min-height: calc(100vh - var(--m-header-h) - var(--m-tabbar-h)); }

/* 首页 Hero */
.m-hero {
  background: linear-gradient(180deg, var(--m-primary) 0%, var(--m-primary-dark) 100%);
  color: #fff;
  padding: 16px 16px 20px;
}

.m-hero-desc {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: .9;
  line-height: 1.6;
}

.m-search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.m-search-form input {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.m-search-form button {
  border: none;
  background: rgba(255,255,255,.95);
  color: var(--m-primary-dark);
  font-weight: 600;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.m-hero-stats {
  display: flex;
  gap: 20px;
  font-size: 12px;
  opacity: .85;
}

.m-hero-stats strong { font-size: 16px; margin-right: 2px; }

/* 分类 Tab */
.m-cat-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--m-card);
  border-bottom: 1px solid var(--m-border);
  position: sticky;
  top: var(--m-header-h);
  z-index: 50;
}

.m-cat-tabs::-webkit-scrollbar { display: none; }

.m-cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--m-bg);
  color: var(--m-muted);
  white-space: nowrap;
}

.m-cat-tab.is-active {
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  font-weight: 600;
}

.m-cat-tabs-page .m-cat-tab.is-active {
  background: var(--m-primary);
  color: #fff;
}

/* H5 分类列表 · 大气版 */
.m-cat-hero {
  position: relative;
  background: linear-gradient(135deg, var(--m-primary) 0%, var(--m-primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 24px 16px 20px;
  overflow: hidden;
}
.m-cat-hero-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
}
.m-cat-hero-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  margin-bottom: 10px;
}
.m-cat-hero h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.m-cat-hero p {
  margin: 0;
  font-size: 13px;
  opacity: .9;
}
.m-cat-hero p strong { font-size: 16px; }

.m-block-count {
  font-size: 12px;
  color: var(--m-muted);
  background: var(--m-bg);
  padding: 2px 10px;
  border-radius: 999px;
}

/* H5 搜索 · 大气版 */
.m-search-hero {
  position: relative;
  background: linear-gradient(135deg, var(--m-primary) 0%, var(--m-primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 20px 16px 22px;
  overflow: hidden;
}
.m-search-hero-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
}
.m-search-hero-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.m-search-hero h1 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-search-form-hero {
  margin-bottom: 0;
}
.m-search-form-hero input {
  background: #fff;
  color: var(--m-text);
}
.m-search-hero-meta {
  margin: 12px 0 0;
  font-size: 13px;
  opacity: .9;
}
.m-search-hero-meta strong { font-size: 16px; }

.m-list-premium .m-list-item {
  position: relative;
  padding-right: 36px;
}
.m-list-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--m-muted);
  font-size: 16px;
}
.m-empty-card {
  margin: 12px;
  padding: 24px 16px;
  background: var(--m-card);
  border-radius: 12px;
  text-align: center;
}

/* 区块 */
.m-block {
  background: var(--m-card);
  margin: 10px 12px;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.m-block-flush { padding: 0; overflow: hidden; }

.m-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.m-block-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.m-block-head a {
  font-size: 13px;
  color: var(--m-primary);
}

/* 图标网格 */
.m-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.m-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.m-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--m-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.m-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-icon-name {
  font-size: 11px;
  line-height: 1.3;
  color: var(--m-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

/* 搜索页列表 */
.m-search-page { padding: 12px; }

.m-search-form-lg { margin-bottom: 16px; }
.m-search-form-lg input { background: var(--m-card); border: 1px solid var(--m-border); }

.m-result-tip {
  font-size: 13px;
  color: var(--m-muted);
  margin: 0 0 12px;
}

.m-list { display: flex; flex-direction: column; gap: 10px; }

.m-list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--m-card);
  border-radius: 12px;
  align-items: flex-start;
}

.m-list-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--m-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 20px;
}

.m-list-icon img { width: 100%; height: 100%; object-fit: cover; }

.m-list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-list-body strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-list-body em {
  font-style: normal;
  font-size: 12px;
  color: var(--m-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-list-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  border-radius: 4px;
  align-self: flex-start;
}

/* 资讯列表 */
.m-news-list { display: flex; flex-direction: column; }

.m-news-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--m-border);
}

.m-news-item:last-child { border-bottom: none; }

.m-news-thumb {
  width: 88px;
  height: 66px;
  border-radius: 8px;
  background: var(--m-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 28px;
}

.m-news-thumb img { width: 100%; height: 100%; object-fit: cover; }

.m-news-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-news-body strong {
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-news-body em {
  font-style: normal;
  font-size: 12px;
  color: var(--m-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-news-meta { font-size: 11px; color: #9ca3af; }

/* 文章详情 */
.m-article {
  background: var(--m-card);
  margin: 10px 12px;
  border-radius: 12px;
  padding: 16px;
}

.m-article-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.4;
}

.m-article-meta {
  font-size: 12px;
  color: var(--m-muted);
  margin-bottom: 12px;
}

.m-article-summary {
  padding: 10px 12px;
  background: var(--m-bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--m-muted);
  margin-bottom: 12px;
}

.m-article-cover {
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.m-article-content {
  font-size: 15px;
  line-height: 1.8;
  word-break: break-word;
}

.m-article-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* 站点详情 */
.m-site-card {
  background: var(--m-card);
  margin: 12px;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
}

.m-site-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--m-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}

.m-site-icon img { width: 100%; height: 100%; object-fit: cover; }

.m-site-card h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.m-site-tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  border-radius: 999px;
  margin-bottom: 12px;
}

.m-site-desc {
  font-size: 14px;
  color: var(--m-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.m-btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--m-primary), var(--m-primary-dark));
  color: #fff;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 15px;
  border: none;
  cursor: pointer;
}

.m-btn-block { display: block; width: 100%; text-align: center; }

.m-site-url {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9ca3af;
  word-break: break-all;
}

/* H5 站点详情 · 大气版 */
.m-site-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--m-muted);
  background: var(--m-card);
  border-bottom: 1px solid var(--m-border);
}
.m-site-breadcrumb a { color: var(--m-primary); }
.m-site-breadcrumb span { opacity: .5; }

/* H5 站点详情 Banner · 大气版 */
.m-site-banner {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 12px 16px 24px;
  overflow: hidden;
}
.m-site-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--m-primary) 0%, var(--m-primary-dark) 100%);
}
.m-site-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
  opacity: .7;
}
.m-site-banner-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 1;
}
.m-site-breadcrumb--banner {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 8px 0 14px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}
.m-site-breadcrumb--banner a { color: rgba(255, 255, 255, 0.92); }
.m-site-banner-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.m-site-banner-icon img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.m-site-banner-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.m-site-tag--banner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}
.m-site-banner-title {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.m-site-banner-desc {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-site-banner-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}
.m-site-banner-meta .is-ok { color: #b8f5d8; font-weight: 600; }
.m-site-banner-visit {
  position: relative;
  z-index: 1;
  margin: 0 12px;
  width: calc(100% - 24px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.m-site-banner-url {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  word-break: break-all;
  padding: 0 8px;
}

.m-site-quick {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--m-bg);
}
.m-site-quick-btn {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--m-text);
  background: var(--m-card);
  border-radius: 10px;
  border: 1px solid var(--m-border);
}

.m-site-premium {
  position: relative;
  background: var(--m-card);
  margin: 12px;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.m-site-premium-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--m-primary), var(--m-primary-dark));
}
.m-site-premium-icon {
  width: 80px;
  height: 80px;
  margin: 8px auto 14px;
  border-radius: 18px;
  background: var(--m-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 168, 112, 0.15);
  border: 2px solid rgba(0, 168, 112, 0.12);
}
.m-site-premium-icon img { width: 100%; height: 100%; object-fit: cover; }
.m-site-premium h1 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
}
.m-site-meta-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--m-muted);
  margin-bottom: 18px;
}
.m-site-meta-row .is-ok { color: var(--m-primary-dark); font-weight: 600; }
.m-site-visit { margin-top: 4px; box-shadow: 0 4px 14px rgba(0, 168, 112, 0.3); }

/* 表单 */
.m-form-page { padding: 12px; }

.m-form-tip {
  font-size: 13px;
  color: var(--m-muted);
  margin: 0 0 12px;
  text-align: center;
}

.m-form {
  background: var(--m-card);
  border-radius: 12px;
  padding: 16px;
}

.m-field {
  display: block;
  margin-bottom: 14px;
}

.m-field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.m-field span em { color: #ef4444; font-style: normal; }

.m-field input,
.m-field select,
.m-field textarea {
  width: 100%;
  border: 1px solid var(--m-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.m-field input:focus,
.m-field select:focus,
.m-field textarea:focus {
  border-color: var(--m-primary);
}

.m-form-msg {
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.m-form-msg.msg-success { display: block; background: #ecfdf5; color: #047857; }
.m-form-msg.msg-error { display: block; background: #fef2f2; color: #b91c1c; }

/* 空状态 */
.m-empty,
.m-empty-tip {
  text-align: center;
  padding: 32px 16px;
  color: var(--m-muted);
  font-size: 14px;
}

.m-empty-tip { padding: 16px; }

/* 分页 */
.m-pagination {
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
}

.m-pagination a,
.m-pagination span {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px;
  border-radius: 6px;
}

.m-pagination a { color: var(--m-primary); }
.m-pagination .current { background: var(--m-primary-soft); color: var(--m-primary-dark); font-weight: 600; }

/* 底部 Tab */
.m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  height: calc(var(--m-tabbar-h) + var(--m-safe-bottom));
  padding-bottom: var(--m-safe-bottom);
  background: var(--m-card);
  border-top: 1px solid var(--m-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.m-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--m-muted);
  padding-top: 6px;
}

.m-tabbar-icon { font-size: 20px; line-height: 1; }

.m-tabbar-item.is-active {
  color: var(--m-primary);
  font-weight: 600;
}

@media (min-width: 768px) {
  .m-body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 24px rgba(0,0,0,.08); }
  .m-tabbar { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
