/* assistant.css — 游戏内知识助手（老年用户规范：大字号 / 高对比 / 无动画） */

.tkai-root {
  --tkai-bg: #FAF6EE;
  --tkai-bg2: #F2EBDD;
  --tkai-ink: #221F1A;
  --tkai-muted: #6A6154;
  --tkai-rule: #DCD1BE;
  --tkai-accent: #7A4E14;
  --tkai-accent2: #2F5C55;
  position: fixed;
  inset: 0;
  z-index: 9000;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
  color: var(--tkai-ink);
}
.tkai-root[hidden] { display: none; }

.tkai-mask {
  position: absolute;
  inset: 0;
  background: rgba(34, 31, 26, 0.42);
}

.tkai-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 430px;
  max-width: 100%;
  background: var(--tkai-bg);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(50, 38, 18, 0.16);
  border-left: 1px solid var(--tkai-rule);
}
.tkai-root[dir='rtl'] .tkai-panel {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--tkai-rule);
}

.tkai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--tkai-bg2);
  border-bottom: 1px solid var(--tkai-rule);
}
.tkai-title { font-size: 19px; font-weight: 700; }

.tkai-close {
  width: 48px;
  height: 48px;
  border: 1px solid var(--tkai-rule);
  border-radius: 8px;
  background: #fff;
  color: var(--tkai-ink);
  font-size: 20px;
  cursor: pointer;
}

.tkai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.tkai-hint {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--tkai-muted);
}

.tkai-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.tkai-chip {
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--tkai-rule);
  border-radius: 10px;
  background: #fff;
  color: var(--tkai-ink);
  font-size: 17px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.tkai-chip:active { background: var(--tkai-bg2); }

.tkai-answers { display: flex; flex-direction: column; gap: 12px; }

.tkai-q {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #E7DBC4;
  font-size: 17px;
  line-height: 1.6;
}

.tkai-card {
  border: 1px solid var(--tkai-rule);
  border-radius: 8px;
  background: #FFFDF8;
  padding: 14px 16px;
}
.tkai-card[data-type='rule'] { border-left: 4px solid var(--tkai-accent); }
.tkai-card[data-type='term'] { border-left: 4px solid var(--tkai-accent2); }

.tkai-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tkai-tag {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--tkai-bg2);
  color: var(--tkai-accent);
  font-weight: 700;
}
.tkai-src { font-size: 13px; color: var(--tkai-muted); }

.tkai-card-title {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
}
.tkai-card-body {
  margin: 0;
  font-size: 18px;
  line-height: 1.8;
  color: #322D25;
  white-space: pre-wrap;
  word-break: break-word;
}

.tkai-empty {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--tkai-accent2);
  background: var(--tkai-bg2);
  border-radius: 0 8px 8px 0;
  font-size: 17px;
  line-height: 1.7;
}
.tkai-root[dir='rtl'] .tkai-empty {
  border-left: none;
  border-right: 4px solid var(--tkai-accent2);
  border-radius: 8px 0 0 8px;
}

.tkai-loading {
  margin: 0;
  font-size: 17px;
  color: var(--tkai-muted);
}

.tkai-form {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--tkai-rule);
  background: var(--tkai-bg);
}
.tkai-input {
  flex: 1;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--tkai-rule);
  border-radius: 8px;
  background: #fff;
  color: var(--tkai-ink);
  font-size: 18px;
  font-family: inherit;
}
.tkai-input:focus { outline: 2px solid var(--tkai-accent); outline-offset: 1px; }

.tkai-send {
  min-width: 64px;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: var(--tkai-accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.tkai-foot {
  display: flex;
  gap: 18px;
  padding: 0 16px 14px;
  font-size: 15px;
}
.tkai-link {
  min-height: 40px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--tkai-accent);
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}

.tkai-fb {
  padding: 14px 16px 16px;
  border-top: 1px dashed var(--tkai-rule);
  background: var(--tkai-bg2);
}
.tkai-fb[hidden] { display: none; }
.tkai-fb-label { display: block; font-size: 16px; margin-bottom: 8px; }
.tkai-fb-text {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--tkai-rule);
  border-radius: 8px;
  background: #fff;
  color: var(--tkai-ink);
  font-size: 17px;
  line-height: 1.7;
  font-family: inherit;
  resize: vertical;
}
.tkai-fb-note {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tkai-muted);
}
.tkai-fb-row { display: flex; align-items: center; gap: 12px; }
.tkai-fb-send {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--tkai-accent);
  border-radius: 8px;
  background: #fff;
  color: var(--tkai-accent);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.tkai-fb-msg { font-size: 15px; color: var(--tkai-accent2); }

@media (max-width: 600px) {
  .tkai-panel { width: 100%; border-left: none; }
  .tkai-card-body { font-size: 18px; }
}

/* 右侧悬浮入口：主页与对局页共用，kk-Cyrl 不创建 */
.tkai-fab {
  position: fixed;
  right: 14px;
  bottom: 96px;
  z-index: 60;
  width: 52px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 178, 106, .55);
  border-radius: 50%;
  background: rgba(28, 34, 48, .92);
  color: #d9b26a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tkai-fab svg { width: 24px; height: 24px; }
.tkai-fab:active { transform: scale(.96); }
[dir="rtl"] .tkai-fab { right: auto; left: 14px; }
@media (max-width: 600px) {
  .tkai-fab { right: 12px; bottom: 84px; width: 50px; height: 50px; }
}

/* === 人性化改造：欢迎卡 / 芯片已读 / 公众号 / 气泡 / 提示 === */

.tkai-guess-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tkai-muted);
  letter-spacing: .02em;
}

/* 芯片：已读置灰 */
.tkai-chip-read {
  background: var(--tkai-bg2);
  color: var(--tkai-muted);
  border-color: var(--tkai-rule);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* 欢迎卡：点开面板 0 秒可见 */
.tkai-welcome {
  border: 1px dashed var(--tkai-rule);
  border-radius: 8px;
  background: #FFFDF8;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.tkai-welcome-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.8;
  color: #322D25;
}

/* 公众号 L1：底部常驻按钮 */
.tkai-foot { align-items: center; }
.tkai-gzh-btn {
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--tkai-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.tkai-gzh-btn:active { opacity: .85; }

/* 公众号 L2：答案尾注引导 */
.tkai-gzh-line { margin: 10px 0 0; }
.tkai-gzh-more {
  border: none;
  background: none;
  padding: 0;
  color: var(--tkai-accent);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

/* 公众号二维码层 + 兜底卡 */
.tkai-gzh-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tkai-gzh-mask {
  position: absolute;
  inset: 0;
  background: rgba(34, 31, 26, .5);
}
.tkai-gzh-box {
  position: relative;
  width: 260px;
  max-width: 84%;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.tkai-gzh-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--tkai-muted);
  cursor: pointer;
}
.tkai-gzh-img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
.tkai-gzh-cap {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--tkai-ink);
}
.tkai-gzh-card { text-align: center; }

/* 一次性引导气泡（静态，无动画） */
.tkai-bubble {
  position: fixed;
  z-index: 61;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(28, 34, 48, .94);
  color: #EDE0C4;
  border: 1px solid rgba(217, 178, 106, .6);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  font-size: 15px;
  line-height: 1.5;
}
.tkai-bubble-text { flex: 1; }
.tkai-bubble-x {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #EDE0C4;
  font-size: 16px;
  cursor: pointer;
}

/* L4：关面板一次性提示 */
.tkai-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 9100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90%;
  padding: 12px 16px;
  background: rgba(28, 34, 48, .95);
  color: #EDE0C4;
  border: 1px solid rgba(217, 178, 106, .6);
  border-radius: 10px;
  font-size: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.tkai-toast-text { flex: 1; }
.tkai-toast-x {
  border: none;
  background: none;
  color: #EDE0C4;
  font-size: 16px;
  cursor: pointer;
}
[dir="rtl"] .tkai-toast { transform: translateX(50%); }

/* === 第二批：追问芯片 / 对局中悬浮球收敛 === */

/* 答完后「还可以问」追问区 */
.tkai-related {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--tkai-rule);
}
.tkai-related-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tkai-muted);
}
.tkai-rel-chip {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--tkai-rule);
  border-radius: 10px;
  background: var(--tkai-bg2);
  color: var(--tkai-ink);
  font-size: 17px;
  font-family: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.tkai-rel-chip:last-child { margin-bottom: 0; }
.tkai-rel-chip:active { background: #E7DBC4; }
.tkai-root[dir='rtl'] .tkai-rel-chip { text-align: right; }

/* 对局进行中：悬浮球缩小并半透明，不遮挡棋盘（纯 CSS 状态，无动画） */
body[data-tk-phase='playing'] .tkai-fab {
  transform: scale(.8);
  opacity: .6;
}
body[data-tk-phase='playing'] .tkai-fab:active {
  transform: scale(.76);
  opacity: .85;
}


