/* 新手教程：教练浮层、高亮、术语、首页卡片与玩法手册。平面黑金，细线分区。 */
.coach {
  position: fixed; z-index: 75; right: 24px; bottom: 24px; width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 560px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid rgba(214,176,106,.45); border-radius: 14px;
  padding: 16px 18px 12px; box-shadow: 0 14px 40px rgba(0,0,0,.45);
  font-size: 14px; line-height: 1.75; color: var(--ink-2);
  animation: coachIn .32s cubic-bezier(.16,1,.3,1) both;
}
@keyframes coachIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.coach .ic { width: 16px; height: 16px; flex: none; }
.coach-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px -6px 6px 0; }
.coach-head > span:last-child { display: inline-flex; }
.coach-kicker { color: var(--gold); font-size: 11.5px; letter-spacing: .1em; }
.coach-kicker b { color: var(--ink); font-weight: 600; }
.coach-x { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.coach-x:hover { color: var(--ink); background: var(--surface-2); }
.coach-bar { height: 2px; background: var(--line); border-radius: 2px; margin-bottom: 12px; overflow: hidden; }
.coach-bar i { display: block; height: 100%; background: var(--gold); transition: width .4s cubic-bezier(.16,1,.3,1); }
.coach h4 { margin: 0 0 6px; font: 600 16px/1.5 var(--serif); color: var(--ink); letter-spacing: .02em; }
.coach p { margin: 0 0 8px; }
.coach-body strong { color: var(--ink); }
.coach-wait { display: flex; gap: 8px; align-items: flex-start; color: var(--gold); font-size: 13px; margin: 10px 0 4px !important; }
.coach-wait .ic { margin-top: 4px; width: 13px; height: 13px; }
.coach-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.coach-acts .btn.small { min-height: 36px; font-size: 13px; padding: 0 14px; border-radius: 9px; }
.coach-acts .btn.text { min-height: 36px; padding: 0 8px; }
.coach-skip { margin-left: auto; font-size: 12px !important; }
.coach-term { display: inline; padding: 0 1px; border: 0; background: none; color: var(--gold); font: inherit; border-bottom: 1px dashed rgba(214,176,106,.6); cursor: help; }
.coach-term:hover { color: var(--ink); }
.coach-def { display: block; margin: 6px 0; padding: 8px 10px; border-left: 2px solid var(--gold); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--ink-2); animation: coachIn .2s both; }
.coach-mini { display: none; }
.coach.min { width: auto; padding: 0; border-radius: 999px; overflow: hidden; }
.coach.min > :not(.coach-mini) { display: none; }
.coach.min .coach-mini { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 0; background: none; color: var(--gold); font: 600 13px/1 var(--sans); cursor: pointer; }
.coach-tip { border-color: var(--line); }

/* 被指到的那一块：金色细框，轻轻呼吸 */
.coach-on { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 10px; animation: coachPulse 2.2s ease-in-out infinite; scroll-margin: 90px; }
@keyframes coachPulse { 50% { outline-color: rgba(214,176,106,.35); } }

/* 教程进行时页面底部多留一段，最下面的按钮也能滚到卡片上方 */
body:has(.coach:not(.min):not(.coach-tip)) .main { padding-bottom: min(70vh, 560px); }

/* 首页卡片 */
.tut-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border: 1px solid rgba(214,176,106,.4); border-radius: 14px; padding: 20px 22px; margin: 18px 0; background: linear-gradient(90deg, rgba(214,176,106,.08), transparent 70%), var(--surface); }
.tut-card > div:first-child { flex: 1 1 360px; }
.tut-card h2 { font: 600 18px/1.5 var(--serif) !important; margin: 4px 0 6px !important; color: var(--ink); }
.tut-card p { margin: 0 0 6px; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.tut-card .tut-note { color: var(--muted); font-size: 12.5px; }
.tut-card .tut-note strong { color: var(--gold); font-weight: 600; }
.tut-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 12px; letter-spacing: .1em; }
.tut-kicker .ic, .tut-line .ic, .tut-banner .ic { width: 15px; height: 15px; flex: none; }
.tut-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tut-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 12px 0 16px; color: var(--muted); font-size: 13px; }
.tut-line .ic { color: var(--gold); }
.tut-line .btn.small { min-height: 34px; font-size: 13px; padding: 0 8px; }
.tut-banner { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 16px; padding: 9px 14px; border: 1px dashed rgba(214,176,106,.5); border-radius: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.tut-banner .ic { color: var(--gold); margin-top: 3px; }
.tut-banner strong { color: var(--gold); }
.arena-head-acts, .deep-head-acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.arena-head-acts .btn .ic, .deep-head-acts .btn .ic { width: 15px; height: 15px; margin-right: 4px; }

/* 玩法手册 */
.manual-modal .manual-box { width: min(620px, 100%); max-height: min(84vh, 760px); overflow: auto; text-align: left; padding: 20px 22px; }
.manual-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.manual-head h3 { margin: 0 !important; }
.manual-item { border-top: 1px solid var(--line); }
.manual-item summary { cursor: pointer; padding: 12px 2px; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.manual-item summary::-webkit-details-marker { display: none; }
.manual-item summary::after { content: "+"; color: var(--gold); font-weight: 400; }
.manual-item[open] summary::after { content: "−"; }
.manual-item > div, .manual-terms { padding: 0 2px 14px; color: var(--ink-2); font-size: 14px; line-height: 1.85; }
.manual-terms { display: grid; gap: 8px; margin: 0; }
.manual-terms div { display: grid; grid-template-columns: 6em 1fr; gap: 10px; }
.manual-terms dt { color: var(--gold); font-weight: 600; }
.manual-terms dd { margin: 0; }

@media (max-width: 899px) {
  .coach { left: 10px; right: 10px; width: auto; bottom: calc(var(--nav-h, 64px) + 20px + env(safe-area-inset-bottom)); max-height: 46vh; padding: 12px 14px 8px; font-size: 13.5px; line-height: 1.7; }
  .coach.min { left: auto; right: 12px; }
  .coach h4 { font-size: 15px; }
  .coach-acts { position: sticky; bottom: -8px; margin: 10px -14px -8px; padding: 8px 14px 10px; background: var(--surface); border-top: 1px solid var(--line); }
  .tut-card { padding: 16px; }
  .tut-acts { width: 100%; }
  .tut-acts .btn:not(.text) { flex: 1 1 auto; }
  .manual-terms div { grid-template-columns: 1fr; gap: 2px; }
  /* 教程进行时给页面底部留出卡片的高度，最后的按钮不会被盖住 */
  body:has(.coach:not(.min):not(.coach-tip)) .main { padding-bottom: calc(46vh + var(--nav-h, 64px) + 40px); }
}
@media (prefers-reduced-motion: reduce) {
  .coach, .coach-def { animation: none; }
  .coach-on { animation: none; }
}
