:root {
  --paper: #f4f2eb;
  --white: #fffefa;
  --ink: #1b342e;
  --green: #204d40;
  --muted: #66716b;
  --line: #dedfd5;
  --sand: #eae3d4;
  --gold: #9b682c;
  --red: #a33535;
  --soft: #e9efe8;
  font-family:
    system-ui,
    -apple-system,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
  border-radius: 9px;
  padding: 9px 15px;
  line-height: 1.4;
}
button:hover {
  border-color: var(--green);
  background: var(--soft);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary,
.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
button.active {
  background: var(--soft);
  border-color: var(--green);
  font-weight: 650;
}
button.danger {
  color: var(--red);
}
button.link {
  border: 0;
  background: transparent;
  padding: 6px;
  color: var(--green);
}
a {
  color: var(--green);
  text-decoration: none;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd1c6;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
textarea {
  min-height: 85px;
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--green);
}
label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 550;
}
small,
.muted {
  color: var(--muted);
  font-size: 13px;
}
h1,
h2,
h3,
p {
  margin: 0 0 12px;
}
h1 {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 650;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 17px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 16px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.card + .card {
  margin-top: 15px;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  background: var(--soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1.5;
  padding: 4px 8px;
  margin-right: 5px;
}
.badge.warm {
  background: #f3e6d5;
  color: #825b25;
}
.badge.red {
  color: var(--red);
  background: #f6e8e4;
}
.notice {
  padding: 13px 16px;
  background: var(--soft);
  border-left: 3px solid var(--green);
  border-radius: 4px;
  margin: 12px 0;
  font-size: 14px;
}
.notice.warn {
  background: #f8eddb;
  border-color: var(--gold);
}
.empty {
  padding: 45px 20px;
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.search {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}
.search input {
  border-radius: 30px;
}
.search button {
  border-radius: 30px;
}
.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-list button {
  border-radius: 30px;
}
.product {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}
.product .body {
  padding: 14px;
}
.product[data-action] {
  cursor: pointer;
}
.product img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.product[data-action] img {
  cursor: pointer;
}
input.invalid,
textarea.invalid {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}
.product h3 {
  margin-bottom: 3px;
}
.product button {
  margin-top: 10px;
}
.broken-image,
.image-placeholder {
  background: var(--sand);
  min-height: 100px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading {
  padding: 80px 25px;
  text-align: center;
}
.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: #10271fd9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: auto;
}
.dialog {
  position: relative;
  width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px;
  background: var(--paper);
  padding: 26px;
}
.dialog .close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
}
.dialog-content {
  clear: both;
  padding-top: 12px;
}
.dialog img.zoom {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.dialog textarea {
  min-height: 130px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
td,
th {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
  min-width: 80px;
}
th {
  color: var(--muted);
  font-weight: 600;
}
td input {
  min-width: 85px;
}
#toast {
  position: fixed;
  z-index: 200;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  background: #18392fee;
  color: white;
  border-radius: 8px;
  padding: 12px 20px;
  max-width: 90%;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
#toast.show {
  opacity: 1;
}
.customer #app {
  max-width: 760px;
  margin: auto;
  min-height: 100dvh;
  padding-bottom: 145px;
  background: var(--paper);
}
.customer header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f4f2ebf5;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 18px;
}
.customer header strong {
  font-size: 17px;
}
.customer header button {
  border: 0;
  padding: 5px 0;
  background: none;
  font-size: 14px;
}
.customer main {
  padding: 24px 20px;
}
.eyebrow {
  letter-spacing: 0.15em;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero {
  padding: 15px 0 22px;
}
.hero h1 {
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: 0.03em;
}
.home-entry {
  position: relative;
  border: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: 12px;
}
.home-entry img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-entry span {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, #10241dbb);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: white;
  font-size: 22px;
  font-weight: 600;
  pointer-events: none;
}
.customer .bottom-nav {
  position: fixed;
  z-index: 15;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 760px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fffefaf5;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 9px 10px max(9px, env(safe-area-inset-bottom));
}
.bottom-nav button {
  border: 0;
  background: none;
  font-size: 14px;
  border-radius: 0;
  padding: 5px;
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--muted);
}
.bottom-nav button.active {
  color: var(--green);
}
.nav-symbol {
  font-size: 20px;
  line-height: 1.2;
}
.submit-bar {
  position: fixed;
  z-index: 14;
  bottom: 69px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 760px;
  width: 100%;
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: #f4f2ebf5;
  border-top: 1px solid var(--line);
}
.dish-head {
  display: flex;
  gap: 15px;
}
.dish-head img {
  width: 110px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  align-self: start;
}
.dish-head > div {
  flex: 1;
  min-width: 0;
}
.dish-head h2 {
  font-size: 19px;
  margin-top: 8px;
}
.dish-card {
  margin-bottom: 16px;
}
.dish-card.general {
  background: #edf0e7;
}
.dish-card.shared {
  border-color: #aec2b0;
}
.dish-actions {
  display: flex;
  gap: 7px;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dish-actions button {
  padding: 8px 12px;
}
.quantity input {
  width: 90px;
}
.quantity {
  margin-top: 10px;
}
.progress {
  height: 5px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
  margin: 12px 0;
}
.progress > span {
  height: 100%;
  background: var(--green);
  display: block;
}
.gallery {
  display: flex;
  overflow: auto;
  scroll-snap-type: x mandatory;
  gap: 8px;
}
.gallery img {
  width: 100%;
  flex: 0 0 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.availability {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 15px 0;
  margin: 12px 0;
}
.availability > div {
  padding: 10px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
}
.availability strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.line-quantities {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}
.line-quantities input {
  width: 110px;
}
.line-quantities input.note {
  width: 100%;
}
.order-number {
  font-family: monospace;
  font-size: 23px;
  overflow-wrap: anywhere;
}
.success {
  border-top: 4px solid var(--green);
}
.series-hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
}
.series-scroll {
  display: flex;
  overflow: auto;
  gap: 12px;
}
.series-scroll button {
  min-width: 210px;
  white-space: nowrap;
}
.admin #app {
  min-height: 100vh;
}
.admin-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #f7f4e9;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-family: Georgia, "Songti SC", serif;
  font-size: 27px;
  letter-spacing: 0.12em;
}
.sidebar small {
  color: #bac9bd;
  display: block;
  margin: 4px 0 30px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav button {
  text-align: left;
  color: #e4ece5;
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 13px;
}
.sidebar nav button.active,
.sidebar nav button:hover {
  background: #33594d;
}
.sidebar .identity {
  margin-top: 40px;
  padding: 15px 10px;
  border-top: 1px solid #4b6258;
}
.admin-main {
  min-width: 0;
}
.admin-topbar {
  padding: 15px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}
.admin-content {
  padding: 32px;
  max-width: 1500px;
  margin: auto;
}
.admin-content > h1 {
  margin-bottom: 7px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 22px 0;
}
.stats .card {
  margin: 0;
}
.stats strong {
  font-size: 32px;
  display: block;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 24px 0;
}
.login {
  max-width: 430px;
  margin: 10vh auto;
  padding: 35px;
}
.login .brand {
  margin-bottom: 10px;
}
.login button {
  margin-top: 22px;
  width: 100%;
}
.store-card .row {
  margin-top: 12px;
}
.editor-card {
  margin: 18px 0;
}
.editor-card img.thumb {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}
.editor-top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--paper);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.editor-card .dish-fields {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 15px;
}
.picker-list {
  max-height: 60vh;
  overflow: auto;
}
.picker-spec {
  border-top: 1px solid var(--line);
  padding: 10px;
  margin-top: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.picker-list .product img {
  max-height: 160px;
}
.media-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}
.media-grid .card {
  margin: 0;
  padding: 12px;
}
.timeline {
  border-left: 2px solid var(--line);
  padding-left: 18px;
}
.timeline > div {
  margin: 16px 0;
}
.changed {
  background: #fbefdf;
}
.shared-row {
  background: #eef3e9;
}
.inline-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.reserved {
  font-size: 13px;
  color: var(--muted);
}
.notice-list .card {
  padding: 16px;
}
.unread {
  border-left: 4px solid var(--gold);
}
.full-width {
  width: 100%;
}
.video-slot {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}
.contact-slot:empty,
.video-slot:empty {
  display: none;
}
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .sidebar .brand {
    font-size: 21px;
  }
  .sidebar small {
    margin: 0 0 12px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .sidebar .identity {
    display: none;
  }
  .admin-topbar {
    padding: 10px 18px;
  }
  .admin-content {
    padding: 20px 15px;
  }
  .stats {
    gap: 8px;
  }
  .stats .card {
    padding: 13px;
  }
  .stats strong {
    font-size: 26px;
  }
  .two-col,
  .editor-card .dish-fields {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }
  .customer main {
    padding: 20px 14px;
  }
  .grid {
    gap: 10px;
  }
  .card {
    padding: 15px;
  }
  .dish-head img {
    width: 85px;
  }
  .dish-head h2 {
    font-size: 17px;
  }
  .home-entry span {
    padding: 12px;
    font-size: 19px;
  }
  .product .body {
    padding: 10px;
  }
  .product h3 {
    font-size: 15px;
  }
  .availability {
    gap: 5px;
  }
  .dialog {
    padding: 17px;
  }
  .stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stats .card {
    font-size: 12px;
    padding: 10px;
  }
  .stats strong {
    font-size: 23px;
  }
  .submit-bar {
    padding: 10px 14px;
  }
}
.sidebar .identity button.link {
  color: #e4ece5;
}

/* 验收修复：搜索、错误态及固定底栏在窄屏仍可操作。 */
.search input {
  flex: 1;
  min-width: 0;
}
.search button {
  flex-shrink: 0;
  white-space: nowrap;
}
input.invalid,
input.invalid:focus {
  border: 2px solid var(--red);
  outline: 2px solid var(--red);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #a3353526;
}
.field-error {
  color: var(--red);
  margin: 8px 0 12px;
  font-size: 14px;
}
.customer #app {
  padding-bottom: calc(160px + env(safe-area-inset-bottom));
}
.customer .bottom-nav {
  height: calc(70px + env(safe-area-inset-bottom));
}
.submit-bar {
  bottom: calc(70px + env(safe-area-inset-bottom));
}
.submit-bar button {
  flex-shrink: 0;
  white-space: nowrap;
}
.table-wrap,
.sidebar,
.sidebar nav,
.admin-content,
.admin-content .card {
  min-width: 0;
}
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-topbar {
    flex-wrap: wrap;
  }
  .sidebar nav {
    flex-wrap: wrap;
  }
  .sidebar .identity {
    display: block;
    margin-top: 12px;
    padding: 8px;
  }
  .admin-content .row > div,
  .admin-content .toolbar > div {
    min-width: 0;
    max-width: 100%;
  }
  .admin-content h1,
  .admin-content h2,
  .admin-content small {
    overflow-wrap: anywhere;
  }
  .workbench-table table,
  .workbench-table tbody,
  .workbench-table tr,
  .workbench-table td {
    display: block;
  }
  .workbench-table thead {
    display: none;
  }
  .workbench-table tr {
    padding: 12px;
    margin-bottom: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .workbench-table td {
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 8px 0;
  }
  .workbench-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
  }
  .table-wrap:not(.workbench-table) {
    border-bottom: 2px solid var(--line);
  }
}
@media (max-width: 420px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-topbar .row {
    gap: 6px;
  }
  .admin-content button {
    max-width: 100%;
  }
}
