* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    background: #000;
    color: white;
    height: 44px;
}

.header-box {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 15px;
    font-weight: 500;
    background: rgba(255,255,255,0.06);
}

.header-box:not(:last-child) {
    border-right: 1px solid #444;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #fff;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.menu {
    display: flex;
    gap: 20px;
    align-items: center;
    cursor: pointer;
}

.search-bar {
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    width: 200px;
}

.icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.categories {
    display: flex;
    gap: 15px;
    padding: 20px 50px 0 50px;
    overflow-x: auto;
}

.category {
    padding: 5px 15px;
    border-radius: 20px;
    background: #f5f5f5;
    white-space: nowrap;
    cursor: pointer;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 50px;
}

.product-card {
    position: relative;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.add-to-bag-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.product-card:hover .add-to-bag-btn {
    opacity: 1;
    pointer-events: auto;
}

.product-image-box {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    margin-bottom: 5px;
    cursor: pointer;
}

.product-title:hover {
    color: #0000008e;
    transition: all 0.3s ease;
}

.product-price {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.current-price {
    font-weight: bold;
    font-size: 16px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.discount-tag {
    color: #ff4444;
    font-size: 14px;
    font-weight: bold;
}

.product-colors {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
    border: 2px solid #0000001f;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    border-color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

.color-option:hover::after {
    content: attr(data-color-desc);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeIn 0.2s ease;
}

.color-option.selected {
    border-color: #000;
}

.color-option[data-ancilla] {
    background: var(--ancilla-color);
}

.color-option[data-ancilla^="linear-gradient"] {
    background: var(--ancilla-gradient);
}

.product-sizes {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.size-tag {
    font-size: 14px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
}

.heart-icon {
    position: absolute;
    right: 10px;
    top: 10px;
    background: white;
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
}

.new-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    background: #e8f4e5;
    color: #4caf50;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.btn-main {
    width: 100%;
    padding: 12px 0;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-main:hover {
    background: #222;
}

.add-to-bag-btn {
    width: 90%;
    padding: 10px 10px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.2s;
    position: absolute;
    top: 340px;
    left: 0px;
    margin: 0 5%;
}

.add-to-bag-btn:hover {
    background: #222;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.18);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
}

.modal-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 32px 24px 24px 24px;
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s cubic-bezier(.4,0,.2,1);
}

.modal-mask.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #888;
    font-size: 22px;
    background: none;
    border: none;
}

.cart-page {
    min-height: 100vh;
    background: #fafafa;
}

.cart-container {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 0 0 32px 0;
    display: flex;
    gap: 32px;
}

.cart-left {
    flex: 2;
    padding: 40px 0 0 40px;
}

.cart-title {
    font-size: 32px;
    font-weight: bold;
}

.cart-success {
    background: #eaffc2;
    padding: 14px 0;
    margin: 32px 0 24px 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #3a5d1c;
    border-radius: 6px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.cart-table th {
    text-align: left;
    padding: 12px 0;
    font-size: 16px;
}

.cart-table td {
    padding: 12px 0;
    font-size: 15px;
}

.cart-table img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

.cart-total {
    margin-top: 32px;
    text-align: right;
    font-size: 22px;
    font-weight: bold;
}

.cart-summary {
    flex: 1;
    min-width: 340px;
    padding: 40px 40px 0 0;
}

.cart-summary-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 28px 28px 28px;
}

.cart-summary-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 18px;
}

.cart-summary-input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

.cart-summary-btn {
    width: 100%;
    background: #ccc;
    color: #fff;
    padding: 8px 0;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    margin-bottom: 18px;
}

.cart-summary-list {
    margin-bottom: 12px;
}

.cart-summary-list div {
    font-size: 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-summary-total-label {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 8px;
}

.cart-summary-total {
    font-size: 22px;
    font-weight: bold;
    color: #1976d2;
}

.cart-summary-saved {
    font-size: 15px;
    color: #4caf50;
    margin-bottom: 18px;
}

.cart-summary-checkout {
    width: 100%;
    padding: 16px 0;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.cart-summary-tip {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

.wishlist-page {
    max-width: 1200px;
    margin: 40px auto 0 auto;
}

.wishlist-title {
    font-size: 32px;
    font-weight: bold;
}

.wishlist-empty {
    text-align: center;
    color: #888;
    font-size: 20px;
    margin: 60px 0;
}

.wishlist-back-btn {
    font-size: 20px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    color: #1976d2;
    padding: 10px 28px;
    border-radius: 24px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.wishlist-back-btn:hover {
    background: #e0e0e0;
}

.site-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.18);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-modal-content {
    background: #fff;
    min-width: 320px;
    max-width: 350px;
    width: 90vw;
    padding: 32px 28px 24px 28px;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    position: relative;
}

.site-modal-content select {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 18px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 15px;
}

.site-modal-content button {
    width: 100%;
    padding: 12px 0;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.site-modal-content .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #888;
    font-size: 22px;
    background: none;
    border: none;
}

.detail-page {
    max-width: 1200px;
    margin: 20px auto 0 auto;
    display: flex;
    gap: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 70px 40px 40px 40px;
}

.detail-left {
    flex: 1.2;
    display: flex;
    gap: 16px;
}

.detail-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 800px;
    overflow-y: auto;
}

.detail-thumb-img {
    width: 56px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #eee;
}

.detail-thumb-img.selected {
    border: 2px solid #000;
}

.detail-main-img {
    width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.detail-right {
    flex: 1.5;
    min-width: 340px;
}

.detail-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 12px;
}

.detail-price {
    font-size: 22px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 18px;
}

.detail-section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 32px 0 12px 0;
}

.detail-desc-list {
    margin-bottom: 18px;
    padding: 15px;
    background-color: #eee;
    border-radius: 8px;
}

.detail-desc-list ul {
    margin-left: 18px;
    margin-bottom: 10px;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 33.33% 33.33% 33.33%;
}

.detail-desc-list li {
    margin-bottom: 4px;
}

.detail-care-icons {
    display: flex;
    gap: 18px;
    margin-top: 10px;
}

.detail-care-icon {
    font-size: 22px;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.detail-care-icon span {
    font-size: 12px;
    color: #666;
}

.detail-ul {
    margin-left: 18px;
    margin-bottom: 8px;
}

.detail-ul li {
    line-height: 24px;
    font-size: 12px;
}

.detail-section-label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.material-part {
    font-size: 12px;
}

.material-composition {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.detail-back-btn {
    position: absolute;
    top: 20px;
    left: 40px;
    background: #f5f5f5;
    color: #1976d2;
    border: none;
    border-radius: 18px;
    font-size: 15px;
    font-weight: bold;
    padding: 6px 18px 6px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: background 0.2s;
}

.detail-back-btn:hover {
    background: #e0e0e0;
}

.add-to-cart-loading {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: not-allowed;
}

.add-to-cart-success {
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-add-to-cart-loading {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: not-allowed;
}

.modal-add-to-cart-success {
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #333;
}

.grid100 {
    grid-template-columns: 100% !important;
}
.product-modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-content {
  background: #fff;
  max-width: 920px;
  width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  display: flex;
}

.product-modal-left {
  flex: 1;
  min-width: 320px;
  padding: 32px 16px 32px 32px;
  display: flex;
}

.product-modal-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 85vh;
  overflow-y: auto;
}

.product-modal-thumb {
  width: 56px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid #eee;
}

.product-modal-thumb.selected {
  border: 2px solid #000;
}

.product-modal-main-img {
  width: 320px;
  height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-left: 12px;
}

.product-modal-right {
  flex: 1;
  padding: 32px 32px 32px 16px;
  min-width: 320px;
}

.product-modal-title {
  font-size: 22px;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 10px;
}

.product-modal-price {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
}

.product-modal-section {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-modal-favorite {
  cursor: pointer;
}

.product-modal-favorite .material-icons {
  color: #bbb;
}

.product-modal-favorite .material-icons.favorite {
  color: #e74c3c;
}

.product-modal-colors {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.color-name {
  font-size: 14px;
}

.product-modal-size-type {
  margin-bottom: 10px;
}

.product-modal-size-type button {
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 10px;
}

.product-modal-size-type button.active {
  font-weight: bold;
  text-decoration: underline;
}

.product-modal-sizes {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.product-modal-sizes button {
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: bold;
}

.product-modal-sizes button.selected {
  border: 2px solid #000;
}

.product-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
}

/* 加载和成功状态的按钮样式 */
.modal-add-to-cart-loading,
.modal-add-to-cart-success {
  width: 100%;
  padding: 16px 0;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-add-to-cart-loading {
  background: #f5f5f5;
  color: #666;
}

.modal-add-to-cart-success {
  background: #4caf50;
  color: #fff;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #666;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
      transform: rotate(360deg);
  }
}
