/* assets/css/stats.css — 好友分析（与 index.html #fa-critical 保持一致） */
#page-friendAnalysis { display: block !important; }
.fa-stack { display: flex; flex-direction: column; gap: 16px; position: relative; }

#page-friendAnalysis .fa-box.card {
  padding: 0;
  overflow: hidden;
  min-height: 0 !important;
  height: auto;
  border-radius: 8px;
  border: 1px solid #E5E6EB;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
}
#page-friendAnalysis .fa-box .card-toolbar { padding: 16px 20px 8px; margin-bottom: 0; }
#page-friendAnalysis .fa-box .card-toolbar h3 { font-size: 15px; }
#page-friendAnalysis .fa-box .fa-cards { border-bottom: none; overflow: visible; }
#page-friendAnalysis .fa-filter-box { overflow: visible !important; }

.fa-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px 24px;
  padding: 16px 20px;
}
.fa-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: none;
}
.fa-filter-lab {
  font-size: 13px;
  color: #86909C;
  line-height: 20px;
  flex: none;
  white-space: nowrap;
}
.fa-filter-item .form-select { width: 320px; max-width: 42vw; min-width: 160px; position: relative; }
.fa-filter-item .form-select-btn {
  height: 32px; border-radius: 6px; border-color: #E5E6EB; padding: 0 28px 0 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
  line-height: 30px; max-width: 100%;
}
.fa-filter-item .form-select-btn.fa-staff-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 0;
  text-overflow: clip; line-height: normal;
}
.fa-filter-item .form-select-caret { right: 8px; top: 50%; transform: translateY(-50%); }
.fa-filter-item .form-select.open .form-select-caret { transform: translateY(-50%) rotate(180deg); }
.fa-filter-item .form-select-menu {
  top: calc(100% + 4px); bottom: auto; left: 0; right: 0; max-height: 240px; overflow: auto;
  width: 100% !important; min-width: 100% !important; max-width: 100% !important;
  box-sizing: border-box; border-radius: 6px;
}
.fa-filter-item .form-select-menu button {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fa-filter-item .form-select-menu button.fa-staff-opt {
  display: flex !important; align-items: center; justify-content: flex-start; gap: 0;
  width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.fa-staff-opt-name {
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.fa-staff-opt-cnt {
  flex: 0 0 auto; margin-left: 0; color: #1D2129;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fa-filter-item .form-select-menu button.fa-staff-opt.current .fa-staff-opt-cnt,
.fa-filter-item .form-select-btn.fa-staff-btn .fa-staff-opt-cnt { color: inherit; }
.fa-filter-item .dr-input {
  display: flex; align-items: center; width: 240px; max-width: 42vw; min-width: 180px; height: 32px;
  border: 1px solid #E5E6EB; border-radius: 6px; background: #fff; cursor: pointer;
  padding: 0 32px 0 10px; position: relative; box-sizing: border-box;
}
.fa-filter-item .dr-input:hover { border-color: #C9CDD4; }
.fa-filter-item .dr-input.open { border-color: var(--primary); }
.fa-filter-item .dr-input .dr-text {
  flex: 1; min-width: 0; font-size: 14px; color: #1D2129; line-height: 30px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fa-filter-item .dr-input .dr-text.ph { color: #C0C4CC; }
.fa-filter-item .dr-input .dr-ico {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: #C0C4CC; pointer-events: none;
}
.fa-filter-actions { gap: 8px; margin-left: 0 !important; margin-right: 0 !important; flex: none; }
.fa-filter-actions .btn {
  height: 32px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 6px;
  box-sizing: border-box;
  line-height: 1;
}
.fa-loading {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  pointer-events: none;
}
.fa-loading-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #E5E6EB;
  border-top-color: #165DFF;
  animation: fa-spin .7s linear infinite;
  box-sizing: border-box;
}
@keyframes fa-spin {
  to { transform: rotate(360deg); }
}

.fa-section-title {
  padding: 18px 20px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #1D2129;
  background: #fff;
  line-height: 22px;
}
.fa-section-title .fa-section-tip {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #86909C;
}
.fa-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 20px 20px;
  background: #fff;
}
.fa-cards.fa-cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fa-cards.fa-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fa-card {
  border: 1px solid #E5E6EB;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  min-height: 86px;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}
.fa-card .fa-label {
  font-size: 13px;
  color: #86909C;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 18px;
  max-width: 100%;
}
.fa-card .fa-value { font-size: 28px; font-weight: 600; color: #1D2129; line-height: 36px; }
.fa-card .fa-sub { font-size: 12px; color: #86909C; margin-top: 6px; }
.fa-card .fa-value.fa-tone-up,
.fa-card .fa-sub.fa-tone-up { color: #00B42A; }
.fa-card .fa-value.fa-tone-down,
.fa-card .fa-sub.fa-tone-down { color: #F53F3F; }
.fa-q {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #C9CDD4;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  vertical-align: middle;
}
.fa-q:hover,
.fa-q.on { background: #86909C; }
.fa-q-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(260px, 70vw);
  padding: 8px 12px;
  background: #1D2129;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 4px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: left;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  pointer-events: none;
  box-sizing: border-box;
}
.fa-q-pop::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  margin: 0;
  border: 5px solid transparent;
  border-bottom-color: #1D2129;
}
.fa-card,
.fa-card .fa-label {
  overflow: visible;
}

.fa-bars { padding: 18px 20px 16px; background: #fff; }
.fa-bars-title { font-size: 14px; font-weight: 600; color: #1D2129; margin-bottom: 14px; }
.fa-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fa-bar-date { width: 44px; flex: none; font-size: 12px; color: #4E5969; }
.fa-bar-track {
  flex: 1; height: 10px; background: #F2F3F5; border-radius: 5px; overflow: hidden;
}
.fa-bar-track > i {
  display: block; height: 100%; background: #00B42A; border-radius: 5px;
}
.fa-bar-track-group > i { background: #165DFF; }
.fa-bar-n { width: 36px; flex: none; text-align: right; font-size: 12px; color: #4E5969; }
.fa-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

#page-friendAnalysis .fa-box .table-wrap {
  margin: 0 16px 16px;
  border: 1px solid #E5E6EB;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
#page-friendAnalysis .fa-pager {
  padding: 12px 20px 16px;
  margin: 0;
  border-top: none;
}
#page-friendAnalysis .table-wrap table { width: 100%; border-collapse: collapse; }
#page-friendAnalysis .table-wrap table th,
#page-friendAnalysis .table-wrap table td {
  text-align: center;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid #F2F3F5;
  color: #1D2129;
}
#page-friendAnalysis .table-wrap table th {
  background: #F7F8FA;
  color: #86909C;
  font-weight: 500;
  border-bottom: 1px solid #E5E6EB;
}
#page-friendAnalysis .table-wrap table th:first-child,
#page-friendAnalysis .table-wrap table td:first-child { text-align: left; }
#page-friendAnalysis .table-wrap table tbody tr:last-child td { border-bottom: none; }
#page-friendAnalysis .table-wrap table tbody tr:hover td { background: #F7F8FA; }

@media (max-width: 1200px) {
  .fa-cards, .fa-cards.fa-cards-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fa-cards.fa-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fa-charts-row { grid-template-columns: 1fr; }
  .fa-filter-actions { margin-left: 0; width: 100%; }
  .fa-filter-item .form-select,
  .fa-filter-item .dr-input { width: min(280px, 70vw); }
}
@media (max-width: 720px) {
  .fa-cards, .fa-cards.fa-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
