/* ============================================================
   终端输出
   ============================================================ */
.line {
  margin: 0 0 3px;
  max-width: min(74ch, 100%);
  word-break: break-word;
  animation: line-in 0.24s var(--ease-out) both;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 玩家输入的指令回显 */
.line--cmd {
  color: var(--t-2);
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.line--cmd::before {
  content: "›";
  color: var(--qing);
  opacity: 0.7;
  flex: none;
}

/* 叙述正文 */
.line--narr {
  color: var(--t-0);
  line-height: 1.85;
}

/* 系统提示 */
.line--sys {
  color: var(--t-2);
  font-size: 12.5px;
  line-height: 1.7;
}

/* 弱化 */
.line--dim {
  color: var(--t-2);
}

/* 场景标题 */
.line--title {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--t-1);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.28em;
  margin: 26px 0 16px;
  max-width: none;
}
.line--title::before,
.line--title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* NPC 对话：左侧竖线 */
.line--say {
  position: relative;
  padding-left: 14px;
  color: var(--qing);
  line-height: 1.85;
}
.line--say::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 1px;
  background: var(--qing-dim);
}

/* 物品 / 收获 */
.line--item {
  color: var(--jin);
  padding-left: 16px;
  position: relative;
}
.line--item::before {
  content: "▸";
  position: absolute;
  left: 2px;
  color: var(--jin-dim);
}

/* 伤害 / 凶险 */
.line--dmg {
  color: var(--zhu);
}

/* 修为增长 */
.line--gain {
  color: var(--qing);
  font-size: 13px;
}

/* 空行 */
.line--gap {
  height: 10px;
  margin: 0;
}

/* ---------- 天机：模型介入的内容 ----------
   AI 用得越少，这个样式越值钱。它必须一眼可辨，
   但不能抢过正文——玩家要读的是故事，不是"AI 在说话"这件事。 */
.line--tianji {
  position: relative;
  padding-left: 16px;
  color: #ddd3ee;
  line-height: 1.85;
}

.line--tianji::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(201, 167, 255, 0.62), rgba(201, 167, 255, 0.12));
}

/* 推演开始的分隔条 */
.line--tianji-open {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  max-width: none;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--zi);
  opacity: 0.8;
}

.line--tianji-open::before,
.line--tianji-open::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(201, 167, 255, 0.28), transparent);
}

/* 推演中的状态行：三个点在走，文字是步骤名 */
.line--thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--t-2);
  letter-spacing: 0.06em;
  margin: 2px 0 2px 16px;
}

.line--thinking .dots {
  display: inline-flex;
  gap: 3px;
}

.line--thinking .dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--zi);
  opacity: 0.25;
  animation: think 1.05s ease-in-out infinite;
}

.line--thinking .dots i:nth-child(2) {
  animation-delay: 0.16s;
}
.line--thinking .dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes think {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* 可点的选项行：选择本身也不该靠打字 */
.line--choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 6px;
  max-width: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.line--choices.is-used {
  opacity: 0;
  transform: translateY(-4px);
}

.choice {
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--t-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  transition: all 0.16s var(--ease);
}

.choice:hover {
  color: var(--t-0);
  border-color: var(--line-bright);
  background: var(--ink-3);
}

.choice:active {
  transform: translateY(1px);
}

.choice small {
  color: var(--t-3);
  margin-left: 9px;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.choice.is-tianji {
  border-color: rgba(201, 167, 255, 0.28);
}

.choice.is-tianji:hover {
  color: var(--zi);
  border-color: var(--zi);
}

.choice.is-tianji::after {
  content: "◇";
  margin-left: 9px;
  font-size: 9px;
  color: var(--zi);
  opacity: 0.75;
}

.choice[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* 打字机光标 */
.caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  background: var(--qing);
  opacity: 0.75;
  vertical-align: -0.12em;
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

/* 终端顶部渐隐：滚动时不要露出半截字 */
.app__main::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, var(--ink-0), transparent);
}

/* 终端底部的暗角，制造纵深 */
.app__main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--ink-1));
}
