/* ===== QU MARKET 后台 =====
 * 与前台同一套令牌（tokens.css），圆角同样只有 --r-4 / --r-8。
 * 版式是后台该有的样子：左侧固定栏 + 右侧工作区，数据用表格 ——
 * 后台是拿来一眼扫一列、批量处理的，不是拿来看的。
 * 窄屏下左栏收成顶部横滑，表格横向滚动，不为了塞进手机把列删掉。 */

.admin {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
}

/* ===== 左栏 ===== */
.aside {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  background: var(--c-bg);
  border-right: 1px solid var(--c-border);
}

.aside-brand { padding: 4px 10px 16px; }
.aside-brand b { display: block; font-size: 15px; font-weight: 600; }

.anav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-4);
  font-size: var(--row-value-size);
  color: var(--c-sub);
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.anav:hover { background: var(--c-surface-2); color: var(--c-text); }
.anav.is-on { background: var(--c-accent-dark); color: var(--c-bg); font-weight: 500; }
.anav-n {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-4);
  background: var(--c-surface-2);
  font-size: 11px;
  color: var(--c-sub);
}
.anav.is-on .anav-n { background: rgba(255, 255, 255, 0.22); color: inherit; }

.aside-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

/* ===== 工作区 ===== */
.work { padding: 22px 26px 60px; min-width: 0; }

.work-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.work-title { font-size: 22px; font-weight: 600; line-height: 1.2; }
.work-head .spacer { flex: 1; }

/* ===== 概览 ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat {
  padding: 14px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-8);
  background: var(--c-bg);
}
.stat b {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 11px; color: var(--c-sub); }

.panel {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-8);
  background: var(--c-bg);
}
.panel h2 {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-hint);
  margin-bottom: 14px;
}

/* 分区分布：一行一条，条长按占比。不用饼图 —— 七个扇形谁也读不出差别 */
.bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 40px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-size: var(--row-value-size);
  color: var(--c-sub);
}
.bar-track {
  height: 6px;
  border-radius: var(--r-4);
  background: var(--c-surface-2);
  overflow: hidden;
}
.bar-fill {
  display: block;              /* 必须写：它躺在 inline 的 span 里，不 blockify 的话宽高全被忽略，条子看着永远是空的 */
  height: 100%;
  border-radius: var(--r-4);
  background: var(--c-accent-dark);
}
.bar-row b { text-align: right; color: var(--c-text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ===== 表格 ===== */
.table-wrap {
  margin-top: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-8);
  background: var(--c-bg);
  overflow-x: auto;            /* 窄屏横滚，不删列 */
}

table { width: 100%; border-collapse: collapse; min-width: 760px; }

th, td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border);
}
th {
  background: var(--c-surface-l);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-hint);
  white-space: nowrap;
}
td { font-size: var(--row-value-size); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--c-surface-l); }

td.t-title { max-width: 400px; }
td.t-title a { font-size: var(--row-name-size); font-weight: 500; }
td.t-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.t-time { white-space: nowrap; }   /* 「1 分钟前」不能被折成两行，一折整行就变高 */
td.acts { white-space: nowrap; text-align: right; }
td.acts .btn { margin-left: 4px; }

.btn-danger { color: #b04a4a; }
.btn-danger:hover { background: #b04a4a; border-color: #b04a4a; color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #e08b8b; }

.filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.filters .field { width: 220px; }
.filters select {
  height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-8);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: var(--row-value-size);
  cursor: pointer;
}

/* ===== 举报 ===== */
/* 与前台的列表同一条规矩：一整块 + 分隔线，不是一堆各自带边框的卡 */
.reports {
  border: 1px solid var(--c-border);
  border-radius: var(--r-8);
  background: var(--c-bg);
  overflow: hidden;
}
.report {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-bottom: 1px solid var(--c-border);
}
.report:last-child { border-bottom: none; }
.report-main { flex: 1; min-width: 0; }
.report-why { margin-top: 4px; line-height: 1.6; }
.report-acts { display: flex; gap: 6px; flex: none; }

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

/* ===== 窄屏 ===== */
@media (max-width: 860px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .aside {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 10px 14px;
    scrollbar-width: none;
  }
  .aside::-webkit-scrollbar { display: none; }
  .aside-brand { display: none; }
  .anav { width: auto; flex: none; }
  .aside-foot { margin-top: 0; flex-direction: row; }
  .work { padding: 18px 14px 60px; }
  .work-title { font-size: 20px; }
}
