:root {
  color-scheme: light;
  --page: #eef7ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #172033;
  --muted: #7b8494;
  --line: rgba(38, 108, 196, 0.12);
  --blue: #2878f0;
  --blue-deep: #0b4aa2;
  --cyan: #43cfc4;
  --orange: #ff9a2f;
  --purple: #8a66f3;
  --shadow: 0 14px 34px rgba(46, 105, 170, 0.14);
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.mini-app {
  min-height: 100vh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 25%),
    linear-gradient(180deg, #dff2ff 0%, #eef7ff 45%, #f8fbff 100%);
}

.app-header {
  min-height: 326px;
  padding: 0 18px 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #d8efff 0%, #eaf8ff 56%, rgba(238, 247, 255, 0) 100%);
}

.status-space {
  height: max(20px, env(safe-area-inset-top));
}

.nav-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
}

.nav-bar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.wechat-capsule {
  position: absolute;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.92);
}

.wechat-capsule span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #111827;
}

.wechat-capsule i {
  display: block;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border: 3px solid #111827;
  border-radius: 50%;
}

.hero {
  position: relative;
  min-height: 228px;
  margin: 8px -8px 0;
  padding: 52px 8px 22px;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(90deg, rgba(221, 241, 255, 0.98) 0%, rgba(221, 241, 255, 0.94) 48%, rgba(221, 241, 255, 0.3) 100%),
    url("../assets/hero-bg.png") center bottom / cover no-repeat;
}

.hero__copy {
  position: relative;
  z-index: 2;
}

.hero__copy p {
  margin: 0;
  color: var(--blue-deep);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero__copy strong {
  display: block;
  max-width: 290px;
  margin-top: 8px;
  color: var(--blue-deep);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero__badges span {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #1f64b5;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(36, 113, 206, 0.08);
}

.hero__city {
  position: absolute;
  right: -26px;
  bottom: -10px;
  width: min(58vw, 248px);
  max-width: 270px;
  opacity: 0;
  pointer-events: none;
}

main {
  width: min(100% - 24px, 430px);
  margin: -32px auto 0;
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
  min-height: 66px;
  padding: 8px;
  border: 1px solid rgba(36, 120, 240, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.search-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
}

.search-box span {
  flex: 0 0 auto;
  color: #4d5a6f;
  font-size: 14px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-button {
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #3c91ff, #236cf0);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(35, 108, 240, 0.3);
}

.category-item strong,
.recommend-item strong {
  display: block;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0;
}

.recommend-item span,
.recommend-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.category-panel,
.section,
.filter-drawer {
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(46, 105, 170, 0.1);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.category-item {
  min-width: 0;
  min-height: 98px;
  padding: 13px 4px 12px;
  background: transparent;
  border-right: 1px solid rgba(38, 108, 196, 0.08);
  border-bottom: 1px solid rgba(38, 108, 196, 0.08);
}

.category-item:nth-child(4n) {
  border-right: 0;
}

.category-item:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.category-item.is-active {
  background: rgba(40, 120, 240, 0.08);
}

.category-item img {
  display: block;
  width: 50px;
  height: 50px;
  margin: 0 auto;
  object-fit: contain;
}

.category-item strong {
  margin-top: 8px;
  font-size: 16px;
}

.section {
  padding: 16px;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.section__head button,
.section__head span,
.filter-drawer button,
.filter-drawer select {
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.recommend-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recommend-item {
  min-width: 0;
  text-align: center;
}

.recommend-item img {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border-radius: 16px;
  object-fit: contain;
  background: #f0f7ff;
}

.recommend-item strong {
  margin-top: 6px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-item small {
  margin-top: 4px;
  color: #8b95a5;
}

.filter-drawer {
  padding: 10px 12px;
}

.filter-drawer__top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.filter-drawer strong {
  color: var(--blue-deep);
  font-size: 14px;
}

.filter-drawer select {
  max-width: 116px;
  border: 0;
  outline: 0;
}

.resource-list,
.news-list {
  display: grid;
  gap: 10px;
}

.resource-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(38, 108, 196, 0.08);
}

.resource-row:first-child,
.news-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.resource-row__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #eff7ff;
}

.resource-row__icon img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.resource-row__body {
  min-width: 0;
}

.resource-row__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.resource-row h3,
.news-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.resource-row__title span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--blue);
  background: #eaf3ff;
  font-size: 11px;
  font-weight: 800;
}

.resource-row__desc {
  margin: 6px 0 0;
  color: #596579;
  font-size: 13px;
}

.resource-row__meta {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag-row span {
  border-radius: 999px;
  padding: 3px 7px;
  color: #24706c;
  background: #e8f8f5;
  font-size: 11px;
  font-weight: 700;
}

.resource-row__detail {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #f6faff;
}

.resource-row__detail p {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  font-size: 12px;
}

.resource-row__detail span {
  color: var(--muted);
}

.resource-row__detail strong {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.resource-row__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.resource-row__actions button,
.resource-row__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

.resource-row__actions button {
  color: var(--blue);
  background: #edf5ff;
}

.resource-row__actions a {
  color: #fff;
  background: linear-gradient(135deg, #38a0ff, #236cf0);
}

.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 9px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid rgba(38, 108, 196, 0.08);
}

.news-row p {
  margin: 4px 0 0;
  color: #596579;
  font-size: 13px;
}

.news-row time {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 130px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.tab-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 66px;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(38, 108, 196, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: #6f7a8d;
  font-size: 12px;
  font-weight: 800;
}

.tab-bar img {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
}

.tab-bar a.is-active {
  color: var(--blue);
}

@media (min-width: 680px) {
  body {
    background: #dfeaf7;
  }

  .mini-app {
    width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(20, 53, 92, 0.08), 0 20px 60px rgba(20, 53, 92, 0.2);
  }

  .tab-bar {
    right: auto;
    left: 50%;
    width: 430px;
    transform: translateX(-50%);
  }
}

@media (max-width: 374px) {
  .hero__copy p {
    font-size: 26px;
  }

  .hero__copy strong {
    font-size: 19px;
  }

  .category-item strong {
    font-size: 14px;
  }

  .recommend-strip,
  .category-grid {
    gap: 6px;
  }
}
