:root {
  --ink: #18211f;
  --muted: #64706d;
  --line: #dce3df;
  --paper: #f5f7f5;
  --surface: #ffffff;
  --green: #176b5b;
  --green-soft: #e5f2ee;
  --coral: #d15d3e;
  --yellow: #f0b949;
  --danger: #b73c39;
  --nav-height: 68px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .52; cursor: not-allowed; }
.app-header { position: sticky; top: 0; z-index: 20; height: 66px; padding: 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 8px; }
.brand-mark svg { width: 23px; height: 23px; }
.brand div { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-button, .dialog-close { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; }
.icon-button svg, .dialog-close svg { width: 20px; height: 20px; }
main { width: min(100%, 760px); margin: 0 auto; padding-bottom: calc(var(--nav-height) + 22px + env(safe-area-inset-bottom)); }
.view { display: none; padding: 14px 14px 26px; }
.view.active { display: block; }
.group-hero { position: relative; height: 190px; overflow: hidden; border-radius: 8px; background: #25443d; }
.group-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,31,27,.86), rgba(12,31,27,.12)); }
.group-hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy { position: absolute; z-index: 1; left: 18px; top: 50%; width: 68%; color: #fff; transform: translateY(-50%); }
.hero-copy span, .page-title span, .section-heading span, .dialog-title span, .dialog-bar span { display: block; color: var(--yellow); font-size: 12px; font-weight: 700; }
.hero-copy h1 { margin: 6px 0 8px; font-size: 29px; line-height: 1.16; }
.hero-copy p { margin: 0; font-size: 13px; color: rgba(255,255,255,.82); }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 12px 0 8px; }
.search-box { height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.search-box svg { width: 19px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-button { min-width: 88px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.filter-button svg { width: 18px; }
.usage-strip { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; background: var(--green-soft); color: var(--green); border-radius: 6px; font-size: 13px; }
.usage-strip svg { width: 17px; }
.section-heading, .page-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-heading span, .page-title span, .dialog-title span, .dialog-bar span { color: var(--coral); }
.section-heading h2, .page-title h1, .dialog-title h2, .dialog-bar h2 { margin: 3px 0 0; font-size: 21px; line-height: 1.2; }
.text-action { padding: 8px 0; border: 0; color: var(--green); background: transparent; font-weight: 700; cursor: pointer; }
.group-list, .task-list { display: grid; gap: 8px; }
.group-row { min-height: 80px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.group-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.group-icon.enterprise { background: #fff2d8; color: #9b6714; }
.group-icon svg { width: 22px; }
.group-main { min-width: 0; }
.group-main button { max-width: 100%; padding: 0; border: 0; background: transparent; font-weight: 750; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.group-main small { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 6px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.tag.enterprise { background: #fff2d8; color: #8d5a08; }
.tag.pinned { background: #ffe9e1; color: var(--coral); }
.group-count { min-width: 54px; text-align: right; }
.group-count strong, .group-count small { display: block; }
.group-count strong { font-size: 17px; }
.group-count small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.group-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.small-action { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.list-footer { padding: 18px 0 4px; text-align: center; color: var(--muted); font-size: 12px; }
.empty { padding: 32px 16px; text-align: center; background: var(--surface); border: 1px dashed #cbd5d0; border-radius: 8px; color: var(--muted); }
.primary, .secondary { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border-radius: 7px; font-weight: 750; cursor: pointer; }
.primary { border: 1px solid var(--green); background: var(--green); color: white; }
.secondary { border: 1px solid var(--green); background: white; color: var(--green); }
.primary.compact { min-height: 38px; padding: 0 12px; font-size: 13px; }
.primary.full { width: 100%; min-height: 48px; }
.primary svg { width: 18px; }
.metric-band { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; }
.metric-band div { padding: 13px 8px; text-align: center; border-right: 1px solid var(--line); }
.metric-band div:last-child { border-right: 0; }
.metric-band small, .metric-band strong { display: block; }
.metric-band small { color: var(--muted); font-size: 11px; }
.metric-band strong { margin-top: 5px; font-size: 14px; }
.task-tabs { display: grid; grid-template-columns: repeat(3,1fr); margin: 16px 0 10px; border-bottom: 1px solid var(--line); }
.task-tabs button { height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.task-tabs button.active { border-bottom-color: var(--green); color: var(--green); font-weight: 750; }
.task-row { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.task-row header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-row h3 { margin: 0; font-size: 16px; }
.task-row header span { color: var(--coral); font-weight: 750; }
.task-progress { height: 7px; margin: 13px 0 7px; overflow: hidden; border-radius: 4px; background: #e6ebe8; }
.task-progress i { display: block; height: 100%; background: var(--green); }
.task-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.task-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.publish-entry { width: 100%; display: grid; grid-template-columns: 46px minmax(0,1fr) 20px; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; }
.publish-entry > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.publish-entry strong, .publish-entry small { display: block; }
.publish-entry small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.publish-entry > svg { width: 19px; color: var(--muted); }
.profile-head { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 18px 2px; }
.avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 8px; background: var(--green); color: #fff; font-size: 24px; font-weight: 800; }
.profile-head span { color: var(--coral); font-size: 12px; font-weight: 700; }
.profile-head h1 { margin: 3px 0; font-size: 21px; }
.profile-head p { margin: 0; color: var(--muted); font-size: 12px; }
.balance-panel { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; background: #173b34; color: white; border-radius: 8px; }
.balance-panel small, .balance-panel strong { display: block; }
.balance-panel small { color: rgba(255,255,255,.7); }
.balance-panel strong { margin-top: 6px; font-size: 25px; }
.profile-grid { display: grid; grid-template-columns: repeat(3,1fr); margin: 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.profile-grid button { padding: 14px 6px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; }
.profile-grid button:last-child { border-right: 0; }
.profile-grid span, .profile-grid small { display: block; }
.profile-grid span { font-size: 19px; font-weight: 800; }
.profile-grid small { margin-top: 4px; color: var(--muted); }
.menu-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.menu-list button { width: 100%; min-height: 64px; display: grid; grid-template-columns: 22px minmax(0,1fr) 18px; align-items: center; gap: 12px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.menu-list button:last-child { border-bottom: 0; }
.menu-list svg { width: 20px; color: var(--green); }
.menu-list button > svg:last-child { width: 17px; color: var(--muted); }
.menu-list strong, .menu-list small { display: block; }
.menu-list small { margin-top: 3px; color: var(--muted); }
.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; width: min(100%,760px); height: calc(var(--nav-height) + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding-bottom: env(safe-area-inset-bottom); transform: translateX(-50%); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.bottom-nav button.active { color: var(--green); font-weight: 750; }
.bottom-nav svg { width: 21px; height: 21px; }
dialog { color: var(--ink); border: 0; padding: 0; background: var(--surface); box-shadow: 0 22px 70px rgba(17,34,30,.22); }
dialog::backdrop { background: rgba(14,24,22,.58); }
.sheet-dialog { width: min(92vw, 430px); padding: 22px; border-radius: 8px; }
.sheet-dialog.wide { width: min(92vw, 520px); }
.sheet-dialog > .dialog-close { position: absolute; top: 12px; right: 12px; }
.qr-heading { padding: 8px 48px 14px 0; }
.qr-heading span { color: var(--green); font-size: 12px; font-weight: 750; }
.qr-heading h2 { margin: 5px 0; font-size: 21px; overflow-wrap: anywhere; }
.qr-heading p { margin: 0; color: var(--muted); }
.qr-button { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; }
.qr-button img { width: min(70vw, 300px); aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; background: white; }
.qr-button span { display: block; margin-top: 10px; color: var(--green); font-weight: 750; }
.qr-button.qr-only { padding: 18px; border: 0; background: white; }
.dialog-title { padding: 5px 48px 16px 0; }
.membership-plans, .pin-plans { display: grid; gap: 8px; }
.plan-button { width: 100%; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; }
.plan-button strong, .plan-button small { display: block; }
.plan-button small { margin-top: 3px; color: var(--muted); }
.plan-button b { color: var(--coral); font-size: 18px; }
.dialog-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-dialog { width: min(94vw, 540px); max-height: 90vh; overflow: auto; border-radius: 8px; }
.dialog-bar { position: sticky; top: 0; z-index: 2; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.form-dialog form { display: grid; gap: 14px; padding: 18px 16px 22px; }
.form-dialog label, .form-dialog legend { font-size: 13px; font-weight: 700; }
.form-dialog input, .form-dialog select, .form-dialog textarea { width: 100%; min-height: 44px; margin-top: 7px; padding: 9px 11px; border: 1px solid #cbd5d0; border-radius: 6px; background: white; outline: 0; }
.form-dialog input:focus, .form-dialog select:focus, .form-dialog textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,91,.1); }
.form-dialog fieldset { margin: 0; padding: 0; border: 0; }
.choice { display: flex; align-items: center; gap: 9px; min-height: 52px; margin-top: 7px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; }
.choice input { width: 18px; min-height: 18px; margin: 0; }
.choice span, .choice small { display: block; }
.choice small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.file-field { min-height: 48px; display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 10px 12px; border: 1px dashed #aebbb5; border-radius: 6px; background: var(--paper); color: var(--green); }
.file-field input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.file-field svg { width: 20px; }
.cost-preview { padding: 12px; background: var(--green-soft); color: var(--green); border-radius: 6px; font-weight: 750; text-align: center; }
#claim-target { padding: 16px; border-bottom: 1px solid var(--line); text-align: center; }
#claim-target img { width: min(68vw,280px); aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; background: white; }
.detail-list { display: grid; gap: 8px; max-height: 58vh; overflow: auto; }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.detail-item strong, .detail-item small { display: block; }
.detail-item small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-height) + 18px + env(safe-area-inset-bottom)); max-width: min(88vw, 420px); padding: 10px 14px; border-radius: 7px; background: #17221f; color: white; font-size: 13px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (min-width: 700px) {
  .app-header { width: min(100%,760px); margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  main { min-height: calc(100vh - 66px); background: #f8faf8; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .view { padding: 18px 22px 34px; }
  .group-hero { height: 220px; }
}
@media (max-width: 370px) {
  .hero-copy h1 { font-size: 25px; }
  .group-row { grid-template-columns: 40px minmax(0,1fr) auto; padding: 10px; }
  .group-icon { width: 40px; height: 40px; }
  .metric-band strong { font-size: 12px; }
  .bottom-nav span { font-size: 10px; }
}
