:root{
  --bg: #0d0f11;
  --panel: #1a1e22;
  --panel-2: #21262b;
  --border: #2d3439;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --green: #00e676;
  --red: #ff3b3b;
}

*{ box-sizing: border-box; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-width: 1400px;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header{
  background: #000;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

/* Layout */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* 必须保留下面这几行 */
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 15px;
    padding: 15px 0;
    flex: 1;
}

/* Cards / sections */
.sidebar-section{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.section-title{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #00e676;
  margin-bottom: 14px;
}

/* =========================
   NEW: Left Sidebar Items (修复补充)
   ========================= */
[data-action="filter-league"] {
  transition: all 0.15s ease-in-out;
  border-left: 2px solid transparent;
}

[data-action="filter-league"]:hover {
  background-color: #252b31;
}

/* 选中高亮状态 */
[data-action="filter-league"].bg-\[\#252b31\] {
  border-left-color: var(--green);
}

#countries-list img, #pinned-leagues img {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

#pinned-leagues li {
  transition: background 0.2s;
}

/* =========================
   Main card & Tabs
   ========================= */
.main-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.tabs-nav{
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 18px;
  padding: 0 15px;
  height: 50px;
  align-items: center;
}

.tab-btn{
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 11px;
  color: #7b8794;
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  position: relative;
  padding: 0 2px;
}

.tab-btn.active{
  color: var(--green);
}

.tab-btn.active::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--green);
}

/* Date row */
.date-row{
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-btn{
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
}
.date-btn:hover{ background: #2d3439; color: #e5e7eb; }

.date-strip{
  display: flex;
  gap: 18px;
  justify-content: center;
  flex: 1;
}

.date-chip{
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.date-chip .d1{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #6b7280;
}
.date-chip .d2{
  font-size: 9px;
  font-weight: 700;
  opacity: .7;
  letter-spacing: .12em;
  color: #6b7280;
  text-transform: uppercase;
}
.date-chip.active .d1,
.date-chip.active .d2{
  color: var(--green);
}

/* Fixtures */
.loading-placeholder {
  padding: 80px 20px;
  text-align: center;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.league-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  opacity: .95;
}

.league-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

/* 1. 比赛行基础容器 */
.match-row {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 10px 15px;
  gap: 0;
  transition: background 0.2s;
  position: relative;
  cursor: pointer;
  border-left: 3px solid transparent; /* 增加这一行，防止边框出现时内容闪动 */
}

.match-row:hover {
  background: #21262b;
}

/* 放置在这里：激活行的样式 */
.match-row.is-active {
    background: #252b31;
    border-left: 3px solid var(--green) !important; /* 使用绿色标记正在查看的比赛 */
    padding-left: 12px; /* 稍微缩进以补偿 border 宽度，保持内容对齐 */
}

/* 如果该行本来就是 LIVE，为了避免颜色冲突，可以做如下微调 */
.match-row.is-active:has(.live-time) {
    border-left-color: var(--green); /* 强制覆盖直播的红色边框 */
}

/* 2. 左侧组：时间 + 球队 */
.match-left-group {
  display: flex;
  align-items: center;
  flex: 1; 
  gap: 15px;
}

.match-left-group .status-cell {
  width: 45px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.teams-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-line .team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.team-line .team-name {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

/* 3. 中间组：比分 + 垂直线条 */
.score-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scores-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 25px;
  text-align: right;
}

.team-score {
  font-family: 'Inter', sans-serif;
  font-weight: 550;
  font-size: 13px;
  color: #fff;
  line-height: 1.4;
}

.vertical-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 5px;
}

/* 4. 右侧组：功能按钮 + 星星 */
.match-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-left: 10px;
  z-index: 5;
}

/* 按钮基础样式 */
.live-btn, .odds-btn {
  height: 22px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #3a3f45;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease; /* 增加平滑过渡效果 */
  cursor: pointer;           /* 确保鼠标变成手型 */
}

/* --- LIVE 按钮激活状态 (正在直播) --- */
.live-btn.active {
  color: #fff;
  border-color: #ff4d4f;
  background: #be0e11; /* 初始状态给一个实色或明显的浅色 */
}

/* 新增：LIVE 按钮悬停效果 */
.live-btn.active:hover {
  background: #ff7875;     /* 悬停时颜色变浅变亮 */
  border-color: #ff7875;
  box-shadow: 0 0 10px rgba(255, 77, 79, 0.4); /* 增加发光感 */
  transform: translateY(-1px); /* 轻微上浮感 */
}

/* --- LIVE 按钮非激活状态 --- */
.live-btn.inactive {
  color: #4b5563;
  border-color: #3a3f45;
  background: transparent;
}

.live-btn.inactive:hover {
  background: #2d3439;     /* 灰色按钮悬停时背景加深 */
  color: #e2e8f0;
}

/* ODDS 按钮悬停保持你原来的效果 */
.odds-btn:hover {
  border-color: #00e676;
  color: #00e676;
  background: rgba(0, 230, 118, 0.05);
}

/* 星星移至最末尾 */
.star-btn {
  cursor: pointer;
  font-size: 15px;
  color: #4b5563;
  padding: 0 5px;
  transition: all 0.2s;
}

.star-btn:hover { color: #cbd5e1; }
.star-btn.on { color: #fbbf24 !important; }

/* 🔴 LIVE 状态效果 */
.live-time { color: #ff3b3b; font-weight: 800; }

.live-dot {
  width: 6px;
  height: 6px;
  background: #ff3b3b;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255,59,59,.55); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255,59,59,0); }
  100% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(255,59,59,0); }
}

.match-row:has(.live-time) {
  border-left: 2px solid #ff3b3b;
  padding-left: 12px;
}

/* Right: Featured live */
.featured-header{
  background: #64031b;
  color: #fff;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.featured-nav{ color: rgba(255,255,255,.9); cursor: pointer; }
.featured-nav:hover{ color: #000; }

.featured-body{
  padding: 16px;
  background: #000;
  color: #fff;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* News */
.news-header{
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.news-link{
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
}
.news-link:hover{ text-decoration: underline; }

.news-item{
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  border-left: 2px solid transparent;
}
.news-item:hover{
  background: #252b31;
  border-left-color: var(--green);
}
.news-title{
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 6px;
}
.news-meta{
  display: flex;
  gap: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #6b7280;
}
.news-meta .tag{ color: var(--green); }

/* Footer */
.site-footer{
  background: #000;
  border-top: 1px solid var(--border);
  padding: 40px 0 18px;
  margin-top: 40px;
}
.footer-content{
  width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
}
.footer-title{
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .2em;
}
.footer-link{
  display: block;
  font-size: 11px;
  color: #9aa6b2;
  margin-bottom: 12px;
}
.footer-link:hover{ color: var(--green); }

.footer-safe{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.footer-bottom{
  width: 1400px;
  margin: 18px auto 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  text-align: center;
  color: #3f4a54;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .3em;
}

/* =========================
   Date Picker – FINAL TUNING
   ========================= */
input[type="date"] {
  position: relative;
  top: -3px; 
  width: 115px;
  height: 32px;
  background-color: #0f1724;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 6px 10px 6px 10px;
  font-size: 13px;
  line-height: 1;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.9;
  width: 16px;
  height: 18px;
  margin-right: 0px;
  filter: invert(1);
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* ===================================================
   LEFT SIDEBAR - COMPETITIONS & PINNED STYLES
   =================================================== */

/* 1. 列表基础样式 */
#top-competitions, #all-competitions, #pinned-leagues, #countries-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 2. 联赛项布局：仿照图3效果 */
[data-action="filter-league"] {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 2px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* 鼠标悬停及选中状态 */
[data-action="filter-league"]:hover {
    background-color: #252b31;
}

[data-action="filter-league"].active, 
[data-action="filter-league"][style*="background"] { /* 兼容JS直接改背景的情况 */
    background-color: #252b31 !important;
}

/* ===== League Logo: Circle / Badge (Always Color) ===== */
[data-action="filter-league"] img {
    width: 32px;
    height: 32px;
    object-fit: contain;

    background: #ffffff;
    padding: 5px;
    border-radius: 50%;

    box-shadow:
      0 1px 3px rgba(0,0,0,0.25),
      inset 0 0 0 1px rgba(0,0,0,0.08);

    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

/* 4. 文字布局：联赛名+国家名 */
.flex-col {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    overflow: hidden;
}

.text-gray-200 { /* 联赛名 */
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.text-gray-500 { /* 国家名 */
    color: #64748b;
    font-size: 10px;
    margin-top: 2px;
}

/* 悬停时联赛名变绿 (仿照主流UI) */
[data-action="filter-league"]:hover .text-gray-200 {
    color: #00e676;
}

/* 5. 折叠箭头旋转 */
#comp-chevron {
    transition: transform 0.3s ease;
    color: #64748b;
}

/* 6. Pinned League 专属样式 (带图钉图标) */
#pinned-leagues li i {
    font-size: 10px;
    color: #00e676;
    margin-right: 8px;
}

/* 7. 隐藏列表的过渡 */
.hidden {
    display: none !important;
}

/* 自定义左侧滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #3f474e;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #00e676;
}

/* 强制 Header 内部所有元素垂直居中 */
.site-header .flex {
    display: flex;
    align-items: center; /* 关键：解决偏高问题 */
}

/* 统一导航链接的样式 */
.site-header nav {
    display: flex;
    align-items: center;
    gap: 32px;      /* 统一 Football 和 News 之间的间距 */
    margin-left: 40px; /* 增加 LOGO 和文字之间的间距，解决太靠左 */
    height: 100%; /* 确保导航栏占满 Header 高度 */
}

.site-header nav a {
    font-size: 13px;       /* 统一字体大小 */
    font-weight: 700;      /* 统一粗细 */
    text-transform: uppercase;
    letter-spacing: 1px;   /* 增加字间距，看起来更高级 */
    line-height: 1;        /* 消除行高导致的偏移 */
    display: flex;
    align-items: center;   /* 确保文字在 A 标签内部也居中 */
    height: 100%; /* 关键：让点击区域占满高度，且文字垂直居中 */
    transition: color 0.2s; /* 增加平滑过渡 */
}

/* 针对 FOOTBALL 的特殊绿色 */
.site-header nav a:first-child {
    color: #00e676;
}

/* 针对 NEWS 的灰色 */
.site-header nav a:last-child {
    color: #64748b;
}

/* ===================================================
   FIX: RIGHT SIDEBAR FEATURED LIVE (RED BOX AREA)
   =================================================== */

/* 1. 强制右侧比分为白色 */
.featured-body .score, 
.featured-body .score.live,
#live-carousel-content .score {
    color: #ffffff !important; 
    font-size: 24px !important;  /* 调大比分数字 */
    font-weight: 800;
}

/* 2. 调大右侧直播时间 (40' LIVE) */
.featured-body .status-cell,
#live-carousel-content .status-cell {
    font-size: 16px !important;  /* 调大时间 */
    font-weight: 700;
    color: #ff3b3b !important;   /* 确保 LIVE 时间是醒目的红色 */
    display: flex;
    flex-direction: column;      /* 让时间在比分下方居中显示 */
    align-items: center;
    margin-top: 10px;
}

/* 3. 如果想让右边球队名字也大一点 */
.featured-body .team-name {
    font-size: 14px;
    font-weight: 600;
}

.chart-btn:hover {
  color: var(--green);
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.08);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

/* Modal Box */
.modal-content {
    background: #1a1e22;
    width: 600px; max-height: 85vh;
    border-radius: 12px; border: 1px solid #2d3439;
    position: relative; overflow-y: auto;
    padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.close-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: #6b7280;
    font-size: 24px; cursor: pointer; z-index: 10;
}

/* 弹窗内部：比分头部 */
.modal-header-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-2);
}
.modal-header-box .team { flex-direction: column; gap: 8px; }
.modal-header-box .team-logo { width: 50px; height: 50px; }
.modal-header-box .score-big { font-size: 32px; font-weight: 800; color: #fff; }

/* 统计数据布局 */
.stats-container {
    padding: 10px 5px;
}

.stat-item {
    margin-bottom: 20px;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #cbd5e1;
    white-space: nowrap; /* 强制不换行 */
}

/* 弹窗动画 */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 背景遮罩层加一点磨砂玻璃感 */
.modal-overlay {
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ===================================================
   SIDEBAR MATCH DETAIL PANEL OPTIMIZATION (窄屏优化)
   =================================================== */

/* 1. 容器内部排版 */
#right-panel-body {
    padding: 15px;
    background: #1a1e22;
}

/* 2. 比分头部：在 300px 宽度下垂直排列或紧凑排列 */
#right-panel-body .modal-header-box {
    flex-direction: row; 
    justify-content: space-between;
    padding: 10px 0 20px 0;
    border-bottom: 1px solid #2d3439;
}

#right-panel-body .team {
    flex: 1;
    flex-direction: column !important; /* Logo 在上，名字在下 */
    gap: 5px;
    text-align: center;
}

#right-panel-body .team-logo {
    width: 32px !important; /* 缩小 Logo */
    height: 32px !important;
}

#right-panel-body .team-name {
    font-size: 11px !important;
    max-width: 80px;
    text-align: center;
    white-space: normal; /* 允许换行 */
    line-height: 1.2;
}

#right-panel-body .score-big {
    font-size: 24px !important; /* 缩小比分数字 */
    margin: 0 10px;
    color: var(--green);
}

/* 3. Tab 切换按钮缩小 */
#right-panel-body .modal-tabs {
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

#right-panel-body .modal-tab-item {
    font-size: 10px;
    letter-spacing: 1px;
}

/* 4. 统计条微调：让它更细，适合侧边栏 */
#right-panel-body .stat-item {
    margin-bottom: 15px;
}

#right-panel-body .stat-info {
    font-size: 10px;
    margin-bottom: 4px;
}


/* 5. 事件列表（Summary）紧凑化 */
#right-panel-body .event-row {
    grid-template-columns: 30px 1fr 25px; /* 侧边栏不需要左右对称，单列显示更好 */
    padding: 8px 0;
    font-size: 11px;
}

#right-panel-body .event-detail {
    font-size: 11px;
}

/* 隐藏在侧边栏不需要的列（如果是双边布局的话） */
#right-panel-body .event-row > div:nth-child(4) {
    display: none; 
}

/* --- Match Detail Panel (Right Sidebar) --- */
.detail-panel {
    margin-top: 1rem;
    background: #1a1e22;
    border: 1px solid #2d3439;
    border-radius: 8px;
    overflow: hidden;
}


.detail-header {
    background: #252b31;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.detail-title {
    font-size: 11px;
    color: #00e676;
    font-weight: bold;
    text-transform: uppercase;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* Tabs in Detail Panel */
.modal-tabs {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 10px;
    border-bottom: 1px solid #2d3439;
    scrollbar-width: none; /* Firefox */
}
.modal-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.modal-tab-item {
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
    padding-bottom: 5px;
    transition: color 0.2s;
}

.modal-tab-item.active {
    color: #00e676;
    border-bottom: 2px solid #00e676;
}

/* Stats Style */
.stats-container { padding: 10px 5px; }
.stat-item { margin-bottom: 15px; }
.stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 6px;
    color: #cbd5e1;
}


/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    color: var(--muted);
    font-size: 12px;
}

  .spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--green);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#match-detail-panel {
    width: 100%;
    box-sizing: border-box;
}

.detail-panel.hidden {
    display: none !important;
}

/* 右侧 aside 变成滚动容器 */
.app-container > aside:last-child {
  display: flex;
  flex-direction: column;
}

/* Detail panel 吸附在 Featured Live 下方 */
#match-detail-panel {
  position: sticky;
  top: 80px;
}


/* ===== Summary: 2-column align + center line ===== */
.events-container.events-2col{
  position: relative;
}

.events-container.events-2col::before{
  content:"";
  position:absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.08);
  transform: translateX(-0.5px);
}

.events-container.events-2col .event-row{
  display: grid;
  grid-template-columns: 44px 1fr 40px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 10px;
  border-bottom: 1px solid #252b31;
}

.events-container.events-2col .event-time{
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-align: left;
}

.events-container.events-2col .event-side{
  font-size: 12px;
  color: #e2e8f0;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.events-container.events-2col .event-side.home{ text-align: right; padding-right: 6px; }
.events-container.events-2col .event-side.away{ text-align: left;  padding-left: 6px; }

.events-container.events-2col .event-mid{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 40px;
}

.events-container.events-2col .event-icon{
  width: 22px;
  height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
}


/* ===== Stats: animate + leading highlight ===== */
.stat-bar-bg{
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  display:flex;
}

.stat-bar-home,
.stat-bar-away{
  height: 100%;
  transition: width 0.5s ease;
}

.stat-bar-home{ background: rgba(0,230,118,0.55); }
.stat-bar-away{ background: rgba(148,163,184,0.35); }

.stat-bar-home.lead{ background: rgba(0,230,118,0.9); }
.stat-bar-away.lead{ background: rgba(148,163,184,0.55); }

.stat-side.lead{
  color: #e2e8f0;
  font-weight: 800;
}

.stat-type{
  color: #94a3b8;
  font-weight: 700;
}


/* ===============================
   LINEUPS – REAL FOOTBALL PITCH
   =============================== */

.pitch {
  position: relative;
  width: 100%;
  height: 480px;

  background-color: #388e3c;
  background-image: repeating-linear-gradient(
    to bottom,
    #388e3c,
    #388e3c 40px,
    #43a047 40px,
    #43a047 80px
  );

  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
}

/* 👉 中轴线（视觉锚点，关键） */
.pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.08);
  transform: translateX(-0.5px);
  pointer-events: none;
}

/* pitch markings */
.pitch-markings > div {
  position: absolute;
  border: 2px solid rgba(255,255,255,0.4);
  pointer-events: none;
}

.half-line {
  top: 50%;
  left: 0;
  width: 100%;
  border-bottom: 2px solid rgba(255,255,255,0.4);
}

.center-circle {
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.penalty-area {
  left: 15%;
  width: 70%;
  height: 16%;
}
.penalty-area.top { top: 0; border-top: none; }
.penalty-area.bottom { bottom: 0; border-bottom: none; }

.goal-area {
  left: 30%;
  width: 40%;
  height: 6%;
}
.goal-area.top { top: 0; border-top: none; }
.goal-area.bottom { bottom: 0; border-bottom: none; }

/* players */
.player-dot {
  position: absolute;
  transform: translate(-50%, -50%); /* 确保点的几何中心对准 left/top */
  width: 60px; /* 适当加宽，给名字留空间，防止溢出导致的视觉偏移 */
  display: flex; /* 开启 Flex */
  flex-direction: column;
  align-items: center; /* 强制所有子元素（球衣、名字）水平居中 */
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.player-dot .shirt {
  width: 28px; /* 稍微加大一点，视觉更饱满 */
  height: 28px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  /* 确保球衣圆点自己也是绝对圆心对齐 */
  flex-shrink: 0; 
}

.home-p .shirt { background: #1e88e5; }
.away-p .shirt { background: #e53935; }

.player-dot .name {
  display: block; /* 改为 block 配合 width: 100% */
  width: 60px;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-align: center; /* 强制文字居中 */
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,1);
}

/* team labels */
.team-label {
  position: absolute;
  left: 15px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  z-index: 2;
}
.away-label { top: 12px; }
.home-label { bottom: 12px; }

/* Finished status */
.status-finished {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af; /* 灰色 */
  letter-spacing: 0.3px;
}

html {
  scroll-behavior: smooth;
}

/* ===== Footer Logo (独立控制) ===== */
.footer-logo {
  width: 180px;     /* 👈 用宽度，不用高度 */
  height: auto;
  display: block;
}

/* ===== LIVE INDICATOR (BASE) ===== */
.live-indicator {
  width: 8px;
  height: 8px;
  margin-left: 6px;

  background: #ff3b3b;
  border-radius: 50%;

  display: none;              /* ✅ 默认隐藏 */
  position: relative;
  flex-shrink: 0;
}


/* =========================
   MOBILE LAYOUT (BROWSER)
   ========================= */
@media (max-width: 768px) {

  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  /* ===== 主体三栏 → 一栏 ===== */
  .app-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ===== 左侧 Sidebar：手机隐藏 ===== */
  .app-container > aside:first-of-type {
    display: none !important;
  }

  /* ===== 中间主内容 ===== */
  .app-container > main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px;
  }

  /* ===== 右侧栏：移到底部 ===== */
  .app-container > aside:last-of-type {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  /* ===== Header：解除 1400px 限制 ===== */
  .site-header .max-w-\[1400px\] {
    max-width: 100% !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Logo 缩小 */
  .site-header img {
    height: 32px !important;
  }

  /* ===== Tabs 可横向滑 ===== */
  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }
}


/* 展开后的容器样式 */
.detail-expanded {
    background: #1e242a;
    width: 100%;
    border-bottom: 1px solid var(--border);
    box-shadow: inset 0 10px 10px -10px rgba(0,0,0,0.5);
    scroll-margin-top: 80px; /* 防止被固定 Header 挡住 */
    overflow: hidden;
    animation: slideFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.inline-detail-content {
    padding: 10px;
}

/* 详情内的简易切换按钮 */
.detail-tabs {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.d-tab {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 0;
    cursor: pointer;
}

.d-tab.active {
    color: #00e676;
    border-bottom: 2px solid #00e676;
}

@keyframes slideFadeIn {
    from { 
        opacity: 0; 
        max-height: 0; 
    }
    to { 
        opacity: 1; 
        max-height: 1500px; /* 给一个足够大的值 */
    }
}

.status-cell {
    width: 65px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   LEAGUE ACCORDION (联赛折叠功能) 
   ========================================== */

/* 1. 联赛标题容器 - 增加区分度 */
.league-header {
    background: #22282f; /* 比背景稍亮一点的深灰色 */
    border-left: 2px solid #04aa5a; /* 左侧绿色竖线条，增加品牌感 */
    padding: 10px 14px;
    margin-top: 8px; /* 联赛与联赛之间拉开距离 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2d343c;
}

/* 2. 悬停效果 - 让它看起来像可以点击的按钮 */
.league-header:hover {
    background: #2a3139;
    filter: brightness(1.1);
}

/* 3. 联赛信息左侧布局 */
.league-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 4. 图片样式微调 */
.league-flag, .league-logo {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

/* 5. 字体样式 - 更加醒目 */
.league-name-text {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase; /* 强制大写增加庄重感 */
    letter-spacing: 0.5px;
}

/* 6. 右侧箭头图标样式 */
.league-header-right i {
    color: #8894a0;
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* 7. 当联赛被折叠时，可以给 header 增加一个稍淡的状态（可选） */
.league-group[data-collapsed="true"] .league-header {
    border-left-color: #444; 
    opacity: 0.8;
}

/* ======================================
   LIVE TAB 单红点 + 呼吸效果（最终版）
   ====================================== */

.tab-live {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 红点本体 */
.tab-live .live-indicator {
  display: none;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: #ff3b3b;
  position: relative;
  flex-shrink: 0;
}

/* 有 LIVE 时显示 */
.tab-live.has-live .live-indicator {
  display: inline-block;
}

/* 呼吸外圈 */
.tab-live.has-live .live-indicator::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(255, 59, 59, 0.35);
  animation: livePulse 1.5s infinite;
}

/* 呼吸动画 */
@keyframes livePulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ======================================
   比赛行 LIVE 红点（时间前）
   ====================================== */

.status-cell.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  height: 15px;          /* 🔴 关键：锁定一条视觉中线 */
  line-height: 15px;     /* 和 height 一致 */

  font-size: 12px;
  font-weight: 600;
  color: #ff3b3b;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b3b;
  position: relative;
  flex-shrink: 0;   /* 防止被压缩 */
}


/* 呼吸圈 */
.live-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: rgba(255, 59, 59, 0.35);
  animation: livePulse 1.5s infinite;
}

/* ============================================================
   LEAGUE PAGE & TABS SYSTEM (FINAL – INTEGRATED)
   ============================================================ */

/* =====================
   基础隐藏控制（JS 强依赖）
   ===================== */
.hidden {
  display: none !important;
}

/* =====================
   League Page 容器
   ===================== */
.league-page {
  background: #1a1e22;
  min-height: 600px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #2d3439;
}

/* Header */
.league-page-header {
  background: linear-gradient(180deg, #252b31 0%, #1a1e22 100%);
  padding: 30px 24px;
  border-bottom: 1px solid #2d3439;
}

.league-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 联赛名称与 meta */
.league-name {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.league-meta {
  font-size: 13px;
  color: #88909b;
  margin-top: 6px;
  display: flex;
  gap: 15px;
}

/* =====================
   League Tabs
   ===================== */
.league-tabs {
  display: flex;
  background: #252b31;
  padding: 0 15px;
  border-bottom: 1px solid #2d3439;
  gap: 10px;
}

.league-tab {
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.league-tab:hover {
  color: #ffffff;
}

.league-tab.active {
  color: #00e676;
  border-bottom-color: #00e676;
}

/* =====================
   League Panels
   ===================== */
.league-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.league-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================
   Standings Table
   ===================== */
.league-standings-block {
  padding: 20px;
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #e5e7eb;
}

.standings-table th {
  text-align: left;
  padding: 12px 10px;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 2px solid #2d3439;
}

.standings-table td {
  padding: 14px 10px;
  border-bottom: 1px solid #252b31;
}

.standings-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.standings-table th:not(:nth-child(2)),
.standings-table td:not(:nth-child(2)) {
  text-align: center;
}

/* Team cell */
.team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

/* 暂时保留（后续可再语义化） */
.team-logo-mini {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Form dots */
.form-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  margin: 0 2px;
  color: #fff;
}
.form-w { background: #00c853; }
.form-d { background: #757575; }
.form-l { background: #ff5252; }

/* =====================
   Loading Spinner
   ===================== */
.animate-spin {
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   LEAGUE LOGO – SEMANTIC SYSTEM（关键补充）
   ===================================================== */

/* 大：League Page Header（index.html） */
.league-logo-lg {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* 中：比赛列表联赛头（main.js） */
.league-logo-md {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
  flex-shrink: 0;
}

/* 小：左侧 World Competitions / Pinned（main.js） */
.league-logo-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border-radius: 50%;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.site-header .logo {
  height: 80px;
  width: auto;
}

.header-icon {
  font-size: 25px;   /* 或 20px */
  color: #043da0;    /* gray-400 */
  cursor: pointer;
  transition: color .2s ease;
}

.header-icon:hover {
  color: #ff0808;
}


