/* 后台管理端样式 */

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(1100px 520px at 50% -12%, #dbeafe 0%, #f1f5f9 55%, #f8fafc 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 30px 26px 26px;
  box-shadow: 0 30px 70px -34px rgba(15, 23, 42, .5);
  border: 1px solid rgba(226, 232, 240, .9);
}
.login-logo {
  width: 58px; height: 58px;
  border-radius: 18px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -16px rgba(37, 99, 235, .95);
}
.login-logo svg { width: 28px; height: 28px; }
.login-title { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.login-sub { text-align: center; font-size: 13px; color: var(--muted); margin: 4px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.input-icon { position: relative; }
.input-icon svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-2);
}
.input-icon input { padding-left: 36px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 2px 0 16px; }
.checkbox-row input { width: 15px; height: 15px; accent-color: var(--blue-600); }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.9; }

/* ---------------- 布局 ---------------- */
.admin-shell { display: flex; min-height: 100vh; background: #f4f6fb; }
.sidebar {
  width: 226px;
  flex: none;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand .logo-box {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex; align-items: center; justify-content: center; color: #fff; flex: none;
}
.brand .logo-box svg { width: 18px; height: 18px; }
.brand .name { color: #fff; font-size: 15px; font-weight: 600; line-height: 1.25; }
.brand .desc { font-size: 11px; color: #94a3b8; }
.menu { padding: 10px; flex: 1; overflow: auto; }
.menu-group { font-size: 11px; color: #64748b; padding: 12px 10px 6px; letter-spacing: .5px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  color: #cbd5e1;
  user-select: none;
  transition: .15s ease;
}
.menu-item svg { width: 16px; height: 16px; flex: none; }
.menu-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu-item.active { background: rgba(37, 99, 235, .95); color: #fff; box-shadow: 0 8px 20px -12px rgba(37, 99, 235, 1); }
.menu-item .count {
  margin-left: auto; background: var(--rose-600); color: #fff;
  font-size: 11px; border-radius: 999px; padding: 0 6px; line-height: 17px;
}
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #94a3b8; }
.sidebar-foot .u { color: #fff; font-weight: 600; font-size: 13px; }

.main { flex: 1; min-width: 0; margin-left: 226px; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 25;
  height: 60px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 18px 20px 44px; flex: 1; }

/* ---------------- 卡片 / 统计 ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-title .more { margin-left: auto; font-size: 12.5px; font-weight: 400; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.stat-card .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .v { font-size: 27px; font-weight: 700; margin-top: 2px; letter-spacing: -.5px; }
.stat-card .d { font-size: 11.5px; color: var(--muted-2); }
.stat-card .glow {
  position: absolute; right: -14px; top: -14px; width: 62px; height: 62px; border-radius: 50%;
  background: var(--blue-50); opacity: .8;
}
.stat-card.warn .glow { background: var(--amber-50); }
.stat-card.warn .v { color: var(--amber-700); }
.stat-card.ok .glow { background: var(--emerald-50); }
.stat-card.ok .v { color: var(--emerald-700); }
.stat-card.pink .glow { background: var(--rose-50); }
.stat-card.pink .v { color: var(--rose-600); }

.cols { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1.35fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1080px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.chart { width: 100%; height: 230px; display: block; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 9px; }
.bar-row .lbl { width: 88px; flex: none; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 1; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--blue-700)); }
.bar-row .num { width: 34px; text-align: right; color: var(--text); font-weight: 600; font-size: 12.5px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; max-height: calc(100vh - 250px); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  position: sticky; top: 0; z-index: 2;
  background: #f8fafc; color: var(--muted); text-align: left; font-weight: 600;
  padding: 11px 12px; white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data th, table.data td { white-space: nowrap; }
table.data td.wrap-cell { white-space: normal; }
table.data { min-width: 880px; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fbfdff; }
table.data .thumb { width: 40px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--line-soft); }
table.data .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 2px 0; font-size: 13px; color: var(--muted); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { width: auto; min-width: 118px; padding: 8px 10px; font-size: 13px; }
.filter-bar select { padding-right: 28px; }
.filter-bar .search { position: relative; }
.filter-bar .search input { padding-left: 38px !important; min-width: 190px; }
.filter-bar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-2); }

.page-head { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }

/* ---------------- 表单弹窗 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .field { margin-bottom: 0; }
.section-label {
  grid-column: 1 / -1;
  font-size: 13px; font-weight: 600; color: var(--blue-700);
  background: var(--blue-50); border-radius: 8px; padding: 6px 10px; margin-top: 4px;
}
.tag-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-option {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--muted);
}
.tag-option.active { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); font-weight: 500; }

.photo-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.photo-edit-grid .photo-item { aspect-ratio: 3 / 4; }

.review-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: flex;
  gap: 14px;
}
.review-card .info { flex: 1; min-width: 0; }
.review-card .thumb-list img { width: 58px; height: 74px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 12px; font-size: 13px; margin: 8px 0; }
.review-meta .k { color: var(--muted); }

.recognize-box textarea { min-height: 150px; font-size: 13.5px; }
.parse-result { background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; padding: 12px; font-size: 13px; max-height: 240px; overflow: auto; }
.parse-result .row { display: flex; gap: 8px; padding: 3px 0; }
.parse-result .k { color: var(--muted); width: 88px; flex: none; }
.parse-result .v { color: var(--text); }
.warn-text { color: var(--amber-700); font-size: 12.5px; }

/* ---------------- 移动端适配 ---------------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    width: 100%; height: auto; bottom: auto; right: 0;
    flex-direction: row; align-items: center;
  }
  .sidebar .brand { border: none; padding: 12px; }
  .sidebar .brand .desc { display: none; }
  .menu { display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .menu-group { display: none; }
  .menu-item { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .menu-item span.txt { display: none; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; padding-top: 60px; }
  .topbar { top: 60px; }
  .content { padding: 12px; }
  .table-wrap { max-height: none; }
}

.filter-bar .search svg { pointer-events: none; z-index: 1; }
