/* ===================== 全局重置 ===================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

#app {
  height: 100%;
}

/* ===================== 整体布局 ===================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f5f7fa;
}

/* ===================== 侧边栏 ===================== */
.admin-sider {
  width: 220px;
  min-height: 100vh;
  background: #001529;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sider-logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: #002140;
  border-bottom: 1px solid #003a6b;
  flex-shrink: 0;
}

.sider-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-right: 10px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.sider-logo-text {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.sider-logo-sub {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 400;
}

.sider-menu {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sider-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 0;
}

.sider-menu-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sider-menu-item.active {
  color: #fff;
  background: #1677ff;
}

.sider-menu-item .menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sider-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sider-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}

.sider-user-avatar {
  width: 32px;
  height: 32px;
  background: #1677ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.sider-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 0;
  margin-top: 6px;
  display: block;
  width: 100%;
  text-align: left;
  transition: color 0.2s;
}

.sider-logout-btn:hover {
  color: #ff4d4f;
}

/* ===================== 主内容区 ===================== */
.admin-main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 99;
}

.admin-breadcrumb {
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.admin-content {
  flex: 1;
  padding: 24px;
}

/* ===================== 页面通用 ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #262626;
  margin: 0;
}

/* ===================== 统计卡片 ===================== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  border: 1px solid #e8e8e8;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card-info {
  flex: 1;
  min-width: 0;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #262626;
  line-height: 1.2;
}

.stat-card-label {
  font-size: 13px;
  color: #8c8c8c;
  margin-top: 4px;
}

/* ===================== 图表容器 ===================== */
.chart-container {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  padding: 20px;
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 16px;
}

/* ===================== 登录页 ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 100%);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 48px 40px;
  width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
}

.login-logo-title {
  font-size: 20px;
  font-weight: 700;
  color: #262626;
  margin-bottom: 4px;
}

.login-logo-sub {
  font-size: 13px;
  color: #8c8c8c;
}

/* ===================== 门店详情标签页 ===================== */
.store-detail-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 160px);
}

/* ===================== 相册网格 ===================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-info {
  padding: 8px;
  font-size: 12px;
  color: #8c8c8c;
  background: #fff;
}

/* ===================== 产品卡片 ===================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 32px;
}

.product-card-body {
  padding: 12px;
}

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 4px;
}

.product-card-features {
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-card-price {
  font-size: 15px;
  font-weight: 600;
  color: #ff2442;
  margin-bottom: 10px;
}

.product-card-actions {
  display: flex;
  gap: 8px;
}

/* ===================== QR Code Modal ===================== */
.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}

.qr-preview canvas {
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.qr-preview-title {
  font-size: 14px;
  color: #595959;
  margin-top: 12px;
  text-align: center;
}

/* ===================== 空状态 ===================== */
.empty-tip {
  text-align: center;
  padding: 48px 0;
  color: #8c8c8c;
}

/* ===================== 响应式 ===================== */
@media (max-width: 1200px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sider {
    display: none;
  }
  .admin-main {
    margin-left: 0;
  }
}
