/* 用量统计页面样式 - tokens.css */

/* 主要内容区域 */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: #f8f9fa;
}

/* 页面标题 */
.top-header {
  height: 77px;
  min-height: 77px;
  max-height: 77px;
  padding: 24px 24px 0 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #f0f0f0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  margin: 0;
}

/* 内容容器 */
.tokens-container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 提示信息 */
.tokens-notice {
  margin-bottom: 24px;
}

.notice-content {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #856404;
}

.notice-label {
  font-weight: 600;
  margin-right: 4px;
}

.notice-text {
  color: #856404;
}

/* 四大模型厂商网格 */
.tokens-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

/* 模型卡片 */
.token-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: 2px solid transparent;
  box-sizing: border-box;
}

.token-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.token-card.active {
  border-color: #20c997;
  padding: 18px;
}

.token-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 模型图标 */
.token-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 16px;
}

.hunyuan-icon {
  background: linear-gradient(135deg, #4a9eff, #00d4aa);
}

.hunyuan-icon::after {
  content: "H";
}

.deepseek-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.deepseek-icon::after {
  content: "D";
}

.moonshot-icon {
  background: linear-gradient(135deg, #ff6b6b, #feca57);
}

.moonshot-icon::after {
  content: "M";
}

.minimax-icon {
  background: linear-gradient(135deg, #ff9a9e, #fecfef);
}

.minimax-icon::after {
  content: "M";
}

.token-info {
  flex: 1;
}

.token-name {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
}

.token-balance {
  font-size: 24px;
  font-weight: 700;
  color: #495057;
}

/* 激活指示器 */
.token-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  border-radius: 0 0 12px 12px;
}

.token-indicator.active {
  background: #20c997;
}

/* 选项卡 */
.tokens-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #20c997;
  color: white;
}

/* --- 新版用量统计样式 --- */

.tokens-usage .page-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #6c757d;
}

.quota-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}

.quota-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.quota-meta {
  display: flex;
  flex-direction: column;
}

.quota-label {
  font-size: 14px;
  color: #6c757d;
}

.quota-total {
  font-size: 32px;
  font-weight: 700;
  color: #212529;
}

.quota-usage {
  display: flex;
  gap: 24px;
}

.quota-used, .quota-remaining {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.quota-used-label,
.quota-remaining-label {
  font-size: 13px;
  color: #6c757d;
  letter-spacing: 0.2px;
}

.quota-used-value,
.quota-remaining-value {
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.quota-empty {
  color: #dc3545;
}

.quota-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #f1f3f5;
  overflow: hidden;
  margin-bottom: 12px;
}

.quota-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4c6ef5, #845ef7);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.quota-hint {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #495057;
  margin: 0;
}

.quota-hint-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  color: #4c6ef5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.summary-title {
  font-size: 13px;
  color: #6c757d;
}

.summary-value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #212529;
  margin-top: 8px;
}

.summary-separator {
  margin: 0 4px;
  font-size: 18px;
  color: #adb5bd;
}

.summary-desc {
  font-size: 12px;
  color: #868e96;
  margin-top: 4px;
}

.usage-trend,
.usage-table-section,
.monthly-summary {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.section-description {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6c757d;
}

.section-link {
  font-size: 13px;
  color: #4c6ef5;
  text-decoration: none;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
}

.usage-table th,
.usage-table td {
  padding: 12px;
  text-align: left;
  font-size: 13px;
  color: #495057;
}

.usage-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #868e96;
  border-bottom: 1px solid #f1f3f5;
}

.usage-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.usage-table .text-right {
  text-align: right;
}

.usage-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(76, 110, 245, 0.1);
  color: #4c6ef5;
  font-weight: 500;
}

.usage-agent-link {
  color: #1c7ed6;
  text-decoration: none;
}

.usage-agent-link.muted {
  color: #adb5bd;
}

.model-info {
  display: flex;
  flex-direction: column;
}

.model-name {
  font-weight: 600;
  color: #212529;
}

.model-provider {
  font-size: 12px;
  color: #868e96;
}

.token-total {
  font-weight: 600;
  color: #212529;
}

.trend-placeholder {
  padding: 32px;
  border: 1px dashed #ced4da;
  border-radius: 12px;
  text-align: center;
  color: #868e96;
  font-size: 13px;
}

.trend-placeholder.is-empty {
  background: #f8f9fa;
}

.usage-trend-chart {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: end;
  height: 180px;
  padding: 12px 8px 0;
}

.usage-trend-bar {
  position: relative;
  width: 100%;
  min-width: 12px;
  background: linear-gradient(180deg, rgba(76, 110, 245, 0.8), rgba(132, 94, 247, 0.8));
  border-radius: 6px 6px 0 0;
  height: var(--bar-height, 0%);
  transition: height 0.3s ease;
}

.usage-trend-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.2);
}

.usage-trend-bar-label {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #868e96;
  white-space: nowrap;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.monthly-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
}

.monthly-label {
  font-size: 13px;
  color: #6c757d;
}

.monthly-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.pagination {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.tab-btn:hover:not(.active) {
  background: #e9ecef;
  color: #495057;
}

/* 细分模型区域 */
.models-section {
  margin-top: 32px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  margin: 0 0 16px 0;
  padding-left: 16px;
  position: relative;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: #20c997;
  border-radius: 2px;
}

/* 模型表格 */
.models-table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.models-table {
  width: 100%;
  border-collapse: collapse;
}

.models-table thead {
  background: #f8f9fa;
}

.models-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.models-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid #f1f3f4;
}

.models-table tbody tr:last-child td {
  border-bottom: none;
}

.models-table tbody tr:hover {
  background: #f8f9fa;
}

.model-name {
  color: #212529;
  font-weight: 500;
}

.tokens-consumed {
  color: #6c757d;
  text-align: right;
}

.model-name-header {
  width: 60%;
}

.tokens-consumed-header {
  width: 40%;
  text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tokens-container {
    padding: 16px;
  }
  
  .top-header {
    padding: 16px 16px 0 16px;
  }
  
  .tokens-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .token-card {
    padding: 16px;
  }
  
  .token-header {
    gap: 12px;
  }
  
  .token-icon {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .token-name {
    font-size: 14px;
  }
  
  .token-balance {
    font-size: 20px;
  }
  
  .models-table th,
  .models-table td {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .tokens-grid {
    grid-template-columns: 1fr;
  }
  
  .tokens-tabs {
    width: 100%;
    justify-content: center;
  }
  
  .tab-btn {
    flex: 1;
    text-align: center;
  }
}
