:root {
  --blue: #0052d9;
  --blue-2: #1296db;
  --red: #fa3534;
  --ink: #222;
  --muted: #8a93a3;
  --line: #eef0f4;
  --bg: #f4f6fb;
  --card: #fff;
  --shadow: 0 8px 24px rgba(0, 56, 143, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #e8edf5;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

#app {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}
body.has-tab #app { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
body.has-footer #app { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}
.topbar .back, .topbar .side {
  width: 36px;
  height: 36px;
  border: 0;
  background: #f3f6fb;
  border-radius: 10px;
  color: var(--blue);
  font-size: 18px;
  cursor: pointer;
}
.topbar .side { visibility: hidden; }

.search-wrap { padding: 12px 14px 0; background: #fff; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f5f9;
  border-radius: 999px;
  padding: 10px 14px;
  color: #9aa3b2;
}
.search-bar input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-size: 14px;
  color: var(--ink);
}
.search-bar button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.swiper {
  margin: 12px 14px 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #d9e4f5;
  height: 168px;
}
.swiper-track {
  display: flex;
  height: 100%;
  transition: transform .45s ease;
}
.swiper-track img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  flex: 0 0 100%;
}
.dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.dots i {
  width: 6px; height: 6px; border-radius: 99px;
  background: rgba(255,255,255,.55);
}
.dots i.on { width: 14px; background: #fff; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 10px 0;
  background: #fff;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .chips button {
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 14px;
  padding: 8px 10px 10px;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}
.tabs button.on { color: var(--blue); font-weight: 700; }
.tabs button.on::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 3px; border-radius: 3px;
  background: var(--blue);
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 14px 12px;
  background: #fff;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  background: #f2f4f8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}
.chips button.on { background: rgba(0,82,217,.1); color: var(--blue); font-weight: 700; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(0, 56, 143, .14);
  padding: 8px 8px 10px;
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.card .logo {
  width: 100%;
  height: 96px;
  object-fit: contain;
  background: #f7f8fb;
  border-radius: 10px;
  display: block;
}
.ribbon {
  position: absolute;
  top: 8px; left: 14px;
  color: #fff;
  font-size: 11px;
  padding: 4px 0 8px;
  width: 22px;
  text-align: center;
  line-height: 1.15;
  border-radius: 0 0 4px 4px;
}
.ribbon.hot { background: var(--red); }
.ribbon.rec { background: var(--blue); }
.card h3 {
  margin: 8px 2px 0;
  font-size: 13px;
  line-height: 1.35;
  height: 35px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card .meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: #9aa3b2;
}
.st { font-weight: 700; white-space: nowrap; }
.st.hot { color: var(--red); }
.st.blue { color: var(--blue); }

.news-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.news {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.news img {
  width: 112px; height: 78px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef2f7;
  flex: 0 0 auto;
}
.news h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news .sub { margin-top: 10px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

.hero { position: relative; height: 250px; background: #123; color: #fff; }
.hero img { width: 100%; height: 250px; object-fit: cover; display: block; }
.hero .mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(8,20,48,.78));
}
.hero .copy { position: absolute; left: 16px; right: 16px; bottom: 16px; }
.hero h2 { margin: 8px 0; font-size: 20px; line-height: 1.35; }
.hero .loc { font-size: 13px; opacity: .92; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span, .hot-tags span {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.count-card {
  margin: -18px 14px 0;
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.count-card .label { color: var(--muted); font-size: 12px; }
.count-card .nums { font-size: 22px; font-weight: 800; letter-spacing: 1px; margin-top: 4px; }
.count-card .nums b {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  background: #f3f6ff;
  color: var(--blue);
  border-radius: 8px;
  padding: 2px 4px;
}
.count-card .units { display: flex; gap: 18px; color: #98a2b3; font-size: 11px; margin-top: 4px; }
.pill {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.section { margin: 14px; }
.section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h3::before {
  content: "";
  width: 4px; height: 16px; border-radius: 4px; background: var(--blue);
}
.info-row, .stat, .menu, .contact {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.info-row {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.info-row .k { color: var(--muted); font-size: 12px; }
.info-row .v { margin-top: 4px; font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 18px; color: var(--blue); margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: 12px; }
.rich {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  overflow: hidden;
}
.rich img { height: auto; border-radius: 8px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photos img { height: 110px; width: 100%; object-fit: cover; border-radius: 10px; background: #eef2f7; cursor: pointer; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.hscroll .mini {
  flex: 0 0 180px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.hscroll img { height: 100px; width: 100%; object-fit: cover; background: #eef2f7; }
.hscroll p { margin: 8px; font-size: 13px; line-height: 1.4; height: 36px; overflow: hidden; }

.footer-bar {
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244,246,251,0), #f4f6fb 30%);
  box-sizing: border-box;
}
body.has-tab .footer-bar {
  bottom: calc(56px + env(safe-area-inset-bottom));
}
.footer-bar button, .primary {
  width: 100%;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 12px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.field textarea { min-height: 72px; resize: vertical; }
.hp { position: absolute; left: -9999px; }

.profile {
  margin: 16px 14px;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center;
  font-size: 22px;
}
.profile p { margin: 4px 0 0; font-size: 12px; opacity: .9; }
.menu { margin: 0 14px 12px; overflow: hidden; }
.menu a, .menu button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 16px; }
.hot-tags span {
  background: #fff;
  color: var(--blue);
  border: 1px solid #d6e4ff;
  cursor: pointer;
}
.contact { margin: 0 14px 16px; padding: 6px 16px 14px; }
.contact .row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contact .row b { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-bottom: 4px; }
.empty, .loading, .guide {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
}
.guide h2 { color: var(--ink); font-size: 18px; }
.more {
  display: block;
  margin: 0 auto 18px;
  border: 0;
  background: #fff;
  color: var(--blue);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

#tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid var(--line);
  display: none;
  z-index: 30;
}
body.has-tab #tabbar { display: flex; }
#tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: #98a2b3;
}
#tabbar img { width: 22px; height: 22px; object-fit: contain; }
#tabbar a.on { color: var(--blue-2); font-weight: 700; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, .92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 50;
  max-width: min(420px, calc(100% - 32px));
  font-size: 13px;
  text-align: center;
}
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
}
#lightbox.show { display: flex; }
#toast[hidden] { display: none !important; }
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.desk {
  display: block;
  text-align: center;
  color: #98a2b3;
  font-size: 12px;
  padding: 8px 0 18px;
}
.account-bar {
  width: calc(100% - 28px);
  margin: 16px 14px 0;
  border: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}
.account-bar .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.account-text { flex: 1; min-width: 0; }
.account-text strong { display: block; font-size: 16px; }
.account-text small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.chev { color: #98a2b3; font-size: 20px; line-height: 1; }
.account-panel {
  margin: 10px 14px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.account-panel[hidden] { display: none !important; }
.phone-line, .code-line { display: flex; gap: 8px; align-items: center; }
.prefix {
  height: 42px;
  padding: 0 10px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #667085;
  background: #f8fafc;
}
.phone-line input, .code-line input { flex: 1; }
.code-btn {
  height: 42px;
  border: 0;
  background: #eef3ff;
  color: var(--blue);
  border-radius: 10px;
  padding: 0 12px;
  font-weight: 700;
  white-space: nowrap;
}
.code-btn:disabled { color: #98a2b3; background: #f2f4f7; }
.agree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 12px;
}
.agree a { color: var(--blue); }
.sub-list { display: flex; flex-direction: column; gap: 10px; }
.sub-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.sub-item img {
  width: 72px;
  height: 52px;
  object-fit: contain;
  background: #f7f8fb;
  border-radius: 8px;
}
.sub-item h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.35; }
.logout-btn {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: #f8fafc;
  color: #d54941;
  border-radius: 999px;
  padding: 12px;
  font-weight: 700;
}
