/* ---------- 家庭端 ---------- */
.app-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.app-shell { width: min(720px, 100%); margin: 0 auto; padding: 0 18px; }

.app-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 2px 12px;
  background: linear-gradient(180deg, rgba(246,242,231,0.96) 70%, rgba(246,242,231,0));
  backdrop-filter: blur(8px);
}
.mini-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.mini-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--green); display: grid; place-items: center; }
.mini-mark svg { width: 19px; height: 19px; }
.mini-brand b { display: block; font-family: var(--serif); font-size: 14px; letter-spacing: 0.02em; }
.mini-brand small { display: block; font-size: 10px; color: var(--faint); letter-spacing: 0.14em; }
.family-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--green);
  max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.family-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-mid); flex: none; }

.view { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.day-head { padding: 18px 2px 22px; }
.day-date { font-size: 12px; letter-spacing: 0.18em; color: var(--green-mid); font-weight: 700; text-transform: uppercase; }
.day-title { font-family: var(--serif); font-size: clamp(32px, 8vw, 46px); line-height: 1.22; margin-top: 10px; letter-spacing: 0.01em; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.stat { background: rgba(255,253,247,0.7); border: 1px solid rgba(226,218,200,0.75); border-radius: 16px; padding: 11px 6px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 24px; color: var(--green); line-height: 1.1; }
.stat span { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }

.capture-card {
  background: var(--card);
  border: 1px solid rgba(226,218,200,0.9);
  border-radius: 26px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.capture-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 2px 2px 14px; }
.kicker { font-size: 10px; letter-spacing: 0.22em; color: var(--green-mid); font-weight: 700; }
.capture-head h2 { font-family: var(--serif); font-size: 24px; margin-top: 3px; }
.step-pill { font-size: 11px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }

.photo-zone {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(205,219,169,0.3), transparent 55%),
    #f1edde;
  border: 1.5px dashed #cfc6b0;
  cursor: pointer;
}
.photo-zone img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted);
}
.photo-empty b { font-size: 15px; color: var(--ink); }
.photo-empty span { font-size: 11.5px; color: var(--faint); }
.camera-ring {
  width: 58px; height: 58px; border-radius: 50%;
  background: #fffdf7; border: 1px solid #ddd3bd;
  display: grid; place-items: center; color: var(--green);
  box-shadow: 0 8px 18px rgba(45,60,48,0.08);
  margin-bottom: 4px;
}
.camera-ring svg { width: 27px; height: 27px; }
.photo-retake {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(31,45,38,0.8); color: #fff;
  border-radius: 999px; padding: 6px 12px; font-size: 12px;
  backdrop-filter: blur(4px);
}
.photo-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,253,247,0.72); font-size: 13px; color: var(--green);
}

.capture-body { padding-top: 18px; }
.identify-strip { background: #f4f7ec; border: 1px solid #dfe6cf; border-radius: 16px; padding: 12px 13px; margin-bottom: 16px; }
.identify-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; }
.identify-title b { font-size: 12px; color: var(--green); }
.identify-title span:last-child { color: var(--faint); font-size: 11px; }
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-mid); box-shadow: 0 0 0 3px rgba(61,122,92,0.14); }
.candidate-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.candidate {
  border: 1px solid #cfd9bd; background: #fffdf7; color: #31483a;
  border-radius: 999px; padding: 6px 11px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.candidate b { font-weight: 600; }
.candidate small { color: var(--faint); font-size: 10px; }
.candidate.active { background: var(--green); border-color: var(--green); color: #fff; }
.candidate.active small { color: #d7e4da; }
.candidate .known { color: var(--green-mid); font-size: 10px; }
.candidate.active .known { color: #e7c78d; }
.identify-error { margin-top: 8px; font-size: 11.5px; color: var(--red); line-height: 1.6; }
.species-field { margin-bottom: 14px; }

.location-box { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fffef9; }
.location-row { display: flex; align-items: center; gap: 11px; padding: 12px 13px; }
.loc-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.loc-icon svg { width: 18px; height: 18px; }
.loc-copy { min-width: 0; flex: 1; }
.loc-copy b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-copy span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.text-btn { border: 0; background: none; color: var(--green-mid); font-size: 12px; font-weight: 600; padding: 4px; white-space: nowrap; }
.text-btn.muted { color: var(--faint); font-weight: 400; }
.map-actions { display: flex; justify-content: space-between; gap: 10px; padding: 0 13px 10px; border-top: 1px dashed #e8e1d2; margin-top: -1px; padding-top: 8px; }
.map-box { height: 240px; width: 100%; border-top: 1px solid var(--line); }

.submit-btn { margin-top: 18px; height: 52px; font-size: 16px; }
.submit-btn:disabled { background: #c7cec3; box-shadow: none; }
.submit-note { text-align: center; color: var(--faint); font-size: 11px; margin-top: 8px; }

.records-section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 3px 12px; }
.section-head h2 { font-family: var(--serif); font-size: 22px; }
.count-pill { font-size: 11px; color: var(--muted); background: rgba(255,253,247,0.7); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.record-list { display: grid; gap: 10px; }
.record-card {
  display: grid; grid-template-columns: 78px 1fr; gap: 12px;
  background: var(--card); border: 1px solid rgba(226,218,200,0.9);
  border-radius: 18px; padding: 9px;
  box-shadow: 0 4px 12px rgba(45,60,48,0.04);
}
.record-thumb { width: 78px; height: 78px; border-radius: 13px; object-fit: cover; background: var(--paper-deep); cursor: zoom-in; }
.record-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.record-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.record-top b { font-size: 16px; font-family: var(--serif); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-meta { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 11px; flex-wrap: wrap; }
.record-note { color: #8a6a44; font-size: 11px; line-height: 1.55; background: #f8f0e2; border-radius: 8px; padding: 4px 7px; }
.record-del { align-self: flex-start; border: 0; background: none; color: var(--faint); font-size: 11px; padding: 0; text-decoration: underline; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-leaf { font-size: 30px; color: #b6c5a9; margin-bottom: 6px; }
.empty-state b { display: block; color: var(--ink); font-size: 15px; }
.empty-state p { font-size: 12px; margin-top: 4px; }

/* 榜单 */
.page-head { padding: 20px 3px 20px; }
.page-head h1 { font-family: var(--serif); font-size: 34px; margin: 7px 0 8px; }
.page-head > p:last-child { color: var(--muted); font-size: 12.5px; line-height: 1.8; max-width: 500px; }
.rank-toolbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.inline-field { flex: 1; }
.inline-field > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.small-select { padding: 10px 34px 10px 13px; font-size: 13px; border-radius: 12px; background-position: calc(100% - 19px) 18px, calc(100% - 13px) 18px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--green); display: grid; place-items: center; }
.icon-btn svg { width: 17px; height: 17px; }
.rank-block { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 14px; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(45,60,48,0.04); }
.rank-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 3px 9px; }
.rank-title h2 { font-family: var(--serif); font-size: 20px; }
.rank-title span { font-size: 10.5px; color: var(--faint); }
.rank-table { display: grid; gap: 2px; }
.rank-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 3px; border-top: 1px solid #f0eadc; }
.rank-row:first-child { border-top: 0; }
.rank-num { font-family: var(--serif); font-size: 15px; color: var(--faint); text-align: center; }
.rank-row:nth-child(1) .rank-num { color: #b07a26; font-size: 19px; }
.rank-row:nth-child(2) .rank-num { color: #77837a; font-size: 17px; }
.rank-row:nth-child(3) .rank-num { color: #9b6a48; font-size: 17px; }
.rank-who { min-width: 0; }
.rank-who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-who span { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.rank-score { text-align: right; }
.rank-score b { font-family: var(--serif); font-size: 21px; color: var(--green); line-height: 1; }
.rank-score small { display: block; font-size: 9.5px; color: var(--faint); margin-top: 3px; }
.rank-row.mine { background: #eef4e6; border-radius: 12px; padding-left: 8px; padding-right: 8px; }
.rank-row.mine .rank-who b { color: var(--green); }
.species-rank .rank-row { grid-template-columns: 32px 1fr auto; }
.species-rank .rank-who b { font-family: var(--serif); font-size: 15px; }
.rank-empty { text-align: center; color: var(--faint); font-size: 12px; padding: 24px 0; }

/* 我的 */
.family-card { background: var(--green); color: #eef3e7; border-radius: 24px; padding: 22px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.family-card::after { content: ""; position: absolute; right: -40px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,0.07); }
.family-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.family-group { font-size: 11px; letter-spacing: 0.16em; color: #bfd2c2; }
.family-top h2 { font-family: var(--serif); font-size: 30px; margin: 4px 0 5px; }
.family-top p { font-size: 11px; color: #b6c9ba; }
.family-seal { width: 54px; height: 54px; border: 1px solid rgba(238,243,231,0.4); border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 11px; line-height: 1.3; text-align: center; color: #dfe9d9; flex: none; }
.family-sign { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.16); }
.family-sign img, .sign-empty { width: 62px; height: 62px; border-radius: 13px; object-fit: cover; background: rgba(255,255,255,0.1); }
.sign-empty { display: grid; place-items: center; font-size: 10px; color: #c6d8c9; }
.file-btn.small { padding: 7px 12px; font-size: 11px; background: rgba(255,255,255,0.12); color: #edf3e7; border-color: rgba(255,255,255,0.25); }
.recap-card { margin-top: 16px; background: linear-gradient(140deg, #f5e9d5, #fbf5e8); border: 1px solid #ead9bd; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.recap-card h2 { font-family: var(--serif); font-size: 23px; margin: 4px 0 6px; }
.recap-card p:last-child { color: #7c6b52; font-size: 12px; line-height: 1.7; max-width: 330px; }
.recap-card .btn { width: 100%; }
.me-links { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.me-link { display: flex; justify-content: space-between; gap: 12px; padding: 15px 16px; border-top: 1px solid #f0eadc; font-size: 13px; color: var(--ink); }
.me-link:first-child { border-top: 0; }
.me-link span:last-child { color: var(--faint); font-size: 12px; }
.me-link.static { color: var(--muted); }
.me-foot { text-align: center; color: var(--faint); font-size: 10.5px; margin: 22px 0 8px; }

/* 底栏 */
.tabbar {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(340px, calc(100% - 48px));
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,253,247,0.94);
  border: 1px solid rgba(226,218,200,0.95);
  border-radius: 22px;
  padding: 6px;
  box-shadow: 0 12px 34px rgba(45,60,48,0.14);
  backdrop-filter: blur(14px);
  z-index: 100;
}
.tab { border: 0; background: none; border-radius: 16px; padding: 7px 4px 6px; display: grid; justify-items: center; gap: 2px; color: #98a49b; font-size: 9.5px; }
.tab svg { width: 21px; height: 21px; }
.tab.active { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(36,90,67,0.2); }

.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(18,26,21,0.92); display: grid; place-items: center; padding: 18px; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }

@media (min-width: 760px) {
  .app-shell { padding: 0 24px; }
  .capture-card { padding: 24px; }
  .photo-zone { aspect-ratio: 16 / 10; }
  .record-list { grid-template-columns: 1fr 1fr; }
  .recap-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .recap-card .btn { width: auto; flex: none; }
}
