:root {
  --ink: #24312f;
  --muted: #68716d;
  --paper: #f5f2eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #ddd6ca;
  --line-strong: #c9beb0;
  --brand: #b84d2f;
  --brand-dark: #8f351f;
  --brand-soft: #f4d7c9;
  --sage: #466a60;
  --sage-dark: #2f5149;
  --sage-soft: #dbe8e1;
  --gold: #d99b2b;
  --gold-soft: #f7e7bc;
  --danger: #b53636;
  --danger-soft: #f7d9d7;
  --success: #2f7359;
  --success-soft: #d9eee4;
  --info: #3b6486;
  --info-soft: #dae8f2;
  --shadow: 0 14px 34px rgba(42, 49, 46, 0.1);
  --shadow-soft: 0 6px 20px rgba(42, 49, 46, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --header-height: 66px;
  --content-width: 1260px;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(217, 155, 43, 0.45);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 60;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-header-inner {
  width: min(var(--content-width), calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 218px;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--sage-dark);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}

.brand-name {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-en {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.2;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav-link {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  background: #f2eee6;
}

.nav-link.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: #e8bba6;
}

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

.icon-button {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #f5f1e9;
}

.icon-button .badge,
.nav-link .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  border: 2px solid var(--surface);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.account-button {
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  color: var(--ink);
}

.avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--sage);
  font-size: 13px;
  font-weight: 800;
}

.page {
  width: min(var(--content-width), calc(100% - 40px));
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.page.narrow {
  max-width: 940px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.page-subtitle {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--sage-dark);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(0.96);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.button.primary {
  background: var(--brand);
}

.button.gold {
  color: #432e0e;
  background: var(--gold);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.button.ghost {
  color: var(--ink);
  border-color: transparent;
  background: transparent;
}

.button.danger {
  background: var(--danger);
}

.button.success {
  background: var(--success);
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.button.block {
  width: 100%;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-carousel {
  position: relative;
  height: 340px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid #b9c7c1;
  background: var(--sage-dark);
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(24, 43, 40, 0.34);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  left: 42px;
  bottom: 42px;
  max-width: 660px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.34);
}

.hero-copy h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.15;
}

.hero-copy p {
  margin: 12px 0 0;
  font-size: 17px;
}

.hero-dots {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.hero-dot.active {
  width: 25px;
  border-radius: 8px;
  background: #fff;
}

.notice-strip {
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: 1.55fr 0.75fr;
  gap: 16px;
}

.notice-box,
.batch-box {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.notice-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.notice-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.notice-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 800;
}

.notice-text {
  margin: 0;
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.batch-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.batch-name {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.batch-time {
  color: var(--muted);
  font-size: 13px;
}

.status-line {
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(47, 115, 89, 0.12);
}

.status-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(181, 54, 54, 0.12);
}

.toolbar {
  margin: 24px 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 420px;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
}

.search-field .input {
  padding-left: 40px;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(70, 106, 96, 0.13);
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field-label {
  color: #4f5a56;
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-line {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f5a56;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.category-tabs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--surface);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.category-button.active {
  color: #fff;
  border-color: var(--sage-dark);
  background: var(--sage-dark);
}

.subcategory-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.subcategory-button {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.subcategory-button.active {
  color: var(--brand-dark);
  border-color: #dda98f;
  background: var(--brand-soft);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  border-color: #c4b6a8;
  box-shadow: 0 16px 32px rgba(42, 49, 46, 0.13);
  transform: translateY(-3px);
}

.product-image-button {
  position: relative;
  width: 100%;
  aspect-ratio: 1.14 / 1;
  padding: 0;
  border: 0;
  display: block;
  overflow: hidden;
  background: #e8e3d8;
}

.product-image-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.product-card:hover .product-image-button img {
  transform: scale(1.025);
}

.product-category {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  background: rgba(47, 81, 73, 0.88);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-body {
  padding: 14px;
}

.product-title {
  min-height: 46px;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.product-description {
  min-height: 42px;
  margin: 7px 0 12px;
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.price {
  color: var(--brand);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.price .currency {
  margin-right: 2px;
  font-size: 13px;
}

.price-from {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.empty-state {
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.66);
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sage-dark);
  background: var(--sage-soft);
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--ink);
}

.empty-state p {
  margin: 0;
}

.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.panel-body {
  padding: 16px;
}

.cart-list {
  display: grid;
}

.cart-item {
  padding: 16px;
  display: grid;
  grid-template-columns: auto 82px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.checkbox {
  width: 19px;
  height: 19px;
  accent-color: var(--brand);
}

.cart-thumb,
.order-thumb,
.mini-thumb {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  background: #e9e2d7;
}

.cart-thumb {
  aspect-ratio: 1 / 1;
}

.cart-info {
  min-width: 0;
}

.cart-name,
.order-product-name {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.cart-spec {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-warning {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.cart-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quantity-control {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 34px 44px 34px;
  overflow: hidden;
  background: #fff;
}

.quantity-control button {
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #f4f0e8;
}

.quantity-control input {
  width: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  outline: none;
}

.summary-panel {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.summary-line {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.summary-total {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.summary-total strong {
  color: var(--brand);
  font-size: 27px;
}

.order-list {
  display: grid;
  gap: 15px;
}

.order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.order-card-head {
  min-height: 50px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #faf7f0;
}

.order-no {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-card-body {
  padding: 15px;
}

.order-items {
  display: grid;
  gap: 11px;
}

.order-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.order-thumb {
  width: 58px;
  height: 58px;
}

.order-item-price {
  text-align: right;
}

.order-item-price strong {
  display: block;
}

.order-item-price small {
  color: var(--muted);
}

.order-card-foot {
  padding: 13px 15px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.order-total strong {
  color: var(--brand);
  font-size: 22px;
}

.status-badge,
.tag {
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pending {
  color: #7c5513;
  background: var(--gold-soft);
}

.status-submitted {
  color: #2d5a70;
  background: var(--info-soft);
}

.status-shipped {
  color: #245b47;
  background: var(--success-soft);
}

.status-completed {
  color: #35563f;
  background: #d9e8d8;
}

.status-cancelled,
.status-disabled,
.status-rejected {
  color: #813d3d;
  background: var(--danger-soft);
}

.tag {
  color: #4f5a56;
  border: 1px solid var(--line);
  background: #f8f5ef;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.address-card {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.address-card.selected {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(70, 106, 96, 0.12);
}

.address-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.address-name {
  font-size: 16px;
  font-weight: 900;
}

.address-phone {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.address-text {
  margin: 5px 0 11px;
  color: #4e5955;
  font-size: 13px;
}

.address-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  overflow: auto;
  display: grid;
  place-items: center;
  background: rgba(25, 34, 32, 0.58);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
  animation: modal-in 170ms ease-out;
}

.modal.wide {
  width: min(1020px, 100%);
}

.modal.narrow-modal {
  width: min(460px, 100%);
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: var(--surface);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-detail {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 24px;
}

.detail-gallery {
  min-width: 0;
}

.detail-main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: #e9e3d8;
}

.detail-gallery .product-image-button {
  aspect-ratio: auto;
}

.detail-thumbnails {
  margin-top: 9px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.detail-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  overflow: hidden;
  background: transparent;
  flex: 0 0 auto;
}

.detail-thumb.active {
  border-color: var(--brand);
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-price {
  margin: 8px 0 15px;
  color: var(--brand);
  font-size: 30px;
  font-weight: 900;
}

.spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-button {
  min-width: 92px;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-align: left;
  background: #fff;
}

.spec-button strong,
.spec-button small {
  display: block;
}

.spec-button small {
  margin-top: 3px;
  color: var(--muted);
}

.spec-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(184, 77, 47, 0.12);
  background: #fff8f4;
}

.spec-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.tab-button {
  height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.tab-button.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}

.tab-content {
  padding: 16px 0;
  color: #4b5652;
  font-size: 14px;
  white-space: pre-wrap;
}

.checkout-selection {
  display: grid;
  gap: 10px;
}

.checkout-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.mini-thumb {
  width: 54px;
  height: 54px;
}

.checkout-address-list {
  display: grid;
  gap: 10px;
}

.checkout-address {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.checkout-address.active {
  border-color: var(--sage);
  background: #f6fbf8;
}

.checkout-address label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  cursor: pointer;
}

.auth-page {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  gap: 28px;
  align-items: stretch;
  background: #e9eee9;
}

.auth-visual {
  position: relative;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--sage-dark);
  box-shadow: var(--shadow);
}

.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(24, 47, 43, 0.35);
}

.auth-visual-copy {
  position: absolute;
  z-index: 2;
  left: 42px;
  right: 42px;
  bottom: 46px;
  color: #fff;
}

.auth-visual-copy h1 {
  max-width: 700px;
  margin: 0;
  font-size: 44px;
  line-height: 1.14;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}

.auth-visual-copy p {
  max-width: 640px;
  margin: 14px 0 0;
  font-size: 16px;
}

.auth-panel {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(430px, 100%);
}

.auth-brand {
  margin-bottom: 30px;
}

.auth-brand .brand-mark {
  width: 48px;
  height: 48px;
}

.auth-brand h2 {
  margin: 17px 0 3px;
  font-size: 29px;
  line-height: 1.2;
}

.auth-brand p {
  margin: 0;
  color: var(--muted);
}

.auth-tabs {
  margin-bottom: 21px;
  padding: 4px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eee9df;
}

.auth-tab {
  height: 37px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.auth-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(32, 39, 36, 0.08);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-note {
  margin-top: 17px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8f4ec;
  font-size: 13px;
}

.toast-root {
  position: fixed;
  z-index: 200;
  top: 78px;
  right: 20px;
  width: min(380px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  color: #fff;
  background: var(--sage-dark);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: #853535;
}

.toast.warning {
  color: #3e2d0f;
  background: var(--gold);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  background: #eef0eb;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 13px;
  display: flex;
  flex-direction: column;
  color: #eef5f1;
  background: #29443e;
}

.admin-brand {
  min-height: 64px;
  padding: 6px 7px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-brand .brand-name {
  color: #fff;
}

.admin-brand .brand-en {
  color: #b9cdc6;
}

.admin-nav {
  margin-top: 15px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
}

.admin-nav-link {
  position: relative;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbdad5;
  text-align: left;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
}

.admin-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.admin-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.admin-nav-link .badge {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
}

.admin-sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
}

.admin-sidebar-foot .button {
  width: 100%;
  color: #e6efeb;
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(10px);
}

.admin-topbar h1 {
  margin: 0;
  font-size: 21px;
}

.admin-content {
  padding: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value {
  margin-top: 14px;
  color: var(--ink);
  font-size: 29px;
  font-weight: 950;
  line-height: 1;
}

.metric-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 18px;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 13px;
}

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

.data-table th {
  color: #52605b;
  background: #f4f1e9;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfaf6;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

.filter-bar {
  margin-bottom: 15px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
}

.filter-bar .field {
  min-width: 150px;
  flex: 1;
}

.filter-bar .field.small-filter {
  min-width: 120px;
  max-width: 170px;
}

.inline-editor {
  display: grid;
  gap: 8px;
}

.line-item-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(100px, 0.7fr) 88px 112px auto;
  gap: 9px;
  align-items: end;
  background: #fbfaf6;
}

.upload-zone {
  min-height: 110px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: #faf8f3;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.image-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eee9df;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(117, 30, 30, 0.86);
}

.lightbox {
  position: fixed;
  z-index: 150;
  inset: 0;
  padding: 28px;
  display: grid;
  place-items: center;
  background: rgba(15, 21, 20, 0.88);
}

.lightbox img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
}

.mobile-bottom-nav {
  display: none;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
}

.loading-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border: 5px solid var(--sage-soft);
  border-top-color: var(--sage-dark);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

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

.danger-text {
  color: var(--danger);
}

.success-text {
  color: var(--success);
}

.nowrap {
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-header-inner,
  .page {
    width: min(100% - 24px, var(--content-width));
  }

  .brand {
    min-width: 0;
  }

  .brand-en {
    display: none;
  }

  .main-nav .nav-link span {
    display: none;
  }

  .main-nav .nav-link {
    width: 40px;
    padding: 0;
  }

  .hero-carousel {
    height: 280px;
  }

  .hero-copy {
    left: 25px;
    right: 25px;
    bottom: 30px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .notice-strip,
  .cart-layout,
  .checkout-layout,
  .product-detail,
  .auth-page,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .auth-page {
    padding: 14px;
  }

  .auth-visual {
    min-height: 300px;
  }

  .auth-visual-copy {
    left: 24px;
    right: 24px;
    bottom: 26px;
  }

  .auth-visual-copy h1 {
    font-size: 32px;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .admin-brand {
    display: none;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
    margin: 0;
  }

  .admin-nav-link {
    flex: 0 0 auto;
  }

  .admin-sidebar-foot {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 66px;
  }

  .app-header {
    height: auto;
    min-height: 58px;
  }

  .app-header-inner {
    min-height: 58px;
    gap: 10px;
  }

  .brand-name {
    font-size: 15px;
  }

  .main-nav {
    display: none;
  }

  .account-button span:last-child {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 70;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 62px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 253, 248, 0.98);
    backdrop-filter: blur(10px);
  }

  .mobile-nav-link {
    position: relative;
    padding: 5px 2px;
    border: 0;
    border-radius: 7px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-nav-link.active {
    color: var(--brand-dark);
    background: var(--brand-soft);
  }

  .hero-carousel {
    height: 240px;
  }

  .hero-copy h1 {
    font-size: 27px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .notice-box {
    grid-template-columns: auto 1fr;
  }

  .notice-box .button {
    grid-column: span 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .product-body {
    padding: 11px;
  }

  .product-title {
    min-height: 40px;
    font-size: 15px;
  }

  .product-description {
    display: none;
  }

  .product-meta {
    margin-top: 8px;
    align-items: center;
  }

  .price {
    font-size: 18px;
  }

  .product-meta .button {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .product-meta .button span {
    display: none;
  }

  .page {
    padding-top: 18px;
  }

  .page-head {
    flex-direction: column;
  }

  .page-title {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .cart-item {
    grid-template-columns: auto 70px minmax(0, 1fr);
  }

  .cart-actions {
    grid-column: 3;
    justify-content: space-between;
  }

  .summary-panel {
    position: static;
  }

  .order-card-head,
  .order-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .order-item-price {
    grid-column: 2;
    text-align: left;
  }

  .address-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal,
  .modal.wide,
  .modal.narrow-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }

  .product-detail {
    gap: 17px;
  }

  .detail-main-image {
    max-height: 390px;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: calc(100vh - 28px);
    padding: 24px 18px;
  }

  .admin-shell {
    display: block;
  }

  .admin-topbar {
    padding: 0 14px;
  }

  .admin-content {
    padding: 14px;
  }

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

  .metric-card {
    min-height: 108px;
  }

  .metric-value {
    font-size: 24px;
  }

  .line-item-row {
    grid-template-columns: 1fr 1fr;
  }

  .line-item-row .line-item-remove {
    grid-column: span 2;
  }
}

@media (max-width: 460px) {
  .app-header-inner {
    width: calc(100% - 16px);
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions > .icon-button:first-child {
    display: none;
  }

  .hero-carousel {
    height: 210px;
  }

  .hero-copy h1 {
    font-size: 23px;
  }

  .hero-copy p {
    display: none;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
  }

  .product-title {
    font-size: 14px;
  }

  .button.small {
    padding: 0 9px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
