/* 统计分析页面（重制版）
   仅作用于 statistics.html，避免影响全站样式
*/

:root {
  --tat-bg: rgba(255, 255, 255, 0.98);
  --tat-border: rgba(102, 126, 234, 0.18);
  --tat-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  --tat-text: #1a1a1a;
  --tat-muted: #718096;
  --tat-card-radius: 16px;
  --tat-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tat-main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tat-hero {
  background: var(--tat-bg);
  border: 1px solid var(--tat-border);
  border-radius: var(--tat-card-radius);
  box-shadow: var(--tat-shadow);
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tat-hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tat-h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--tat-text);
  letter-spacing: 0.4px;
}

.tat-subtitle {
  color: var(--tat-muted);
  font-size: 0.95rem;
}

.tat-hero-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tat-btn {
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  background: var(--tat-accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(102, 126, 234, 0.35);
  white-space: nowrap;
}

.tat-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.tat-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.45);
}

.tat-panel {
  background: var(--tat-bg);
  border: 1px solid var(--tat-border);
  border-radius: var(--tat-card-radius);
  box-shadow: var(--tat-shadow);
  padding: 1rem 1.25rem;
}

.tat-controls-grid {
  display: grid;
  grid-template-columns: 180px 200px 220px 1fr;
  gap: 0.75rem 1rem;
  align-items: end;
}

.tat-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--tat-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tat-field select,
.tat-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  outline: none;
  font-size: 0.95rem;
  background: #fff;
}

.tat-field input::placeholder {
  color: rgba(113, 128, 150, 0.8);
}

.tat-hint {
  margin-top: 0.75rem;
  color: var(--tat-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tat-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.tat-kpi {
  background: var(--tat-bg);
  border: 1px solid var(--tat-border);
  border-radius: var(--tat-card-radius);
  box-shadow: var(--tat-shadow);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 86px;
}

.tat-kpi-label {
  color: var(--tat-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.tat-kpi-value {
  color: var(--tat-text);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.tat-kpi-sub {
  color: rgba(113, 128, 150, 0.95);
  font-size: 0.85rem;
}

.tat-grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
  align-items: start;
}

.tat-grid-2.equal {
  grid-template-columns: 1fr 1fr;
}

.tat-card {
  background: var(--tat-bg);
  border: 1px solid var(--tat-border);
  border-radius: var(--tat-card-radius);
  box-shadow: var(--tat-shadow);
  overflow: hidden;
}

.tat-card-header {
  background: var(--tat-accent);
  color: #fff;
  font-weight: 900;
  padding: 1rem 1.25rem;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tat-card-header small {
  font-weight: 700;
  opacity: 0.9;
}

.tat-card-body {
  padding: 1rem 1.25rem;
}

.tat-table-container {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
}

.tat-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.tat-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, #f8f9fa 0%, #eef2ff 100%);
  padding: 0.8rem 0.9rem;
  text-align: left;
  font-size: 0.9rem;
  color: #1a1a1a;
  font-weight: 800;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  white-space: nowrap;
}

.tat-table tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  color: #2d3748;
  font-size: 0.92rem;
  vertical-align: middle;
}

.tat-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.06);
}

.tat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.8);
}

.tat-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.07);
  overflow: hidden;
}

.tat-progress > div {
  height: 100%;
  border-radius: 999px;
  background: var(--tat-accent);
  width: 0%;
  transition: width 0.25s ease;
}

.tat-inline-muted {
  color: var(--tat-muted);
  font-weight: 700;
}

/* 适配现有号码圆球组件，缩小在表格里的显示 */
.tat-table .number-box-mini {
  width: 34px;
  height: 34px;
  border-width: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16), inset 0 1px 2px rgba(255,255,255,0.2);
}

.tat-table .number-box-value-mini {
  font-size: 0.95rem;
}

.tat-table .zodiac-mini {
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.tat-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--tat-muted);
  font-weight: 800;
}

.tat-error {
  text-align: center;
  padding: 2rem 1rem;
  color: #e53e3e;
  font-weight: 900;
}

.tat-chart-wrap canvas {
  max-height: 360px;
}

.tat-main-container .trends-container canvas {
  max-height: 420px;
}

@media (max-width: 1100px) {
  .tat-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tat-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tat-grid-2,
  .tat-grid-2.equal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .tat-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .tat-hero-actions {
    width: 100%;
  }
  .tat-btn {
    width: 100%;
  }
}


