/* 轻记体重 · 管理后台全局样式
   只放布局/视觉基调；组件内部样式优先用 AntD token 与内联样式。 */

:root {
  color-scheme: light;
  --qj-primary: #2f9e7e;
  --qj-bg: #f4f8f6;
  --qj-ink: #1b2420;
  --qj-muted: #7b8b84;
  --qj-border: #edf2ef;
  --qj-shadow: 0 1px 4px rgba(27, 36, 32, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  background: var(--qj-bg);
  color: var(--qj-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 通用卡片 / 页面 ---------------- */
.qj-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--qj-shadow);
  border: 1px solid var(--qj-border);
}

.qj-card.ant-card {
  border-radius: 8px;
  box-shadow: var(--qj-shadow);
  border-color: var(--qj-border);
}

.qj-page {
  padding: 20px 24px 32px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
}

.qj-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qj-toolbar-spacer {
  flex: 1 1 auto;
}

.qj-table-hint {
  color: var(--qj-muted);
  font-size: 12px;
}

/* ---------------- 侧边栏 ---------------- */
.qj-sider {
  border-right: 1px solid var(--qj-border);
}

.qj-sider .ant-layout-sider-children {
  display: flex;
  flex-direction: column;
}

.qj-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--qj-border);
  overflow: hidden;
  white-space: nowrap;
}

.qj-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #37b18d 0%, #2f9e7e 100%);
  color: #fff;
  font-size: 17px;
}

.qj-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--qj-ink);
}

.qj-logo-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--qj-muted);
  letter-spacing: 1px;
}

.qj-menu {
  flex: 1 1 auto;
  padding: 12px 10px;
  border-inline-end: 0 !important;
}

.qj-menu .ant-menu-item {
  height: 42px;
  line-height: 42px;
  margin-block: 2px;
}

.qj-sider-footer {
  padding: 12px 16px 16px;
  color: var(--qj-muted);
  font-size: 12px;
  border-top: 1px solid var(--qj-border);
}

/* ---------------- 顶栏 ---------------- */
.qj-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  /* AntD 的 .ant-layout-header 带 line-height:64px，会被标题块继承并顶出上沿 */
  height: auto !important;
  min-height: 64px;
  line-height: 1.3 !important;
  padding-top: 10px;
  padding-bottom: 10px;
  background: #fff;
  border-bottom: 1px solid var(--qj-border);
}

.qj-header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--qj-ink);
  line-height: 1.3;
}

.qj-header-sub {
  font-size: 12px;
  line-height: 1.4;
  color: var(--qj-muted);
}

.qj-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qj-admin-name {
  font-size: 13px;
  color: #3c4a44;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 概览统计卡 ---------------- */
.qj-stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.qj-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
}

.qj-stat-title {
  font-size: 13px;
  color: var(--qj-muted);
}

.qj-stat-value {
  color: var(--qj-ink);
}

.qj-stat-value .ant-statistic-content {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--qj-ink);
}

/* ---------------- 趋势图 ---------------- */
.qj-chart {
  position: relative;
  width: 100%;
}

.qj-chart svg {
  display: block;
}

.qj-chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: rgba(27, 36, 32, 0.92);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(27, 36, 32, 0.18);
}

.qj-chart-tip b {
  font-weight: 600;
}

.qj-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--qj-muted);
}

.qj-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.qj-legend-line {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ---------------- 快捷入口 ---------------- */
.qj-quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.qj-quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  color: inherit;
  appearance: none;
  padding: 14px 16px;
  border: 1px solid var(--qj-border);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.qj-quick-item:hover {
  border-color: rgba(47, 158, 126, 0.45);
  box-shadow: 0 4px 14px rgba(47, 158, 126, 0.1);
  transform: translateY(-1px);
}

.qj-quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: rgba(47, 158, 126, 0.1);
  color: var(--qj-primary);
  font-size: 18px;
}

.qj-quick-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--qj-ink);
}

.qj-quick-desc {
  font-size: 12px;
  color: var(--qj-muted);
  margin-top: 2px;
}

/* ---------------- 登录页 ---------------- */
.qj-login-bg {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: radial-gradient(1100px 560px at 8% -10%, #dff1e8 0%, rgba(223, 241, 232, 0) 62%),
    radial-gradient(900px 520px at 102% 108%, #d9eee5 0%, rgba(217, 238, 229, 0) 58%),
    linear-gradient(155deg, #f8fcfa 0%, #eef6f2 100%);
}

.qj-login-bg::before,
.qj-login-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.qj-login-bg::before {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(47, 158, 126, 0.16) 0%, rgba(47, 158, 126, 0) 70%);
}

.qj-login-bg::after {
  width: 360px;
  height: 360px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(47, 158, 126, 0.12) 0%, rgba(47, 158, 126, 0) 70%);
}

.qj-login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 34px 32px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 48px rgba(27, 36, 32, 0.12), 0 2px 6px rgba(27, 36, 32, 0.04);
  backdrop-filter: blur(8px);
}

.qj-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  text-align: center;
}

.qj-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: linear-gradient(135deg, #37b18d 0%, #2f9e7e 100%);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(47, 158, 126, 0.28);
}

.qj-login-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--qj-ink);
}

.qj-login-sub {
  font-size: 13px;
  color: var(--qj-muted);
}

.qj-login-form .ant-form-item {
  margin-bottom: 18px;
}

.qj-login-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qj-login-hint {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f8f6;
  color: var(--qj-muted);
  font-size: 12px;
  line-height: 1.7;
}

.qj-login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #9aa9a2;
}

/* ---------------- 表格 / 抽屉细节 ---------------- */
.qj-table .ant-table-thead > tr > th {
  font-weight: 600;
  font-size: 13px;
}

.qj-table .ant-table-tbody > tr > td {
  font-size: 13px;
}

.qj-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qj-sub {
  display: block;
  font-size: 11px;
  color: var(--qj-muted);
  line-height: 1.5;
}

.qj-emoji {
  font-size: 20px;
  line-height: 1;
}

.qj-desc-label {
  color: var(--qj-muted);
}

.qj-count-card {
  padding: 12px 14px;
  border: 1px solid var(--qj-border);
  border-radius: 8px;
  background: #fbfdfc;
  text-align: center;
}

.qj-count-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--qj-ink);
  line-height: 1.2;
}

.qj-count-label {
  font-size: 12px;
  color: var(--qj-muted);
  margin-top: 2px;
}

.qj-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* ---------------- 意见反馈 ---------------- */
.qj-feedback-content,
.qj-feedback-reply {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--qj-border);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--qj-ink);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.qj-feedback-reply {
  border-left: 3px solid var(--qj-primary);
}

.qj-feedback-user {
  min-width: 0;
  cursor: pointer;
}

.qj-feedback-user-name {
  color: var(--qj-primary);
  font-weight: 500;
}

.qj-feedback-user:hover .qj-feedback-user-name,
.qj-feedback-user:focus-visible .qj-feedback-user-name {
  text-decoration: underline;
}

.qj-feedback-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qj-feedback-footer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.qj-feedback-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 768px) {
  .qj-page {
    padding: 14px 12px 24px;
  }

  .qj-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qj-header {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
