﻿:root {
  --bg: #f4efe6;
  --ink: #2a2018;
  --muted: #6b5a4a;
  --accent: #f26b4f;
  --accent-2: #2f6f5e;
  --paper: #fff8f1;
  --paper-2: #f6ede2;
  --line: #e7d6c4;
  --shadow: rgba(42, 32, 24, 0.12);
  --radius: 18px;
  --radius-lg: 26px;
  --font-display: "ZCOOL XiaoWei", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-ui: "HarmonyOS Sans", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -20% -10% auto auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(242, 107, 79, 0.25), rgba(242, 107, 79, 0));
  filter: blur(6px);
}

body::after {
  inset: auto auto -30% -20%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 70% 40%, rgba(47, 111, 94, 0.22), rgba(47, 111, 94, 0));
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(244, 239, 230, 0.95), rgba(244, 239, 230, 0.7));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(231, 214, 196, 0.6);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), #f8b08e);
  box-shadow: 0 10px 24px rgba(242, 107, 79, 0.25);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.15);
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 1px;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(42, 32, 24, 0.08);
  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  width: 100%;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip {
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(242, 107, 79, 0.25);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.toolbar .hint {
  font-size: 14px;
  color: var(--muted);
}

.view-switch {
  display: flex;
  gap: 8px;
}

.view-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.view-pill.active {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.button {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(242, 107, 79, 0.2);
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.ghost {
  background: rgba(47, 111, 94, 0.15);
  color: var(--accent-2);
  border: none;
}

.material-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.material-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  min-height: 150px;
}

.color-block {
  height: 90px;
  border-radius: 12px;
}

.empty-state {
  margin-top: 22px;
  text-align: center;
  padding: 30px 20px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  background: rgba(255, 248, 241, 0.6);
}

.empty-state h3 {
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.section-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  background: #fff7ef;
}

.section-header .title {
  font-weight: 600;
}

.section-body {
  padding: 18px;
}

.masonry {
  column-count: 2;
  column-gap: 18px;
  margin-top: 20px;
}

.masonry-card {
  break-inside: avoid;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  transition: transform 0.2s ease;
}

.masonry-card:hover {
  transform: translateY(-4px);
}

.masonry-hero {
  border-radius: 14px;
  background: linear-gradient(135deg, #f7d4bf, #fce9dc);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--ink);
  margin-bottom: 12px;
}

.rating {
  display: inline-flex;
  gap: 4px;
  font-size: 12px;
  color: #d4a166;
}

.profile {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items: center;
}

.avatar {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  background: linear-gradient(145deg, #f4b49a, #f7dfcf);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
}

.menu-group {
  margin-top: 18px;
}

.menu-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.menu-item + .menu-item {
  margin-top: 10px;
}

.menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(242, 107, 79, 0.12);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.menu-arrow {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-size: 13px;
  color: var(--muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-ui);
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.12);
  color: var(--accent-2);
  font-size: 13px;
}

.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 248, 241, 0.9);
  border-top: 1px solid var(--line);
  padding: 12px 20px 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 248, 241, 0.95);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 16px;
  z-index: 30;
}

.tabbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.tabbar a.active {
  color: var(--accent);
  font-weight: 600;
}

.tabbar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.tabbar a.active .dot {
  background: var(--accent);
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.admin-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  cursor: pointer;
}

.admin-link.active {
  background: rgba(242, 107, 79, 0.12);
  border-color: rgba(242, 107, 79, 0.25);
  font-weight: 600;
}

.admin-content {
  display: grid;
  gap: 16px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

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

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form .form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.12);
  color: var(--accent-2);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(42, 32, 24, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 16, 12, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(520px, 90vw);
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-card ul {
  padding-left: 18px;
  margin: 10px 0 0;
}

[data-animate] {
  animation: fadeUp 0.5s ease both;
  animation-delay: calc(var(--i) * 0.06s);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .masonry {
    column-count: 3;
  }
}

@media (max-width: 720px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .tabbar {
    padding-bottom: 24px;
  }
}
