/* VPS Context Styles - Added by范雍 */

/* 修复未定义的变量 */
:root {
  --accent-primary: #ff9500;  /* 太阳橙 - 主品牌色 */
  --accent-red: #ef4444;     /* 错误红 */
}

.vps-context-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.token-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.token-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.token-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.token-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.token-by-agent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-agent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.token-agent-name {
  font-weight: 500;
}

.token-agent-tokens {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.workspace-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.workspace-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 13px;
}

.workspace-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-file-size {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* VPS Health Status */
.vps-health-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.health-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: center;
}

.health-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.health-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.health-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 20px;
  font-size: 12px;
}

.health-indicator.warning {
  background: rgba(255, 149, 0, 0.1);
}

.health-indicator.error {
  background: rgba(255, 59, 48, 0.1);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.health-dot.warning {
  background: var(--accent-orange);
}

.health-dot.error {
  background: var(--accent-red);
}

.health-text {
  color: var(--accent-green);
}

.health-text.warning {
  color: var(--accent-orange);
}

.health-text.error {
  color: var(--accent-red);
}

/* Accuracy Leaderboard */
.accuracy-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.accuracy-overall, .accuracy-predictions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.accuracy-label {
  font-size: 12px;
  color: var(--text-muted);
}

.accuracy-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-green);
  font-family: var(--font-mono);
}

.accuracy-predictions .accuracy-value {
  color: var(--accent-purple);
}

.accuracy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accuracy-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.accuracy-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.accuracy-rank.gold {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #000;
}

.accuracy-rank.silver {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #000;
}

.accuracy-rank.bronze {
  background: linear-gradient(135deg, #cd7f32, #b06020);
  color: #fff;
}

.accuracy-agent {
  flex: 1;
  font-weight: 500;
}

.accuracy-agent-name {
  font-weight: 600;
}

.accuracy-agent-role {
  font-size: 11px;
  color: var(--text-muted);
}

.accuracy-percent {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.accuracy-count {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Shipping Log */
.shipped-count {
  margin-left: auto;
  padding: 4px 10px;
  background: var(--accent-green);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.shipping-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.shipping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--accent-green);
}

.shipping-icon {
  font-size: 20px;
}

.shipping-info {
  flex: 1;
}

.shipping-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.shipping-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.shipping-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Ledger */
.ledger-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.ledger-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.ledger-stat-icon {
  font-size: 24px;
}

.ledger-stat-info {
  display: flex;
  flex-direction: column;
}

.ledger-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.ledger-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.ledger-table-container {
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ledger-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}

.ledger-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.ledger-table tr:hover td {
  background: var(--bg-secondary);
}

.ledger-table .loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

/* Card Header Styles (for new sections) */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-icon {
  font-size: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-content {
  color: var(--text-secondary);
}

/* New Sections Grid */
.new-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .vps-health-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .ledger-stats {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .ledger-stat {
    flex: 1;
    min-width: 120px;
  }
  
  .ledger-table {
    font-size: 12px;
  }
  
  .ledger-table th,
  .ledger-table td {
    padding: 8px 6px;
  }
  
  .new-sections-grid {
    grid-template-columns: 1fr;
  }
  
  .new-sections-grid .card {
    grid-column: span 1 !important;
  }
}
