/* static/style.css */
:root {
  --ink-900: #10151b;
  --ink-800: #171e27;
  --ink-700: #273241;
  --paper-100: #f5f1e8;
  --paper-200: #ebe3d3;
  --gold-300: #cba96b;
  --gold-400: #b38745;
  --line-soft: rgba(214, 185, 131, 0.25);
  --line-strong: rgba(214, 185, 131, 0.45);
}

body {
  margin: 0;
  padding: 0;
}

.menu-page {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--paper-100);
  background:
    linear-gradient(130deg, rgba(20, 24, 31, 0.86), rgba(16, 21, 27, 0.92)),
    radial-gradient(circle at 20% 16%, rgba(179, 135, 69, 0.17), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(158, 43, 43, 0.1), transparent 38%),
    #0f141b;
  min-height: 100vh;
  overflow-x: hidden;
}

.menu-bg-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 12px
    );
}

.menu-page .container {
  max-width: 860px;
  margin: 22px auto;
  padding: 20px;
  background: linear-gradient(160deg, rgba(20, 25, 33, 0.88), rgba(17, 22, 28, 0.9));
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  position: relative;
}

.menu-header {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
  margin-bottom: 18px;
  animation: fade-up 0.5s ease-out both;
}

.menu-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-300);
  margin-bottom: 6px;
}

.menu-page h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.menu-header p {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(245, 241, 232, 0.74);
}

.menu-list {
  margin-top: 10px;
}

.menu-item {
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(145deg, rgba(35, 42, 54, 0.56), rgba(25, 31, 40, 0.5)),
    rgba(23, 30, 39, 0.52);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  animation: fade-up 0.45s ease-out both;
  animation-delay: calc(var(--item-index) * 45ms);
}

.menu-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.menu-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-name {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff8eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-price {
  margin-top: 2px;
  font-size: 13px;
  color: var(--gold-300);
  letter-spacing: 0.02em;
}

.menu-image-wrap {
  flex: 0 0 auto;
  margin: 0 4px;
}

.menu-image {
  width: 88px;
  height: 62px;
  border-radius: 7px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.menu-image-placeholder {
  width: 88px;
  height: 62px;
  border-radius: 7px;
  font-size: 11px;
  color: rgba(241, 233, 216, 0.68);
  border: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
}

.menu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(203, 169, 107, 0.14);
  color: #fff7e9;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.menu-actions button:active {
  transform: translateY(1px) scale(0.98);
}

.menu-actions button:hover {
  background: rgba(203, 169, 107, 0.24);
}

.menu-actions .qty {
  min-width: 24px;
  text-align: center;
  color: var(--paper-100);
  font-weight: 600;
}

.remark {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--paper-100);
  background: rgba(19, 25, 32, 0.62);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-sizing: border-box;
}

.remark::placeholder {
  color: rgba(245, 241, 232, 0.42);
}

.cart-panel {
  position: sticky;
  bottom: 8px;
  background: linear-gradient(140deg, rgba(21, 27, 34, 0.95), rgba(16, 22, 29, 0.94));
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  margin-top: 16px;
  color: var(--paper-100);
  backdrop-filter: blur(3px);
}

#submit-order-btn {
  margin-top: 9px;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(130deg, #c89a55, #ac7534 60%, #8a532a);
  color: #fff9ef;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}

#message {
  margin-top: 8px;
  min-height: 20px;
  font-size: 13px;
  color: #f5e4bf;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th,
.orders-table td {
  border: 1px solid #ddd;
  padding: 6px;
  vertical-align: top;
}

.orders-table th {
  background: #fafafa;
}

.orders-table button {
  font-size: 12px;
  padding: 4px 8px;
}

.admin-orders-page .container {
  max-width: 980px;
}

.admin-header p a {
  color: var(--gold-300);
  text-decoration: none;
}

.admin-header p a:hover {
  text-decoration: underline;
}

.admin-orders-page .orders-table {
  width: 100%;
  table-layout: fixed;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(18, 24, 32, 0.5);
}

.orders-table-wrap {
  overflow-x: auto;
}

.admin-orders-page .orders-table th,
.admin-orders-page .orders-table td {
  border: 1px solid var(--line-soft);
  color: var(--paper-100);
  padding: 8px;
}

.admin-orders-page .orders-table th {
  background: rgba(203, 169, 107, 0.16);
  color: #fff4da;
}

.admin-orders-page .orders-table th:nth-child(1),
.admin-orders-page .orders-table td:nth-child(1) {
  width: 56px;
}

.admin-orders-page .orders-table th:nth-child(2),
.admin-orders-page .orders-table td:nth-child(2) {
  width: 64px;
}

.admin-orders-page .orders-table th:nth-child(3),
.admin-orders-page .orders-table td:nth-child(3) {
  width: 78px;
}

.admin-orders-page .orders-table th:nth-child(4),
.admin-orders-page .orders-table td:nth-child(4) {
  min-width: 280px;
}

.admin-orders-page .orders-table th:nth-child(5),
.admin-orders-page .orders-table td:nth-child(5) {
  width: 86px;
}

.admin-orders-page .orders-table th:nth-child(6),
.admin-orders-page .orders-table td:nth-child(6) {
  width: 86px;
}

.order-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  text-transform: lowercase;
}

.status-new {
  background: rgba(59, 130, 246, 0.18);
  color: #c9e2ff;
}

.status-in_progress {
  background: rgba(245, 158, 11, 0.2);
  color: #ffe4ad;
}

.status-done {
  background: rgba(34, 197, 94, 0.2);
  color: #c9f3d7;
}

.status-btn {
  margin: 2px 4px 2px 0;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(203, 169, 107, 0.14);
  color: #fff7e9;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}

.status-btn:hover {
  background: rgba(203, 169, 107, 0.24);
}

.order-time {
  line-height: 1.45;
  min-width: 86px;
}

.order-date,
.order-clock {
  white-space: nowrap;
}

.order-dishes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-dish-line {
  white-space: nowrap;
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-actions form {
  margin: 0;
}

.order-actions .status-btn {
  width: 100%;
  padding: 4px 6px;
}

@media (max-width: 480px) {
  .menu-page .container {
    margin: 10px;
    padding: 14px;
    border-radius: 12px;
  }

  .menu-page h1 {
    font-size: 24px;
  }

  .menu-name {
    font-size: 18px;
  }

  .menu-image,
  .menu-image-placeholder {
    width: 76px;
    height: 54px;
  }

  .menu-actions {
    gap: 6px;
  }

  .menu-actions button {
    width: 30px;
    height: 30px;
  }

  .admin-orders-page .orders-table {
    font-size: 11px;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .admin-orders-page .orders-table th,
  .admin-orders-page .orders-table td {
    padding: 4px;
  }

  .admin-orders-page .orders-table th:nth-child(1),
  .admin-orders-page .orders-table td:nth-child(1) {
    width: 6%;
  }

  .admin-orders-page .orders-table th:nth-child(2),
  .admin-orders-page .orders-table td:nth-child(2) {
    width: 8%;
  }

  .admin-orders-page .orders-table th:nth-child(3),
  .admin-orders-page .orders-table td:nth-child(3) {
    width: 12%;
  }

  .admin-orders-page .orders-table th:nth-child(4),
  .admin-orders-page .orders-table td:nth-child(4) {
    width: 46%;
    min-width: 0;
  }

  .admin-orders-page .orders-table th:nth-child(5),
  .admin-orders-page .orders-table td:nth-child(5) {
    width: 14%;
  }

  .admin-orders-page .orders-table th:nth-child(6),
  .admin-orders-page .orders-table td:nth-child(6) {
    width: 14%;
  }

  .admin-orders-page .orders-table th:nth-child(1),
  .admin-orders-page .orders-table td:nth-child(1),
  .admin-orders-page .orders-table th:nth-child(2),
  .admin-orders-page .orders-table td:nth-child(2),
  .admin-orders-page .orders-table th:nth-child(3),
  .admin-orders-page .orders-table td:nth-child(3),
  .admin-orders-page .orders-table th:nth-child(5),
  .admin-orders-page .orders-table td:nth-child(5),
  .admin-orders-page .orders-table th:nth-child(6),
  .admin-orders-page .orders-table td:nth-child(6) {
    white-space: nowrap;
  }

  .admin-orders-page .orders-table td:nth-child(4) {
    max-width: none;
  }

  .admin-orders-page .order-dish-line {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .order-status {
    padding: 1px 5px;
    font-size: 10px;
  }

  .order-time {
    min-width: 0;
    line-height: 1.25;
  }

  .order-date,
  .order-clock {
    font-size: 10px;
  }

  .order-actions {
    gap: 4px;
  }

  .order-actions .status-btn {
    font-size: 10px;
    padding: 3px 4px;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
