:root {
  --river: #176b73;
  --deep: #123a46;
  --soft: #deebea;
  --paper: #f5f6f3;
  --card: #fffefa;
  --wall: #e5e1d8;
  --ink: #202726;
  --muted: #71807e;
  --red: #c94b3c;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e9edeb;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #e9edeb; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(23,107,115,.28); outline-offset: 2px; }

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(18,58,70,.10);
}

#view { min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); }
.screen { animation: screen-in .28s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.tabbar {
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 50%;
  display: flex;
  width: min(100%, 480px);
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  transform: translateX(-50%);
  background: rgba(255,255,252,.96);
  border-top: 1px solid rgba(18,58,70,.10);
  backdrop-filter: blur(18px);
}

.tab { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #637170; background: transparent; }
.tab b { font-size: 12px; font-weight: 500; }
.tab.active { color: var(--river); }
.tab.active b { font-weight: 700; }
.icon { position: relative; display: block; width: 25px; height: 25px; color: currentColor; }
.icon-home::before { position: absolute; inset: 6px 3px 1px; background: currentColor; border-radius: 2px; content: ""; }
.icon-home::after { position: absolute; top: 1px; left: 5px; width: 15px; height: 15px; background: currentColor; border-radius: 2px; transform: rotate(45deg); content: ""; }
.icon-search::before { position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border: 3px solid currentColor; border-radius: 50%; content: ""; }
.icon-search::after { position: absolute; right: 1px; bottom: 4px; width: 10px; height: 3px; background: currentColor; border-radius: 3px; transform: rotate(45deg); content: ""; }
.icon-calendar { border: 3px solid currentColor; border-radius: 4px; }
.icon-calendar::before { position: absolute; top: 4px; right: 0; left: 0; height: 3px; background: currentColor; content: ""; }
.icon-calendar::after { position: absolute; top: 12px; left: 5px; width: 3px; height: 3px; background: currentColor; border-radius: 50%; box-shadow: 7px 0 currentColor; content: ""; }
.icon-person::before { position: absolute; top: 0; left: 8px; width: 10px; height: 10px; background: currentColor; border-radius: 50%; content: ""; }
.icon-person::after { position: absolute; right: 3px; bottom: 1px; left: 3px; height: 12px; background: currentColor; border-radius: 12px 12px 3px 3px; content: ""; }

.surface { background: var(--card); border: 1px solid rgba(18,58,70,.09); border-radius: 21px; box-shadow: 0 10px 28px rgba(18,58,70,.06); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 17px 3px 22px; }
.page-head h1 { margin: 0; color: var(--deep); font-family: "STKaiti", "KaiTi", serif; font-size: 34px; line-height: 1; letter-spacing: 1px; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.points-badge { padding: 8px 11px; color: var(--red); background: #f7ebe7; border-radius: 999px; font-size: 12px; font-weight: 700; }
.primary { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; color: #fff; background: var(--river); border-radius: 14px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 6px 10px; color: var(--deep); background: #edf4f3; border-radius: 999px; font-size: 12px; }

/* Home */
.home-screen { padding-top: 0; }
.hero { position: relative; min-height: 330px; margin: -16px -16px 0; padding: calc(max(24px, env(safe-area-inset-top)) + 18px) 20px 0; overflow: hidden; }
.hero-meta { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { color: #6d898a; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.hero-points { padding: 6px 9px; color: var(--deep); background: rgba(255,255,255,.7); border: 1px solid rgba(23,107,115,.13); border-radius: 999px; font-size: 11px; }
.hero-points em { margin-right: 4px; color: var(--red); font-style: normal; }
.hero h1 { position: relative; z-index: 2; margin: 45px 0 0; color: var(--deep); font-family: "STKaiti", "KaiTi", serif; font-size: clamp(34px, 9vw, 44px); line-height: 1.08; letter-spacing: 1px; text-align: center; }
.hero h2 { position: relative; z-index: 2; margin: 13px 0 0; color: #356368; font-family: "STKaiti", "KaiTi", serif; font-size: 18px; font-weight: 500; letter-spacing: 3px; text-align: center; }
.landscape { position: absolute; right: -10%; bottom: -15px; left: -10%; height: 155px; opacity: .7; }
.tower { position: absolute; bottom: 63px; left: 12%; width: 57px; height: 36px; background: #bed3d4; border-radius: 3px; }
.tower::before { position: absolute; top: -20px; left: -12px; width: 81px; height: 25px; background: #8eb5b7; clip-path: polygon(50% 0,100% 80%,70% 67%,50% 100%,30% 67%,0 80%); content: ""; }
.tower::after { position: absolute; left: -31px; bottom: -13px; width: 150px; height: 17px; background: #cfdddd; content: ""; }
.bridge { position: absolute; right: 9%; bottom: 46px; width: 190px; height: 49px; border-top: 8px solid #b8cecf; }
.bridge i { position: absolute; top: -2px; width: 53px; height: 37px; border: 8px solid #b8cecf; border-bottom: 0; border-radius: 50px 50px 0 0; }
.bridge i:nth-child(1) { left: 8px; }.bridge i:nth-child(2) { left: 67px; }.bridge i:nth-child(3) { left: 126px; }
.river { position: absolute; right: -20%; bottom: 8px; left: -20%; height: 70px; border: 5px solid rgba(70,151,156,.3); border-right-color: transparent; border-left-color: transparent; border-radius: 50%; transform: rotate(-5deg); }
.river::before, .river::after { position: absolute; border: 5px solid rgba(70,151,156,.26); border-right-color: transparent; border-left-color: transparent; border-radius: 50%; content: ""; }
.river::before { inset: 12px -15px -20px; }.river::after { inset: 27px -25px -38px; }
.home-card { position: relative; z-index: 3; margin-bottom: 14px; padding: 20px; }
.home-heading { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 16px; }
.round-mark { display: grid; flex: 0 0 auto; width: 47px; height: 47px; place-items: center; color: #fff; background: var(--river); border-radius: 50%; font-family: "STKaiti", serif; font-size: 19px; font-weight: 700; }
.home-card h3 { margin: 1px 0 7px; color: var(--deep); font-size: 20px; }
.home-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.rules-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.rules-head .round-mark { width: 35px; height: 35px; font-family: inherit; font-size: 16px; }
.rules-head h3 { margin: 0; }
.rule-list { overflow: hidden; border: 1px solid var(--wall); border-radius: 14px; }
.rule-row { display: grid; min-height: 48px; padding: 0 13px; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--wall); }
.rule-row:last-child { border: 0; }
.rule-row i { display: grid; width: 25px; height: 25px; place-items: center; color: #fff; background: var(--river); border-radius: 7px; font-size: 11px; font-style: normal; font-weight: 700; }
.rule-row span { font-size: 14px; }.rule-row b { color: var(--red); font-size: 14px; }
.text-link { display: block; margin: 13px auto -4px; padding: 7px; color: var(--river); background: transparent; font-size: 13px; }
.quick-search { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 17px 19px; color: #fff; background: var(--deep); border-radius: 20px; }
.quick-search h3 { margin: 0; font-size: 16px; }.quick-search p { margin: 5px 0 0; color: rgba(255,255,255,.65); font-size: 11px; }.quick-search .icon-search { width: 31px; height: 31px; }

/* Search */
.searchbox { display: flex; height: 54px; align-items: center; padding: 0 15px; }
.searchbox .icon-search { flex: 0 0 auto; width: 22px; height: 22px; color: var(--river); }
.searchbox input { flex: 1; height: 100%; margin-left: 12px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 15px; }
.scope-tabs { display: flex; gap: 9px; margin: 13px 0 20px; }
.scope { flex: 1; padding: 13px 14px; color: #657472; background: #e8edea; border: 1px solid transparent; border-radius: 15px; text-align: left; }
.scope b, .scope small { display: block; }.scope b { font-size: 15px; }.scope small { margin-top: 4px; font-size: 11px; }.scope.active { color: var(--deep); background: #e4f0ef; border-color: rgba(23,107,115,.22); }
.result-meta { display: flex; justify-content: space-between; margin: 0 3px 10px; color: var(--muted); font-size: 12px; }
.member-card { margin-bottom: 12px; padding: 16px; }
.member-top { display: flex; align-items: center; }.avatar { display: grid; flex: 0 0 auto; width: 46px; height: 46px; place-items: center; color: #fff; background: var(--river); border-radius: 15px; font-family: "STKaiti", serif; font-size: 20px; font-weight: 700; }.identity { flex: 1; min-width: 0; margin-left: 12px; }.identity h3 { margin: 0; color: var(--deep); font-size: 17px; }.identity h3 small { margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 400; }.company { overflow: hidden; margin-top: 4px; color: #62716f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.arrow { color: #91a09e; font-size: 28px; }
.route { display: flex; align-items: center; margin: 13px 0 10px; color: var(--river); font-size: 12px; font-weight: 700; }.route i { flex: 1; height: 1px; margin: 0 8px; background: linear-gradient(90deg,rgba(23,107,115,.5),rgba(23,107,115,.05)); }.business { color: #344341; font-size: 14px; line-height: 1.55; }.need { margin-top: 9px; padding-top: 9px; color: #677572; border-top: 1px dashed #d9dfdc; font-size: 12px; line-height: 1.5; }.need b { margin-right: 6px; color: var(--red); }

/* Activity */
.activity-types { display: flex; gap: 9px; margin-bottom: 22px; }.type-card { display: flex; flex: 1; align-items: center; gap: 9px; padding: 14px 11px; color: #fff; background: var(--river); border-radius: 16px; }.type-card:nth-child(2) { background: var(--deep); }.type-mark { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; background: rgba(255,255,255,.14); border-radius: 9px; font-family: "STKaiti",serif; font-weight: 700; }.type-card b,.type-card small { display: block; }.type-card b { font-size: 14px; }.type-card small { margin-top: 3px; color: rgba(255,255,255,.65); font-size: 9px; }.list-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 3px 11px; }.list-head b { color: var(--deep); font-size: 18px; }.list-head small { color: var(--red); font-size: 11px; }
.activity-card { overflow: hidden; margin-bottom: 14px; }.activity-cover { position: relative; height: 118px; overflow: hidden; color: #fff; background: var(--river); }.activity-cover.visit { background: #365e63; }.activity-cover h3 { position: absolute; top: 16px; left: 17px; margin: 0; font-family: "STKaiti",serif; font-size: 29px; }.activity-cover span { position: absolute; right: 15px; bottom: 13px; padding: 5px 9px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 11px; }.activity-cover::after { position: absolute; right: -40px; bottom: -110px; width: 280px; height: 190px; border: 4px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: inset 0 0 0 29px transparent, 0 0 0 28px rgba(255,255,255,.05), 0 0 0 57px rgba(255,255,255,.04); content: ""; }.activity-body { padding: 16px; }.activity-title { margin: 0 0 12px; color: var(--deep); font-size: 17px; line-height: 1.4; }.meta { margin: 7px 0; color: #53615f; font-size: 12px; }.meta em { margin-right: 8px; color: #899593; font-style: normal; }.activity-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 12px; border-top: 1px solid #e5e8e5; }.activity-foot small { margin-right: 7px; color: var(--muted); }.activity-foot strong { color: var(--red); font-size: 11px; }.signup { min-height: 37px; padding: 0 15px; color: #fff; background: var(--river); border-radius: 10px; font-size: 12px; }.signup.done { color: #74817f; background: #e1e7e4; }

/* Profile */
.profile-card { position: relative; overflow: hidden; padding: 20px; color: #fff; background: var(--deep); border-radius: 22px; box-shadow: 0 14px 30px rgba(18,58,70,.15); }.profile-top { position: relative; display: flex; align-items: center; }.profile-top .avatar { width: 52px; height: 52px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); }.profile-main { flex: 1; min-width: 0; margin-left: 12px; }.profile-main h2 { margin: 0; font-family: "STKaiti",serif; font-size: 22px; }.profile-main p { overflow: hidden; margin: 5px 0 0; color: rgba(255,255,255,.65); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.edit-mini { padding: 7px 11px; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 9px; font-size: 11px; }.profile-card .route { color: #acd0d1; }.profile-card .route i { background: rgba(172,208,209,.28); }.profile-business { position: relative; font-size: 13px; line-height: 1.6; }.profile-card .tags { margin-top: 11px; }.profile-card .tag { color: #fff; background: rgba(255,255,255,.09); }.profile-button { width: 100%; min-height: 41px; margin-top: 14px; color: var(--deep); background: #fffefa; border-radius: 11px; font-weight: 700; }.stats { display: flex; gap: 8px; margin: 13px 0 18px; }.stat { display: flex; flex: 1; flex-direction: column; align-items: center; padding: 13px 5px; }.stat b { color: var(--deep); font-size: 22px; }.stat small { margin-top: 3px; color: var(--muted); font-size: 10px; }.panel-tabs { display: flex; margin-bottom: 10px; border-bottom: 1px solid #dce2de; }.panel-tabs button { position: relative; flex: 1; padding: 11px; color: var(--muted); background: transparent; }.panel-tabs button.active { color: var(--deep); font-weight: 700; }.panel-tabs button.active::after { position: absolute; right: 33%; bottom: -1px; left: 33%; height: 3px; background: var(--river); border-radius: 3px; content: ""; }.records { overflow: hidden; padding: 0 15px; }.record { display: flex; min-height: 61px; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e8e4; }.record:last-child { border: 0; }.record span b,.record span small { display: block; }.record span b { max-width: 260px; color: #354341; font-size: 13px; }.record span small { margin-top: 4px; color: #96a09e; font-size: 10px; }.amount { color: var(--river); font-size: 17px; }.amount.minus { color: var(--red); }.status { padding: 5px 8px; color: var(--river); background: #e9f2f0; border-radius: 999px; font-size: 10px; }.empty { padding: 42px 15px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }.reset { display: block; margin: 18px auto; color: #96625e; background: transparent; font-size: 11px; }

/* Overlay / details / forms */
.overlay { position: fixed; z-index: 100; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 16px max(16px, calc((100vw - 480px)/2 + 16px)) calc(16px + env(safe-area-inset-bottom)); background: rgba(9,34,39,.61); }
.sheet { width: min(100%, 448px); max-height: 88dvh; overflow: auto; padding: 22px; background: #fffefa; border-radius: 25px; animation: sheet-in .25s ease both; }.sheet-handle { width: 42px; height: 4px; margin: -7px auto 19px; background: #d7dcda; border-radius: 4px; }.sheet h2 { margin: 0 0 12px; color: var(--deep); font-family: "STKaiti",serif; font-size: 27px; }.sheet-copy { color: var(--muted); font-size: 14px; line-height: 1.7; }.detail-head { display: flex; align-items: center; margin-bottom: 16px; }.detail-head .avatar { width: 57px; height: 57px; margin-right: 13px; }.detail-head h2 { margin-bottom: 3px; }.detail-block { margin: 17px 0; color: #344341; font-size: 14px; line-height: 1.65; }.detail-block label { display: block; margin-bottom: 5px; color: var(--deep); font-size: 12px; font-weight: 700; }.locked, .contact { padding: 18px; background: #edf4f3; border-radius: 16px; text-align: center; }.locked h3 { margin: 8px 0 4px; color: var(--deep); }.locked p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }.contact { text-align: left; }.contact-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(23,107,115,.12); }.contact-row span:first-child { color: var(--muted); }.contact-actions, .form-actions { display: flex; gap: 9px; margin-top: 13px; }.contact-actions button, .form-actions button { flex: 1; min-height: 44px; border-radius: 12px; }.contact-actions button { color: #fff; background: var(--river); }.notice { margin: 14px 0; padding: 13px; color: #704f49; background: #f7ebe7; border-radius: 12px; font-size: 12px; line-height: 1.55; }
.form { padding-top: 3px; }.form label { display: block; margin-bottom: 13px; color: #4d5a58; font-size: 12px; font-weight: 700; }.form input,.form textarea { width: 100%; margin-top: 6px; padding: 12px; color: var(--ink); background: #fff; border: 1px solid #dce3df; border-radius: 11px; outline: 0; font-size: 14px; font-weight: 400; }.form textarea { min-height: 90px; resize: vertical; }.form-actions button:first-child { color: var(--river); background: #e5eeeb; }.form-actions button:last-child { color: #fff; background: var(--river); }
.toast { position: fixed; z-index: 200; top: 20px; left: 50%; max-width: calc(100% - 40px); padding: 11px 16px; color: #fff; background: rgba(18,58,70,.94); border-radius: 999px; box-shadow: 0 8px 25px rgba(18,58,70,.2); transform: translateX(-50%); font-size: 13px; animation: toast .25s ease both; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .4; } }
@keyframes toast { from { transform: translate(-50%,-15px); opacity: 0; } }

/* First-entry member form */
.onboarding { margin: -16px; padding: max(22px, env(safe-area-inset-top)) 16px 42px; background: linear-gradient(180deg,#e9f1f0 0,#f5f6f3 300px); }
.onboarding-hero { position: relative; padding: 24px 7px 20px 68px; }
.onboarding-mark { position: absolute; top: 18px; left: 5px; display: grid; width: 50px; height: 50px; place-items: center; color: #fff; background: var(--river); border-radius: 17px; font-family: "STKaiti",serif; font-size: 24px; font-weight: 700; box-shadow: 0 10px 24px rgba(23,107,115,.18); }
.onboarding-hero p { margin: 0 0 8px; color: var(--river); font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.onboarding-hero h1 { margin: 0; color: var(--deep); font-family: "STKaiti",serif; font-size: 31px; line-height: 1.2; }
.onboarding-hero h2 { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.65; }
.onboarding-progress { display: flex; align-items: center; gap: 5px; margin: 3px 7px 15px; }
.onboarding-progress span { width: 24px; height: 4px; background: #d7dfdc; border-radius: 4px; }.onboarding-progress span.active { width: 46px; background: var(--river); }.onboarding-progress small { margin-left: auto; color: var(--muted); font-size: 10px; }
.member-form.surface { padding: 20px; border-radius: 24px; }
.form-group-title { display: flex; align-items: flex-start; gap: 10px; margin: 7px 0 16px; padding-top: 8px; border-top: 1px solid #e6eae6; }.form-group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }.form-group-title > span { padding-top: 2px; color: var(--red); font-size: 11px; font-weight: 700; }.form-group-title div { display: flex; flex-direction: column; }.form-group-title b { color: var(--deep); font-size: 16px; }.form-group-title small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.field-grid { display: grid; gap: 8px; }.field-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }.field-grid label { min-width: 0; }.field-grid input { padding-right: 8px; padding-left: 8px; font-size: 12px; }
.privacy-note { margin: 15px 0 4px; padding: 12px; color: #66584d; background: #f7f2e9; border-radius: 11px; font-size: 11px; line-height: 1.6; }
.form-actions.single button { flex-basis: 100%; }.form-actions button:disabled { cursor: wait; opacity: .6; }
.contact-requested { padding: 16px; color: #4d5c59; background: #f6f1e8; border-radius: 14px; text-align: center; }.contact-requested b { color: var(--deep); }.contact-requested p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }

@media (min-width: 600px) {
  body { padding: 20px 0; }
  .app-shell { min-height: calc(100dvh - 40px); border-radius: 30px; }
  #view { min-height: calc(100dvh - 40px); }
  .tabbar { bottom: 20px; border-radius: 0 0 30px 30px; }
}
