:root {
  color-scheme: light;
  font-family: "DM Sans", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #222d2d;
  background: #f4f2e8;
  --green: #294b4d;
  --muted: #4d5c59;
  --surface: #fffdf5;
  --border: #dcdccf;
  --accent: #e4eeeb;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; }
body::before {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  background: url('/ink-paper.webp') center / 100% 100% no-repeat;
  pointer-events: none;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .60; }
a { color: var(--green); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #47745e; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.site { max-width: 760px; margin: auto; }
.site main { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.top { min-height: 67px; padding: max(8px, env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; letter-spacing: .03em; }
.brand span { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 11px; background: #f0e6ce; color: #755525; }
.profile { min-height: 44px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 11px; border: 1px solid var(--border); border-radius: 100px; background: var(--surface); color: var(--green); font-size: 13px; font-weight: 700; }
.profile span { margin-left: 3px; }
.child-row { display: flex; align-items: center; min-height: 35px; margin-bottom: 9px; font-size: 14px; }
.child-row label { display: flex; align-items: center; gap: 8px; }
.child-row select { width: auto; min-height: 40px; padding: 4px 12px; }
.point-card {
  position: relative; overflow: hidden; isolation: isolate; min-height: 212px; border-radius: 22px;
  color: #233839;
  background: linear-gradient(90deg, #faf6e9 5%, #faf6e9eb 32%, #faf6e922 61%, transparent 70%),
    url('/ink-card.webp') right center / cover no-repeat #eceadf;
  border: 1px solid #c0a772; box-shadow: 0 8px 22px #39494923;
}
.point-card::before { position: absolute; content: ''; inset: 5px; border: 1px solid #b59b6657; border-radius: 17px; pointer-events: none; }
.card-text { position: relative; width: 54%; padding: 23px 0 20px 19px; }
.card-label { color: #745422; font-weight: 800; font-size: 14px; }
.card-label span { margin-right: 4px; }
.balance-label { display: block; margin: 19px 0 2px; font-size: 13px; color: #405553; }
.balance { font-size: clamp(31px, 10vw, 55px); font-weight: 800; line-height: 1; letter-spacing: -.06em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.earned { display: inline-block; margin-top: 13px; padding: 5px 10px; border: 1px solid #c5b895; background: #fffaf0e8; border-radius: 20px; font-size: 12px; color: #384b48; overflow-wrap: anywhere; }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin: 13px 0 24px; }
.rule { padding: 0 3px; min-height: 44px; background: #fffefa; color: #40564a; border: 1px solid var(--border); border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rule span { opacity: .75; }
.section-heading, .subheading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 12px; }
h1 { font-size: 23px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.pill { min-height: 44px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.pill.selected { background: var(--green); border-color: var(--green); color: white; }
.project-list { display: grid; gap: 9px; }
.project, .record { background: #fffdf5f2; border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: 0 3px 10px #36474708; }
.project { display: grid; grid-template-columns: 41px minmax(0,1fr) minmax(59px, max-content); gap: 9px; align-items: center; min-height: 96px; }
.project-icon { display: grid; place-items: center; border-radius: 12px; background: #eef0e6; font-size: 23px; width: 41px; height: 44px; overflow: hidden; }
.project-body p, .record p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.category { display: inline-block; max-width: 100%; overflow-wrap: anywhere; border-radius: 5px; color: #3d624b; font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.project-side { display: grid; justify-items: end; gap: 3px; text-align: right; }
.project-side strong, .record strong { font-variant-numeric: tabular-nums; color: var(--green); white-space: nowrap; }
.project-side strong { font-size: 14px; }
.project-side small { font-size: 11px; color: #665136; }
.small-button, .quiet, .secondary, .primary, .icon-button { min-height: 44px; border-radius: 11px; font-weight: 750; }
.small-button { white-space: nowrap; border: 0; padding: 0 11px; background: var(--accent); color: var(--green); font-size: 13px; }
.quiet { background: transparent; border: 0; color: var(--green); padding: 0 7px; font-size: 13px; overflow-wrap: anywhere; }
.record-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.record strong.negative { color: #a04829; }
.record .note { color: #263e32; font-size: 14px; white-space: pre-wrap; }
.record .category { margin: 8px 0 0; }
.record-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.danger { min-height: 44px; border: 0; border-radius: 11px; padding: 0 10px; background: #faede7; color: #942f21; font-weight: 750; font-size: 13px; }
.request-section { margin-bottom: 14px; }
.request-section > h2 { margin-bottom: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 14px; border: 1px dashed var(--border); border-radius: 16px; }
.bottom { position: fixed; z-index: 2; inset: auto 0 0; border-top: 1px solid var(--border); background: #fffdf5ed; backdrop-filter: blur(12px); padding: 6px 14px calc(6px + env(safe-area-inset-bottom)); }
.bottom > div { display: flex; gap: 4px; max-width: 728px; margin: auto; }
.bottom button { flex: 1; min-height: 53px; color: var(--muted); background: transparent; border: 0; border-radius: 12px; font-weight: 700; font-size: 12px; }
.bottom button span { display: block; font-size: 22px; line-height: 1.15; }
.bottom button.current { background: var(--accent); color: var(--green); }
.admin-content { margin-top: 14px; }
.admin-content > form, .auth-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.auth { max-width: 440px; margin: auto; padding: 22px 16px 25px; }
.auth-art { height: 158px; margin: 14px 0 10px; border-radius: 18px; border: 1px solid #caba99; background: url('/ink-card.webp') right top / cover no-repeat #eceadf; }
.auth-panel h1 { margin-bottom: 15px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 700; color: #34463b; }
input, textarea, select { width: 100%; min-height: 46px; border: 1px solid #cbd5c8; border-radius: 10px; color: #202f27; background: #fffefa; padding: 9px 11px; font-size: 16px; }
input[readonly] { background: #f0f2e9; }
textarea { min-height: 76px; resize: vertical; }
fieldset { border: 1px solid #d5ded0; border-radius: 12px; margin: 0; padding: 6px 9px; min-width: 0; }
legend { padding: 0 5px; font-weight: 700; font-size: 14px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.check input { min-height: 0; margin: 0; width: 18px; height: 18px; accent-color: var(--green); }
.form-error { font-size: 14px; color: #a13323; }
.form-error:empty { display: none; }
.primary, .secondary { border: 0; background: var(--green); color: white; padding: 0 15px; }
.secondary { background: var(--accent); color: var(--green); }
.load-more { width: 100%; margin-top: 10px; }
dialog { max-height: min(86dvh, 740px); width: min(calc(100% - 24px), 460px); border: 1px solid var(--border); border-radius: 19px; background: var(--surface); color: #26372e; padding: 16px; }
dialog::backdrop { background: #14271ebb; }
.modal-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-heading h2 { font-size: 20px; }
.icon-button { width: 44px; min-width: 44px; border: 0; background: #eef1e8; color: #314838; font-size: 23px; }
.modal-copy, .hint, .rule-text, .preview { line-height: 1.65; }
.modal-copy:empty { display: none; }
.rule-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.hint, .preview { font-size: 13px; color: var(--muted); }
#toast { display: none; position: fixed; z-index: 4; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 30px); width: max-content; bottom: calc(77px + env(safe-area-inset-bottom)); border-radius: 12px; padding: 12px 16px; background: #213c31; color: white; box-shadow: 0 3px 12px #20352d44; }
#toast.visible { display: block; }
.loading { text-align: center; padding: 32px; color: var(--muted); }
@media (min-width: 600px) {
  .site main { padding-inline: 22px; }
  .top { padding-inline: 22px; }
  body::before { background-size: cover; }
  .point-card { min-height: 242px; background-position: center, right top; background-size: cover, auto 125%; }
  .card-text { padding: 24px; }
  .project-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
