:root {
  --bg: #ffffff;
  --page-bg: #f7f8fa;
  --text: #262a33;
  --text-mute: #8a8f9c;
  --line: #eef0f3;
  --accent: #4a7dff;
  --accent-soft: #eef2ff;
  --hover-bg: #f4f6f9;
  --radius-sm: 8px;
  --radius-md: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部 ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #7c9bff);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.brand .name { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { font-size: 12px; color: var(--text-mute); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apply-btn {
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 18px;
  border-radius: 20px; white-space: nowrap; transition: opacity .15s;
}
.apply-btn:hover { opacity: 0.88; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; }

.main-nav { border-top: 1px solid var(--line); background: var(--bg); }
.main-nav ul { list-style: none; display: flex; margin: 0; padding: 0; overflow-x: auto; }
.main-nav a { display: block; padding: 10px 15px; font-size: 13px; color: var(--text-mute); white-space: nowrap; }
.main-nav a:hover { color: var(--accent); }

/* ---------- 横幅广告 ---------- */
.banner-ads { padding: 16px 0 0; }
.banner-ads .container { display: flex; gap: 12px; overflow-x: auto; }
.banner-ads a { flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 2px 10px rgba(20,30,60,0.06); }
.banner-ads img { height: 80px; width: auto; }

/* ---------- 小图标广告 ---------- */
.icon-ads { padding: 14px 0 0; }
.icon-ads .container { display: flex; gap: 14px; flex-wrap: wrap; }
.icon-ads a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; text-align: center; }
.icon-ads img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 8px rgba(20,30,60,0.08); }
.icon-ads span { font-size: 11px; color: var(--text-mute); }

/* ---------- 主体：分区 ---------- */
.main-content { padding: 20px 22px 50px; }
.empty-state { text-align: center; color: var(--text-mute); padding: 60px 20px; background: var(--bg); border-radius: var(--radius-md); }

.section-block { background: var(--bg); border-radius: var(--radius-md); padding: 16px 18px 10px; margin-bottom: 14px; scroll-margin-top: 110px; }
.section-title {
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text);
  padding-bottom: 12px; margin-bottom: 8px;
}
.section-icon { font-size: 16px; line-height: 1; }
.title-rule { flex: 1; height: 1px; background: var(--line); margin-left: 6px; }
.tag-global { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 10px; }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 2px 6px; }
.link-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  transition: background .12s;
}
.link-item:hover { background: var(--hover-bg); }
.link-item:hover .chevron { opacity: 1; transform: translateX(2px); }
.link-item.is-ad { background: #fbf9ff; }
.icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; object-fit: cover; }
.icon-placeholder { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.item-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ad-flag { font-style: normal; font-size: 10px; color: #fff; background: #b98af2; padding: 1px 6px; border-radius: 5px; flex-shrink: 0; }
.chevron { color: var(--text-mute); opacity: 0; transition: all .15s; flex-shrink: 0; }

/* ---------- 收录申请表单 ---------- */
.apply-form { padding: 8px 4px 20px; display: grid; gap: 14px; max-width: 560px; }
.apply-form .form-row { display: flex; flex-direction: column; gap: 6px; }
.apply-form label { font-size: 13px; color: var(--text-mute); }
.apply-form input, .apply-form select, .apply-form textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%;
  background: #fff;
}
.apply-form .honeypot { position: absolute; left: -9999px; opacity: 0; }
.apply-form button {
  padding: 11px 26px; background: var(--accent); color: #fff; border: none; border-radius: 22px;
  font-size: 14px; font-weight: 600; cursor: pointer; width: fit-content;
}
.apply-tip { padding: 0 4px 6px; font-size: 13px; color: var(--text-mute); }
.form-alert { margin: 0 4px 6px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.form-alert.success { background: #e7f8ee; color: #16794a; }
.form-alert.error { background: #fdeaea; color: #b3261e; }

/* ---------- 页脚 ---------- */
.site-footer { text-align: center; padding: 26px 0; font-size: 12px; color: var(--text-mute); }
.site-footer a { color: var(--accent); }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 860px) {
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 640px) {
  .top-bar { padding: 12px 0; }
  .brand .name { font-size: 16px; }
  .apply-btn { display: none; }
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 6px 0; overflow: visible; }
  .main-nav a { padding: 10px 20px; }
  .main-content { padding: 14px 12px 34px; }
  .section-block { padding: 14px 12px 6px; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .banner-ads img { height: 60px; }
}
