/* ============ 网址导航 - 前台样式 ============ */
:root {
  --brand: #5b6cff;
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #1a1c23;
  --text-2: #6b7280;
  --text-3: #9aa0ae;
  --line: #eceef3;
  --star: #ffb020;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 20, 40, .04), 0 4px 14px rgba(16, 20, 40, .05);
}

* { box-sizing: border-box; }

/* 全局兜底：hidden 属性必须真正隐藏 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
}

/* ---------------- 顶部横幅 ---------------- */
.banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  /* 用「底色 + 明暗叠加」代替 color-mix，兼容旧版 WebView */
  background-color: var(--brand);
  background-image: linear-gradient(135deg, rgba(255,255,255,.14), rgba(0,0,0,.16));
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.banner > a,
.banner > span {
  display: block;
  width: 100%;
  height: 100%;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* ---------------- 滚动公告 ---------------- */
.notice {
  background: var(--card);
  border-radius: 999px;
  padding: 9px 14px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice::before {
  content: "公告";
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 2px 9px;
  position: relative;
  z-index: 2;
}

/* 滚动视口：只在这一层裁剪，避免文字滑过「公告」徽章 */
.notice-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.notice-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
  will-change: transform;
}

.notice:hover .notice-track { animation-play-state: paused; }

.notice-item {
  font-size: 13px;
  color: var(--text-2);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 24px)); }
}

/* ---------------- 卡片列表 ---------------- */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: rise .34s cubic-bezier(.22,.61,.36,1) both;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16,20,40,.05), 0 12px 28px rgba(16,20,40,.09);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.card-img {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 11px;
  overflow: hidden;
  background: #f1f2f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-img .ph {
  font-size: 30px;
  font-weight: 700;
  color: #c4c8d4;
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
}

.stars {
  color: var(--star);
  letter-spacing: 1.5px;
  font-size: 12px;
}

.score {
  color: var(--brand);
  font-weight: 600;
}

.card-count {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.card-count b { color: var(--text-2); font-weight: 600; }

.card-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  justify-content: flex-end;
}

.card-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background-color: var(--brand);
  background-image: linear-gradient(135deg, rgba(255,255,255,.16), rgba(0,0,0,.14));
  box-shadow: 0 3px 10px rgba(16, 20, 40, .16);
  transition: filter .16s ease, transform .16s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.card-go:hover { filter: brightness(1.06); }
.card-go:active { transform: scale(.97); }

.card-go.is-off {
  background: #e9ebf2;
  color: var(--text-3);
  box-shadow: none;
  cursor: default;
}

/* ---------------- 空状态 / 页脚 ---------------- */
.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  padding: 48px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  line-height: 2;
}

.empty span { font-size: 12px; }

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
}

/* ---------------- 移动端微调 ---------------- */
@media (max-width: 380px) {
  .card-img { flex-basis: 76px; width: 76px; height: 76px; }
  .card-title { font-size: 14px; }
  .card-go { padding: 6px 14px; font-size: 12px; }
  .notice::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .notice-track { animation: none; }
  .card { animation: none; }
}
