/* =========================================================
   球队大全 专属样式表 - 扁平硬核拆分版 (移动端防撑破优化)
   ========================================================= */
:root { 
    --fb-color: #d63638; 
    --bk-color: #00529b; 
    --main-bg: #f5f6f7;
    --border-color: #e5e5e5;
    --text-main: #333;
    --text-muted: #888;
}

.dir-wrap { background-color: var(--main-bg); padding: 15px 0 50px; font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif; }
.dir-inner { max-width: 1200px; margin: 0 auto; padding: 0 15px; box-sizing: border-box; }

/* 面包屑 */
.dir-breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }
.dir-breadcrumb a { color: #555; text-decoration: none; }
.dir-breadcrumb a:hover { color: var(--fb-color); }

/* 主体白框 (无多余阴影) */
.dir-main-box { background: #fff; border: 1px solid var(--border-color); border-radius: 2px; }

/* 头部及导航 */
.dir-header { padding: 25px 25px 15px; border-bottom: 1px solid var(--border-color); background: #fafafa;}
.fb-header { border-top: 3px solid var(--fb-color); }
.bk-header { border-top: 3px solid var(--bk-color); }

.dir-header h1 { font-size: 24px; font-weight: 700; color: var(--text-main); margin: 0 0 15px 0; }
.dir-quick-nav { font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nav-label { font-size: 14px; font-weight: bold; color: #333; flex-shrink: 0; padding-top: 2px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0;}
.nav-links a { display: inline-block; padding: 4px 12px; background: #fff; border: 1px solid #ddd; color: #555; text-decoration: none; font-size: 13px; border-radius: 2px; transition: 0.1s; font-weight: 500;}
.fb-header a:hover { background: var(--fb-color); border-color: var(--fb-color); color: #fff; }
.bk-header a:hover { background: var(--bk-color); border-color: var(--bk-color); color: #fff; }

/* 联赛区块 */
.dir-content { padding: 25px; }
.league-block { margin-bottom: 40px; }
.league-title { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 10px; border-bottom: 2px solid var(--border-color); margin-bottom: 20px; }
.league-title.fb-border { border-bottom-color: rgba(214,54,56,0.3); }
.league-title.bk-border { border-bottom-color: rgba(0,82,155,0.3); }
.league-title h2 { font-size: 20px; font-weight: 700; margin: 0; color: var(--text-main); border-left: 4px solid var(--fb-color); padding-left: 10px; line-height: 1.2;}
.bk-border h2 { border-left-color: var(--bk-color); }
.league-title h2 span { font-size: 13px; font-weight: normal; color: var(--text-muted); margin-left: 8px; }
.more-link { font-size: 13px; color: #1e88e5; text-decoration: none; }
.more-link:hover { text-decoration: underline; }

/* 球队网格矩阵 (PC端自动排满) */
.dir-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; }

/* 扁平化球队卡片 (绝对防溢出) */
.dir-team-card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 10px; background: #fdfdfd; border: 1px solid #f0f0f0; border-radius: 2px; text-decoration: none; color: #444; transition: 0.1s; box-sizing: border-box; min-width: 0; overflow: hidden;}
.dir-team-card:hover { border-color: #ccc; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.dir-team-card img { width: 50px; height: 50px; object-fit: contain; margin-bottom: 10px; flex-shrink: 0;}
.dir-team-card .team-name { font-size: 13px; font-weight: 500; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}

/* SEO描述块 */
.dir-seo-box { padding: 20px; background: #fff; border: 1px solid #eee; margin-top: 30px; border-radius: 2px;}
.dir-seo-box h3 { font-size: 15px; margin: 0 0 8px 0; color: #333; font-weight: 600; border-left: 4px solid var(--fb-color); padding-left: 10px;}
.bk-seo h3 { border-left-color: var(--bk-color); }
.dir-seo-box p { font-size: 13px; color: #666; line-height: 1.6; margin: 0 0 10px 0; }
.dir-seo-box p:last-child { margin: 0; }


/* ====================================
   移动端极致防溢出响应式
   ==================================== */
@media (max-width: 768px) {
    .dir-inner { padding: 0; }
    .dir-breadcrumb { padding: 10px 15px 5px; margin-bottom: 0;}
    .dir-main-box { border-radius: 0; border-left: none; border-right: none; }
    
    .dir-header { padding: 15px; }
    .dir-header h1 { font-size: 18px; margin-bottom: 12px; }

    /* 手机端筛选变为单行横滑 */
    .dir-quick-nav { flex-direction: column; align-items: flex-start; }
    .nav-label { display: none; } /* 隐藏文字，节省空间 */
    .nav-links { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { flex-shrink: 0; padding: 4px 12px; font-size: 13px;}

    .dir-content { padding: 15px; }
    .league-block { margin-bottom: 25px; }
    .league-title { padding-bottom: 8px; margin-bottom: 12px; }
    .league-title h2 { font-size: 16px; }
    .league-title h2 span { display: none; }

    /* 核心修复：手机端强制 3 列，配合 overflow: hidden 绝对不会超屏 */
    .dir-team-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    
    .dir-team-card { padding: 10px 4px; border-radius: 4px; }
    .dir-team-card img { width: 40px; height: 40px; margin-bottom: 8px; }
    .dir-team-card .team-name { font-size: 12px; transform: scale(0.95); }

    .dir-seo-box { padding: 15px; border-radius: 0; border-left: none; border-right: none; margin-top: 15px;}
}

@media (max-width: 360px) {
    /* 针对超小屏幕退回到 3 列，减小字号 */
    .dir-team-grid { gap: 6px; }
    .dir-team-card { padding: 8px 2px; }
    .dir-team-card .team-name { font-size: 11px; transform: scale(0.9); }
}