:root {
  --gf-bg: #111217;
  --gf-panel: #181b1f;
  --gf-border: #2c3235;
  --gf-text: #d8d9da;
  --gf-dim: #8e8e8e;
  --gf-blue: #5794f2;
  --gf-green: #73bf69;
  --gf-yellow: #f2cc0c;
  --gf-orange: #ff9830;
  --gf-purple: #b877d9;
  --gf-red: #f2495c;
}

#stats-app.gf {
  color: var(--gf-text);
  margin: 8px 0 32px;
  font-size: 14px;
}

#stats-app * { box-sizing: border-box; }

.gf-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--gf-panel);
  border: 1px solid var(--gf-border);
  border-radius: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gf-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.gf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gf-green); }
.gf-sep { width: 1px; height: 18px; background: var(--gf-border); }
.gf-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gf-dim);
  font-size: 12px;
}
.gf-select {
  position: relative;
}
.gf-select-btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 30px;
  min-width: 116px;
  padding: 0 10px;
  background: #0b0c0e url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e8e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--gf-border);
  border-radius: 4px;
  color: var(--gf-text);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.gf-select-btn:hover { border-color: #3d444b; background-color: #14171b; }
.gf-select.open .gf-select-btn,
.gf-select-btn:focus {
  outline: none;
  border-color: var(--gf-blue);
  box-shadow: 0 0 0 2px rgba(87, 148, 242, .18);
}
.gf-select-menu {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  z-index: 30;
  min-width: 100%;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #14171b;
  border: 1px solid var(--gf-border);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  display: none;
}
.gf-select.open .gf-select-menu { display: block; }
.gf-select-menu li {
  position: relative;
  padding: 7px 12px 7px 26px;
  border-radius: 4px;
  color: var(--gf-text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.gf-select-menu li:hover { background: #22262b; }
.gf-select-menu li.is-active::before {
  content: '✓';
  position: absolute;
  left: 9px;
  color: var(--gf-green);
}
.gf-spacer { flex: 1; }
.gf-build { color: var(--gf-dim); font-size: 12px; }

.gf-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.gf-kpi {
  background: var(--gf-panel);
  border: 1px solid var(--gf-border);
  border-radius: 8px;
  padding: 16px 18px;
}
.gf-kpi b { display: block; font-size: 28px; line-height: 1.25; font-weight: 600; white-space: nowrap; }
.gf-kpi span { color: var(--gf-dim); font-size: 12px; }

.gf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.gf-col-2 { grid-column: span 2; }
.gf-col-3 { grid-column: span 3; }

.gf-panel {
  background: var(--gf-panel);
  border: 1px solid var(--gf-border);
  border-radius: 8px;
  padding: 14px 18px 16px;
  min-width: 0;
}
.gf-panel header {
  color: var(--gf-text);
  font-size: 13px;
  font-weight: 600;
  /* 覆盖主题 .l_main header { margin: 2rem 1rem 1rem } */
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gf-hint { color: var(--gf-dim); font-weight: 400; }
.gf-body { height: 260px; }
#gf-cal { height: auto; overflow: auto; }
.gf-panel:has(#gf-cal) .gf-body { height: auto; }
.gf-table { height: auto; }
.gf-panel .gf-body { min-width: 0; }

.gf-up i { width: 6px; height: 6px; border-radius: 50%; background: var(--gf-green); display: inline-block; }


}

#stats-app table.gf-tbl {
  display: table;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: visible;
}
#stats-app .gf-table th,
#stats-app .gf-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gf-border);
  font-size: 12px;
  background: none;
}
#stats-app .gf-table th {
  color: var(--gf-dim);
  font-weight: 500;
  border-bottom-color: #363b40;
}
#stats-app .gf-table td.num { font-variant-numeric: tabular-nums; }
#stats-app .gf-table a { color: var(--gf-blue); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stats-app .gf-table a:hover { text-decoration: underline; }
#stats-app table.gf-tbl th:nth-child(1), #stats-app table.gf-tbl td:nth-child(1) { width: auto; }
#stats-app table.gf-tbl th:nth-child(2), #stats-app table.gf-tbl td:nth-child(2) { width: 46px; }
#stats-app table.gf-tbl th:nth-child(3), #stats-app table.gf-tbl td:nth-child(3) { width: 88px; }
#stats-app .gf-table .gf-kind,
#stats-app .gf-table .gf-date { color: var(--gf-dim); white-space: nowrap; }
#stats-app .gf-table .gf-words { width: 104px; white-space: nowrap; }
.gf-table { min-width: 0; overflow-x: auto; }
#stats-app .gf-table .num { font-variant-numeric: tabular-nums; }
.gf-bar {
  display: inline-block;
  vertical-align: middle;
  width: 40px;
  height: 5px;
  margin-left: 8px;
  background: #2a2f35;
  border-radius: 3px;
  overflow: hidden;
}
.gf-bar i { display: block; height: 100%; background: var(--gf-green); border-radius: 3px; }

.gf-cal-grid { display: flex; gap: 3px; }
.gf-cal-week { display: flex; flex-direction: column; gap: 3px; }
.gf-cal-cell { width: 11px; height: 11px; border-radius: 2px; background: #1f2329; }
.gf-cal-cell[data-l="1"] { background: #0e4429; }
.gf-cal-cell[data-l="2"] { background: #1f6f3f; }
.gf-cal-cell[data-l="3"] { background: #3aa356; }
.gf-cal-cell[data-l="4"] { background: var(--gf-green); }

@media (max-width: 900px) {
  .gf-grid { grid-template-columns: minmax(0, 1fr); }
  .gf-col-2, .gf-col-3 { grid-column: span 1; }
}

/* 统计页用更宽的正文列（主题默认 --width-main 约 800px） */
.l_body:has(#stats-app) {
  --width-main: 1120px;
}

@media (max-width: 900px) {
  #stats-app .gf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #stats-app .gf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
