/* =========================================================
   球队详情页 (足球 & 篮球通用) 样式表 - 终极自适应防重叠版
   ========================================================= */

/* 基础重置 */
.portal-team-wrap { width: 100%; font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif; background-color: #f5f6f7; padding-bottom: 40px; }
.portal-team-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.portal-inner { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 顶部沉浸式看板 (根据 PHP 传过来的 --theme-color 自动变色) */
.hero-board { width: 100%; background-color: var(--theme-color); padding: 40px 0; margin-bottom: 20px; position: relative; }
.hero-grid { display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.hero-left { display: flex; align-items: center; gap: 20px; flex: 0 0 auto; }
.team-logo-box { width: 120px; height: 120px; background: rgba(255,255,255,0.1); border-radius: 50%; padding: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border: 2px solid rgba(255,255,255,0.4); }
.team-logo-box img { width: 100%; height: 100%; object-fit: contain; }

.team-info-box { color: #fff; text-shadow: 1px 1px 3px rgba(0,0,0,0.2); }
.team-info-box h1 { font-size: 32px; font-weight: 900; margin-bottom: 5px; line-height: 1.2; }
.team-info-box p { font-size: 15px; color: rgba(255,255,255,0.85); margin: 0; font-weight: 500; letter-spacing: 1px;}

/* 玻璃态球队简介框 */
.hero-right { flex: 1; background: rgba(0,0,0,0.15); padding: 15px 20px; border-radius: 8px; font-size: 13px; color: rgba(255,255,255,0.95); line-height: 1.6; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(4px); max-height: 120px; overflow-y: auto; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);}
.hero-right::-webkit-scrollbar { width: 4px; }
.hero-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

/* 模块容器 */
.portal-section { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; margin-bottom: 20px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.02);}
h2.portal-sec-header { background: #fafafa; padding: 15px 20px; font-size: 18px; font-weight: bold; color: #333; border-bottom: 1px solid #eee; margin: 0;}
.portal-sec-body { padding: 20px; }

/* ====================================
   赛程与战绩列表 UI (PC端)
   ==================================== */
.match-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px dashed #eee; transition: 0.2s; text-decoration: none; color: #333; background: #fff; flex-wrap: nowrap;}
.match-row:hover { background-color: #fdfdfd; }
.match-row:last-child { border-bottom: none; }

/* 时间排版 */
.m-time { flex: 0 0 80px; font-size: 13px; color: #666; text-align: center; }
.m-time .t-md { display: block; font-weight: bold; color: #333; font-size: 14px; margin-bottom: 2px;}
.m-time .t-hi { display: block; font-size: 12px; }

/* 战绩红绿方块 (仅战绩列表有) */
.m-form { flex: 0 0 40px; text-align: center; }
.form-box { display: inline-block; padding: 2px 6px; border-radius: 3px; color: #fff; font-size: 12px; font-weight: bold; }

/* 球队布局 (Flex 弹性收缩核心) */
.m-team { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; /* 关键：允许子元素溢出截断 */ }
.m-team.h { justify-content: flex-end; text-align: right; }
.m-team.a { justify-content: flex-start; text-align: left; }
.m-team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #555; display: block; }
.m-team-name.is-main { font-weight: bold; color: #000; }
.m-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0;}

/* 比分与状态 */
.m-score { flex: 0 0 80px; text-align: center; font-weight: bold; color: #999; font-size: 14px; }
.m-score .m-vs { display: block; color: #999; font-size: 14px; }
.m-score .m-status { display: block; font-size: 11px; font-weight: normal; margin-top: 2px; }
.m-score.is-finished { font-size: 18px; color: #000; letter-spacing: 1px; font-family: Impact, sans-serif;}

/* 动作按钮 */
.m-act { flex: 0 0 60px; text-align: right; font-size: 13px; color: var(--theme-color); }

/* ====================================
   球员阵列
   ==================================== */
.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 20px; }
.player-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #333; transition: 0.3s; padding: 10px; border-radius: 8px;}
.player-card:hover { background: #f9f9f9; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.player-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; background: #f5f5f5; border: 2px solid #eee; box-shadow: 0 2px 6px rgba(0,0,0,0.05);}
.player-card .p-name { font-size: 14px; font-weight: bold; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; width: 100%;}
.player-card .p-pos { font-size: 12px; color: #888; }

/* SEO 描述块 */
.seo-content-box { margin-top: 10px; padding: 20px; background: #fff; border: 1px dashed #e5e5e5; border-radius: 8px; color: #555; font-size: 14px; line-height: 1.8; margin-bottom: 40px; }

/* ====================================
   移动端完美防重叠自适应 (解决图 030923)
   ==================================== */
@media (max-width: 768px) {
    .portal-inner { padding: 0; }
    .hero-board { padding: 25px 15px; }
    .hero-grid { flex-direction: column; align-items: flex-start; gap: 15px; }
    .hero-left { width: 100%; gap: 15px;}
    .team-logo-box { width: 70px; height: 70px; padding: 5px; border-width: 2px; margin-bottom: 10px; }
    .team-info-box h1 { font-size: 20px; }
    .hero-right { width: 100%; max-height: none; font-size: 12px; padding: 10px 15px;}
    
    .portal-section { border-left: none; border-right: none; border-radius: 0; margin-bottom: 10px; box-shadow: none;}
    h2.portal-sec-header { font-size: 15px; padding: 10px 15px; }
    .portal-sec-body { padding: 15px; }
    
    /* 赛程模块紧凑压榨 */
    .match-row { padding: 12px 10px; gap: 4px; }
    
    .m-time { flex: 0 0 38px; }
    .m-time .t-md { font-size: 11px; margin-bottom: 0; }
    .m-time .t-hi { font-size: 10px; color: #888; }
    
    .m-form { flex: 0 0 26px; }
    .form-box { padding: 2px 4px; font-size: 11px; }
    
    /* 核心修复：释放极大空间给球队名，允许弹性拉伸但超长截断 */
    .m-team { gap: 4px; font-size: 13px; }
    .m-team-name { font-size: 12px; }
    .m-logo { width: 18px; height: 18px; }
    
    .m-score { flex: 0 0 45px; font-size: 14px; }
    .m-score .m-vs { font-size: 12px; }
    .m-score .m-status { font-size: 10px; margin-top: 0; }
    .m-score.is-finished { font-size: 15px; }
    
    /* 移动端隐藏冗余的 "前瞻/战报" 文字，彻底让路给球队名 */
    .m-act { display: none; }
    
    .players-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .player-card { padding: 5px; }
    .player-card img { width: 60px; height: 60px; margin-bottom: 8px;}
    .player-card .p-name { font-size: 12px; }
}

@media (max-width: 360px) {
    .players-grid { grid-template-columns: repeat(3, 1fr); }
}