/**
 * 匠心手作 —— 补充样式补丁
 * 骨架屏 / 订单卡片 / 购物车金额栏 / 登录注册 / 个人中心 / 表单 / 响应式
 */

/* =============== 骨架屏 =============== */
.skeleton-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  border: 1px solid rgba(40,54,24,.06);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  position: relative;
}
.skeleton-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(40,54,24,.06) 0%, rgba(40,54,24,.12) 50%, rgba(40,54,24,.06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  pointer-events: none;
}
.skeleton-card .sk-img { height: 180px; background: rgba(40,54,24,.05); }
.skeleton-card .sk-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-card .sk-line { height: 14px; border-radius: 6px; background: rgba(40,54,24,.07); }
.skeleton-card .sk-line.short { width: 60%; }
.skeleton-card .sk-line.mid   { width: 80%; height: 12px; }
.skeleton-card .sk-line.price { width: 40%; height: 18px; }

.skeleton-category {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  border: 1px solid rgba(40,54,24,.06);
  display: flex;
  flex-direction: column;
  min-height: 160px;
  position: relative;
}
.skeleton-category::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(40,54,24,.06) 0%, rgba(40,54,24,.12) 50%, rgba(40,54,24,.06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  pointer-events: none;
}
.skeleton-category .sk-img { flex: 1; background: rgba(40,54,24,.05); }
.skeleton-category .sk-name { height: 32px; background: rgba(40,54,24,.05); }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============== 订单卡片 =============== */
.order-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  border: 1px solid rgba(40,54,24,.06);
}
.order-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.order-no { font-weight: 700; color: #283618; font-size: .9rem; }
.order-status {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}
.order-status.pending_payment { background: #FEFAE0; color: #BC6C25; }
.order-status.pending_ship    { background: #E8F5E9; color: #606C38; }
.order-status.shipped         { background: #E3F2FD; color: #2E7D8A; }
.order-status.completed       { background: #F5F5F5; color: #5C5A56; }
.order-status.canceled        { background: #FDECEC; color: #C0392B; }

.order-body { display: flex; gap: 12px; }
.order-body img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #FAF6F1;
}
.order-body .order-info { flex: 1; min-width: 0; }
.order-body .order-name {
  font-weight: 600;
  color: #283618;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-body .order-meta { font-size: .82rem; color: #8C8A86; }
.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(40,54,24,.06);
}
.order-foot .order-total { font-family: 'Playfair Display', serif; font-weight: 700; color: #BC6C25; font-size: 1.1rem; }
.order-foot .order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =============== 购物车金额栏 =============== */
.cart-summary {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  position: sticky;
  top: calc(var(--header-h, 76px) + 16px);
  border: 1px solid rgba(40,54,24,.06);
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  align-self: start;
}
.cart-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #5C5A56;
  font-size: .92rem;
}
.cart-summary .row .label { color: #8C8A86; }
.cart-summary .row.free-shipping { color: #606C38; font-weight: 600; }
.cart-summary .row.total {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: #BC6C25;
  font-weight: 700;
  margin-top: 8px;
  border-top: 1px dashed rgba(40,54,24,.12);
  padding-top: 14px;
}

/* 购物车主列表 */
.cart-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(40,54,24,.06);
  margin-bottom: 12px;
}
.cart-item img { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; background: #FAF6F1; }
.cart-item .ci-name { font-weight: 600; color: #283618; margin-bottom: 4px; }
.cart-item .ci-price { color: #BC6C25; font-weight: 700; font-family: 'Playfair Display', serif; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 4px; }
.cart-item .ci-qty button {
  width: 28px; height: 28px; border: 1px solid rgba(40,54,24,.15);
  background: #FAF6F1; border-radius: 8px; font-weight: 700; color: #283618;
  cursor: pointer;
}
.cart-item .ci-qty button:hover { background: #BC6C25; color: #fff; border-color: #BC6C25; }
.cart-item .ci-qty input { width: 44px; text-align: center; border: none; background: transparent; font-weight: 600; }
.cart-item .ci-subtotal { font-weight: 700; color: #283618; font-family: 'Playfair Display', serif; }
.cart-item .ci-remove {
  background: transparent; border: none; color: #C0392B; font-size: .8rem; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.cart-item .ci-remove:hover { background: rgba(192,57,43,.08); }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(40,54,24,.06);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: #283618; margin-bottom: 8px; }
.empty-state p { color: #8C8A86; margin-bottom: 20px; }

/* =============== 登录 / 注册 =============== */
.auth-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, #FEFAE0 0%, #FAF6F1 60%, #F3E9D9 100%);
}
.auth-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(40,54,24,.12);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  border: 1px solid rgba(40,54,24,.06);
}
.auth-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; margin-bottom: 4px; text-align: center; }
.auth-sub { color: #8C8A86; text-align: center; font-size: .88rem; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .88rem; color: #5C5A56; }
.auth-switch a { color: #BC6C25; font-weight: 600; }

/* =============== 个人中心 =============== */
.user-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.user-side {
  background: #fff;
  border-radius: 16px;
  padding: 26px;
  border: 1px solid rgba(40,54,24,.06);
  text-align: center;
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  height: fit-content;
}
.user-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #BC6C25, #D4A373);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-side .nickname { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; color: #283618; }
.user-side .role {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: #606C38;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  margin-top: 6px;
}
.user-side .u-meta { font-size: .82rem; color: #8C8A86; margin-top: 14px; line-height: 1.6; }
.user-side .btn-logout {
  margin-top: 20px;
  width: 100%;
}

.user-tabs {
  display: flex;
  gap: 4px;
  background: #FAF6F1;
  padding: 4px;
  border-radius: 100px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.user-tabs button {
  flex: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 100px;
  background: transparent;
  font-weight: 600;
  font-size: .85rem;
  color: #5C5A56;
  cursor: pointer;
  white-space: nowrap;
}
.user-tabs button:hover { color: #283618; }
.user-tabs button.active {
  background: #fff;
  color: #283618;
  box-shadow: 0 2px 8px rgba(40,54,24,.06);
}

.user-panel {
  background: #fff;
  border-radius: 16px;
  padding: 26px;
  border: 1px solid rgba(40,54,24,.06);
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
}

/* 地址列表 */
.address-list .addr-item {
  border: 1px solid rgba(40,54,24,.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: .2s;
}
.address-list .addr-item:hover { border-color: rgba(188,108,37,.3); }
.address-list .addr-info { flex: 1; min-width: 0; }
.address-list .addr-name { font-weight: 700; color: #283618; margin-right: 10px; }
.address-list .addr-phone { color: #8C8A86; font-size: .85rem; }
.address-list .addr-detail { color: #5C5A56; font-size: .9rem; margin-top: 4px; }
.address-list .addr-default-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #606C38;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.address-list .addr-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* =============== 表单字段 =============== */
.form-row { display: grid; gap: 14px; }
.form-row.two { grid-template-columns: 1fr 1fr; }

.field label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #5C5A56;
  margin-bottom: 6px;
  display: block;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(40,54,24,.12);
  border-radius: 10px;
  font-family: inherit;
  font-size: .92rem;
  background: #FAF6F1;
  transition: .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #BC6C25;
  box-shadow: 0 0 0 3px rgba(188,108,37,.12);
  background: #fff;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #C0392B; }
.field-error { color: #C0392B; font-size: .8rem; margin-top: 5px; }
.error-tip {
  background: rgba(192,57,43,.08);
  color: #C0392B;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: .88rem;
  border-left: 3px solid #C0392B;
}
.success-tip {
  background: rgba(96,108,56,.08);
  color: #606C38;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: .88rem;
  border-left: 3px solid #606C38;
}

/* 列表页筛选工具条 */
.products-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.products-toolbar .search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.products-toolbar .search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid rgba(40,54,24,.12);
  border-radius: 100px;
  background: #FAF6F1;
  font-family: inherit;
}
.products-toolbar .search-box input:focus {
  outline: none;
  border-color: #BC6C25;
  box-shadow: 0 0 0 3px rgba(188,108,37,.12);
  background: #fff;
}
.products-toolbar .search-box::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  opacity: .6;
}
.products-toolbar select {
  padding: 10px 36px 10px 14px;
  border: 1px solid rgba(40,54,24,.12);
  border-radius: 100px;
  background: #FAF6F1;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23283618' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.products-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.cat-filter {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid rgba(40,54,24,.06);
  box-shadow: 0 4px 16px rgba(40,54,24,.05);
  position: sticky;
  top: calc(var(--header-h, 76px) + 16px);
}
.cat-filter h4 { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 14px; color: #283618; }
.cat-filter .cat-item {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: #5C5A56;
  text-decoration: none;
  font-size: .92rem;
  transition: .2s;
}
.cat-filter .cat-item:hover { background: #FAF6F1; color: #283618; }
.cat-filter .cat-item.active { background: #FEFAE0; color: #BC6C25; font-weight: 700; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.pagination a,
.pagination button {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 12px;
  border: 1px solid rgba(40,54,24,.12);
  background: #fff;
  color: #5C5A56;
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: .2s;
}
.pagination a:hover,
.pagination button:hover:not(:disabled) {
  border-color: #BC6C25;
  color: #BC6C25;
}
.pagination .active,
.pagination a.active {
  background: #BC6C25;
  border-color: #BC6C25;
  color: #fff;
}
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* 商品详情 */
.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.detail-gallery .main-img {
  width: 100%;
  height: 480px;
  border-radius: 20px;
  overflow: hidden;
  background: #FAF6F1;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-info .artisan-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: #FAF6F1;
  color: #606C38;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.detail-info h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: #283618; margin-bottom: 16px; }
.detail-info .price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-info .price-row .price {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #BC6C25;
}
.detail-info .price-row .original { color: #8C8A86; text-decoration: line-through; font-size: 1rem; }
.detail-info .stock-row { color: #8C8A86; font-size: .88rem; margin-bottom: 16px; }
.detail-info .stock-row .in-stock { color: #606C38; font-weight: 600; }
.detail-info .stock-row .out-stock { color: #C0392B; font-weight: 600; }
.detail-info .desc { color: #5C5A56; line-height: 1.8; margin-bottom: 24px; }
.detail-info .desc p { margin-bottom: 10px; }
.detail-info .qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.detail-info .qty-row label { font-weight: 700; color: #283618; }
.detail-info .qty-row .ci-qty { display: flex; align-items: center; gap: 4px; }
.detail-info .action-row { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-info .action-row .btn { flex: 1; min-width: 140px; }

/* Checkout */
.checkout-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.section-paper .checkout-card,
.section-paper .address-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid rgba(40,54,24,.06);
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(40,54,24,.04);
}
.section-paper .sec-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: #283618; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-paper .sec-title::before { content: ""; width: 4px; height: 18px; background: #BC6C25; border-radius: 2px; }

.address-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(40,54,24,.08);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: .2s;
}
.address-option:hover { border-color: rgba(188,108,37,.3); }
.address-option.active { border-color: #BC6C25; background: rgba(188,108,37,.04); box-shadow: 0 0 0 3px rgba(188,108,37,.1); }
.address-option input { margin-top: 3px; }
.address-option .addr-name { font-weight: 700; color: #283618; margin-right: 10px; }
.address-option .addr-phone { color: #8C8A86; font-size: .85rem; }
.address-option .addr-detail { color: #5C5A56; font-size: .9rem; margin-top: 4px; }

/* =============== 通用响应式补丁 =============== */
@media (max-width: 900px) {
  .user-wrap { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }
  .cat-filter { position: static; }
}
@media (max-width: 768px) {
  .form-row.two { grid-template-columns: 1fr; }
  .cart-main { grid-template-columns: 1fr; }
  .order-body { flex-wrap: wrap; }
  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px 14px;
  }
  .cart-item img { width: 60px; height: 60px; }
  .cart-item .ci-qty,
  .cart-item .ci-subtotal,
  .cart-item .ci-remove { grid-column: 1 / -1; justify-self: start; }
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-gallery .main-img { height: 340px; }
  .checkout-main { grid-template-columns: 1fr; }
  .order-status { font-size: .7rem; padding: 3px 8px; }
  .order-head { flex-direction: column; gap: 6px; align-items: flex-start; }
  .user-tabs { border-radius: 16px; }
}
@media (max-width: 540px) {
  .auth-box { padding: 28px 22px; }
  .product-card-footer { flex-direction: column; align-items: flex-start !important; gap: 10px !important; }
}
