/*
 * 极简深色主题。
 *
 * 几条原则：
 *   - 只用一个强调色（金色），其余全是低饱和的中性灰。颜色只用来表达状态，
 *     不做装饰——这样选中的英雄、识别框才会真正跳出来。
 *   - 描边很淡、间距放大，靠留白分层，而不是靠一块块边框把页面切碎。
 *   - 动效统一用同一条缓动曲线，时长控制在 0.2~0.5 秒；宁可少动，不要乱动。
 *
 * 注意：admin.html 的内联样式还在用 --gold / --gold-bright / --gold-dim /
 * --panel / --panel-2 / --border / --radius / --green / --red 这几个变量，
 * 改名之前先确认那边。
 */

:root {
  /*
   * 之前底色是 #080b10（接近纯黑），面板只比它亮一点，整页糊成一片，
   * 看着又暗又闷。现在整体抬高到深石板灰：背景离开纯黑，面板之间
   * 拉开层次，文字也提亮一档。仍然是深色（比赛多在晚上看），
   * 但不再是一片黑，英雄立绘的颜色也更容易跳出来。
   */
  --bg: #12161f;
  --panel: #1a212c;
  --panel-2: #232c3a;
  --border: #2e3848;
  --radius: 10px;

  /* 描边分三档：分隔、可见、强调 */
  --line: #2e3848;
  --line-mid: #3f4b5e;
  --line-strong: #55637a;

  /* 文字分三档：正文、强调、弱化 */
  --text: #c3ccd9;
  --text-strong: #f5f8fd;
  --text-dim: #8894a6;

  /* 强调色 */
  --gold: #d9bd84;
  --gold-bright: #f4ead3;
  --gold-dim: #8f7548;
  --accent: #d9bd84;
  --accent-soft: rgba(217, 189, 132, .13);

  /* 状态色，只在识别框和标签上用 */
  --blue: #6fb3e8;
  --red: #e87b72;
  --green: #5ccf96;

  /* 几个特殊底（比页面更深的地方，用来衬托图片）+ 零散的固有色 */
  --inset: #0b0f16;
  --hover: #26313f;
  --bar-bg: #26313f;
  --on-accent: #161a21;
  --footer-text: #63707f;
  --footer-dim: #525d6c;
  --empty-sub: #616d7d;
  --warn-text: #b08a55;

  --ease: cubic-bezier(.22, .68, .28, 1);
  --viewer-height: 360px;
}

* { box-sizing: border-box; }

/* hidden 必须能压住类里的 display。
   浏览器默认的 [hidden] 优先级很低，任何写了 display:grid/flex 的类都会盖掉它。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  /* 竖排 flex + main 撑满剩余高度，初始状态才能把输入区放到视线中心 */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  /* 顶部一层极淡的光，把视线引到输入区，也别让整页死黑一片 */
  background-image: radial-gradient(1100px 420px at 50% -180px, rgba(217, 189, 132, .07), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(217, 189, 132, .22); color: var(--text-strong); }

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 20px 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: .14em;
}

.patch {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .04em;
  text-decoration: none;
}

/* ---------- 演示视频来源开关 ---------- */

.video-source-wrap { margin: 18px 0 6px; }

.video-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.vs-title { font-size: 12px; color: var(--text-dim); letter-spacing: .06em; }

.vs-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

/* 真正的复选框藏起来，只留自绘的轨道和滑块 */
.vs-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vs-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background .22s ease, border-color .22s ease;
}

.vs-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), background .22s ease;
}

/* 打开：轨道染成金色，滑块滑到右边 */
.vs-switch input:checked + .vs-track {
  background: rgba(217, 189, 132, .2);
  border-color: var(--gold);
}

.vs-switch input:checked + .vs-track .vs-thumb {
  transform: translateX(18px);
  background: var(--gold-bright);
}

.vs-switch input:focus-visible + .vs-track {
  outline: 2px solid var(--gold-dim);
  outline-offset: 2px;
}

.vs-state {
  /* 两个状态都是两个字，这里再钉一个最小宽度：
     哪怕以后换成不同字数的文案，滑块也不会被顶得左右挪。 */
  min-width: 2.2em;
  font-size: 12px;
  color: var(--text-dim);
  transition: color .22s ease;
}

.vs-switch input:checked ~ .vs-state { color: var(--gold); }

.vs-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
}

.patch:hover { color: var(--gold); }

main {
  /* 撑满顶栏和页脚之间的空间，但内容更高时也跟着长，不会被裁掉 */
  flex: 1 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/*
 * 打开网页时的状态：还没有任何输入，把输入区放在视线中央。
 * 一旦贴了图 / 开始搜索 / 显示了结果，body 上的 home 会被摘掉，
 * 布局就回到正常的顶部对齐，内容往下自然铺开。
 */
body.home main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 30px;
}

/* 页脚占两百多像素，留着会把输入区顶到视口上方三分之一去。
   首页既然还没有任何内容，就先让它让位；一有内容立刻回来。 */
body.home footer { display: none; }

/* ---------- 输入区：文字和图片共用一行 ---------- */

.composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 22px;
  overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}

/* 拖拽悬停或输入框聚焦时，整个输入区轻微亮起 */
.composer:focus-within,
.composer.over {
  border-color: var(--line-mid);
  box-shadow: 0 8px 40px -18px rgba(217, 189, 132, .45);
}

.composer.over { border-color: var(--gold-dim); }

.composer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  transition: background .25s var(--ease);
}

.composer.over .composer-row { background: var(--accent-soft); }

.composer-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke .25s var(--ease);
}

.composer:focus-within .composer-icon { stroke: var(--gold); }

.composer-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text-strong);
  font: inherit;
  font-size: 15px;
  letter-spacing: .01em;
}

.composer-input::placeholder { color: var(--text-dim); }

/* Safari / Chrome 自带的清除按钮和整体风格不搭，去掉 */
.composer-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.composer-action {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.composer-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s var(--ease);
}

.composer-action:hover { background: var(--panel-2); border-color: var(--line); }
.composer-action:hover svg { stroke: var(--gold); }

/* 状态提示。固定一行高度，内容长短变化时输入区不会跳动 */
.composer-hint {
  margin: 0;
  padding: 0 16px 13px;
  min-height: 18px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .25s var(--ease);
}

.composer-hint.active { color: var(--gold); }

/* ---------- 图片查看区 ---------- */

/*
 * 用 grid-template-rows 从 0fr 到 1fr 做展开动画。
 * 这是目前唯一能对「内容高度未知」做平滑过渡的纯 CSS 办法，
 * 用 max-height 得猜一个固定值，猜小了会截断、猜大了动画会先快后慢。
 */
.viewer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}

.viewer-wrap.open { grid-template-rows: 1fr; }

.viewer-inner { overflow: hidden; min-height: 0; }

.viewer {
  position: relative;
  height: var(--viewer-height);
  margin: 0 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}

/* 这一层紧贴画布，检测框按百分比定位在它上面，必须和画布同尺寸 */
.viewer-stage {
  position: relative;
  line-height: 0;
  max-width: 100%;
}

.viewer-stage canvas {
  display: block;
  max-width: 100%;
  max-height: calc(var(--viewer-height) - 2px);
  width: auto;
  height: auto;
}

.viewer-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 11px;
  font-size: 11px;
  font-family: inherit;
  letter-spacing: .04em;
  color: var(--text);
  background: rgba(8, 11, 16, .82);
  border: 1px solid var(--line-mid);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.viewer:hover .viewer-clear { opacity: 1; }
.viewer-clear:hover { color: var(--gold-bright); border-color: var(--gold-dim); }

.box-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 只在检测框层里生效，避免和 admin.html 的 .box 卡片打架 */
.box-layer .box {
  position: absolute;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  pointer-events: auto;
  cursor: grab;
  /* 拖动时别让页面跟着滚动（触摸屏上很关键） */
  touch-action: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.box-layer .box.dragging {
  cursor: grabbing;
  z-index: 2;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(217, 189, 132, .45), 0 8px 24px -8px rgba(0, 0, 0, .7);
}

.box-layer .box.left { border-color: var(--blue); }
.box-layer .box.right { border-color: var(--red); }

.box-layer .box:hover { border-color: var(--gold-bright); }

.box-layer .box.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 0 14px rgba(255, 255, 255, .3);
}

/* ---------- 搜索候选 ---------- */

.candidates:empty { display: none; }

.candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 14px;
}

.champ-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  padding: 7px 12px 7px 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
  animation: rise .32s var(--ease) both;
}

.champ-card:hover {
  border-color: var(--line-strong);
  background: var(--hover);
  transform: translateY(-1px);
}

.champ-card img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: block;
}

.champ-card .name { color: var(--text-strong); font-size: 14px; line-height: 1.4; }
.champ-card .sub { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ---------- 当前比赛 ---------- */

.match {
  margin-bottom: 22px;
  animation: rise .4s var(--ease) both;
}

/* 整体居中，两侧朝中线收拢，两端不留大片空白 */
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 16px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .22s var(--ease), transform .22s var(--ease);
}

.match-row:hover { border-color: var(--line-mid); transform: translateY(-1px); }
.match-row.active { border-color: var(--gold-dim); }

.mr-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mr-side.blue { justify-content: flex-end; }
.mr-side.red { justify-content: flex-start; }

.mr-team {
  font-size: 13px;
  color: var(--text-strong);
  letter-spacing: .06em;
  white-space: nowrap;
  min-width: 3em;
  flex-shrink: 0;
}

.mr-side.blue .mr-team { text-align: right; }
.mr-side.red .mr-team { text-align: left; }

.mr-picks { display: flex; gap: 4px; }

.mr-picks img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--line);
  transition: border-color .18s var(--ease);
}

.match-row:hover .mr-picks img { border-color: var(--line-mid); }

.mr-divider {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.match-caption {
  margin: 9px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- 结果区 ---------- */

.result-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
  animation: rise .45s var(--ease) both;
}

.side,
.center {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.side { width: 190px; }
.side[hidden] { display: none; }

.side-title {
  margin: 0 0 11px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-align: center;
}

.side-list { display: flex; flex-direction: column; gap: 6px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
  animation: rise .34s var(--ease) both;
}

/* 依次浮现。只用前十个，再多用户也看不过来 */
.side-item:nth-child(1) { animation-delay: .02s; }
.side-item:nth-child(2) { animation-delay: .05s; }
.side-item:nth-child(3) { animation-delay: .08s; }
.side-item:nth-child(4) { animation-delay: .11s; }
.side-item:nth-child(5) { animation-delay: .14s; }
.side-item:nth-child(6) { animation-delay: .17s; }
.side-item:nth-child(7) { animation-delay: .20s; }
.side-item:nth-child(8) { animation-delay: .23s; }
.side-item:nth-child(9) { animation-delay: .26s; }
.side-item:nth-child(10) { animation-delay: .29s; }

.side-item:hover { background: var(--panel-2); border-color: var(--line); }

.side-item.active {
  background: var(--accent-soft);
  border-color: var(--gold-dim);
}

.side-item img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.si-text { flex: 1; min-width: 0; }
.si-name { font-size: 13px; color: var(--text); line-height: 1.45; }
.si-sub { font-size: 10px; color: var(--text-dim); line-height: 1.45; }

.side-item.active .si-name { color: var(--text-strong); }

.side-item .score {
  font-size: 10px;
  margin-left: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.center { min-height: 220px; }

.center-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  color: var(--text-dim);
}

.center-empty p { margin: 0 0 4px; font-size: 14px; }
.center-empty .sub { font-size: 12px; color: var(--empty-sub); }

/* ---------- 英雄详情 ---------- */

/* 技能数据是按需下载的，慢速网络下会有短暂的等待，给个提示别让它空着 */
.detail-loading {
  margin: 0;
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  animation: rise .4s var(--ease) both;
}

.detail-head img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  border: 1px solid var(--line-mid);
}

.detail-head .title {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: .04em;
  line-height: 1.3;
}

.detail-head .epithet { font-size: 12px; color: var(--text-dim); letter-spacing: .06em; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.tag {
  font-size: 10px;
  letter-spacing: .05em;
  padding: 2px 9px;
  border: 1px solid var(--line-mid);
  border-radius: 20px;
  color: var(--text-dim);
}

.tag.role { border-color: rgba(111, 179, 232, .3); color: var(--blue); }

/* 特性条 */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px 20px;
  margin-bottom: 20px;
}

.feature { font-size: 11px; }

.feature .label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.feature .label span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

.bar { height: 4px; background: var(--bar-bg); border-radius: 3px; overflow: hidden; }

.bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width .6s var(--ease);
}

/* 技能 */
.skill {
  display: flex;
  gap: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  animation: rise .42s var(--ease) both;
}

.skill:first-child { border-top: none; padding-top: 4px; }

.skill:nth-child(1) { animation-delay: .03s; }
.skill:nth-child(2) { animation-delay: .07s; }
.skill:nth-child(3) { animation-delay: .11s; }
.skill:nth-child(4) { animation-delay: .15s; }
.skill:nth-child(5) { animation-delay: .19s; }
.skill:nth-child(6) { animation-delay: .23s; }

.skill img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--line-mid);
  flex-shrink: 0;
}

/* 有演示视频的技能：图标包成按钮，右下角带播放标记 */
.skill-icon {
  position: relative;
  padding: 0;
  background: none;
  border: none;
  line-height: 0;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-start;
}

.skill-icon img { transition: border-color .18s var(--ease); }
.skill-icon:hover img { border-color: var(--gold-dim); }
.skill-icon.playing img { border-color: var(--gold); }

.play-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
  font-size: 7px;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
  transition: background .18s var(--ease);
}

.skill-icon.playing .play-badge { background: var(--gold-bright); }

/* 点击后才创建，不随详情页预加载 */
.skill-video { margin-top: 11px; animation: rise .3s var(--ease) both; }

.skill-video video {
  display: block;
  width: 100%;
  max-width: 280px;
  border-radius: 8px;
  border: 1px solid var(--line-mid);
  background: var(--inset);
}

.video-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--warn-text);
}

.skill-body { flex: 1; min-width: 0; }

.skill-name {
  color: var(--text-strong);
  font-size: 14px;
  margin-bottom: 3px;
  letter-spacing: .02em;
}

.skill-key {
  display: inline-block;
  width: 19px;
  height: 19px;
  line-height: 17px;
  text-align: center;
  border: 1px solid var(--line-mid);
  border-radius: 5px;
  font-size: 10px;
  color: var(--gold);
  margin-right: 8px;
  vertical-align: 1px;
}

.skill-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.skill-meta span { margin-right: 13px; }

.skill-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-line;
}

/* ---------- 对线小贴士 ---------- */

.tips {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tips h3 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .1em;
  margin: 0 0 9px;
}

.tips ul { margin: 0 0 14px; padding-left: 18px; font-size: 12px; line-height: 1.8; }
.tips li { margin-bottom: 5px; }
.tips ul:last-child { margin-bottom: 0; }

/* ---------- 阵容分析 ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  animation: rise .4s var(--ease) both;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .12em;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 { margin-bottom: 0; }

/* ---------- 通用件（build.html 也在用） ---------- */

.btn {
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-mid);
  border-radius: 9px;
  cursor: pointer;
  transition: all .18s var(--ease);
}

.btn:hover { color: var(--text-strong); border-color: var(--line-strong); background: var(--hover); }
.btn.primary { color: var(--gold-bright); border-color: var(--gold-dim); }
.btn.primary:hover { border-color: var(--gold); }
.btn.small { padding: 5px 12px; font-size: 12px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

.hint { font-size: 12px; color: var(--text-dim); margin: 8px 0; }
.hint a { color: var(--gold); }

.log {
  margin-top: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.8;
}

.log:empty { display: none; }
.log-line { color: var(--text); white-space: pre-wrap; word-break: break-all; }
.log-line.ok { color: var(--green); }
.log-line.warn { color: var(--gold); }
.log-line.err { color: var(--red); }

code {
  padding: 1px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  color: var(--gold);
}

/* ---------- 识别置信度 ---------- */

.score {
  padding: 1px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  transition: color .2s var(--ease);
}

.score.high { color: var(--green); border: 1px solid rgba(92, 207, 150, .3); }
.score.mid  { color: var(--gold);  border: 1px solid var(--gold-dim); }
.score.low  { color: var(--text-dim); border: 1px solid var(--line-mid); }

/* ---------- 页脚 ---------- */

footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 20px 48px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--footer-text);
  line-height: 1.8;
}

footer p { margin: 0 0 8px; }
.disclaimer-en { color: var(--footer-dim); font-size: 10px; }
.data-source { color: var(--footer-dim); }

/* ---------- 动效 ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 系统里关掉了动画就别硬放 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 窄屏与各种屏幕形状 ---------- */

/*
 * 960px 以下放不下「左栏 + 详情 + 右栏」三列。
 * 改成：两队英雄各占一行排在搜索框下面，详情落到最后。
 *
 * 这里必须用 grid-template-areas 指定顺序——只按 DOM 顺序堆叠的话，
 * 详情会夹在左右两队中间，看比赛时得来回跳。
 */
@media (max-width: 960px) {
  .result-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "left"
      "right"
      "center";
    gap: 10px;
  }

  #side-left   { grid-area: left; }
  #side-right  { grid-area: right; }
  #side-center { grid-area: center; }

  .side { width: auto; padding: 10px 12px; }
  .side-title { text-align: left; margin-bottom: 8px; }

  /* 一队的英雄横向排开，放不下就横向滑动。
     滚动条在触摸设备上没意义还破坏观感，隐掉。 */
  .side-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .side-list::-webkit-scrollbar { display: none; }

  .side-item {
    flex-direction: column;
    width: 72px;
    flex-shrink: 0;
    text-align: center;
    padding: 6px 4px;
  }

  .side-item img { width: 34px; height: 34px; }
  .side-item .si-text { width: 100%; }
  .side-item .score { margin-top: 3px; font-size: 9px; }
  .si-name { font-size: 12px; }
  .si-sub { font-size: 9px; }
}

@media (max-width: 720px) {
  :root { --viewer-height: 240px; }

  main { padding: 0 14px 56px; }
  .topbar { padding: 18px 14px 14px; }
  .topbar h1 { font-size: 14px; letter-spacing: .1em; }

  .champ-card { min-width: 132px; }

  .detail-head { gap: 12px; padding-bottom: 14px; margin-bottom: 14px; }
  .detail-head img { width: 60px; height: 60px; }
  .detail-head .title { font-size: 18px; }

  .result-layout { gap: 8px; }
  .side, .center { border-radius: 12px; }
  .center { padding: 12px; min-height: 180px; }

  /* 十个头像加两个队名在窄屏放不下，缩小图标并收紧间距 */
  .match-row { gap: 10px; padding: 12px; }
  .mr-side { gap: 7px; }
  .mr-picks { gap: 2px; }
  .mr-picks img { width: 21px; height: 21px; }
  .mr-team { font-size: 12px; min-width: 2.6em; }

  .composer-row { padding: 13px 14px; }
  .composer-hint { padding: 0 14px 12px; }
}

/* 竖屏小手机：再收一档，保证十个头像和两个队名还排得下 */
@media (max-width: 480px) {
  :root { --viewer-height: 210px; }

  main { padding: 0 12px 48px; }
  .topbar { padding: 16px 12px 12px; }
  .topbar h1 { font-size: 13px; }

  .match-row { gap: 8px; padding: 10px; }
  .mr-side { gap: 5px; }
  .mr-picks img { width: 18px; height: 18px; border-radius: 4px; }
  .mr-team { font-size: 11px; min-width: 2.4em; }
  .mr-divider { height: 16px; }

  .side-item { width: 64px; }
  .side-item img { width: 30px; height: 30px; }

  .composer-row { gap: 9px; padding: 12px; }
  .composer-input { font-size: 14px; }
  .composer-hint { padding: 0 12px 11px; font-size: 11px; }

  .skill { gap: 10px; }
  .skill img { width: 40px; height: 40px; }
  .features { gap: 8px 14px; }

  .candidates { padding: 0 10px 12px; }
  .champ-card { min-width: 0; flex: 1 1 calc(50% - 4px); }
}

/* 横屏手机：高度才是瓶颈，把图片区压扁，别让一屏只剩张图 */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --viewer-height: 200px; }
  .topbar { padding: 10px 20px 8px; }
  main { padding-bottom: 40px; }
  body.home main { justify-content: flex-start; padding-top: 8px; }
}

/* 大屏：内容可以再宽一点，左右栏也放宽 */
@media (min-width: 1400px) {
  main, .topbar, footer { max-width: 1120px; }
  .side { width: 210px; }
}
