/* ==========================================================================
   小马社区服务商 · 设计系统
   主色：马场绿 #1F7A56，辅色：暖橙 #F5733A，背景：米白 #FAFAF7
   ========================================================================== */
:root {
  --brand: #1F7A56;
  --brand-2: #2F9C6B;
  --brand-soft: #E8F4EE;
  --brand-deep: #14523A;
  --accent: #F5733A;
  --accent-soft: #FFF0E8;
  --ink: #16211C;
  --ink-2: #4A564F;
  --ink-3: #8A948E;
  --line: #E8EAE5;
  --bg: #FAFAF7;
  --bg-2: #FFFFFF;
  --warn: #FA8B2A;
  --info: #4B6BE0;
  --purple: #7C5CE0;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(22, 33, 28, .05), 0 2px 8px rgba(22, 33, 28, .04);
  --shadow: 0 4px 20px rgba(22, 33, 28, .07), 0 1px 3px rgba(22, 33, 28, .04);
  --shadow-lg: 0 18px 50px rgba(22, 33, 28, .12);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Alibaba PuHuiTi", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --num: "DIN Alternate", "SF Pro Display", "Helvetica Neue", var(--font);
  --max: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }
i, em { font-style: normal; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: #CDEBDC; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8DCD6; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 布局 */
#page { max-width: var(--max); margin: 0 auto; padding: 0 24px 80px; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  max-width: var(--max); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
  background: rgba(250, 250, 247, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  font-size: 20px; box-shadow: 0 4px 12px rgba(31, 122, 86, .28);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-size: 17px; letter-spacing: .5px; }
.brand-txt i { font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.5px; }
.topnav { display: flex; gap: 6px; flex: 1; }
.topnav a {
  padding: 7px 13px; border-radius: 99px; font-size: 14px; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.topnav a:hover { background: var(--brand-soft); color: var(--brand); }
.top-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; font-size: 17px;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center;
}
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px #fff;
}
.avatar-chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px;
  border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 13.5px;
}
.avatar-chip span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); font-size: 15px;
}
/* 顶栏登录态：已登录 = 昵称 + 退出按钮；未登录 = 「登录 / 注册」 */
.user-chip { display: flex; align-items: center; gap: 6px; }
.btn-logout { width: 34px; height: 34px; font-size: 15px; color: var(--ink-3); }
.btn-logout:hover { color: #C2471B; border-color: #F0C7C1; background: #FDEEEE; }
.btn-login { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 4px 12px rgba(31, 122, 86, .22); text-decoration: none; }
.btn-login:hover { color: #fff; filter: brightness(1.05); }
.tabbar, .fab-cs { display: none; }

/* ---------------------------------------------------------------- 通用组件 */
.card {
  background: var(--bg-2); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.pad { padding: 24px; }
.sect { margin-top: 44px; }
.sect-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.sect-title { font-size: 20px; font-weight: 650; letter-spacing: -.2px; }
.sect-title small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 8px; letter-spacing: 0; }
.sect-more { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 3px; }
.sect-more:hover { color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  transition: transform .12s, box-shadow .18s, background .18s;
  white-space: nowrap;
}
.btn:hover { border-color: #d3d8d2; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(31, 122, 86, .22); }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(245, 115, 58, .22); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 6px; font-size: 11.5px; line-height: 1.6; font-weight: 500;
  background: var(--brand-soft); color: var(--brand);
}
.tag-accent { background: var(--accent-soft); color: #C2471B; }
.tag-plain { background: #F2F4F1; color: var(--ink-2); }
.tag-line { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border-radius: 99px; font-size: 12.5px; background: #F3F5F2; color: var(--ink-2);
  border: 1px solid transparent; cursor: pointer; transition: all .16s; white-space: nowrap;
}
.pill:hover { background: #EBEFEA; }
.pill.on { background: var(--brand); color: #fff; }

.money { font-family: var(--num); font-weight: 650; letter-spacing: -.3px; }
.money small { font-size: .62em; font-weight: 500; margin-right: 1px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); font-size: 19px; flex: 0 0 auto;
}
.avatar.lg { width: 56px; height: 56px; font-size: 26px; }
.avatar.sm { width: 30px; height: 30px; font-size: 15px; }
.avatar.sq { border-radius: 12px; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.xs { font-size: 12px; }
.sm { font-size: 13px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { color: #F5A623; font-size: 12px; letter-spacing: 1px; }

.dot-live { width: 6px; height: 6px; border-radius: 50%; background: #2FBF71; display: inline-block; }
.dot-live.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, .5); } 50% { box-shadow: 0 0 0 6px rgba(47, 191, 113, 0); } }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty i { font-size: 40px; display: block; margin-bottom: 10px; opacity: .7; }

.skeleton {
  background: linear-gradient(90deg, #EFF2EE 25%, #F7F9F6 37%, #EFF2EE 63%);
  background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 8px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(22, 33, 28, .92); color: #fff; padding: 9px 18px; border-radius: 99px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: tin .22s ease;
  max-width: 86vw; text-align: center;
}
.toast.ok { background: rgba(31, 122, 86, .95); }
.toast.err { background: rgba(190, 60, 40, .95); }
@keyframes tin { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* Modal */
.mask {
  position: fixed; inset: 0; background: rgba(18, 28, 23, .42); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease; backdrop-filter: blur(3px);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 460px;
  max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: #F4F6F3; display: grid; place-items: center; color: var(--ink-3); font-size: 16px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); outline: 0; transition: border .18s, box-shadow .18s; font-size: 14px;
}
.textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47, 156, 107, .12); }
.input::placeholder, .textarea::placeholder { color: #B4BBB6; }
.radio-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card {
  flex: 1; min-width: 90px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  text-align: center; cursor: pointer; font-size: 13px; transition: all .16s; background: #fff;
}
.radio-card.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 500; }

/* 底部 Tabbar（移动端） */
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .topnav { display: none; }
  .top-right { margin-left: auto; }
  .brand-txt i { display: none; }
  #page { padding: 0 16px 96px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; color: var(--ink-3); padding: 3px 0; }
  .tab i { font-size: 19px; line-height: 1.2; }
  .tab.on { color: var(--brand); }
  .tab-main i {
    width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; font-size: 22px; margin-top: -14px;
    box-shadow: 0 6px 16px rgba(31, 122, 86, .35);
  }
  .tab-main span { margin-top: 0; }
  .fab-cs {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: 86px; z-index: 55;
    width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 20px;
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .sect { margin-top: 30px; }
  .pad { padding: 18px; }
}
