/* ============================================================
   UniCode 校服溯源码系统 —— 管理端样式
   引入顺序：common.css -> admin.css
   ============================================================ */

/* ---------- 顶部导航 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.brand .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-primary);
  display: inline-block;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-item {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--c-text-2);
  font-size: 14px;
}

.nav-item:hover {
  background: var(--c-bg);
  color: var(--c-text);
}

.nav-item.active {
  color: var(--c-primary);
  font-weight: 600;
  background: var(--c-primary-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-2);
}

.user-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-success);
}

/* ---------- 页面 ---------- */
.page {
  padding: 20px 0 48px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.page-sub {
  color: var(--c-text-3);
  font-size: 13px;
  margin-top: 2px;
}

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.filter-bar .filter-search {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}

.filter-bar .filter-item {
  width: 160px;
}

/* ---------- 表格 ---------- */
.table-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 16px 16px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.table-wrap {
  overflow-x: auto;
}

table.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.list-table th,
.list-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.list-table th {
  color: var(--c-text-3);
  font-weight: 500;
  background: #fafbfc;
  white-space: nowrap;
}

.list-table tbody tr:hover {
  background: #fafbfd;
}

.list-table .col-check {
  width: 34px;
}

.list-table .col-actions {
  white-space: nowrap;
}

.list-table .row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.list-table .thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  display: block;
}

.code-cell {
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-weight: 600;
}

.name-cell {
  max-width: 220px;
}

/* 序号列：窄列、弱化颜色 */
.list-table .col-seq {
  width: 48px;
  color: #888780;
  font-size: 12px;
}

/* 卡片标题中的必填星号（如「校服图片 *」）标红 */
.card-title .req {
  color: var(--c-danger);
  margin-left: 2px;
}

/* 斑马纹：偶数行淡色区分（写在其后再次声明 hover，保证悬停高亮优先） */
.list-table tbody tr:nth-child(even) {
  background: #f6f8fb;
}

.list-table tbody tr:hover {
  background: #eef3f9;
}

/* 勾选列 */
input[type='checkbox'].row-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--c-primary);
}

/* ---------- 录入页 ---------- */
.edit-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.edit-head .page-title {
  flex: 1;
}

.form-section .section-body {
  padding-top: 6px;
}

/* 图片/PDF 上传 */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.upload-item {
  position: relative;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafbfc;
}

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

.upload-item .upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 35, 41, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.upload-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 120px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  color: var(--c-text-3);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.upload-add:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.upload-add .plus {
  font-size: 26px;
  line-height: 1;
}

.pdf-existing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.pdf-existing .pdf-name {
  color: var(--c-primary);
  word-break: break-all;
  font-size: 13px;
}

/* 标准行（动态增删） */
.std-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.std-row .input {
  flex: 1;
}

/* ---------- 二维码弹层 ---------- */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
}

.qr-box img {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fff;
}

.qr-url {
  max-width: 100%;
  word-break: break-all;
  font-size: 12px;
  color: var(--c-text-3);
}

/* ---------- 密码一次性展示 ---------- */
.pw-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-primary-light);
  border: 1px dashed var(--c-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 10px 0;
}

.pw-box .pw-value {
  flex: 1;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 15px;
  color: var(--c-text);
  word-break: break-all;
}

/* ---------- 账号管理表格加宽容器 ---------- */
.page-wide {
  max-width: 1180px;
}

@media (max-width: 720px) {
  .topbar-inner {
    gap: 10px;
    padding: 0 12px;
  }
  .brand {
    font-size: 15px;
  }
  .filter-bar .filter-search {
    max-width: none;
  }
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 22px;
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: 0.5px;
}

.login-sub {
  color: var(--c-text-3);
  margin-top: 4px;
  font-size: 13px;
}

/* ---------- 扫码统计页 ---------- */
.stats-disclaimer {
  margin-bottom: 16px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.stat-card .stat-label {
  color: var(--c-text-3);
  font-size: 13px;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  color: var(--c-text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
}

.stat-card .stat-value-sm {
  font-size: 16px;
  font-weight: 600;
}

/* 趋势柱状（纯 CSS） */
.trend-box {
  padding-bottom: 20px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 2px 0;
  min-height: 200px;
}

.trend-bar {
  flex: 1 0 26px;
  min-width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 190px;
}

.trend-bar-count {
  font-size: 11px;
  color: var(--c-text-3);
  height: 16px;
  line-height: 16px;
  white-space: nowrap;
}

.trend-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar-fill {
  width: 60%;
  min-height: 2px;
  background: var(--c-primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.trend-bar-label {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 6px;
  white-space: nowrap;
}

.stats-empty {
  text-align: center;
  color: var(--c-text-3);
  padding: 48px 16px;
  width: 100%;
}

