/* Reset and Base Styles */

:root {
  --primary-yellow: #ffd700;
  --dark-yellow: #ffc700;
  --light-yellow: #ffed4e;
  --black: #1a1a1a;
  --gray: #666;
  --light-gray: #f5f5f5;
  --white: #ffffff;
  --warm-white: #fffef7;
  --border: #ddd;
  --shadow: rgba(0, 0, 0, 0.1);
  --price-red: #d32f2f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  background-color: --warm-white;
  color: var(--black);
  line-height: 1.6;
}

.container {
  margin: 0 auto;
  padding: 0 20px;
}

.main .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
  margin: 0 auto;
  padding: 0 20px;
  align-content: center;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--dark-yellow) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--black);
}

.logo-icon {
  user-select: none;
  background-color: var(--primary-yellow);
  color: var(--black);
  font-size: 32px;
  font-weight: bold;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid var(--black);
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
  color: var(--black);
}

.search-bar {
  flex: 1;
  max-width: 500px;
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--black);
  border-radius: 8px;
  font-size: 14px;
  background-color: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.search-btn {
  padding: 10px 24px;
  background-color: var(--black);
  color: var(--primary-yellow);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.search-btn:hover {
  background-color: #333;
  transform: translateY(-1px);
}

.nav {
  display: flex;
  gap: 16px;
  justify-content: right;
  align-items: right;
}

.nav-link {
  border: none;
  background: none;
  font-size: 1rem;
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

/* Main Content */
.main {
  min-height: calc(100vh - 200px);
  padding: 32px 0;
}

/* Filters */
.filters {
  width: 80%;
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  padding: 20px;
  background-color: white;
  border-radius: 12px;
  border: 2px solid var(--primary-yellow);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-weight: 600;
  color: var(--black);
}

.filter-group .form-input,
.filter-group datalist,
.filter-group select {
  padding: 8px 12px;
  border: 2px solid var(--primary-yellow);
  border-radius: 6px;
  background-color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-group select:hover {
  border-color: var(--black);
  transform: translateY(4px);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--black);
}

/* Product Grid */
.product-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  grid-auto-rows: 30rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid var(--primary-yellow);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  min-height: 10vh;
}

.new-product-card {
  position: relative;
  background-color: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid var(--primary-yellow);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  min-height: 10vh;
}

.new-product-card:hover,
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

.product-image {
  position: relative;
  width: 100%;
  flex: 3;

  /* height: 60%; */
  overflow: hidden;
  background-color: var(--light-gray);
}

.new-product-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--light-gray);
}

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

.sold-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--light-yellow);
  padding: 4px 12px;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.product-info {
  position: relative;
  flex: 2;

  overflow: hidden;
  min-height: 40px;
  padding: 0 1rem;
}

.new-product-info {
  position: absolute;
  /* flex: 2; */
  bottom: 0;
  overflow: hidden;
  min-height: 40px;
  padding: 0 1rem;
}

.product-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-desc {
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 0px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  /* min-height: 40px; */
}

.product-footer {
  margin-top: 0px;
  padding-top: 0px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  overflow: hidden;

  gap: 20px;
  align-items: baseline;
}

.product-time {
  position: absolute;
  bottom: 12px;
  left: 12px;
  /* margin-top: 2rem; */
  text-align: right;
  font-size: 12px;
  color: var(--gray)
}

.product-tag {
  position: absolute;
  right: 12px;
  bottom: 12px;
  max-width: 50%;
  display: flex;
  justify-content: right;
  align-items: right;
  flex-wrap: wrap;
  gap: 8px;
}

.product-price {
  font-size: 3rem;
  font-weight: bold;
  color: var(--price-red);
  text-align: baseline;
}

.product-category {
  font-size: 12px;
  color: var(--black);
  background-color: rgba(255, 215, 0, 0.7);
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 5rem;
  border-radius: 4px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  padding: 8px 16px;
  border: 2px solid var(--primary-yellow);
  background-color: white;
  color: var(--black);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 1000;
  transition: all 0.2s;
}

.page-btn:hover {
  background-color: var(--primary-yellow);
}

.page-btn.active {
  background-color: var(--black);
  color: var(--primary-yellow);
  border-color: var(--black);
}

.page-ellipsis {
  padding: 8px;
  color: var(--gray);
}

/* Loading and Empty States */
.loading,
.empty,
.error {
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
  color: var(--gray);
  grid-column: 1 / -1;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ffd700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.wave-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
}

.wave-loading span {
  width: 6px;
  height: 100%;
  background: #ffd700;
  /* 主题色 */
  border-radius: 4px;
  animation: wave 1s ease-in-out infinite;
}

.wave-loading.white {
  height: 20px;
}

.wave-loading.white span {
  width: 6px;
  height: 100%;
  background: var(--white);
  /* 主题色 */
  border-radius: 4px;
  animation: wave 1s ease-in-out infinite;
}

.wave-loading span:nth-child(1) {
  animation-delay: 0s;
}

.wave-loading span:nth-child(2) {
  animation-delay: 0.2s;
}

.wave-loading span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0% {
    transform: scaleY(0.3);
  }

  50% {
    transform: scaleY(1);
  }

  100% {
    transform: scaleY(0.3);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.error {
  color: #d32f2f;
}

/* Footer */
.footer {
  background-color: var(--black);
  color: var(--primary-yellow);
  padding: 24px 0;
  text-align: center;
  margin-top: 60px;
}

/* Form Styles */
.form-container {
  position: relative;
  max-width: 40vw;
  min-width: 300px;
  margin: 15vh auto;
  padding: 2rem 3rem;
  background-color: white;
  border-radius: 2rem;
  border: 3px solid var(--primary-yellow);
  transition: 0.5s;
}

.form-title {
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 32px;
  color: var(--black);
}



.form-group {

  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--black);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--primary-yellow);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;

}


.form-textarea {
  width: 100%;
  height: 3rem;
  padding: 8px 12px;
  border: 2px solid var(--primary-yellow);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 1rem;
  transition: all 0.2s;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}



.form-button {
  flex: 1;
  padding: 0 0;
  background-color: var(--primary-yellow);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.form-button.single {
  width: 40%;
  display: block;
  margin: 0 auto;
  padding: 14px;
  background-color: #ffd700;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}


.form-button:hover {
  background-color: var(--black);
  color: var(--primary-yellow);
  transform: translateY(-2px);
}

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

.form-link {
  text-align: center;
  margin-top: 20px;
  color: var(--gray);
}

.form-link a {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}

.form-link a:hover {
  text-decoration: underline;

}

.error-message {
  color: #eb5454;
  font-size: 1rem;
}

.success-message {
  color: #2e7d32;
  font-size: 14px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .form-container {
    max-width: 80vw;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
  }

  .search-bar {
    max-width: 100%;
    width: 100%;
  }

  .nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .filters {
    flex-direction: column;
    gap: 16px;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  /* .form-container {
    margin: 20px;
    padding: 24px;
  } */
}

.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  justify-content: center;

}

.auth-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray);
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

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

.auth-tab:hover {
  color: var(--black);
  transform: translateY(-2px);

}

button.clear {
  border: none;
  background: none;
  color: var(--gray);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.5s;
}

button.clear:hover {
  color: var(--black);
}

.watersign {
  position: fixed;
  bottom: -10vw;
  right: -5vw;
  width: 40vw;
  min-width: 20rem;
  min-height: 20rem;
  height: 40vw;
  background-color: rgba(255, 215, 0, 0.1);
  color: rgba(0, 0, 0, 0.2);
  border: 1rem solid rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24rem;
  font-weight: bold;
  z-index: -9998;
  pointer-events: none;
}

.watermark {
  position: fixed;
  top: -30vw;
  left: -10vw;
  width: 80vw;
  height: 80vw;
  background-color: rgba(0, 0, 0, 0);
  color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48rem;
  font-weight: bold;
  z-index: -9999;
  pointer-events: none;
}

.modal {
  /* display: none; */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-mask {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
}



.modal-content {

  background-color: var(--white);
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
}



.modal-close {
  user-select: none;

  position: absolute;
  right: 1rem;
  top: 0rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--gray);
}

.modal-close:hover {
  color: var(--black);
  transform: translateY(-2px);

}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu>ul>li {
  position: relative;
  padding: 10px 20px;
  background: #eee;
  cursor: pointer;
}

.menu .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  /* 默认隐藏 */
  background: #ddd;
}

.menu>ul>li:hover .submenu {
  display: block;
  /* hover 显示 */
}

.menu .submenu li {
  padding: 8px 15px;
}

.profile-container {
  min-width: 80vw;

  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-header {
  min-width: 60vw;
  background-color: white;
  padding: 32px;
  border-radius: 12px;
  border: 2px solid #FFD700;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #FFD700;
  margin-bottom: 16px;

}

.avatar-upload {
  display: none;
}

.avatar-btn {
  padding: 0 4px;
  margin: 0 2rem;
  background-color: #FFD700;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;

  transition: all 0.3s;
}

.avatar-btn:hover {
  background-color: #1a1a1a;
  color: #FFD700;
  transform: translateY(-2px);

}

.user-info {
  flex: 1;
}

.user-info-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.edit-btn {
  flex: 1;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

.edit-btn:hover {
  background: var(--light-gray);
  transform: translateY(-2px);

}

.user-details {
  margin-top: 10px;
}

.user-details label {
  max-width: 10%;
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.detail-item label {
  width: 80px;
  font-weight: bold;
}

.detail-item.balance label {
  width: 80px;
  font-weight: bold;
}

.detail-item.balance span {
  color: var(--price-red);
  font-weight: bold;
  flex: 1;
}

.detail-item span {

  flex: 1;
}

.detail-item input,
.detail-item textarea {
  flex: 1;
  padding: 4px 6px;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

.user-info-header #usernameInput,
.username {
  flex: 13;
  font-size: 28px;
  font-weight: bold;
}

.balance-info {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
}

.balance-item {
  display: flex;
  flex-direction: column;
}

.balance-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.balance-value {
  font-size: 24px;
  font-weight: bold;
  color: #d32f2f;
}

.profile-tabs {
  min-width: 80vw;
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  border-bottom: 2px solid #FFD700;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

[hidden] {
  display: none !important;
}

.tab-btn.active {
  color: #1a1a1a;
  border-bottom-color: #FFD700;
}

.tab-content {
  display: none;
}



.recharge-section {
  background-color: white;
  padding: 32px;
  border-radius: 12px;
  border: 2px solid var(--primary-yellow);
}

.recharge-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.recharge-option {
  border: 2px solid var(--primary-yellow);
  border-radius: 8px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}

.recharge-option:hover,
.recharge-option.selected {
  background-color: var(--primary-yellow);
  transform: translateY(-4px);
}

.recharge-amount {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.tab-content.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  justify-content: left;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray);
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab-btn.active {
  color: var(--black);
  border-bottom-color: var(--primary-yellow);
}

.tab-btn:hover {
  color: var(--black);
  transform: translateY(-2px);

}

.detail-container {
  min-width: 80vw;

  margin: 1rem 2rem 0 2rem;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: left;
}

.history-tittle,
.history-item {
  display: flex;
  align-items: center;
  border: none;
  justify-content: space-between;
}


.history-item div {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}


.history-tittle div {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
  font-weight: 500  ;
}