/* ============ 大模型导航 · iOS 风格 ============ */

:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --card-border: rgba(0, 0, 0, 0.055);
  --text: #1D1D1F;
  --text-2: #86868B;
  --text-3: #AEAEB2;
  --accent: #007AFF;
  --accent-deep: #0064D2;
  --accent-soft: rgba(0, 122, 255, 0.10);
  --chip: rgba(120, 120, 128, 0.12);
  --hairline: rgba(60, 60, 67, 0.14);
  --glass: rgba(248, 248, 251, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 28px rgba(30, 30, 60, 0.07);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(30, 30, 60, 0.12);
  --orange-soft: rgba(255, 159, 10, 0.12);
  --orange-text: #9A6100;
  --radius: 20px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0A0A0E;
  --card: #1C1C1E;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #F5F5F7;
  --text-2: #98989E;
  --text-3: #6C6C70;
  --accent: #0A84FF;
  --accent-deep: #3395FF;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --chip: rgba(120, 120, 128, 0.24);
  --hairline: rgba(84, 84, 88, 0.42);
  --glass: rgba(16, 16, 21, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 14px 40px rgba(0, 0, 0, 0.5);
  --orange-soft: rgba(255, 159, 10, 0.14);
  --orange-text: #FFB340;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { font-size: 26px; line-height: 1; }
.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.btn-contact {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-contact:hover { filter: brightness(1.08); }
.btn-contact:active { transform: scale(0.96); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--chip);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.icon-btn:hover { transform: rotate(15deg); }
.icon-btn .ico-moon { display: none; }
html[data-theme="dark"] .icon-btn .ico-sun { display: none; }
html[data-theme="dark"] .icon-btn .ico-moon { display: inline; }

/* ---------- 板块标签 ---------- */
.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab:hover { background: var(--chip); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.tab .badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab:not(.active) .badge { background: var(--text-3); }

/* ---------- 二级板块分段控件 ---------- */
.main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 32px;
  flex: 1;
}

#subbar { display: flex; justify-content: flex-start; margin-bottom: 18px; }
#subbar:empty { display: none; }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: var(--chip);
}
.seg {
  border: none;
  background: transparent;
  height: 32px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.seg.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(10, 132, 255, 0.25); }
}

.site-head { display: flex; align-items: center; gap: 12px; }

.site-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--chip);
  flex: none;
  border: 1px solid var(--card-border);
}
.icon-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  flex: none;
}

.site-name {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.site-name:hover { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.tag-more { font-size: 11px; color: var(--text-3); padding: 3px 4px; }

.intro {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.perk {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
}
.perk .perk-ico { flex: none; }
.perk span.perk-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.req {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
  min-height: 18px;
}
.req .req-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.models { margin-top: 10px; }
.models-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.model-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 50px; overflow: hidden; }
.model {
  font-size: 11px;
  padding: 2.5px 9px;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text-2);
  white-space: nowrap;
}

.spacer { flex: 1 1 12px; min-height: 12px; }

.card-actions { display: flex; gap: 8px; margin-top: 14px; }

.btn-reg {
  flex: 1;
  height: 42px;
  min-width: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #3B9BFF, var(--accent));
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 5px 16px rgba(0, 122, 255, 0.35);
  transition: filter 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}
html[data-theme="dark"] .btn-reg { background: linear-gradient(180deg, #2F94FF, #0A6FE8); }
.btn-reg:hover { filter: brightness(1.07); }
.btn-reg:active { transform: scale(0.97); }

.btn-fav {
  flex: none;
  min-width: 98px;
  height: 42px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: var(--chip);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.btn-fav:hover { border-color: var(--accent); color: var(--accent); }
.btn-fav.faved {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

/* ---------- 空状态 ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 20px;
  color: var(--text-3);
}
.empty .empty-ico { font-size: 52px; display: block; margin-bottom: 14px; }
.empty .empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty .empty-sub { font-size: 13px; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 48px;
  text-align: center;
}
.footer #disclaimer {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto;
}
.footer .update-time {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  opacity: 0.85;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px 6px; }
  .brand-title { font-size: 17px; }
  .main { padding: 16px 14px 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
  .card { padding: 14px; min-height: 0; }
  .site-icon { width: 44px; height: 44px; border-radius: 12px; }
  .site-name { font-size: 14.5px; }
  .intro { font-size: 12px; }
  .btn-fav { min-width: 88px; }
  .footer { padding: 8px 16px 40px; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- 联系我弹窗 ---------- */
.modal-mask[hidden] { display: none !important; }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px 16px;
}
.modal {
  position: relative;
  width: 340px;
  max-width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 24px 22px 28px;
  animation: contactPop 0.2s ease;
}
@keyframes contactPop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--chip);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: var(--hairline); }
.contact-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.contact-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.contact-email {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
  background: var(--chip);
  border-radius: 10px;
  padding: 10px 12px;
}
.btn-copy {
  flex: none;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn-copy:hover { filter: brightness(1.08); }
.contact-qr { text-align: center; }
.contact-qr-label {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.contact-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
}
