* {
  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: #f5f5f5;
  color: #333;
}

.container {
  max-width: 414px;
  margin: 0 auto;
  background: #f5f5f5;
  min-height: 100vh;
}

/* 头部导航 */
.header {
  background: #07c160;
  color: #fff;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .back-btn {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
}

.header .header-delete-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid #ff4d4f;
  color: #ff4d4f;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.header .header-delete-btn:hover {
  background: #ff4d4f;
  color: #fff;
}

.header-right {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right .login-btn,
.header-right .admin-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.3s;
}

.header-right .login-btn {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.header-right .login-btn:hover,
.header-right .admin-link:hover {
  opacity: 0.8;
}

.header-right .user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 13px;
}

.header-right .user-info .phone {
  opacity: 0.9;
}

.header-right .user-info .logout-btn {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-left: 4px;
}

/* 搜索框 */
.search-box {
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

/* 分类筛选 */
.category-box {
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 辖区筛选 */
.district-box,
.sort-box {
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.filter-label {
  font-size: 14px;
  color: #333;
  font-weight: bold;
  white-space: nowrap;
  padding-top: 4px;
}

.district-tags,
.sort-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.category-box .tag {
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 15px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.category-box .tag.active {
  background: #07c160;
  color: #fff;
}

/* 商户列表 */
.merchant-list {
  padding: 10px;
}

.merchant-card {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  cursor: pointer;
  transition: transform 0.2s;
}

.merchant-card:active {
  transform: scale(0.98);
}

.merchant-card .logo {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #e0e0e0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}

.merchant-card .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merchant-card .info {
  flex: 1;
  margin-left: 15px;
}

.merchant-card .info .name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.merchant-card .info .address {
  font-size: 13px;
  color: #666;
  margin-bottom: 5px;
}

.merchant-card .info .distance {
  font-size: 12px;
  color: #999;
}

.merchant-card .info .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
}

.merchant-card .info .meta .distance {
  font-size: 12px;
  color: #999;
}

.merchant-card .info .meta .popularity {
  font-size: 12px;
  color: #ff9900;
}

/* 商户信息页 */
.merchant-detail {
  background: #fff;
}

.merchant-detail .banner {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.merchant-detail .content {
  padding: 20px;
  padding-bottom: 80px;
}

.merchant-detail .content .title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
}

.merchant-detail .content .info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  font-size: 14px;
}

.merchant-detail .content .info-item .icon {
  width: 20px;
  margin-right: 10px;
  color: #07c160;
}

.merchant-detail .content .info-item .label {
  color: #666;
  min-width: 70px;
}

.merchant-detail .content .info-item .value {
  flex: 1;
  color: #333;
}

/* 星级评分 */
.stars {
  color: #ff9900;
  font-size: 18px;
  letter-spacing: 2px;
}

.rating-score {
  font-size: 14px;
  color: #ff9900;
  font-weight: bold;
  margin-left: 8px;
}

/* 用户评分 */
.user-rating {
  background: #fff8f0;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.user-rating .rating-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.user-rating .star-rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.user-rating .rating-star {
  font-size: 36px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.user-rating .rating-star:hover {
  transform: scale(1.2);
}

.user-rating .rating-star.active {
  color: #ff9900;
}

.user-rating .rating-star.active:hover {
  transform: scale(1.2);
}

.user-rating .rating-feedback {
  font-size: 14px;
  color: #ff9900;
  margin-top: 5px;
}

/* 登录页 */
.login-page {
  padding: 40px 20px;
  text-align: center;
}

.login-logo {
  font-size: 80px;
  margin-bottom: 20px;
}

.login-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.login-desc {
  font-size: 14px;
  color: #999;
  margin-bottom: 50px;
}

.login-methods {
  margin-bottom: 30px;
}

.login-method-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  margin-bottom: 15px;
}

.login-method-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-method-btn.primary {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
}

.login-method-btn.primary .login-method-desc {
  color: rgba(255, 255, 255, 0.8);
}

.login-icon {
  font-size: 32px;
  margin-right: 15px;
}

.login-text {
  flex: 1;
}

.login-method-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.login-method-desc {
  font-size: 12px;
  color: #666;
}

.agreement {
  padding: 0 20px;
  font-size: 13px;
  color: #666;
}

.agreement .checkbox-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.agreement input[type="checkbox"] {
  margin-right: 4px;
}

.agreement a {
  color: #4a90e2;
  text-decoration: none;
}

.agreement a:hover {
  text-decoration: underline;
}

/* 协议弹窗内容 */
.agreement-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  text-align: left;
}

/* 地图预览 */
.map-preview {
  margin: 20px 0;
  height: 200px;
  background: #e0e0e0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
}

/* 图片展示区 */
.image-display {
  margin: 20px 0;
}

.main-image {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

.thumb-gallery {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}

.thumb-item {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

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

.thumb-item:hover {
  border-color: #999;
}

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

/* 图片画廊（旧样式，保留兼容） */
.image-gallery {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  overflow-x: auto;
  padding-bottom: 10px;
}

.gallery-item {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}

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

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

/* 图片预览覆盖层 */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.image-overlay-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.image-overlay-content .close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 导航按钮 */
.detail-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 414px;
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.detail-actions .action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 80px;
}

.detail-actions .action-btn .btn-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.detail-actions .action-btn .btn-text {
  font-size: 12px;
  color: #666;
}

.detail-actions .favorite-btn.active {
  border-color: #ff9900;
  background: #fff8f0;
}

.detail-actions .favorite-btn.active .btn-icon {
  color: #ff9900;
}

.detail-actions .favorite-btn.active .btn-text {
  color: #ff9900;
}

.detail-actions .nav-btn {
  flex: 1;
  position: static;
  left: auto;
  transform: none;
  width: auto;
  margin: 0;
  background: #07c160;
  color: #fff;
  padding: 15px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  transition: background 0.3s;
}

.detail-actions .nav-btn:hover {
  background: #06ad56;
}

.nav-btn {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 414px;
  width: 100%;
  background: #07c160;
  color: #fff;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}

.nav-btn:hover {
  background: #06ad56;
}

/* 导航方式选择 */
.nav-modal {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 414px;
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}

.nav-modal.show {
  display: block;
}

.nav-modal .modal-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
}

.nav-modal .nav-option {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background: #f5f5f5;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

.nav-modal .nav-option:hover {
  background: #e0e0e0;
}

.nav-modal .nav-option .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 20px;
}

.nav-modal .nav-option .text {
  flex: 1;
}

.nav-modal .nav-option .text .title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 3px;
}

.nav-modal .nav-option .text .desc {
  font-size: 12px;
  color: #666;
}

.nav-modal .cancel-btn {
  width: 100%;
  padding: 15px;
  background: #f5f5f5;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  margin-top: 10px;
}

/* 遮罩层 */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.overlay.show {
  display: block;
}

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

.empty-state .icon {
  font-size: 60px;
  margin-bottom: 15px;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 20px;
  color: #999;
}

/* ================== 管理页面样式 ================== */

/* 统计信息 */
.stats-box {
  background: #fff;
  padding: 15px;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-item .number {
  font-size: 20px;
  font-weight: bold;
  color: #07c160;
  margin-bottom: 5px;
}

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

/* 操作按钮 */
.action-bar {
  padding: 15px;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.add-btn {
  flex: 1;
  padding: 12px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.add-btn:hover {
  background: #06ad56;
}

.export-btn {
  padding: 12px 20px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s;
}

.export-btn:hover {
  background: #3a7dc2;
}

/* 管理页面商户列表 */
.admin-merchant-list {
  padding: 10px;
}

.admin-merchant-card {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.admin-merchant-card .logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #e0e0e0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}

.admin-merchant-card .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.admin-merchant-card .info {
  flex: 1;
  margin-left: 15px;
}

.admin-merchant-card .info .name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
}

.admin-merchant-card .info .address {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-merchant-card .info .category-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
}

.admin-merchant-card .actions {
  display: flex;
  gap: 10px;
}

.admin-merchant-card .actions .btn-edit,
.admin-merchant-card .actions .btn-delete {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.admin-merchant-card .actions .btn-edit {
  background: #e3f2fd;
  color: #4a90e2;
}

.admin-merchant-card .actions .btn-edit:hover {
  background: #bbdefb;
}

.admin-merchant-card .actions .btn-delete {
  background: #ffebee;
  color: #e53935;
}

.admin-merchant-card .actions .btn-delete:hover {
  background: #ffcdd2;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  z-index: 1001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal.show {
  display: block;
}

.modal-header {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
}

/* 表单样式 */
.form-group {
  margin-bottom: 15px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-group.half {
  flex: 1;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

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

.form-textarea {
  resize: vertical;
  font-family: inherit;
}

/* 表单页面 */
.form-page {
  background: #fff;
  padding: 20px;
  min-height: calc(100vh - 56px);
}

/* 图片上传 */
.image-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-box {
  width: 80px;
  height: 80px;
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.upload-box:hover {
  border-color: #07c160;
}

.upload-box .upload-icon {
  font-size: 32px;
  color: #999;
  line-height: 1;
}

.upload-box .upload-text {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

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

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

.image-preview-item .preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-preview-item:hover .preview-overlay {
  opacity: 1;
}

.image-preview-item .cover-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: #07c160;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 0 0 8px 0;
  font-weight: bold;
}

.image-preview-item .set-cover-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.image-preview-item .set-cover-btn:hover {
  background: #fff;
}

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

.image-preview-item .delete-img-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.image-count {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 按钮组 */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-cancel {
  background: #f0f0f0;
  color: #333;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-save {
  background: #07c160;
  color: #fff;
}

.btn-save:hover {
  background: #06ad56;
}

.btn-danger {
  background: #e53935;
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

/* 确认弹窗 */
.confirm-content {
  text-align: center;
}

.confirm-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.confirm-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.confirm-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}
