/* =============================================================
 * 一物一码溯源动销营销系统 · PC 管理后台样式
 * 无构建：纯静态样式，配合 Vue3 + Element Plus
 * ============================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: #303133;
  background: #f0f2f5;
}

#app { height: 100%; }

/* ---------- 启动态 / 错误态 ---------- */
.boot-loading,
.boot-error {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #909399;
  letter-spacing: 1px;
}
.boot-error {
  color: #f56c6c;
  padding: 40px;
  text-align: center;
  line-height: 1.8;
}

/* ---------- 整体布局 ---------- */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-aside {
  width: 220px;
  flex-shrink: 0;
  background: #1f2d3d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-logo {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #409eff;
  color: #fff;
  font-size: 15px;
  line-height: 28px;
  text-align: center;
  font-weight: 700;
}
.logo-text { font-size: 14px; font-weight: 600; letter-spacing: .5px; }

.admin-menu-scroll { flex: 1; overflow: hidden; }
.admin-menu { border-right: none !important; background: transparent !important; }
.admin-menu .el-menu-item,
.admin-menu .el-sub-menu__title {
  color: #c0c4cc !important;
  height: 46px;
  line-height: 46px;
}
.admin-menu .el-menu-item:hover,
.admin-menu .el-sub-menu__title:hover { background: rgba(255, 255, 255, .06) !important; color: #fff !important; }
.admin-menu .el-menu-item.is-active {
  background: #409eff !important;
  color: #fff !important;
}
.admin-menu .el-menu { background: #182534 !important; }
.menu-dot { margin-right: 6px; font-size: 10px; color: #6b7c91; }

.admin-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-header {
  height: 56px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e6e8eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.crumb-title { font-size: 16px; font-weight: 600; }
.crumb-sub { font-size: 12px; color: #909399; margin-left: 10px; }
.admin-user { cursor: pointer; }
.user-inner { display: flex; align-items: center; gap: 8px; color: #303133; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #409eff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.user-name { font-size: 13px; }

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ---------- 页面通用 ---------- */
.page { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title { font-size: 15px; font-weight: 600; }
.panel-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: #409eff;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 2px;
}

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

.pager {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.muted { color: #c0c4cc; }

.upload-img {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dcdfe6;
}

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

.chart-box { width: 100%; height: 320px; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: #909399; margin-top: 4px; }

/* ---------- 登录页 ---------- */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2d3d 0%, #2b5876 45%, #4e8cff 100%);
}
.login-box {
  width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 34px 34px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 54px; height: 54px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: #409eff;
  color: #fff;
  font-size: 26px;
  line-height: 54px;
  font-weight: 700;
}
.login-brand h1 { font-size: 19px; margin: 0 0 6px; color: #1f2d3d; }
.login-brand p { font-size: 12px; color: #909399; margin: 0; letter-spacing: 1px; }
.login-btn { width: 100%; margin-top: 6px; }
.login-tip {
  margin-top: 16px;
  font-size: 12px;
  color: #909399;
  text-align: center;
  line-height: 1.7;
}

/* ---------- 404 ---------- */
.page-notfound {
  height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.nf-code { font-size: 72px; font-weight: 800; color: #dcdfe6; letter-spacing: 4px; }
.nf-text { color: #909399; margin-bottom: 8px; }

/* ---------- 出库明细 ---------- */
.items-box { margin-top: 4px; }
.add-item { margin-top: 10px; }

/* ---------- 溯源时间线 ---------- */
.trace-timeline { padding: 8px 4px; }
.trace-title { font-size: 15px; font-weight: 600; }
.trace-meta { font-size: 12px; color: #909399; margin: 4px 0 6px; }
.trace-content { color: #606266; line-height: 1.7; white-space: pre-wrap; }
.trace-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.trace-imgs img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid #ebeef5; }
.trace-actions { margin-top: 8px; }

.detail-list { line-height: 2; }
.detail-list .label { color: #909399; display: inline-block; min-width: 96px; }
