/* @ty.aicoding@ */

/* ==================== 颜色变量 ==================== */
:root {
  --brand: #c8102e;
  --brand-dark: #9b0c23;
  --accent: #1a3a6c;
  --gold: #d4af37;
}

/* ==================== 基础 ==================== */
* { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: linear-gradient(180deg, #f5f7fa 0%, #eef1f6 100%);
  overscroll-behavior: none;
}

/* ==================== 页面切换 ==================== */
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 顶部导航 ==================== */
.header-gradient {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 60%, var(--accent) 100%);
}
.glass-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.6);
}

/* ==================== 排名区配色 ==================== */
.rank-top { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-playoff { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.rank-relegation { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }

/* ==================== 列表行 ==================== */
.rank-row { transition: background .2s; cursor: pointer; }
.rank-row:active { background: rgba(200,16,46,0.05); }

/* ==================== 底部Tab ==================== */
.tab-btn.active { color: var(--brand); }
.tab-btn.active .tab-icon { transform: scale(1.1); }
.tab-indicator {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: var(--brand); border-radius: 2px;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
}

/* ==================== 球队色点 ==================== */
.team-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ==================== 球队下拉 ==================== */
.team-selector {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c8102e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}

/* ==================== 主客场标识 ==================== */
.home-tag { background: rgba(200,16,46,.1); color: var(--brand); }
.away-tag { background: rgba(26,58,108,.1); color: var(--accent); }

/* ==================== 身份选择卡片 ==================== */
.identity-card {
  background: var(--card-bg, #f3f4f6);
  border: 2px solid transparent;
  border-radius: 1rem;
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.identity-card:hover { transform: translateY(-2px); }
.identity-card:active { transform: scale(0.96); }
.identity-card-emoji { font-size: 1.75rem; margin-bottom: 0.25rem; }
.identity-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--card-color, #374151);
}

/* ==================== 预测按钮 ==================== */
.predict-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  transition: all .15s;
  cursor: pointer;
}
.predict-btn:active { transform: scale(0.95); }
.predict-btn.active {
  background: linear-gradient(135deg, #c8102e, #9b0c23);
  color: #fff;
  border-color: #c8102e;
}
.predict-btn.disabled { opacity: 0.4; pointer-events: none; }

.predict-tag-others {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #6b7280;
  margin-right: 2px;
}

/* ==================== 弹层显示控制 ==================== */
#identityModal { display: none; }
#identityModal.active { display: flex; }
.hidden { display: none !important; }

/* ==================== 同步错误横幅（v2.2 新增）====================
   默认隐藏，app.js 检测到 error 时给 .error-banner 添加 .active
   @ty.aicoding@
==================== */
.error-banner {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  color: #78350f;
  font-size: 12px;
  line-height: 1.5;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(245,158,11,0.15);
}
.error-banner.active { display: flex; }
.error-banner-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.error-banner-body {
  flex: 1;
  min-width: 0;
}
.error-banner-title {
  font-weight: 700;
  font-size: 13px;
  color: #7c2d12;
  margin-bottom: 2px;
}
.error-banner-msg {
  font-weight: 500;
  word-break: break-all;
}
.error-banner-suggestion {
  margin-top: 4px;
  color: #92400e;
  font-size: 11px;
}
.error-banner-time {
  margin-top: 2px;
  color: #a16207;
  font-size: 10px;
}
.error-banner-close {
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #78350f;
  padding: 0 4px;
  flex-shrink: 0;
  user-select: none;
}
.error-banner-close:hover { color: #7c2d12; }

/* ==================== 滚动 ==================== */
.scroll-area {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-area::-webkit-scrollbar { display: none; }