/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  padding: 0 20px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header h1 {
  font-size: 18px;
  font-weight: 500;
}

.header-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* ===== 主容器 ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 15px 80px;
}

/* ===== 分类筛选 ===== */
.cat-bar {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}

.cat-bar::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-btn:hover {
  border-color: #07c160;
  color: #07c160;
}

.cat-btn.cat-active {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
}

.cat-dot {
  background: rgba(255,255,255,0.35);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  min-width: 18px;
  text-align: center;
}

.cat-btn:not(.cat-active) .cat-dot {
  background: #e8f5e9;
  color: #07c160;
}

/* ===== 分类区块 ===== */

/* ===== 分类区块 ===== */
.category-section {
  margin-bottom: 30px;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 15px;
}

.category-icon {
  font-size: 24px;
  margin-right: 10px;
}

.category-title {
  font-size: 18px;
  font-weight: bold;
  flex: 1;
}

.category-count {
  font-size: 12px;
  color: #999;
  background: #f0f0f0;
  padding: 4px 12px;
  border-radius: 12px;
}

/* ===== 商品网格 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.media-area {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: #f5f5f5;
  overflow: hidden;
}

.media-area img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.info-area {
  padding: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag {
  display: inline-block;
  font-size: 11px;
  color: #07c160;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.product-price {
  font-size: 18px;
  color: #f44336;
  font-weight: bold;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.empty-icon {
  font-size: 60px;
  display: block;
  margin-bottom: 20px;
}

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  display: flex;
  border-top: 1px solid #eee;
  z-index: 100;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item.active {
  color: #07c160;
}

.nav-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

/* ===== 表单 ===== */
.form-item {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #07c160;
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

/* ===== 标签选择 ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-item.active {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
}

/* ===== 图片上传 ===== */
.upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: #07c160;
  background: #f8fff8;
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.upload-text {
  color: #999;
  font-size: 14px;
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

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

.image-preview-item .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.set-cover-btn {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(7,193,96,0.9);
  color: #fff;
  border: none;
  font-size: 10px;
  padding: 2px;
  cursor: pointer;
}

/* ===== 视频上传 ===== */
.video-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 15px;
}

.video-preview video {
  width: 100%;
  max-height: 300px;
}

.video-preview .delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

/* ===== 提交按钮 ===== */
.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
  transition: all 0.2s;
}

.submit-btn:active {
  transform: scale(0.98);
}

/* ===== 详情页 ===== */
.detail-media {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  background: #000;
}

.detail-media img {
  width: 100%;
  display: block;
}

.detail-content {
  padding: 20px;
}

.detail-name {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
}

.detail-price {
  font-size: 28px;
  color: #f44336;
  font-weight: bold;
  margin-bottom: 15px;
}

.detail-price::before {
  content: '¥';
  font-size: 18px;
}

.detail-tag {
  display: inline-block;
  font-size: 12px;
  color: #07c160;
  background: #e8f5e9;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.detail-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  white-space: pre-wrap;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.detail-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}

.detail-btn.share {
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
}

.detail-btn.copy {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

/* ===== 管理页 ===== */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
}

.admin-title {
  font-size: 18px;
  font-weight: bold;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item {
  display: flex;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-item-info {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.admin-item-tag {
  font-size: 11px;
  color: #07c160;
}

.admin-item-price {
  font-size: 16px;
  color: #f44336;
  font-weight: bold;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
}

.admin-action-btn.edit {
  background: #e3f2fd;
  color: #1976d2;
}

.admin-action-btn.delete {
  background: #ffebee;
  color: #c62828;
}

/* ===== 密码验证 ===== */
.password-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-box {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  width: 300px;
  text-align: center;
}

.password-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
}

.password-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 20px;
}

.password-btn {
  width: 100%;
  padding: 12px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  cursor: pointer;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
