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

html, body, #app {
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

/* 主容器 */
.main-container {
  height: 100%;
}

/* 侧边栏 */
.sidebar {
  background-color: #304156;
  transition: width 0.3s;
  overflow: hidden;
}

.logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background-color: #263445;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
}

.logo img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.sidebar-menu {
  border-right: none;
  height: calc(100% - 60px);
  overflow-y: auto;
}

.sidebar-menu:not(.el-menu--collapse) {
  width: 220px;
}

/* 顶部导航 */
.header {
  background-color: #fff;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.collapse-btn {
  font-size: 20px;
  cursor: pointer;
  color: #606266;
}

.collapse-btn:hover {
  color: #409EFF;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.badge-item {
  margin-right: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #606266;
}

.user-info:hover {
  color: #409EFF;
}

.username {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 主内容区 */
.main-content {
  background-color: #f0f2f5;
  padding: 20px;
  overflow-y: auto;
}

/* 登录页面 */
.login-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  width: 400px;
  padding: 40px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.login-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
  color: #303133;
}

/* 页面卡片 */
.page-card {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-title {
  font-size: 18px;
  font-weight: bold;
  color: #303133;
}

/* 搜索表单 */
.search-form {
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.search-form .el-form-item {
  margin-bottom: 10px;
}

/* 表格操作区 */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.table-toolbar-left {
  display: flex;
  gap: 10px;
}

.table-toolbar-right {
  display: flex;
  gap: 10px;
}

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: #fff;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.stat-card-title {
  font-size: 14px;
  color: #909399;
  margin-bottom: 10px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: bold;
  color: #303133;
}

.stat-card-value.success {
  color: #67C23A;
}

.stat-card-value.warning {
  color: #E6A23C;
}

.stat-card-value.danger {
  color: #F56C6C;
}

.stat-card-value.primary {
  color: #409EFF;
}

/* 微店授权提示 */
.weidian-auth-prompt {
  text-align: center;
  padding: 40px 20px;
}

.weidian-auth-prompt p {
  margin: 15px 0;
  font-size: 16px;
  color: #303133;
}

.weidian-auth-prompt .desc {
  font-size: 14px;
  color: #909399;
}

/* 分类树 */
.category-tree {
  padding: 10px 0;
}

.category-tree .el-tree-node__content {
  height: 36px;
}

/* 标签列表 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  gap: 5px;
}

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

.empty-state .el-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

/* 价格显示 */
.price {
  color: #F56C6C;
  font-weight: bold;
}

.price-original {
  color: #909399;
  text-decoration: line-through;
  font-size: 12px;
  margin-left: 5px;
}

/* 库存显示 */
.stock-low {
  color: #F56C6C;
}

.stock-warning {
  color: #E6A23C;
}

.stock-normal {
  color: #67C23A;
}

/* 状态标签 */
.status-on-sale {
  color: #67C23A;
}

.status-off-sale {
  color: #909399;
}

.status-sold-out {
  color: #F56C6C;
}

/* 响应式 */
@media screen and (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    height: 100%;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .search-form .el-form-item {
    width: 100%;
  }
}

/* 导入进度 */
.import-progress {
  margin: 20px 0;
}

.import-result {
  padding: 20px;
  background-color: #f5f7fa;
  border-radius: 4px;
}

.import-result-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e4e7ed;
}

.import-result-item:last-child {
  border-bottom: none;
}

/* 批量操作确认 */
.batch-confirm {
  max-height: 300px;
  overflow-y: auto;
}

.batch-confirm-item {
  padding: 8px 12px;
  background-color: #f5f7fa;
  margin-bottom: 5px;
  border-radius: 4px;
}

/* 图表容器 */
.chart-container {
  height: 300px;
  margin-top: 20px;
}

/* 日志详情 */
.log-detail {
  word-break: break-all;
}

.log-detail pre {
  background-color: #f5f7fa;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
}

/* 备份文件列表 */
.backup-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  margin-bottom: 10px;
}

.backup-file-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.backup-file-name {
  font-weight: bold;
}

.backup-file-meta {
  font-size: 12px;
  color: #909399;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: #c0c4cc;
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background-color: #f5f7fa;
}

/* 加载动画 */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 店铺切换器 */
.shop-switcher {
  margin-right: 10px;
}

.shop-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #606266;
  padding: 6px 12px;
  background-color: #f5f7fa;
  border-radius: 4px;
  transition: all 0.3s;
}

.shop-info:hover {
  background-color: #e6f7ff;
  color: #409EFF;
}

.shop-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.shop-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.shop-dropdown-item .el-tag {
  margin-left: auto;
}

/* 店铺管理弹窗 */
.shop-management .shop-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-management .shop-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-management .shop-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-management .shop-name-row .name {
  font-weight: 500;
  color: #303133;
}

.shop-management .shop-id {
  font-size: 12px;
  color: #909399;
}

.shop-management .empty-shops {
  padding: 40px 0;
}
