:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #74817b;
  --line: #e9eeeb;
  --paper: #ffffff;
  --canvas: #f5f7f5;
  --green: #237b5c;
  --green-dark: #185b43;
  --green-soft: #eaf5ef;
  --orange: #e9a65a;
  --shadow: 0 12px 32px rgba(32, 60, 46, .07);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--canvas);
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.topbar {
  height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  background: rgba(245, 247, 245, .94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
  cursor: pointer;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--green);
  font-size: 17px;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .5px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: var(--green);
  font-size: 25px;
  cursor: pointer;
}

.main-content { padding: 10px 20px 30px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 23px 23px;
  border-radius: 24px;
  background: #e7f2eb;
}

.hero::after {
  position: absolute;
  right: -25px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(35, 123, 92, .12);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  max-width: 320px;
  margin-bottom: 8px;
  font-size: clamp(24px, 7vw, 31px);
  line-height: 1.35;
  letter-spacing: -1px;
}

.hero-copy {
  margin-bottom: 19px;
  color: #64746b;
  font-size: 13px;
  line-height: 1.7;
}

.search-form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 0 14px;
  border: 1px solid rgba(33, 75, 55, .08);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(40, 82, 57, .05);
}

.search-icon { margin-right: 9px; color: var(--green); font-size: 20px; }
.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.search-form input::placeholder { color: #a0aaa4; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 27px 2px 14px;
}
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.category-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 13px;
  border: 1px solid rgba(224, 232, 226, .8);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 3px 12px rgba(34, 64, 47, .025);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.category-card:active, .entry-card:active { transform: scale(.985); }
.category-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 20px;
}
.category-card:nth-child(3n + 2) .category-icon { background: #fff2e4; }
.category-card:nth-child(3n) .category-icon { background: #edf0fc; }
.category-info { min-width: 0; overflow-wrap: anywhere; }
.category-name { display: block; font-size: 14px; font-weight: 700; }
.category-count { display: block; margin-top: 5px; color: #96a19b; font-size: 10px; }
.category-arrow { margin-left: auto; color: #9baa9f; font-size: 17px; }

.quick-favorite {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 17px;
  padding: 16px;
  border: 1px solid #e8eee9;
  border-radius: 17px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.quick-favorite-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fff1e2;
  color: #d58e3c;
  font-size: 20px;
}
.quick-favorite strong { display: block; font-size: 13px; }
.quick-favorite small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.quick-favorite .category-arrow { margin-left: auto; }

.page-heading { padding: 10px 2px 17px; }
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.page-heading h1 { margin-bottom: 5px; font-size: 26px; letter-spacing: -.8px; }
.page-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.type-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 15px; }
.type-filter {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #e5ebe7;
  border-radius: 12px;
  background: #fff;
  color: #64746b;
  font-size: 12px;
  cursor: pointer;
}
.type-filter.active { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.entry-list { display: grid; gap: 11px; }
.entry-card {
  width: 100%;
  min-width: 0;
  display: block;
  padding: 17px 17px 15px;
  border: 1px solid #e9eeeb;
  border-radius: 17px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease;
}
.entry-title { display: block; overflow-wrap: anywhere; font-size: 15px; font-weight: 700; line-height: 1.55; }
.entry-scene {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 13px;
  color: #68776f;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.entry-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tag-list { min-width: 0; display: flex; flex: 1; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 7px;
  background: #f1f5f2;
  color: #63736a;
  font-size: 10px;
}
.tag-audience { background: #eaf5ef; color: var(--green); }
.entry-open { flex: 0 0 auto; color: #9aa59f; font-size: 16px; }
.empty-state {
  padding: 39px 23px;
  border: 1px dashed #dce5de;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  text-align: center;
}
.empty-state-icon { margin-bottom: 11px; font-size: 29px; }
.empty-state h2 { margin-bottom: 7px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.detail-top { padding-bottom: 17px; }
.detail-kicker { margin-bottom: 9px; color: var(--green); font-size: 12px; font-weight: 700; }
.detail-title { margin-bottom: 13px; overflow-wrap: anywhere; font-size: 25px; line-height: 1.4; letter-spacing: -.6px; }
.detail-tags { margin-bottom: 0; }
.detail-sections { display: grid; gap: 11px; }
.detail-section {
  padding: 17px 17px 16px;
  border: 1px solid #e9eeeb;
  border-radius: 17px;
  background: #fff;
}
.detail-section h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.section-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}
.detail-section p { margin: 0; color: #4e5e55; font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-line { display: block; }
.detail-line + .detail-line { margin-top: .35em; }
.how-content { color: #34493e !important; }
.detail-actions { display: flex; gap: 9px; margin-top: 15px; }
.secondary-button, .primary-button {
  min-height: 43px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.secondary-button { border: 1px solid #e5ebe7; background: #fff; color: var(--green); }
.primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.detail-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 15px; }
.detail-nav button { flex: 1; min-height: 47px; border: 1px solid #e5ebe7; border-radius: 13px; background: #fff; font-size: 12px; cursor: pointer; }
.detail-nav button:disabled { color: #b5beb9; cursor: default; }
.detail-nav span { margin: 0 5px; }

.bottom-nav {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 560px);
  height: calc(67px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  margin: 0 auto;
  padding: 8px 26px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(228, 235, 230, .9);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}
.nav-button { min-width: 70px; display: grid; justify-items: center; gap: 2px; padding: 1px 10px; border: 0; background: transparent; color: #9aa69f; font-size: 10px; cursor: pointer; }
.nav-button span:first-child { font-size: 23px; line-height: 1.1; }
.nav-button.active { color: var(--green); font-weight: 700; }
.toast {
  position: fixed;
  z-index: 10;
  right: 50%;
  bottom: calc(83px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 42px);
  padding: 10px 15px;
  transform: translate(50%, 10px);
  border-radius: 12px;
  background: rgba(25, 43, 34, .92);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.visible { transform: translate(50%, 0); opacity: 1; }

@media (min-width: 560px) {
  .app-shell { box-shadow: 0 0 60px rgba(30, 55, 42, .08); }
  .bottom-nav { box-shadow: 0 -7px 22px rgba(30, 55, 42, .035); }
}

@media (max-width: 360px) {
  .main-content { padding-right: 15px; padding-left: 15px; }
  .category-card { gap: 9px; padding: 12px 10px; }
  .category-icon { width: 37px; height: 37px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
