/* =====================================================================
   云舟导航 · 前台样式
   ===================================================================== */

/* ---------- 搜索区 ---------- */
.hero {
  position: relative;
  padding: var(--sp-10) 0 var(--sp-8);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 120%);
  height: 380px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--brand-400) 22%, transparent), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; text-align: center; }

.hero__title {
  font-size: clamp(26px, 5vw, var(--fs-3xl));
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-2);
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand-500), #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__sub {
  color: var(--text-2);
  font-size: var(--fs-md);
  margin-bottom: var(--sp-6);
}

/* 搜索框 */
.search {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
}
.search__box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 6px 6px 6px var(--sp-4);
  box-shadow: var(--shadow-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search__box:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 14%, transparent), var(--shadow-md);
}
.search__icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}
.search__input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--fs-md);
  padding: 8px 0;
  min-width: 0;
}
.search__input::placeholder { color: var(--text-3); }
.search__kbd {
  display: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  background: var(--surface-2);
}
@media (min-width: 640px) { .search__kbd { display: block; } }

.search__suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: var(--z-dropdown);
  display: none;
}
.search__suggest.is-open { display: block; }
.suggest__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.suggest__item:last-child { border-bottom: 0; }
.suggest__item:hover, .suggest__item.is-active { background: var(--surface-2); }
.suggest__icon {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}
.suggest__name { font-weight: 500; flex-shrink: 0; }
.suggest__desc {
  font-size: var(--fs-sm);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 热门标签 */
.hot-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.hot-tag {
  padding: 4px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: all var(--t-fast);
}
.hot-tag:hover {
  border-color: var(--brand-400);
  color: var(--brand-600);
  background: var(--brand-50);
}

/* ---------- 分类标签栏 ---------- */
.category-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.category-bar__scroll {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--sp-2) 0;
  -webkit-overflow-scrolling: touch;
}
.category-bar__scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 6px var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.cat-chip:hover { background: var(--surface-3); color: var(--text); }
.cat-chip.is-active {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.cat-chip__count {
  font-size: var(--fs-xs);
  opacity: .7;
  margin-left: 4px;
}

/* ---------- 区块标题 ---------- */
.section { margin-bottom: var(--sp-10); }
.section__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.section__icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  background: var(--brand-50);
  color: var(--brand-600);
}
.section__title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; }
.section__desc { font-size: var(--fs-sm); color: var(--text-3); }
.section__more {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.section__more:hover { color: var(--brand-600); }
.section__more svg { width: 14px; height: 14px; }

/* ---------- 站点卡片网格 ---------- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: var(--sp-3);
}
@media (max-width: 520px) {
  .site-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
}

.site-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--text);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  min-width: 0;
}
.site-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-300);
  color: var(--text);
}
.site-card:active { transform: translateY(-1px); }

.site-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.site-card__icon img { width: 100%; height: 100%; object-fit: cover; }

.site-card__body { min-width: 0; flex: 1; }
.site-card__name {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.site-card__name span { overflow: hidden; text-overflow: ellipsis; }
.site-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.site-card__tags {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.site-card__tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text-3);
}
.site-card__flag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #fb923c, #ef4444);
  color: #fff;
  font-weight: 500;
}

/* ---------- 站点详情/跳转页 ---------- */
.go-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: var(--sp-8) var(--sp-4);
}
.go-card {
  width: 100%;
  max-width: 460px;
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
}
.go-card__icon {
  width: 76px;
  height: 76px;
  border-radius: var(--r-xl);
  margin: 0 auto var(--sp-4);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  background: var(--surface-3);
}
.go-card__name { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: var(--sp-2); }
.go-card__url {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-3);
  word-break: break-all;
  margin-bottom: var(--sp-6);
}
.go-countdown {
  font-size: var(--fs-md);
  color: var(--text-2);
  margin-bottom: var(--sp-4);
}
.go-countdown b {
  font-size: var(--fs-2xl);
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
}

/* ---------- 认证页面 ---------- */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: var(--sp-8) var(--sp-4);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--sp-8) var(--sp-6);
}
.auth-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--sp-2);
}
.auth-sub {
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-6);
}
.auth-foot {
  text-align: center;
  margin-top: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* ---------- 收藏页 ---------- */
.fav-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

/* ---------- 收录申请页 ---------- */
.submit-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 900px) { .submit-layout { grid-template-columns: 1fr; } }

.steps { counter-reset: step; }
.step {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--border);
}
.step:last-child { border-bottom: 0; }
.step__num {
  counter-increment: step;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  flex-shrink: 0;
}
.step__num::before { content: counter(step); }
.step__title { font-weight: 500; font-size: var(--fs-base); }
.step__desc { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------- 统计条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: center;
}
.stat__num {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat__label { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }

/* ---------- 后台 ---------- */
.admin-body { background: var(--bg-alt); }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-side {
  width: 216px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-header);
  transform: translateX(-100%);
  transition: transform var(--t-base);
}
.admin-side.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
  .admin-side { position: sticky; top: 0; height: 100vh; transform: none; }
  .admin-overlay { display: none !important; }
}

.admin-side__brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  flex-shrink: 0;
}
.admin-side__nav { flex: 1; overflow-y: auto; padding: var(--sp-3); }
.admin-side__foot {
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-nav__group {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 600;
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
  letter-spacing: .04em;
}
.admin-nav__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  transition: all var(--t-fast);
  margin-bottom: 2px;
}
.admin-nav__item:hover { background: var(--surface-3); color: var(--text); }
.admin-nav__item.is-active {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.admin-nav__item svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.admin-nav__item.is-active .admin-nav__badge { background: rgba(255,255,255,.25); }

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-top {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-top__title { font-size: var(--fs-lg); font-weight: 600; }
.admin-content { padding: var(--sp-5); flex: 1; }
@media (min-width: 768px) { .admin-content { padding: var(--sp-6); } }

.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 90;
  display: none;
}
.admin-overlay.is-open { display: block; }

/* 后台统计卡 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.kpi__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi__icon svg { width: 20px; height: 20px; }
.kpi__num {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi__label { font-size: var(--fs-sm); color: var(--text-3); }

/* 工具条 */
.toolbar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.toolbar .input { flex: 1; max-width: 320px; }

/* 图标预览 */
.icon-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
  overflow: hidden;
}
/* 作为 div 容器时（内联 SVG 图标），让其子元素撑满 */
.icon-preview > svg,
.icon-preview > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.icon-preview--lg { width: 64px; height: 64px; border-radius: var(--r-lg); }

.uploader {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.uploader__preview {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* 后台两栏表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 var(--sp-5);
}
.form-grid .field--full { grid-column: 1 / -1; }

/* 模态 */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(15, 23, 42, .5);
}
.modal.is-open { display: flex; }
.modal__box {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp var(--t-base);
}
.modal__head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal__title { font-size: var(--fs-md); font-weight: 600; }
.modal__body { padding: var(--sp-5); }
.modal__foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
}
