:root {
  --primary: #176b5b;
  --primary-dark: #0f5145;
  --primary-soft: #e9f5f1;
  --accent: #d99c45;
  --ink: #1d2926;
  --muted: #6f7c78;
  --line: #e2e9e6;
  --bg: #f4f7f6;
  --card: #ffffff;
  --danger: #c84c4c;
  --shadow: 0 12px 32px rgba(26, 64, 55, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.app-shell { width: min(480px, 100%); margin: 0 auto; min-height: 100vh; background: #f8faf9; box-shadow: 0 0 60px rgba(15, 81, 69, .1); }
.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 20px 52px;
  color: white;
  background: linear-gradient(145deg, #0e5146 0%, #197262 58%, #278773 100%);
}
.hero::after { content: ""; position: absolute; width: 210px; height: 210px; right: -65px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.16); font-size: 22px; }
.brand h1 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: 12px; }
.hero-intro { position: relative; z-index: 1; margin-top: 27px; }
.hero-intro strong { display: block; font-size: 25px; font-weight: 650; }
.hero-intro span { font-size: 13px; color: rgba(255,255,255,.75); }

.main-content { padding: 0 14px 96px; margin-top: -27px; position: relative; z-index: 2; }
.card { background: var(--card); border: 1px solid rgba(226, 233, 230, .75); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 16px; font-weight: 650; }
.section-title span, .hint { font-size: 12px; color: var(--muted); }
.section-index { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: #53605c; font-weight: 600; }
.control { width: 100%; height: 45px; border: 1px solid var(--line); background: #fbfcfc; border-radius: 12px; padding: 0 12px; outline: none; color: var(--ink); transition: .2s; }
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 107, 91, .1); background: white; }
textarea.control { min-height: 90px; resize: vertical; padding-top: 11px; }
.required::after { content: " *"; color: var(--danger); }

.service-group { border-top: 1px solid var(--line); padding: 16px 0 3px; }
.service-group:first-of-type { border-top: 0; padding-top: 0; }
.service-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.service-heading strong { font-size: 14px; }
.select-all { border: 0; background: transparent; color: var(--primary); font-size: 12px; padding: 4px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: block; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; color: #52605c; font-size: 13px; transition: .18s; }
.check-chip input:checked + span { color: var(--primary-dark); border-color: #86b9ae; background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(23,107,91,.08); font-weight: 600; }
.selected-count { color: var(--primary); font-size: 12px; }

.upload-box { position: relative; display: grid; place-items: center; min-height: 116px; border: 1.5px dashed #b9cbc6; border-radius: 14px; background: #f8fbfa; color: var(--muted); text-align: center; }
.upload-box input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 28px; color: var(--primary); line-height: 1; }
.upload-box strong { display: block; margin: 5px 0 1px; font-size: 14px; color: #3a4945; }
.upload-box small { font-size: 11px; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 10px; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: #eef2f1; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-remove { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: white; background: rgba(20,32,29,.68); }

.form-submit { margin: 18px 2px 0; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 20px; border: 0; border-radius: 13px; color: white; background: linear-gradient(135deg, var(--primary), #248574); font-weight: 650; box-shadow: 0 8px 20px rgba(23,107,91,.22); }
.primary-btn:disabled { opacity: .58; cursor: wait; }
.secondary-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.danger-btn { color: var(--danger); border-color: #f0cdcd; }
.text-btn { border: 0; padding: 5px; color: var(--primary); background: transparent; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 90px; max-width: calc(100% - 36px); transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 10px; color: white; background: #25312e; box-shadow: 0 8px 30px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: .22s; font-size: 13px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #a73f3f; }
.empty { padding: 36px 10px; text-align: center; color: var(--muted); }
.empty-icon { display: block; font-size: 34px; margin-bottom: 7px; opacity: .65; }

.page-header { padding: 19px 17px; color: white; background: linear-gradient(135deg, #0f5145, #247d6d); }
.page-header-row { display: flex; justify-content: space-between; align-items: center; }
.page-header h1 { margin: 0; font-size: 20px; }
.page-header p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: 12px; }
.back-link { font-size: 13px; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.12); }
.flat-main { padding: 14px 14px 96px; }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filter-actions { display: flex; gap: 9px; margin-top: 12px; }
.filter-actions .primary-btn { min-height: 42px; }
.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { padding: 15px; border-radius: 15px; color: white; background: linear-gradient(135deg, #176b5b, #31917e); box-shadow: var(--shadow); }
.stat-card.gold { background: linear-gradient(135deg, #a96e26, #db9f4e); }
.stat-card small { display: block; color: rgba(255,255,255,.75); }
.stat-card strong { font-size: 26px; line-height: 1.25; }
.record-card { padding: 16px; border-radius: 16px; background: white; border: 1px solid var(--line); margin-bottom: 11px; box-shadow: 0 5px 18px rgba(26,64,55,.05); }
.record-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.record-room { font-size: 18px; font-weight: 700; }
.record-room span { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 11px; vertical-align: 2px; }
.record-side { display: grid; justify-items: end; gap: 7px; }
.record-meta { color: var(--muted); font-size: 12px; text-align: right; }
.record-delete { min-width: 52px; min-height: 30px; padding: 4px 10px; border: 1px solid #f0cdcd; border-radius: 9px; color: var(--danger); background: #fff8f8; font-size: 12px; font-weight: 600; }
.record-delete:disabled { opacity: .55; cursor: wait; }
.record-line { margin: 8px 0; color: #53605c; font-size: 13px; }
.record-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.record-tags span { padding: 4px 8px; border-radius: 7px; color: #55615e; background: #f1f4f3; font-size: 11px; }
.record-images { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.record-images a { aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #eee; }
.record-images img { width: 100%; height: 100%; object-fit: cover; }
.daily-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.daily-table th, .daily-table td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.daily-table th { color: var(--muted); font-weight: 500; }

.mobile-tabbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(480px, 100%);
  min-height: 64px;
  padding: 7px 26px calc(7px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(215, 225, 221, .9);
  background: rgba(255,255,255,.96);
  box-shadow: 0 -8px 24px rgba(26, 64, 55, .07);
  backdrop-filter: blur(14px);
}
.tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; color: #89948f; font-size: 11px; font-weight: 600; }
.tab-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; }
.tab-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-item.active { color: var(--primary); }
.tab-item.active .tab-icon { background: var(--primary-soft); }

@media (max-width: 430px) {
  .card { padding: 16px; }
}
@media (max-width: 350px) {
  .form-grid, .filter-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
