﻿:root {
  --bg: #fff4e3;
  --bg-soft: #ffdcb8;
  --panel: #fffaf3;
  --text: #2f1f15;
  --muted: #866e5f;
  --primary: #d86c2f;
  --primary-strong: #b65219;
  --danger: #b53622;
  --border: #ecd9c6;
  --accent: #ff9b54;
  --gold: #f1b74f;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, #ffd3a2 0, transparent 36%),
    radial-gradient(circle at 88% 12%, #ffc8a1 0, transparent 33%),
    radial-gradient(circle at 50% 88%, #ffdcb7 0, transparent 36%),
    linear-gradient(155deg, #fff1dc 0%, #ffe8cf 45%, #ffe3ca 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 153, 102, 0.14) 0 26px, transparent 27px),
    radial-gradient(circle at 78% 38%, rgba(255, 205, 130, 0.17) 0 22px, transparent 23px),
    radial-gradient(circle at 68% 78%, rgba(255, 160, 122, 0.15) 0 30px, transparent 31px);
}

body::after {
  background-image:
    linear-gradient(45deg, rgba(215, 128, 66, 0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(215, 128, 66, 0.07) 25%, transparent 25%);
  background-size: 38px 38px;
  background-position: 0 0, 19px 19px;
  opacity: 0.35;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.app-shell {
  width: 393px;
  max-width: calc(100vw - 24px);
  height: 852px;
  max-height: calc(100vh - 24px);
  margin: 0 auto;
  background: linear-gradient(180deg, #fffaf5 0%, #fff5ea 100%);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 25px 52px rgba(151, 95, 36, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  padding: 12px 12px 88px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-shell::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -105px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 181, 96, 0.34), rgba(255, 181, 96, 0));
  pointer-events: none;
}

.cartoon-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.food-sticker {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 31px;
  line-height: 1;
  border: 1px solid #f1dac1;
  background: linear-gradient(135deg, #fffaf2, #ffeed9);
  box-shadow: 0 10px 20px rgba(143, 86, 33, 0.16);
  filter: saturate(1.08);
  animation: floaty 4.2s ease-in-out infinite;
}

.sticker-burger { left: 10px; top: 140px; animation-delay: 0s; }
.sticker-fries { right: 12px; top: 230px; animation-delay: .5s; }
.sticker-coffee { left: 16px; bottom: 138px; animation-delay: .9s; }
.sticker-pizza { right: 18px; bottom: 156px; animation-delay: 1.3s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}

.topbar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 237, 0.96));
  border-radius: 20px;
  border: 1px solid rgba(237, 210, 181, 0.9);
  box-shadow: 0 10px 28px rgba(159, 94, 33, 0.12);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 6;
}

.brand-block {
  min-width: 0;
  position: relative;
}

.brand-wordmark {
  margin: 0;
  display: inline-block;
  font-family: "Segoe Script", "STHeiti", "Microsoft YaHei", sans-serif;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1px;
  color: #22160f;
  transform: skewX(-8deg) rotate(-1deg);
  text-shadow: 0 2px 0 #f8dcc0, 0 4px 12px rgba(73, 37, 12, 0.18);
}

.brand-wordmark::after {
  content: "";
  display: block;
  margin-top: 2px;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 22, 15, 0.9), rgba(34, 22, 15, 0.3));
}

.brand-subtitle {
  margin: 5px 0 0;
  color: #8a6752;
  font-size: 12px;
  line-height: 1.35;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-box {
  display: flex;
  gap: 8px;
  align-items: center;
  width: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

main {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 5;
}

.tabs {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin-top: 0;
  display: flex;
  gap: 8px;
  background: linear-gradient(135deg, #fff8ef, #fff3e5);
  border: 1px solid #ecd6bf;
  border-radius: 20px;
  padding: 8px;
  z-index: 40;
}

.tab {
  flex: 1;
  border: 1px solid transparent;
  color: #7a5c4a;
  background: #fffaf4;
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.tab.active {
  background: linear-gradient(135deg, #d86c2f, #ef8b3c);
  color: #fff;
  box-shadow: 0 6px 16px rgba(190, 87, 24, 0.35);
}

.tab:not(.active):hover {
  background: #fff2e3;
  transform: translateY(-1px);
}

.panel {
  display: none;
  margin-top: 0;
  background: linear-gradient(180deg, #fffdf9, #fff9f1);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(148, 92, 31, 0.12);
  border: 1px solid #f0ddc8;
  padding: 14px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel.active { display: block; }

.home-hero {
  position: relative;
  margin-bottom: 12px;
}

.home-hero img {
  width: 100%;
  height: 128px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #efd6bc;
  box-shadow: 0 10px 24px rgba(173, 107, 41, 0.18);
}

.home-hero-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.controls #fSearch {
  grid-column: 1 / -1;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-chip {
  border: 1px solid #efcfad;
  border-radius: 999px;
  background: #fff7ec;
  color: #8a5d3b;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.tag-chip.clear-all {
  border-color: #e5b3b0;
  color: #8f1f16;
}

input, select, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: #fffdf9;
  color: #3b271b;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #eb9254;
  box-shadow: 0 0 0 3px rgba(240, 141, 65, 0.18);
}

select[multiple] {
  min-height: 108px;
  padding: 8px;
}

.multi-dd {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf9;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.multi-dd-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  color: #6d5342;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.multi-dd-summary::after {
  content: "▾";
  font-size: 12px;
  color: #7a8a9a;
}

.multi-dd-summary::-webkit-details-marker {
  display: none;
}

.multi-dd[open] .multi-dd-summary {
  border-bottom: 1px solid #f0ddc8;
}

.multi-dd-panel {
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}

.multi-dd[open] {
  border-color: #eb9254;
  box-shadow: 0 0 0 2px rgba(240, 141, 65, 0.18);
}

.multi-dd-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 8px;
  user-select: none;
}

.multi-dd-item:hover {
  background: #fff1e0;
}

.multi-dd-item input {
  margin: 0;
  accent-color: #d86c2f;
}

.multi-dd-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.multi-dd-item span {
  white-space: nowrap;
}

.multi-dd-panel .small-muted {
  grid-column: 1 / -1;
  padding: 4px 2px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(152, 94, 30, 0.08);
}

.card-clickable {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(159, 95, 29, 0.16);
}

.food-cover {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #efd8bf;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-family: "STKaiti", "KaiTi", "FangSong", serif;
}

.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }

.rating-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.rating-num {
  font-weight: 700;
  color: #96610d;
}

.stars { display: inline-flex; gap: 2px; line-height: 1; }
.stars-l .star { font-size: 20px; }
.stars-m .star { font-size: 16px; }
.stars-s .star { font-size: 13px; }
.star.full { color: var(--gold); }
.star.empty { color: #d4dbe3; }
.star.half {
  background: linear-gradient(90deg, var(--gold) 50%, #d4dbe3 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #ef8c3d);
  color: #fff;
  box-shadow: 0 6px 14px rgba(194, 91, 28, 0.3);
}

.btn.primary:hover { background: linear-gradient(135deg, var(--primary-strong), #dc7a2d); }

.btn.ghost {
  background: #fff3e5;
  color: #6b4a34;
  border: 1px solid #efcfac;
}

.btn.danger {
  background: #ffe8e5;
  color: var(--danger);
  border: 1px solid #f2beb6;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff2de;
  color: #8a5b32;
  font-size: 12px;
  border: 1px solid #efcfad;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  right: auto;
  background: rgba(56, 35, 24, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: .2s ease;
  z-index: 80;
  max-width: min(88vw, 360px);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.auth-dialog {
  border: none;
  border-radius: 14px;
  width: min(92vw, 360px);
  padding: 0;
  box-shadow: 0 16px 42px rgba(94, 56, 22, 0.36);
}

.auth-dialog form {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.error { color: var(--danger); min-height: 20px; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 10px; margin-bottom: 10px; }
.small-muted { color: var(--muted); font-size: 13px; }

.restaurant-dialog {
  border: none;
  border-radius: 16px;
  width: min(92vw, 390px);
  padding: 0;
}

.restaurant-dialog::backdrop {
  background: rgba(45, 24, 12, 0.45);
}

.restaurant-dialog-content {
  padding: 16px;
  position: relative;
  background: linear-gradient(180deg, #fffdf9, #fff7ef);
}

.restaurant-dialog-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.94);
}

.restaurant-dialog-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.dialog-rating {
  margin: 8px 0 10px;
}

.rating-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.composer {
  border: 1px solid #edd8c2;
  border-radius: 12px;
  padding: 10px;
  background: #fff9f0;
  margin: 10px 0;
  display: grid;
  gap: 8px;
}

.review-item {
  border: 1px solid #ecd6bf;
  border-radius: 12px;
  background: #fffefc;
  padding: 10px;
  margin-bottom: 8px;
}

.review-item.reply {
  margin-top: 8px;
  margin-left: 26px;
  background: #fffaf4;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #ebd5bf;
  background: #fff5e8;
}

.avatar.large {
  width: 64px;
  height: 64px;
}

.review-author {
  font-size: 13px;
  font-weight: 600;
}

.uid {
  font-size: 12px;
  color: #8f735f;
}

.review-time {
  font-size: 12px;
  color: #9a7f6b;
}

.review-content {
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}

.review-actions {
  display: flex;
  gap: 10px;
}

.review-score {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 2px;
}

.text-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #c45d1f;
  cursor: pointer;
  font-size: 13px;
}

.text-btn.warn { color: #b42318; }

.avatar-block {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.avatar-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  accent-color: #d86c2f;
}

.workbench,
.workbench-group {
  border: 1px solid #ecd5be;
  border-radius: 12px;
  background: #fffaf3;
}

.workbench {
  margin-top: 10px;
}

.workbench > summary,
.workbench-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #7a4f2f;
}

.workbench > summary::-webkit-details-marker,
.workbench-group > summary::-webkit-details-marker {
  display: none;
}

.workbench > summary::after,
.workbench-group > summary::after {
  content: "▾";
  float: right;
  color: #9c7d63;
}

.workbench[open] > summary::after,
.workbench-group[open] > summary::after {
  transform: rotate(180deg);
}

.workbench-body {
  border-top: 1px solid #f1dcc7;
  padding: 10px;
  display: grid;
  gap: 10px;
}

@media (max-width: 800px) {
  body { padding: 0; }
  .app-shell {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 10px 10px 84px;
  }

  .brand-wordmark {
    font-size: 30px;
  }

  .food-sticker {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 27px;
  }
}
