/* Release 演示站移动端补强样式 —— 在所有原始 CSS 之后加载 */

/* ---------- 通用小屏收紧 ---------- */
@media (max-width: 430px) {
  :root {
    --space-page: 14px;
  }

  .main-content {
    padding: 78px 10px 24px !important;
  }

  .surface-card,
  .match-command,
  .match-review-studio,
  .match-coach-actions-card,
  .match-disclosure > summary,
  .match-disclosure-body {
    border-radius: 14px !important;
    padding: 14px !important;
  }

  .section-heading,
  .topbar {
    gap: 8px;
  }

  .topbar h1,
  #page-title {
    font-size: 21px !important;
    line-height: 1.2;
  }

  .topbar-kicker {
    font-size: 9px;
  }

  .user-menu {
    gap: 6px;
  }

  .user-avatar {
    height: 32px;
    width: 32px;
  }

  .icon-button {
    height: 36px;
    width: 36px;
    min-height: 36px !important;
  }
}

/* ---------- 重点时间段卡片：小屏彻底单列 ---------- */
@media (max-width: 560px) {
  .match-l0-card {
    display: grid !important;
    gap: 18px;
    grid-template-columns: 1fr !important;
  }

  
  .match-l0-copy h3 {
    font-size: 18px;
    line-height: 1.35;
    margin: 6px 0 10px;
  }

  .match-l0-guidance {
    font-size: 13px;
    line-height: 1.65;
  }

  .match-l0-meta {
    gap: 6px;
  }

  .match-l0-meta span {
    font-size: 10px;
    padding: 4px 8px;
  }

  .match-primary-formation {
    align-items: flex-start;
    border-left: 0;
    border-top: 1px solid #e2eaf5;
    flex-direction: row;
    gap: 14px;
    justify-content: flex-start;
    padding-top: 16px;
    text-align: left;
  }

  .match-primary-formation .formation-code {
    font-size: 26px;
  }

  .match-primary-formation .formation-label,
  .match-primary-formation .formation-confidence {
    margin-top: 0;
  }

  .match-core-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .match-core-metric {
    padding: 12px;
  }

  .match-core-metric strong {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .match-core-metrics {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- 战术导演控制条：小屏垂直堆叠 ---------- */
@media (max-width: 560px) {
  .match-replay-toolbar {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr !important;
    padding: 14px !important;
  }

  .tv-workspace-head > div:first-child {

    flex-direction: column;

    width: 300px;

  }
  #tv-workspace-badge {
    text-align: center !important;
  }

  .match-replay-identity {
    align-items: flex-start;
    gap: 10px;
  }

  .match-replay-identity strong {
    font-size: 15px;
  }

  .match-replay-identity em {
    font-size: 11px;
    line-height: 1.45;
    white-space: normal;
  }

  .match-replay-controls {
    align-items: stretch;
    display: grid !important;
    gap: 8px;
    grid-template-columns: 1fr 1fr !important;
    justify-content: stretch;
  }

  .match-replay-controls .match-select-shell,
  .match-replay-controls .ui-select-shell {
    grid-column: 1 / -1;
  }

  .match-overlay-switch {
    display: grid;
    gap: 4px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .match-overlay-switch button {
    font-size: 11px;
    min-height: 38px;
    padding: 6px 8px;
  }

  .match-tactical-play.button,
  .match-tactical-exit.button,
  .match-presenter-toggle.button {
    font-size: 12px;
    min-height: 40px;
    padding: 0 10px;
  }

  .match-layer-menu > summary {
    font-size: 11px;
    min-height: 40px;
    padding: 6px 10px;
  }

  .match-replay-progress {
    grid-template-columns: repeat(5, minmax(76px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .match-replay-progress span {
    min-width: 70px;
  }
}

@media (max-width: 360px) {
  .match-replay-controls {
    grid-template-columns: 1fr !important;
  }

  .match-overlay-switch {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- 同步复盘区域：小屏单列 ---------- */
@media (max-width: 560px) {
  .match-sync-grid {
    gap: 14px;
  }

  .match-review-studio .match-video-stage,
  .match-review-studio .match-visual-stage {
    height: auto !important;
    /* max-height: none !important; */
    /* min-height: 220px !important; */
  }

  .match-tactical-hud {
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 9px 11px;
    top: 10px;
  }

  .match-tactical-hud strong {
    font-size: 20px;
  }

  .match-tactical-caption {
    bottom: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 8px 10px;
  }

  .match-review-studio .match-pitch-notes {
    gap: 8px;
    grid-template-columns: 1fr !important;
  }

  .match-pitch-note {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }
}

/* ---------- 教练建议卡片 ---------- */
@media (max-width: 560px) {
  .match-finding-list {
    gap: 14px;
  }

  .match-finding-item {
    padding: 14px;
  }

  .match-finding-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .match-advice-source {
    margin-left: 0;
    max-width: 100%;
  }

  .match-finding-item h4 {
    font-size: 15px;
    line-height: 1.35;
  }

  .match-finding-item p {
    font-size: 13px;
  }

  .match-coaching-callout {
    padding: 12px;
  }

  .match-finding-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .match-finding-actions button {
    justify-content: center;
    min-height: 40px;
  }
}

/* ---------- 片段轨道 ---------- */
@media (max-width: 560px) {
  .match-segment-rail {
    gap: 10px;
    grid-auto-columns: minmax(280px, 85vw);
    padding-bottom: 10px;
  }

  .match-segment-chip {
    grid-template-columns: 120px minmax(0, 1fr);
    min-height: 96px;
  }

  .match-segment-thumb {
    min-height: 78px;
  }

  .match-segment-copy > span > strong {
    font-size: 13px;
  }

  .match-segment-copy > small {
    font-size: 11px;
  }
}

/* ---------- 训练任务卡片 ---------- */
@media (max-width: 560px) {
  .coach-task-card {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .coach-task-main {
    gap: 10px;
  }

  .coach-task-symbol {
    height: 36px;
    width: 36px;
  }

  .coach-task-code {
    font-size: 10px;
  }

  .coach-task-main strong {
    font-size: 14px;
  }

  .coach-task-main small {
    font-size: 12px;
  }

  .coach-task-action {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .coach-task-action .status-chip {
    align-self: flex-start;
  }

  .coach-task-action .task-open {
    justify-content: center;
  }

  .coach-page-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .coach-toolbar-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .coach-filter-field input,
  .coach-filter-select {
    width: 100%;
  }
}

/* ---------- 小球浮窗进一步收紧 ---------- */
@media (max-width: 430px) {
  .match-chat-widget {
    bottom: max(12px, env(safe-area-inset-bottom));
    right: 10px;
  }

  .match-chat-launch {
    border-radius: 50%;
    height: 46px;
    min-height: 46px;
    width: 46px;
  }

  .match-chat-launch > img {
    height: 38px;
    width: 38px;
  }

  .match-chat-panel {
    border-radius: 16px;
    height: calc(100vh - 24px);
    width: calc(100vw - 20px);
  }
}

/* ---------- 比赛分析上下文切换器（队伍 / 任务 / 维度） ---------- */
@media (max-width: 760px) {
  .match-context-switcher {
    align-items: stretch !important;
    display: grid !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    grid-template-columns: 1fr !important;
    overflow-x: visible !important;
    width: 100% !important;
  }

  .match-context-field {
    flex: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .match-context-field .match-select-shell,
  .match-context-field .ui-select-shell,
  .match-context-field .ui-select-trigger {
    width: 100% !important;
  }
}

/* ---------- 模态框与弹层 ---------- */
@media (max-width: 430px) {
  .match-layer-menu > div,
  .ui-select-menu {
    left: 8px !important;
    max-width: calc(100vw - 16px);
    right: 8px !important;
  }
}
