/* ====================== 全局 ====================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b0f1a;
  --bg2: #131828;
  --card: #1a2035;
  --card2: #222944;
  --line: #2d3555;
  --text: #e6ebff;
  --text2: #9aa4c7;
  --muted: #6b7598;
  --primary: #4a7dff;
  --primary2: #6a9cff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --info: #909399;
  --gold: #f0c95e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0,0,0,0.4);
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #070b14 0%, #0d1426 50%, #10172a 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(74,125,255,0.15), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(240,201,94,0.08), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(103,194,58,0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ====================== 顶部 ====================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(26,32,53,0.95), rgba(34,41,68,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  font-size: 36px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(240,201,94,0.5);
}
.logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(90deg, #f0c95e, #4a7dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
.logo .sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}
.nav {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: 10px;
}
.nav-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
  font-weight: 500;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74,125,255,0.4);
}

.main { min-height: calc(100vh - 240px); }
.tab { display: none; }
.tab.active { display: block; }

/* ====================== 通用卡片 ====================== */
.card {
  background: linear-gradient(180deg, rgba(26,32,53,0.95), rgba(22,27,46,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-title h2 {
  font-size: 17px;
  font-weight: 600;
}
.card-title .tip {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
/* 分析模式切换器（结果卡顶部） */
.mode-switcher {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  font-size: 12px;
}
.mode-switcher .mode-btn {
  border: none;
  background: transparent;
  color: #9aa5c7;
  padding: 8px 14px;
  min-height: 36px;
  min-width: 96px;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mode-switcher .mode-btn:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.mode-switcher .mode-btn:active {
  transform: translateY(0);
  background: rgba(255,255,255,0.15);
}
.mode-switcher .mode-btn.active {
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.mode-switcher .mode-btn.mode-local.active {
  background: linear-gradient(135deg, #409EFF, #2178d9);
}
.mode-switcher .mode-btn.mode-ai.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.mode-switcher .mode-btn .mode-ic {
  font-size: 13px;
}
.mode-switcher .mode-loading {
  font-size: 12px;
  color: #f6ad55;
  padding: 0 8px;
  animation: blink 1s infinite;
}
.mode-switcher:has(.mode-btn:disabled) .mode-btn,
.mode-switcher.loading .mode-btn {
  opacity: 0.5;
  pointer-events: none;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.result-time {
  font-size: 12px;
  color: var(--muted);
}
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--primary), #7ab0ff);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(74,125,255,0.4);
}
.result-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-family: 'Consolas', monospace;
}

/* ====================== 上传区域 ====================== */
.upload-zone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all .25s;
  overflow: hidden;
}
.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(74,125,255,0.05);
}
.upload-zone.dragover {
  border-color: var(--success);
  background: rgba(103,194,58,0.08);
  transform: scale(1.005);
}
.upload-inner {
  text-align: center;
  padding: 40px;
  pointer-events: none;
}
.upload-icon {
  font-size: 56px;
  color: var(--primary);
  margin-bottom: 14px;
  animation: float 2.5s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.upload-txt1 { font-size: 16px; color: var(--text); font-weight: 500; margin-bottom: 6px; }
.upload-txt2 { font-size: 12px; color: var(--muted); }
.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0e18;
  display: none;
}
.preview-img.show { display: block; }

.upload-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* AI 分析开关样式 */
.ai-switch-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-left: 16px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  transition: all 0.3s;
}
.ai-switch-wrapper:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(102,126,234,0.5);
}
.ai-switch-wrapper input {
  display: none;
}
.ai-switch-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  margin-right: 10px;
  transition: background 0.3s;
}
.ai-switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.ai-switch-wrapper input:checked + .ai-switch-slider {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.ai-switch-wrapper input:checked + .ai-switch-slider::before {
  transform: translateX(16px);
}
.ai-switch-label {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  transition: color 0.3s;
}
.ai-switch-wrapper input:checked ~ .ai-switch-label {
  color: #764ba2;
}

/* ====================== 按钮 ====================== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7ab0ff);
  color: #fff;
  box-shadow: 0 4px 14px rgba(74,125,255,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(74,125,255,0.5);
}
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text2);
  border: 1px solid var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.btn-danger {
  background: linear-gradient(135deg, #f56c6c, #ff8787);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,108,108,0.35);
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-icon { font-size: 14px; }

/* ====================== 进度条 ====================== */
.progress-track {
  height: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 4px;
  transition: width .5s ease;
  box-shadow: 0 0 12px rgba(74,125,255,0.5);
}
.progress-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  transition: all .3s;
}
.progress-step .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.progress-step.active {
  color: var(--text);
  background: rgba(74,125,255,0.1);
}
.progress-step.active .dot {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 1s infinite;
}
.progress-step.done {
  color: var(--success);
}
.progress-step.done .dot {
  background: var(--success);
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.progress-log {
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text2);
  font-family: 'Consolas', monospace;
  min-height: 40px;
  white-space: pre-wrap;
}

/* ====================== 结果总览 ====================== */
.result-summary {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 24px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(74,125,255,0.05), rgba(240,201,94,0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
}
.avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.screenshot-thumb {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--line);
  background: rgba(0,0,0,0.3);
}
.screenshot-thumb[src=""], .screenshot-thumb:not([src]) {
  content: '';
  background: repeating-linear-gradient(45deg, #1a2035, #1a2035 10px, #222944 10px, #222944 20px);
}
.player-info .nickname {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.level-tag {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--gold), #d6a53b);
  color: #1a1a1a;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

/* 类型判定（大版·用户要求：账号类型标签显示大点）*/
.type-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.type-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 18px currentColor;
  flex-shrink: 0;
}
.type-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(64,158,255,0.22), rgba(64,158,255,0.08));
  border: 2px solid rgba(64,158,255,0.55);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  min-height: 48px;
}
.mode-badge {
  margin-left: 4px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 8px 18px !important;
  border-radius: 14px !important;
  background: rgba(255,184,0,0.15) !important;
  color: #ffcf5e !important;
  border: 1.5px solid rgba(255,184,0,0.5) !important;
}
.confidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text2);
}
.mini-bar {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  overflow: hidden;
}
.mini-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  border-radius: 4px;
  transition: width .8s ease;
}
.confidence-val {
  font-family: 'Consolas', monospace;
  font-weight: 700;
  color: var(--text);
  min-width: 45px;
  text-align: right;
}
.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.score-item {
  text-align: center;
  padding: 10px 6px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
}
.score-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.score-val {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Consolas', monospace;
}
.score-val.overall { color: var(--primary); }
.score-val.anomaly { color: var(--warning); }
.score-val.matched { color: var(--success); font-size: 16px; }

/* 雷达图 */
.summary-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ====================== 战绩数据网格 ====================== */
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 26px 0 14px 0;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  color: var(--text);
}
.section-title:first-child { margin-top: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ============ 用户配置表 9 项核心指标 ============ */
.core9-box {
  margin: 0 0 20px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(64,158,255,0.06), rgba(245,108,108,0.05));
  border: 1px solid rgba(64,158,255,0.25);
}
.core9-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  padding-left: 8px;
  border-left: 3px solid var(--gold);
}
.core9-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.core9-item {
  padding: 12px 14px;
  background: rgba(26,32,53,0.75);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all .2s;
}
.core9-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,184,0,0.35);
}
.core9-label {
  font-size: 12px;
  color: #8a94b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.core9-label [class*="w"] {
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(64,158,255,0.15);
  color: #4a7dff;
}
.core9-label .w22 { background: rgba(245,108,108,0.18); color: #f56c6c; } /* 最高权重红 */
.core9-label .w18 { background: rgba(255,120,80,0.15); color: #ff8a5c; }
.core9-label .w15 { background: rgba(255,184,0,0.15); color: #ffb800; }
.core9-label .w10 { background: rgba(64,158,255,0.15); color: #4a7dff; }
.core9-label .w7  { background: rgba(103,194,58,0.15); color: #67c23a; }
.core9-label .w3  { background: rgba(154,147,199,0.15); color: #8a94b8; }
.core9-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mini-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg,#f56c6c,#ff8a5c);
  color: #fff;
}
.core9-hint {
  font-size: 11px;
  color: #7b84a8;
  margin-top: 4px;
}
.stat-card {
  padding: 14px;
  background: linear-gradient(180deg, rgba(34,41,68,0.6), rgba(26,32,53,0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.stat-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Consolas', monospace;
  color: var(--text);
}
.stat-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 3px;
}
.stat-level-bar {
  height: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.stat-level-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  transition: width .8s ease;
}
.stat-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'Consolas', monospace;
}

/* ====================== 列表类 ====================== */
.reasons-list, .suggestions-list {
  list-style: none;
  padding: 0;
}
.reasons-list li, .suggestions-list li {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.suggestions-list li {
  border-left-color: var(--success);
}
.reasons-list li.inconsistency {
  border-left-color: var(--danger);
  background: rgba(245,108,108,0.08);
}

.ocr-toggle { margin: 22px 0 10px; }
.ocr-raw {
  background: #0a0e18;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
}
.ocr-raw pre {
  font-family: 'Consolas', monospace;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ====================== 历史记录 ====================== */
.history-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.history-list {
  display: grid;
  gap: 14px;
}
.history-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.history-item:hover {
  border-color: var(--primary);
}
.history-thumb {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--card2);
  border: 1px solid var(--line);
}
.history-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.history-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-nick {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.history-type {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.history-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.history-meta span strong { color: var(--text2); font-weight: 500; }
.history-actions-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.history-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.history-empty .big { font-size: 44px; margin-bottom: 10px; opacity: 0.6; }

/* ====================== 底部 ====================== */
.footer {
  margin-top: 30px;
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer p { margin-bottom: 6px; }
.footer .copy { margin-top: 8px; color: var(--muted); opacity: 0.7; }

/* ====================== 响应式 ====================== */
@media (max-width: 900px) {
  .app { padding: 14px; }
  .header { flex-direction: column; gap: 14px; align-items: flex-start; }
  .nav { align-self: stretch; justify-content: center; }
  .result-summary {
    grid-template-columns: 1fr;
  }
  .progress-info { grid-template-columns: repeat(2, 1fr); }
  .history-item { grid-template-columns: 80px 1fr; }
  .history-actions-col {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }
  .summary-right { min-height: 260px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .score-row { grid-template-columns: 1fr; }
}
