/* ═══════════════════════════════════════════════
 * 足球大球分析工具 — 样式表
 * 明亮主题 · 卡片式布局
 * ═══════════════════════════════════════════════ */

/* ── 基础重置 ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --primary: #1a56db;
  --primary-light: #dbeafe;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #ca8a04;
  --yellow-bg: #fef9c3;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.hidden {
  display: none !important;
}

/* ── 头部 ── */
.header {
  padding: 28px 0 20px;
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.header-title-area {
  text-align: center;
  flex: 1;
  min-width: 200px;
}

.title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── 输入区 ── */
.input-section {
  margin-bottom: 24px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

.match-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}

.match-input:focus {
  border-color: var(--primary);
}

.analyze-btn {
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.analyze-btn:hover {
  background: #1746c7;
}

.analyze-btn:active {
  transform: scale(0.97);
}

.analyze-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.input-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── 加载中 ── */
.loading-section {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ── 错误提示 ── */
.error-section {
  margin-bottom: 20px;
}

.error-box {
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.error-text {
  color: var(--red);
  font-size: 14px;
}

/* ── 比赛信息卡片 ── */
.match-info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.match-info-card .league-tag {
  display: inline-block;
  padding: 3px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.match-info-card .teams {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  min-width: 200px;
}

.match-info-card .vs {
  color: var(--text-secondary);
  margin: 0 8px;
}

.match-info-card .match-time {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── 机构对比 ── */
.company-comparison {
  margin-bottom: 16px;
}

.company-comparison.hidden {
  display: none !important;
}

.company-comparison-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.company-card {
  flex: 1;
  min-width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  text-align: center;
  border-top: 4px solid var(--border);
  transition: box-shadow 0.2s;
}

.company-card:hover {
  box-shadow: var(--shadow-lg);
}

.company-card.grade-a {
  border-top-color: var(--green);
}

.company-card.grade-b {
  border-top-color: var(--yellow);
}

.company-card.grade-c {
  border-top-color: var(--red);
}

.company-card.grade-d {
  border-top-color: var(--text-secondary);
}

.company-card-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.company-card-score {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.company-card-score .score-max {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.company-card-grade {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.company-card-grade.grade-a {
  background: var(--green-bg);
  color: var(--green);
}

.company-card-grade.grade-b {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.company-card-grade.grade-c {
  background: var(--red-bg);
  color: var(--red);
}

.company-card-grade.grade-d {
  background: #f3f4f6;
  color: var(--text-secondary);
}

.company-card-perspectives {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.company-card-perspectives .persp-icon {
  font-size: 14px;
  padding: 1px 6px;
  border-radius: 8px;
}

.company-card-perspectives .persp-icon.pass {
  background: var(--green-bg);
}

.company-card-perspectives .persp-icon.warning {
  background: var(--yellow-bg);
}

.company-card-perspectives .persp-icon.fail {
  background: var(--red-bg);
}

.company-card-perspectives .persp-icon.unknown {
  background: #f3f4f6;
  color: var(--text-secondary);
}

/* ── 总分横幅 ── */
.score-banner {
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.score-banner.grade-a {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}

.score-banner.grade-b {
  background: linear-gradient(135deg, #ca8a04, #eab308);
  color: #fff;
}

.score-banner.grade-c {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}

.score-banner .grade-label {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.score-banner .grade-value {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
}

.score-banner .total-score {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
}

.score-banner .grade-advice {
  font-size: 15px;
  margin-top: 8px;
  opacity: 0.95;
}

.score-banner .pass-status {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.25);
}

/* ── 警告 ── */
.warnings-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
}

.warnings-box .warning-item {
  font-size: 13px;
  color: #92400e;
  padding: 3px 0;
}

.warnings-box .warning-item::before {
  content: '⚠ ';
}

/* ── 区块标题 ── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

/* ── 三线卡片 ── */
.three-lines {
  margin-bottom: 8px;
}

.line-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--border);
}

.line-card.dir-big {
  border-left-color: var(--green);
}

.line-card.dir-small {
  border-left-color: var(--red);
}

.line-card.dir-neutral {
  border-left-color: var(--yellow);
}

.line-card.dir-unknown {
  border-left-color: var(--text-secondary);
}

.line-card .line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.line-card .line-name {
  font-size: 16px;
  font-weight: 700;
}

.line-card .line-direction {
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.line-direction.dir-big {
  background: var(--green-bg);
  color: var(--green);
}

.line-direction.dir-small {
  background: var(--red-bg);
  color: var(--red);
}

.line-direction.dir-neutral {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.line-direction.dir-unknown {
  background: #f3f4f6;
  color: var(--text-secondary);
}

.line-card .line-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.line-card .data-group {
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px 14px;
}

.line-card .data-group .data-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.line-card .data-group .data-values {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.line-card .data-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.line-card .data-item .item-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.line-card .data-item .item-value {
  font-size: 15px;
  font-weight: 700;
}

.line-card .line-reason {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 8px;
}

.line-card .line-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.line-card .line-score .score-label {
  color: var(--text-secondary);
}

.line-card .line-score .score-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

/* ── 评分明细 ── */
.score-breakdown {
  margin-bottom: 8px;
}

.breakdown-list {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-item .item-name {
  color: var(--text);
}

.breakdown-item .item-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.breakdown-item .item-score {
  font-weight: 700;
  color: var(--primary);
}

.breakdown-item.total {
  border-top: 2px solid var(--border);
  margin-top: 4px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 15px;
}

.breakdown-item.total .item-score {
  font-size: 18px;
}

/* ── 变化轨迹 ── */
.line-trajectory {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f0f7ff;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

.line-trajectory .trajectory-label {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.line-trajectory .trajectory-points {
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
}

.line-trajectory .trajectory-osc {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  background: #f3f4f6;
  white-space: nowrap;
}

.line-trend {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 12px;
  margin-bottom: 8px;
  font-style: italic;
}

/* ── 出手逻辑链 ── */
.logic-chain-section {
  margin-bottom: 20px;
}

.logic-chain-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.logic-chain-box .chain-step {
  display: inline;
}

/* ── 底部 ── */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.footer .disclaimer {
  font-size: 14px;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 6px;
}

.footer .tech-info {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── D档横幅 ── */
.score-banner.grade-d {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  color: #fff;
}

/* ── 四视角评分 ── */
.perspective-section {
  margin-bottom: 16px;
}

.perspective-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.perspective-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  border-top: 4px solid var(--border);
  transition: box-shadow 0.2s;
}

.perspective-card:hover {
  box-shadow: var(--shadow-lg);
}

.perspective-card.pass {
  border-top-color: var(--green);
}

.perspective-card.warning {
  border-top-color: var(--yellow);
}

.perspective-card.fail {
  border-top-color: var(--red);
}

.perspective-card .perspective-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.perspective-card .perspective-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.perspective-card .perspective-status {
  font-size: 16px;
}

.perspective-card .perspective-title {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
  min-height: 34px;
}

.perspective-card .perspective-score {
  margin-bottom: 8px;
}

.perspective-card .score-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.perspective-card .score-max {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.perspective-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.perspective-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.perspective-card.pass .perspective-bar-fill {
  background: var(--green);
}

.perspective-card.warning .perspective-bar-fill {
  background: var(--yellow);
}

.perspective-card.fail .perspective-bar-fill {
  background: var(--red);
}

/* ── 形态惩罚 ── */
.penalty-section {
  margin-bottom: 16px;
}

.penalty-list {
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 14px 20px;
}

.penalty-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(220, 38, 38, 0.1);
  font-size: 13px;
}

.penalty-item:last-of-type {
  border-bottom: none;
}

.penalty-item .penalty-condition {
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.penalty-item .penalty-reason {
  color: #991b1b;
  flex: 1;
}

.penalty-item .penalty-score {
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.penalty-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid rgba(220, 38, 38, 0.2);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  text-align: right;
}

/* ── 信号强度 ── */
.line-signal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0f7ff;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

.line-signal .signal-label {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.line-signal .signal-strength {
  font-size: 14px;
  font-weight: 700;
}

.line-signal .signal-reason {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ── 评分明细（四视角） ── */
.breakdown-item.perspective-header {
  background: #f9fafb;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
  font-weight: 700;
}

.breakdown-item.perspective-header:first-child {
  margin-top: 0;
}

.breakdown-item.perspective-header .item-name {
  font-size: 14px;
  font-weight: 700;
}

.breakdown-item.perspective-header .item-score {
  font-size: 15px;
  font-weight: 800;
}

.breakdown-item.sub-item {
  padding: 5px 12px 5px 28px;
  font-size: 13px;
  color: var(--text-secondary);
}

.breakdown-item.sub-item .item-name {
  font-weight: 500;
}

.breakdown-item.sub-item .item-score {
  font-weight: 600;
  color: var(--primary);
}

.breakdown-item.penalty-row {
  padding: 6px 12px;
  background: var(--red-bg);
  border-radius: 4px;
  margin-top: 4px;
}

.breakdown-item.penalty-row .item-name {
  color: var(--red);
  font-weight: 600;
}

/* ── 响应式 ── */
@media (max-width: 600px) {
  .input-wrapper {
    flex-direction: column;
  }

  .analyze-btn {
    width: 100%;
  }

  .match-info-card {
    flex-direction: column;
    text-align: center;
  }

  .match-info-card .teams {
    font-size: 16px;
  }

  .score-banner .grade-value {
    font-size: 36px;
  }

  .line-card .line-data {
    grid-template-columns: 1fr;
  }

  .company-comparison-grid {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════
 * 完赛批量查询样式
 * ═══════════════════════════════════════════════ */

/* ── 导航栏 ── */
.nav-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.nav-tab {
  padding: 10px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -2px;
}

.nav-tab:hover {
  color: var(--primary);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── 返回按钮 ── */
.back-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.back-btn:hover {
  background: #d1d5db;
}

/* ── 批量控制区 ── */
.batch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.batch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.batch-date-input {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.batch-date-input:focus {
  border-color: var(--primary);
}

.batch-btn {
  padding: 10px 24px;
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.batch-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.batch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.batch-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.batch-btn.primary:hover:not(:disabled) {
  background: #1746c7;
  color: #fff;
}

/* ── 批量统计 ── */
.batch-stats {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 10px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.batch-stats strong {
  color: var(--primary);
  font-weight: 700;
}

.batch-error {
  color: var(--red);
  font-weight: 600;
}

/* ── 批量操作区 ── */
.batch-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* ── 进度条 ── */
.batch-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-bar {
  flex: 1;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 12px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── 比赛列表表格 ── */
.match-table-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.match-table th {
  background: var(--text);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.match-table th:first-child {
  border-top-left-radius: var(--radius);
}

.match-table th:last-child {
  border-top-right-radius: var(--radius);
}

.match-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.match-table tr.match-row {
  cursor: pointer;
  transition: background 0.15s;
}

.match-table tr.match-row:hover {
  background: #f0f7ff;
}

.match-table .score-cell {
  font-weight: 700;
  text-align: center;
  color: var(--primary);
}

.match-table .half-cell {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.match-table .time-cell {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.match-table .league-cell {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.match-table .empty-row td {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 14px;
}

/* ── 评分档位列 ── */
.grade-cell {
  text-align: center;
  white-space: nowrap;
}

.grade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.grade-badge-A {
  background: var(--green-bg);
  color: var(--green);
}

.grade-badge-B {
  background: var(--blue-bg);
  color: var(--blue);
}

.grade-badge-C {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.grade-badge-D {
  background: #f3f4f6;
  color: var(--text-secondary);
}

.grade-loading {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 12px;
}

.grade-loading::after {
  content: '...';
  animation: grade-loading-dots 1s infinite;
}

@keyframes grade-loading-dots {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.grade-failed {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--red-bg);
  color: var(--red);
}

.grade-blocked {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #fff3cd;
  color: #856404;
}

/* ── 批量视图响应式 ── */
@media (max-width: 600px) {
  .batch-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .batch-btn {
    width: 100%;
  }

  .match-table {
    font-size: 12px;
  }

  .match-table th,
  .match-table td {
    padding: 8px 8px;
  }
}

/* ═══════════════════════════════════════════════
 * 缓存相关样式（T02/T03）
 * ═══════════════════════════════════════════════ */

/* ── 重试按钮 ── */
.retry-btn {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 3px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
}

.retry-btn:hover {
  background: var(--primary);
  color: #fff;
}

.retry-btn:disabled {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── 缓存标签 ── */
.cache-tag {
  display: inline-block;
  padding: 1px 4px;
  font-size: 10px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 2px;
  margin-left: 2px;
}

/* ── 缓存时间 ── */
.cache-time {
  display: inline-block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-left: 2px;
  cursor: help;
  vertical-align: middle;
}

/* ── 查看按钮 ── */
.view-btn {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 3px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
  vertical-align: middle;
}

.view-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ── 重试行禁止点击 ── */
.match-row.retrying {
  pointer-events: none;
  opacity: 0.7;
}

/* ── 缓存提示条（单场分析）── */
.cache-notice {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 8px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text);
}

/* ── 机构切换栏 ── */
.company-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.company-switcher.hidden { display: none; }
.company-tab {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.company-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.company-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.company-tab .tab-grade {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

/* ── 保存到缓存按钮 ── */
.save-cache-btn {
  background: var(--green);
  color: #fff;
  border: none;
}

.save-cache-btn:hover:not(:disabled) {
  background: #138a3e;
  color: #fff;
}

.save-cache-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── 导出Excel按钮 ── */
.export-btn {
  background: var(--blue);
  color: #fff;
  border: none;
}

.export-btn:hover:not(:disabled) {
  background: #1d4ed8;
  color: #fff;
}

.export-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
 * 登录页样式
 * ═══════════════════════════════════════════════ */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 18px;
}

.login-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: var(--primary);
}

.login-error {
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover:not(:disabled) {
  background: #1746c7;
}

.login-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
 * 用户信息栏样式
 * ═══════════════════════════════════════════════ */

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 14px;
  white-space: nowrap;
}

.user-icon {
  font-size: 16px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-action-btn {
  padding: 6px 14px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.user-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.user-action-btn.logout-btn {
  color: var(--red);
  border-color: var(--red);
}

.user-action-btn.logout-btn:hover {
  background: var(--red);
  color: #fff;
}

/* ═══════════════════════════════════════════════
 * 账号管理模态框样式
 * ═══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  padding: 20px 24px;
}

.auth-section {
  margin-bottom: 24px;
}

.auth-section:last-child {
  margin-bottom: 0;
}

.auth-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.auth-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.auth-table th {
  background: var(--text);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

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

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

.auth-delete-btn {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--red);
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.auth-delete-btn:hover {
  background: var(--red);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-input {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-submit-btn {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.auth-submit-btn:hover {
  background: #1746c7;
}

.auth-msg {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
}

.auth-msg.hidden {
  display: none;
}

/* ── 登录页/用户栏/模态框响应式 ── */
@media (max-width: 600px) {
  .header-row {
    flex-direction: column;
    align-items: center;
  }

  .header-title-area {
    text-align: center;
  }

  .user-bar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .auth-form-row {
    flex-direction: column;
  }

  .auth-input {
    min-width: 100%;
  }

  .auth-submit-btn {
    width: 100%;
  }
}
