:root {
  --linen: #f4ecd9;
  --linen-deep: #dfcaa5;
  --grass: #6f9f54;
  --grass-dark: #3e6f39;
  --wood: #a7794b;
  --ink: #2c3329;
  --muted: #73806e;
  --card: rgba(255, 252, 241, 0.84);
  --shadow: 0 18px 50px rgba(70, 82, 51, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(111, 159, 84, 0.28), transparent 26rem),
    radial-gradient(circle at 100% 2%, rgba(223, 202, 165, 0.55), transparent 22rem),
    var(--linen);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.hero-card,
.mine-card,
.search-card,
.fabric-form,
.uniform-card,
.match-item {
  border: 1px solid rgba(167, 121, 75, 0.22);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--grass-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
}

.hero-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.leaf-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  color: white;
  font-weight: 800;
  line-height: 1.25;
  background: linear-gradient(145deg, var(--grass), var(--grass-dark));
  border-radius: 48% 52% 50% 18% / 46% 44% 56% 30%;
  transform: rotate(-8deg);
}

.page {
  display: none;
  padding-top: 22px;
}

.page.active {
  display: block;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.section-title span {
  color: var(--grass-dark);
  font-size: 13px;
}

.waterfall {
  column-count: 2;
  column-gap: 12px;
}

.uniform-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  overflow: hidden;
  border-radius: 24px;
}

.uniform-img {
  display: grid;
  min-height: 136px;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 34px;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(62, 111, 57, 0.82), rgba(167, 121, 75, 0.48)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 2px, transparent 2px 8px);
}

.uniform-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card-body {
  padding: 12px;
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  color: var(--grass-dark);
  font-size: 12px;
  font-weight: 800;
  background: rgba(111, 159, 84, 0.14);
  border-radius: 999px;
}

.seller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.seller img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.fabric-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
}

.fabric-form.compact {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.28);
}

label {
  display: grid;
  gap: 7px;
  color: var(--grass-dark);
  font-weight: 700;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(111, 159, 84, 0.25);
  border-radius: 16px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-grid,
.quick-filter,
.auth-actions,
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-filter {
  grid-template-columns: 0.8fr 0.8fr 1.1fr;
  margin: 12px 0;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.search-card button {
  border: 0;
  border-radius: 18px;
  padding: 13px 16px;
  font-weight: 900;
  cursor: pointer;
}

.primary-btn,
.search-card button {
  color: white;
  background: linear-gradient(135deg, var(--grass), var(--grass-dark));
}

.primary-btn.loading,
.ghost-btn.loading,
.danger-btn.loading,
.search-card button.loading {
  position: relative;
  color: rgba(255, 255, 255, 0.68);
  cursor: wait;
}

.primary-btn.loading::after,
.ghost-btn.loading::after,
.danger-btn.loading::after,
.search-card button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ghost-btn {
  color: var(--grass-dark);
  background: rgba(111, 159, 84, 0.14);
}

.danger-btn {
  color: #8f2d24;
  background: rgba(191, 76, 55, 0.14);
}

.full {
  width: 100%;
  margin-top: 12px;
}

.search-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
}

.tag-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
}

.tag-row button {
  flex: 0 0 auto;
  border: 1px solid rgba(111, 159, 84, 0.28);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--grass-dark);
  background: rgba(255, 255, 255, 0.44);
}

.match-list {
  display: grid;
  gap: 12px;
}

.match-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
}

.match-thumb {
  display: grid;
  place-items: center;
  min-height: 86px;
  color: white;
  background: linear-gradient(135deg, var(--linen-deep), var(--grass));
  border-radius: 18px;
}

.match-item h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.match-item p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.small-actions {
  display: flex;
  gap: 8px;
}

.small-actions button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--grass-dark);
  background: rgba(111, 159, 84, 0.15);
}

.mine-card {
  padding: 18px;
  border-radius: 26px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-row img {
  width: 66px;
  height: 66px;
  border-radius: 24px;
  background: white;
}

.stats {
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0;
}

.stats button {
  border: 0;
  display: grid;
  gap: 4px;
  padding: 14px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  cursor: pointer;
}

.stats button:active {
  transform: scale(0.98);
}

.stats b {
  color: var(--grass-dark);
  font-size: 22px;
}

.stats span {
  color: var(--muted);
  font-size: 12px;
}

.small-btn {
  padding: 9px 14px;
  border-radius: 999px;
}

.empty-card {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(167, 121, 75, 0.18);
  border-radius: 22px;
}

.global-loading {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--grass-dark);
  font-weight: 900;
  background: rgba(244, 236, 217, 0.42);
  backdrop-filter: blur(3px);
}

.loading-leaf {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, var(--grass), var(--grass-dark));
  border-radius: 48% 52% 50% 18% / 46% 44% 56% 30%;
  animation: leaf-spin 0.9s linear infinite;
}

.global-loading.hidden {
  display: none;
}

.hidden {
  display: none;
}

.tabbar {
  position: fixed;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 12px 16px;
  background: rgba(244, 236, 217, 0.86);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(167, 121, 75, 0.2);
}

.tabbar button {
  border: 0;
  padding: 10px;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
  border-radius: 999px;
}

.tabbar button.active {
  color: white;
  background: var(--grass);
}

dialog {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: var(--linen);
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--grass-dark);
  font-size: 24px;
  line-height: 1;
  background: rgba(111, 159, 84, 0.14);
  cursor: pointer;
}

dialog::backdrop {
  background: rgba(44, 51, 41, 0.42);
}

.success-pop {
  animation: pop 0.56s ease both;
}

@keyframes pop {
  0% {
    transform: scale(0.96);
  }
  55% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes leaf-spin {
  to {
    transform: rotate(360deg);
  }
}
