* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #303133;
}

/* 登录 */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d93b30 0%, #b02a20 100%);
}
.login-card {
  width: 380px;
  border-radius: 12px;
}
.login-title {
  text-align: center;
  margin: 0 0 24px;
  color: #d93b30;
  letter-spacing: 2px;
}
.login-btn {
  width: 100%;
}

/* 布局 */
.layout {
  height: 100%;
}
.aside {
  background: #2b2f3a;
  color: #fff;
}
.brand {
  height: 60px;
  line-height: 60px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.menu {
  border-right: none;
  background: transparent;
}
.menu .el-menu-item {
  color: #cfd3dc;
}
.menu .el-menu-item.is-active {
  color: #fff;
  background: #d93b30;
}
.menu .el-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.menu .el-menu-item .menu-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #f56c6c;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
}
.header-title {
  font-size: 16px;
  font-weight: 600;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main {
  padding: 16px;
}

/* 仪表盘 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.stat-label {
  color: #909399;
  font-size: 14px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #d93b30;
  margin-top: 8px;
}

.float-right {
  float: right;
}
.mb16 {
  margin-bottom: 16px;
}
.muted {
  color: #c0c4cc;
}
.tip {
  color: #909399;
  font-size: 13px;
}
.pager {
  margin-top: 16px;
  justify-content: flex-end;
}
.codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.code-tag {
  font-family: Consolas, monospace;
}

/* 贴纸预览 */
.label-product {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.label-product-label {
  font-size: 14px;
  color: #606266;
  margin-right: 10px;
}
.label-preview {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.label-canvas {
  width: 100%;
  max-width: 591px;
  height: auto;
  border: 1px solid #ebeef5;
  border-radius: 6px;
  background: #fff;
}

/* 列表内贴纸缩略图 */
.label-thumb {
  display: block;
  width: 150px;
  height: auto;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  cursor: pointer;
}
.label-thumb:hover {
  border-color: #d93b30;
}
.label-thumb-ph {
  width: 150px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  color: #c0c4cc;
  font-size: 12px;
}

/* 会员详情抽屉头部 */
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
}
.drawer-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  flex-shrink: 0;
}
.drawer-trail {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

/* ================= 手机端适配 ================= */
@media (max-width: 768px) {
  /* 侧边栏变成顶部可横向滚动的菜单条 */
  .layout {
    flex-direction: column;
  }
  .aside {
    width: 100% !important;
    overflow: hidden;
  }
  .brand {
    height: 46px;
    line-height: 46px;
    font-size: 16px;
  }
  .menu {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    border-right: none;
  }
  .menu .el-menu-item {
    flex: 0 0 auto;
    height: 44px;
    line-height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }
  .menu::-webkit-scrollbar {
    display: none;
  }

  .header {
    height: 48px;
    padding: 0 12px;
  }
  .header-title {
    font-size: 15px;
  }
  .main {
    padding: 10px;
  }

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-card {
    padding: 12px 6px;
  }
  .stat-label {
    font-size: 12px;
  }
  .stat-value {
    font-size: 20px;
    margin-top: 4px;
  }

  /* 工具栏不要浮在右侧 */
  .float-right {
    float: none;
    display: block;
    margin-top: 8px;
  }
  .el-form--inline .el-form-item {
    margin-right: 8px;
  }

  /* 弹窗 / 抽屉 / 消息框自适应宽度 */
  .el-dialog {
    width: 92% !important;
    margin-top: 6vh !important;
  }
  .el-drawer {
    width: 92% !important;
  }
  .el-message-box {
    width: 88% !important;
  }

  .el-table {
    font-size: 13px;
  }

  .label-canvas {
    max-width: 100%;
  }
  .label-thumb {
    width: 104px;
  }
  .label-thumb-ph {
    width: 104px;
    height: 62px;
  }

  .pager {
    justify-content: center;
  }
  .drawer-head {
    gap: 8px;
  }
  .login-card {
    width: 90%;
  }
}
