/* assets/css/practice.css —— 练习页：头部 / 双栏布局 / 计时与进度 / 提示条 / 响应式 */

.practice-head { margin-bottom: 12px; }
.practice-head__title { font-size: 21px; font-weight: 700; }
.practice-head__sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 20px;
  align-items: start;
}
.practice-board { min-width: 0; }
.practice-side {
  position: sticky;
  top: 72px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.practice-status { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.practice-turn { font-weight: 700; font-size: 14.5px; }
.practice-timer {
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.progressbar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progressbar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  transition: width 0.25s ease-out;
}

.practice-stats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.practice-stats li { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.practice-stats span { color: var(--muted); }
.practice-stats b { font-variant-numeric: tabular-nums; }

/* —— 提示条（三级） —— */
.hintbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.hintbar--level1 { border-left-color: var(--hint1-line); background: var(--hint1-bg); }
.hintbar--level2 { border-left-color: var(--accent); background: var(--hint2-bg); }
.hintbar--level3 { border-left-color: var(--warn-dot-border); background: var(--hint3-bg); color: var(--warn-ink); }
.hintbar__level {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-ring-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 700;
}
.hintbar--level3 .hintbar__level { background: var(--warn-soft); color: var(--warn-strong); }
.hintbar__text { flex: 1 1 160px; min-width: 0; }

.practice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.practice-actions .btn { flex: 1 1 auto; }

/* ===== 断点：平板竖屏 / 窄屏 ===== */
@media (max-width: 880px) {
  .practice-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .practice-side { position: static; order: 2; padding: 14px; gap: 10px; }
  .practice-board { order: 1; }
  /* 单栏时把状态和提示条提到侧栏顶部，落子后不用滚动就能看到反馈 */
  .practice-status { order: -2; }
  .hintbar { order: -1; }
  .practice-board .board { max-width: 560px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .practice-head { margin-bottom: 8px; }
  .practice-head__title { font-size: 18.5px; }
  .practice-side { padding: 12px; }
  /* 三行统计压成一行三列，把屏幕高度留给棋盘 */
  .practice-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
  .practice-stats li { flex-direction: column; align-items: flex-start; gap: 0; }
  .hintbar { min-height: 46px; font-size: 13.5px; padding: 9px 11px; }
  .practice-board .board { max-width: none; }
}

/* ===== 断点：手机 / 小平板横屏（矮屏）——恢复双栏，棋盘按视口高度收窄 ===== */
@media (orientation: landscape) and (max-height: 560px) {
  .practice-layout { grid-template-columns: minmax(0, 1fr) 236px; gap: 14px; }
  .practice-side { position: static; order: 2; }
  .practice-board { order: 1; }
  .practice-status { order: 0; }
  .hintbar { order: 0; }
  .practice-board .board { max-width: min(100%, calc(100vh - 150px)); margin: 0 auto; }
  .practice-head { margin-bottom: 8px; }
  .practice-head__title { font-size: 18px; }
}
