:root {
  --bg: #070707;
  --panel: #101010;
  --panel-soft: #171717;
  --panel-raised: #1d1d1d;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --line: #2b2b2b;
  --primary: #d8b867;
  --primary-dark: #b99642;
  --primary-text: #14100a;
  --danger: #f05d5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: #090909;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1320px, calc(100% - 64px));
  height: 76px;
  margin: 0 auto;
}

.brand-block,
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 22px;
  font-weight: 900;
}

.brand-block strong {
  display: block;
  font-size: 19px;
}

.brand-block span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.side-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
}

.side-item.active {
  border-color: var(--primary);
  background: var(--panel-soft);
  color: var(--primary);
}

#cartCount {
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #f23939;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}

#cartCount.show {
  display: inline-block;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  white-space: nowrap;
}

.service-card span {
  color: var(--muted);
  font-size: 13px;
}

.service-card strong {
  color: var(--primary);
}

.content {
  width: min(1320px, calc(100% - 64px));
  min-width: 0;
  margin: 0 auto;
  padding: 28px 0 52px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.user-chip {
  max-width: 280px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 210px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #0a0a0a 0%, #171717 60%, #2f2614 100%);
}

.hero span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.hero h2 {
  margin: 28px 0 0;
  font-size: 42px;
  line-height: 1.12;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-tags span,
.tag,
.status-chip,
.default-tag {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.hero-tags span {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.22);
}

.tools-row {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.search-box {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.search-box input,
.checkout-card input,
.checkout-card textarea,
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #0b0b0b;
  color: var(--text);
}

.search-box input {
  height: 42px;
  border: 0;
  background: transparent;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.category-tab {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.category-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 14px;
}

.section-head h2,
.checkout-card h2,
.profile-card h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p,
.profile-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.product-card,
.cart-item,
.checkout-card,
.order-card,
.address-card,
.auth-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.product-card {
  overflow: hidden;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #fff;
}

.product-body {
  padding: 14px;
}

.product-name {
  min-height: 48px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.4;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
  margin-top: 11px;
}

.tag {
  padding: 4px 8px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.price {
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
}

.quick-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.cart-list,
.orders-list,
.address-list {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
}

.cart-item img {
  width: 106px;
  height: 106px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.cart-item-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.cart-item-meta {
  margin-top: 10px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--text);
  font-size: 20px;
}

.qty-controls span {
  min-width: 28px;
  text-align: center;
  font-weight: 900;
}

.checkout-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.checkout-card input,
.auth-form input {
  height: 46px;
  padding: 0 13px;
}

.checkout-card textarea {
  min-height: 86px;
  padding: 13px;
  resize: vertical;
}

.pay-method,
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.pay-method strong,
.total-row strong {
  color: var(--primary);
}

.total-row strong {
  font-size: 26px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-btn {
  background: var(--primary);
  color: var(--primary-text);
}

.secondary-btn {
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.order-top,
.address-card-head,
.address-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-top strong {
  font-size: 17px;
}

.status-chip,
.default-tag {
  padding: 4px 8px;
}

.order-detail {
  color: var(--muted);
  line-height: 1.6;
}

.logistics-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
  color: var(--muted);
}

.order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.order-action {
  min-width: 108px;
  height: 38px;
  border-radius: 8px;
  font-weight: 900;
}

.order-action.primary {
  background: var(--primary);
  color: var(--primary-text);
}

.order-action.muted {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.address-card {
  display: grid;
  gap: 9px;
  padding: 15px;
}

.address-card.default {
  border-color: var(--primary);
  background: var(--panel-soft);
}

.address-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.text-btn {
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.text-btn.primary {
  color: var(--primary);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.account-panel {
  max-width: 520px;
}

.profile-card {
  padding: 20px;
}

.auth-card {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
}

.auth-card.hidden,
.logout-btn.hidden,
#nicknameInput.hidden {
  display: none;
}

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

.auth-tab {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

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

.logout-btn {
  width: 100%;
  margin-top: 16px;
}

.empty {
  padding: 44px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  z-index: 20;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
}

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

@media (max-width: 1280px) {
  body {
    min-width: 1024px;
  }

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