:root {
  --bg: #fbf6ee;
  --surface: #fffaf3;
  --surface-strong: #f3e7d8;
  --ink: #2f241f;
  --muted: #806f63;
  --line: #eadbca;
  --brand: #b76645;
  --brand-dark: #8f432e;
  --brand-soft: #f0c5a9;
  --ok: #6f7f43;
  --danger: #b84d4d;
  --shadow: 0 14px 36px rgba(96, 62, 38, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  min-height: 100vh;
}

.auth-view {
  min-height: 100vh;
  padding: 28px 18px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.brand-block {
  display: grid;
  gap: 8px;
}

.brand-block p,
.topbar p {
  margin: 0;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 800;
}

.brand-block h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.8rem);
  line-height: 1.05;
  color: var(--ink);
}

.brand-block span {
  color: var(--muted);
  line-height: 1.5;
}

.auth-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7ecdf;
}

.segmented button,
.bottom-nav button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  font-weight: 800;
}

.segmented button.active,
.bottom-nav button.active {
  color: #fffaf3;
  background: var(--brand);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fffdf9;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(183, 102, 69, 0.14);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fffaf3;
}

.secondary-btn {
  border: 1px solid var(--brand-soft);
  background: #f8eadc;
  color: var(--brand-dark);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.small-btn {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.form-note.error {
  color: var(--danger);
}

.form-note.ok {
  color: var(--ok);
}

.main-view {
  min-height: 100vh;
  padding: 16px 14px 86px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topbar h1 {
  font-size: clamp(1.8rem, 7vw, 3rem);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.summary-strip article {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 8px;
  background: #f7eadc;
  border: 1px solid var(--line);
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.summary-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 1.25rem;
}

.screen {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.compact-panel {
  box-shadow: none;
}

.panel-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title h2,
.section-head h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.panel-title span {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.86rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.image-grid img,
.record-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #f3e7d8;
}

.feed-list,
.report-list,
.member-list {
  display: grid;
  gap: 10px;
}

.record-card,
.report-card,
.member-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.record-card header,
.report-card header,
.member-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.record-card h3,
.report-card h3 {
  margin: 0;
  font-size: 1rem;
}

.record-card time,
.report-card span,
.member-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.record-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f8eadc;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.record-card p,
.report-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.record-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.empty-state {
  padding: 22px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 250, 243, 0.72);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 243, 0.96);
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .auth-view {
    grid-template-columns: 1fr 380px;
    align-items: center;
  }

  .main-view {
    padding: 28px 22px 94px;
  }

  .screen[data-screen="checkin"] {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .summary-strip {
    grid-column: 1 / -1;
  }
}
