/* Purple Theme - 紫色主题 */

:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --secondary: #ec4899;
  --bg-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  --bg-light: #f3e8ff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.title {
  font-size: 22px;
  font-weight: 700;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.share-btn, .logout-btn, .save-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-gradient);
  color: #fff;
  box-shadow: var(--shadow);
}

.back-btn {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Search Bar */
.search-bar {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-radius: 25px;
  font-size: 15px;
  background: #fff;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Category Navigation */
.category-nav {
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 20px 20px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 16px;
  min-width: 72px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-item.active {
  background: var(--bg-gradient);
  border-color: var(--primary);
}

.category-item.active .category-icon,
.category-item.active .category-name {
  color: #fff;
}

.category-icon {
  font-size: 28px;
}

.category-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  overflow-x: auto;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--bg-gradient);
  border-color: var(--primary);
  color: #fff;
}

/* Stats Banner */
.stats-banner {
  display: flex;
  justify-content: space-around;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-banner span {
  font-size: 13px;
  text-align: center;
}

.stats-banner strong {
  font-size: 20px;
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.item-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.2);
}

.item-card.sold {
  opacity: 0.7;
}

.item-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.item-card:hover .item-image img {
  transform: scale(1.05);
}

.sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

.item-info {
  padding: 12px;
}

.item-price {
  font-size: 18px;
  font-weight: 700;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.item-card.sold .item-price {
  color: #9ca3af;
  -webkit-text-fill-color: #9ca3af;
}

.item-name {
  font-size: 13px;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.item-shop {
  font-size: 11px;
  color: var(--primary);
  margin-top: 4px;
  font-weight: 500;
}

/* Bottom Actions */
.bottom-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.action-btn {
  flex: 1;
  padding: 14px;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.action-btn.primary {
  background: var(--bg-gradient);
  color: #fff;
  box-shadow: var(--shadow);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.action-btn:not(.primary) {
  background: #f3e8ff;
  color: var(--primary);
}

/* Loading & Empty States */
.loading, .empty, .error {
  text-align: center;
  padding: 60px 20px;
  color: #fff;
  grid-column: 1 / -1;
}

.empty {
  color: rgba(255, 255, 255, 0.8);
}

.error {
  color: #fca5a5;
}

/* Responsive */
@media (max-width: 380px) {
  .items-grid {
    gap: 10px;
    padding: 12px;
  }
  
  .category-item {
    min-width: 64px;
    padding: 10px 12px;
  }
  
  .category-icon {
    font-size: 24px;
  }
  
  .category-name {
    font-size: 11px;
  }
  
  .item-info {
    padding: 10px;
  }
  
  .item-price {
    font-size: 16px;
  }
}

/* ===== 商品详情页样式 ===== */

/* Image Gallery */
.image-gallery {
  position: relative;
  background: #000;
  aspect-ratio: 1;
}

.gallery-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-img.active {
  opacity: 1;
}

.gallery-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}

.dot.active {
  background: #fff;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 60px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav.prev { left: 0; border-radius: 0 8px 8px 0; }
.gallery-nav.next { right: 0; border-radius: 8px 0 0 8px; }

.gallery-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.gallery-loading, .no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 14px;
}

/* Item Detail */
.item-detail {
  background: #fff;
  padding: 20px;
}

.detail-price-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.detail-price {
  font-size: 32px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.detail-price .sold-text {
  color: #999;
}

.original-price {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}

.detail-name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #333;
}

.detail-meta {
  margin-bottom: 20px;
}

.meta-item {
  font-size: 14px;
  color: #666;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.detail-description {
  margin-bottom: 24px;
}

.detail-description h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.detail-description p {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
}

/* Contact Section */
.contact-section {
  padding: 20px 0;
  border-top: 1px solid #eee;
}

.contact-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.contact-wechat {
  text-align: center;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.copy-btn {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
}

.copy-btn:active {
  background: #e5e5e5;
}

/* ===== 卖家其他宝贝样式 ===== */
.other-items-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #eee; }
.other-items-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 16px; }
.other-items-grid { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.other-item { flex: 0 0 auto; width: 100px; text-decoration: none; border-radius: 12px; overflow: hidden; background: #f9f9f9; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.other-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.other-item-price { padding: 8px; font-size: 13px; font-weight: 600; color: #ff6b6b; text-align: center; background: #fff; }


/* 分类导航条样式 */
.category-nav-bar {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  position: sticky;
  top: 60px;
  z-index: 50;
}

.category-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.category-btn:hover {
  background: #e9d5ff;
  transform: translateY(-1px);
}

.category-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ===== 我的店铺页面样式 ===== */

/* Shop Header */
.my-shop-header {
  display: flex;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
}

.my-shop-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  margin-right: 16px;
}

.my-shop-info h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.my-shop-info p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 10px;
}

.my-shop-url {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.my-shop-url button {
  padding: 6px 12px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* Quick Stats */
.quick-stats {
  display: flex;
  padding: 16px;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.stat-card {
  flex: 1;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #666;
}

/* Shop Actions */
.shop-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
}

.shop-actions .action-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: #f5f5f5;
  color: #333;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.shop-actions .action-btn.primary {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
}

/* My Items List */
.my-items {
  padding: 16px;
  padding-bottom: 100px;
}

.item-group {
  margin-bottom: 24px;
}

.group-title {
  font-size: 15px;
  font-weight: 600;
  color: #666;
  padding: 12px 0 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

.my-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.my-item-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
  background: #f0f0f0;
}

.my-item-info {
  flex: 1;
  min-width: 0;
}

.my-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-item-meta {
  font-size: 12px;
  color: #999;
}

.my-item-views {
  font-size: 11px;
  color: #7c3aed;
  margin-top: 4px;
}

.my-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-btn.edit { background: #e3f2fd; color: #1976d2; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
.action-btn.price { background: #fff3e0; color: #f57c00; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
.action-btn.sold { background: #e8f5e9; color: #388e3c; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
.action-btn.hide { background: #fce4ec; color: #c2185b; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
.action-btn.show { background: #e8f5e9; color: #388e3c; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
.action-btn.delete { background: #ffebee; color: #c62828; padding: 6px 10px; border-radius: 4px; font-size: 12px; border: none; cursor: pointer; }
