/*
 * 全民修真时代｜聊天正文、单按钮手机终端、完整记忆回廊与玩家消息
 * Version: V1.0
 * Scope: .tyx-chat-root + official player-message/input IDs
 */


.tyx-chat-root,
.tyx-chat-root * {
  box-sizing: border-box;
}

.tyx-chat-root {
  --tyx-chat-jade-0: #f8fcfa;
  --tyx-chat-jade-1: #edf7f3;
  --tyx-chat-jade-2: #dceee8;
  --tyx-chat-ink: #17302e;
  --tyx-chat-text: #263c39;
  --tyx-chat-muted: #617773;
  --tyx-chat-line: rgba(35, 101, 90, 0.16);
  --tyx-chat-mint: #168f7c;
  --tyx-chat-mint-soft: #e1f4ef;
  --tyx-chat-gold: #b7832f;
  --tyx-chat-gold-soft: #fbf2df;
  --tyx-chat-blue: #327a95;
  --tyx-chat-violet: #6b5b99;
  --tyx-chat-red: #b94e4a;
  --tyx-chat-red-soft: #fbeceb;
  --tyx-chat-amber: #a66f19;
  --tyx-chat-amber-soft: #fff4dd;
  --tyx-chat-shadow: 0 14px 34px rgba(26, 65, 59, 0.10);
  width: 100%;
  max-width: 920px;
  margin: 12px auto;
  padding: clamp(14px, 2.4vw, 24px);
  color: var(--tyx-chat-text);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(240,248,245,0.98)),
    var(--tyx-chat-jade-0);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 22px;
  box-shadow: var(--tyx-chat-shadow);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.78;
  overflow-wrap: anywhere;
  word-break: break-word;
  isolation: isolate;
}

.tyx-chat-root p,
.tyx-chat-root ul,
.tyx-chat-root h2,
.tyx-chat-root h3 {
  margin-top: 0;
}

.tyx-chat-root p:last-child,
.tyx-chat-root ul:last-child {
  margin-bottom: 0;
}

.tyx-chat-root strong {
  color: var(--tyx-chat-ink);
}

.tyx-chat-root time {
  font-variant-numeric: tabular-nums;
}

.tyx-chat-root .tyx-chat-scene-head,
.tyx-chat-root .tyx-chat-opening-head,
.tyx-chat-root .tyx-chat-plan-head,
.tyx-chat-root .tyx-chat-risk-head,
.tyx-chat-root .tyx-chat-settlement-head,
.tyx-chat-root .tyx-chat-terminal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px 14px 18px;
  background: linear-gradient(105deg, rgba(225,244,239,0.92), rgba(255,255,255,0.92));
  border: 1px solid var(--tyx-chat-line);
  border-radius: 16px;
  overflow: hidden;
}

.tyx-chat-root .tyx-chat-scene-head::before,
.tyx-chat-root .tyx-chat-opening-head::before,
.tyx-chat-root .tyx-chat-plan-head::before,
.tyx-chat-root .tyx-chat-risk-head::before,
.tyx-chat-root .tyx-chat-settlement-head::before,
.tyx-chat-root .tyx-chat-terminal-head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--tyx-chat-mint), var(--tyx-chat-gold));
}

.tyx-chat-root .tyx-chat-scene-time,
.tyx-chat-root .tyx-chat-terminal-head > div {
  min-width: 0;
}

.tyx-chat-root .tyx-chat-scene-time time,
.tyx-chat-root .tyx-chat-plan-head span,
.tyx-chat-root .tyx-chat-risk-head span,
.tyx-chat-root .tyx-chat-settlement-head span,
.tyx-chat-root .tyx-chat-terminal-kicker {
  display: block;
  color: var(--tyx-chat-mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.tyx-chat-root .tyx-chat-scene-place {
  display: block;
  margin-top: 4px;
  color: var(--tyx-chat-ink);
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 800;
  line-height: 1.45;
}

.tyx-chat-root .tyx-chat-scene-tag,
.tyx-chat-root .tyx-chat-terminal-state {
  flex: 0 0 auto;
  max-width: 42%;
  padding: 5px 10px;
  color: #44615c;
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.tyx-chat-root .tyx-chat-story {
  position: relative;
  margin: 0;
  padding: 2px clamp(2px, 1.2vw, 10px) 4px;
}

.tyx-chat-root .tyx-chat-prose {
  color: var(--tyx-chat-text);
  font-size: clamp(15.5px, 1.9vw, 17px);
  line-height: 1.92;
  letter-spacing: 0.01em;
}

.tyx-chat-root .tyx-chat-prose p {
  margin-bottom: 1.05em;
}

.tyx-chat-root .tyx-chat-prose em {
  color: var(--tyx-chat-mint);
  font-style: normal;
  font-weight: 700;
}

.tyx-chat-root .tyx-chat-section-title {
  margin-bottom: 10px;
  color: var(--tyx-chat-ink);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.tyx-chat-root .tyx-chat-section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--tyx-chat-mint);
  border-radius: 2px;
  transform: rotate(45deg);
}

.tyx-chat-root .tyx-chat-changes,
.tyx-chat-root .tyx-chat-next,
.tyx-chat-root .tyx-chat-opening-context,
.tyx-chat-root .tyx-chat-plan-summary,
.tyx-chat-root .tyx-chat-plan-cost,
.tyx-chat-root .tyx-chat-settlement-summary,
.tyx-chat-root .tyx-chat-app-section,
.tyx-chat-root .tyx-chat-risk-range {
  margin-top: 18px;
  padding: 15px 16px;
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 15px;
}

.tyx-chat-root .tyx-chat-changes {
  background: linear-gradient(120deg, rgba(225,244,239,0.66), rgba(255,255,255,0.86));
}

.tyx-chat-root .tyx-chat-change-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tyx-chat-root .tyx-chat-change-list li {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  background: rgba(255,255,255,0.68);
  border-radius: 10px;
}

.tyx-chat-root .tyx-chat-change-list li strong {
  color: var(--tyx-chat-mint);
  font-size: 13px;
}

.tyx-chat-root .tyx-chat-change-list li span {
  min-width: 0;
  color: var(--tyx-chat-text);
  font-size: 14px;
}

.tyx-chat-root .tyx-chat-next {
  border-color: rgba(183,131,47,0.20);
  background: linear-gradient(120deg, rgba(251,242,223,0.62), rgba(255,255,255,0.88));
}

.tyx-chat-root .tyx-chat-next-copy {
  color: var(--tyx-chat-text);
}

.tyx-chat-root .tyx-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tyx-chat-root .tyx-chat-suggestions span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  color: #5a492a;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(183,131,47,0.22);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.45;
}

.tyx-chat-root .tyx-chat-free-input,
.tyx-chat-root .tyx-chat-view-note {
  margin-top: 10px;
  color: var(--tyx-chat-muted);
  font-size: 13px;
}

.tyx-chat-root .tyx-chat-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding: 10px;
  background: #173b37;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(19,59,55,0.14);
}

.tyx-chat-root .tyx-chat-status-item {
  min-width: 0;
  padding: 9px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}

.tyx-chat-root .tyx-chat-status-item span {
  display: block;
  margin-bottom: 2px;
  color: #acd2c9;
  font-size: 11px;
  line-height: 1.35;
}

.tyx-chat-root .tyx-chat-status-item strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.45;
}

.tyx-chat-root .tyx-chat-status-wide {
  grid-column: span 2;
}

.tyx-chat-root .tyx-chat-risk-card {
  position: relative;
  margin-top: 18px;
  padding: 15px 16px 15px 18px;
  background: var(--tyx-chat-amber-soft);
  border: 1px solid rgba(166,111,25,0.28);
  border-left: 5px solid var(--tyx-chat-amber);
  border-radius: 14px;
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="low"] {
  background: var(--tyx-chat-mint-soft);
  border-color: rgba(22,143,124,0.24);
  border-left-color: var(--tyx-chat-mint);
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="medium"] {
  background: var(--tyx-chat-amber-soft);
  border-left-color: var(--tyx-chat-amber);
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="high"],
.tyx-chat-root .tyx-chat-risk-card[data-risk="extreme"] {
  background: var(--tyx-chat-red-soft);
  border-color: rgba(185,78,74,0.24);
  border-left-color: var(--tyx-chat-red);
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="extreme"] {
  box-shadow: inset 0 0 0 1px rgba(185,78,74,0.08);
}

.tyx-chat-root .tyx-chat-risk-level {
  color: var(--tyx-chat-red);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="low"] .tyx-chat-risk-level {
  color: var(--tyx-chat-mint);
}

.tyx-chat-root .tyx-chat-risk-card[data-risk="medium"] .tyx-chat-risk-level {
  color: var(--tyx-chat-amber);
}

.tyx-chat-root .tyx-chat-risk-copy {
  margin: 6px 0 8px;
}

.tyx-chat-root .tyx-chat-risk-factors {
  margin: 0;
  padding-left: 1.25em;
  color: #4f5e5b;
  font-size: 14px;
}

.tyx-chat-root .tyx-chat-risk-grid,
.tyx-chat-root .tyx-chat-settlement-grid,
.tyx-chat-root .tyx-chat-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.tyx-chat-root .tyx-chat-risk-grid article,
.tyx-chat-root .tyx-chat-settlement-card,
.tyx-chat-root .tyx-chat-metric {
  min-width: 0;
  padding: 13px 14px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 13px;
}

.tyx-chat-root .tyx-chat-risk-grid article span,
.tyx-chat-root .tyx-chat-settlement-card > span,
.tyx-chat-root .tyx-chat-metric > span {
  display: block;
  margin-bottom: 4px;
  color: var(--tyx-chat-muted);
  font-size: 12px;
}

.tyx-chat-root .tyx-chat-risk-grid article strong,
.tyx-chat-root .tyx-chat-settlement-card > strong,
.tyx-chat-root .tyx-chat-metric > strong {
  display: block;
  color: var(--tyx-chat-ink);
  font-size: 16px;
  line-height: 1.45;
}

.tyx-chat-root .tyx-chat-risk-range {
  border-color: rgba(185,78,74,0.20);
}

.tyx-chat-root .tyx-chat-risk-range > span {
  color: var(--tyx-chat-muted);
  font-size: 12px;
}

.tyx-chat-root .tyx-chat-risk-range > strong {
  display: block;
  color: var(--tyx-chat-red);
  font-size: 18px;
}

.tyx-chat-root .tyx-chat-terminal,
.tyx-chat-root .tyx-chat-memory-update {
  margin-top: 16px;
  background: rgba(249,253,251,0.92);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 14px;
  overflow: hidden;
}

.tyx-chat-root .tyx-chat-terminal > summary,
.tyx-chat-root .tyx-chat-memory-update > summary {
  padding: 12px 15px;
  color: var(--tyx-chat-ink);
  background: var(--tyx-chat-jade-1);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.tyx-chat-root .tyx-chat-terminal[open] > summary,
.tyx-chat-root .tyx-chat-memory-update[open] > summary {
  border-bottom: 1px solid var(--tyx-chat-line);
}

.tyx-chat-root .tyx-chat-terminal-body,
.tyx-chat-root .tyx-chat-memory-entry {
  padding: 14px 15px;
}

.tyx-chat-root .tyx-chat-memory-entry {
  color: #4a605c;
  font-size: 14px;
}

.tyx-chat-root .tyx-chat-terminal-title {
  margin: 3px 0 0;
  color: var(--tyx-chat-ink);
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
}

.tyx-chat-root .tyx-chat-app {
  position: relative;
  padding: 16px;
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--tyx-chat-line);
  border-top: 4px solid var(--tyx-chat-mint);
  border-radius: 16px;
}

.tyx-chat-root .tyx-chat-app-wallet,
.tyx-chat-root .tyx-chat-app-assets {
  border-top-color: var(--tyx-chat-gold);
}

.tyx-chat-root .tyx-chat-app-cultivation,
.tyx-chat-root .tyx-chat-app-spirit {
  border-top-color: var(--tyx-chat-mint);
}

.tyx-chat-root .tyx-chat-app-contacts,
.tyx-chat-root .tyx-chat-app-career,
.tyx-chat-root .tyx-chat-app-study {
  border-top-color: var(--tyx-chat-blue);
}

.tyx-chat-root .tyx-chat-app-feed,
.tyx-chat-root .tyx-chat-app-business {
  border-top-color: var(--tyx-chat-violet);
}

.tyx-chat-root .tyx-chat-app-map,
.tyx-chat-root .tyx-chat-app-schedule,
.tyx-chat-root .tyx-chat-app-today {
  border-top-color: #478a80;
}

.tyx-chat-root .tyx-chat-app-memory,
.tyx-chat-root .tyx-chat-app-profile {
  border-top-color: #85725a;
}

.tyx-chat-root .tyx-chat-metric {
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(238,247,244,0.78));
}

.tyx-chat-root .tyx-chat-app-wallet .tyx-chat-metric {
  background: linear-gradient(145deg, rgba(255,252,245,0.96), rgba(251,242,223,0.76));
}

.tyx-chat-root .tyx-chat-app-section + .tyx-chat-app-section {
  margin-top: 10px;
}

.tyx-chat-root .tyx-chat-plan-head,
.tyx-chat-root .tyx-chat-risk-head,
.tyx-chat-root .tyx-chat-settlement-head {
  align-items: center;
}

.tyx-chat-root .tyx-chat-plan-head strong,
.tyx-chat-root .tyx-chat-risk-head strong,
.tyx-chat-root .tyx-chat-settlement-head strong {
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.4;
  text-align: right;
}

.tyx-chat-root .tyx-chat-plan-list {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-left: 14px;
}

.tyx-chat-root .tyx-chat-plan-list::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 2px;
  background: var(--tyx-chat-jade-2);
}

.tyx-chat-root .tyx-chat-plan-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr;
  gap: 2px 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--tyx-chat-line);
  border-radius: 13px;
}

.tyx-chat-root .tyx-chat-plan-item::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -14px;
  width: 8px;
  height: 8px;
  background: var(--tyx-chat-mint);
  border: 3px solid var(--tyx-chat-jade-0);
  border-radius: 50%;
}

.tyx-chat-root .tyx-chat-plan-item time {
  grid-row: span 2;
  color: var(--tyx-chat-mint);
  font-size: 13px;
  font-weight: 800;
}

.tyx-chat-root .tyx-chat-plan-item strong {
  font-size: 15px;
}

.tyx-chat-root .tyx-chat-plan-item span {
  color: var(--tyx-chat-muted);
  font-size: 13px;
}

.tyx-chat-root .tyx-chat-plan-cost {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tyx-chat-root .tyx-chat-plan-cost div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--tyx-chat-jade-1);
  border-radius: 10px;
}

.tyx-chat-root .tyx-chat-plan-cost span {
  display: block;
  color: var(--tyx-chat-muted);
  font-size: 11px;
}

.tyx-chat-root .tyx-chat-plan-cost strong {
  display: block;
  font-size: 14px;
}

.tyx-chat-root .tyx-chat-settlement-card p {
  margin: 5px 0 0;
  color: var(--tyx-chat-muted);
  font-size: 13px;
}

.tyx-chat-root .tyx-chat-opening-head {
  min-height: 92px;
  align-items: center;
  color: #ffffff;
  background:
    linear-gradient(115deg, rgba(20,76,69,0.98), rgba(35,110,97,0.92));
  border-color: rgba(255,255,255,0.08);
}

.tyx-chat-root .tyx-chat-opening-head::before {
  background: linear-gradient(to bottom, #7ce2ce, #e3b55c);
}

.tyx-chat-root .tyx-chat-opening-head,
.tyx-chat-root .tyx-chat-opening-head strong,
.tyx-chat-root .tyx-chat-opening-head span,
.tyx-chat-root .tyx-chat-opening-head time {
  color: #ffffff;
}

.tyx-chat-root .tyx-chat-opening-context {
  background: linear-gradient(120deg, rgba(225,244,239,0.72), rgba(251,242,223,0.58));
}

.tyx-chat-root .tyx-chat-ooc,
.tyx-chat-root .tyx-chat-repair {
  border: 1px solid var(--tyx-chat-line);
  border-radius: 15px;
  overflow: hidden;
}

.tyx-chat-root .tyx-chat-ooc-head {
  padding: 11px 14px;
  color: #ffffff;
  background: #4d5f74;
  font-weight: 800;
}

.tyx-chat-root .tyx-chat-ooc-body,
.tyx-chat-root .tyx-chat-repair {
  padding: 15px 16px;
  background: rgba(255,255,255,0.84);
}

.tyx-chat-root .tyx-chat-repair {
  border-left: 5px solid var(--tyx-chat-mint);
}

.tyx-chat-root .tyx-chat-repair strong {
  display: block;
  margin-bottom: 5px;
  color: var(--tyx-chat-mint);
}

.tyx-chat-root .tyx-chat-sync {
  display: none !important;
}

@media (max-width: 720px) {
  .tyx-chat-root {
    margin: 8px auto;
    padding: 14px;
    border-radius: 17px;
    font-size: 15.5px;
  }

  .tyx-chat-root .tyx-chat-change-list,
  .tyx-chat-root .tyx-chat-risk-grid,
  .tyx-chat-root .tyx-chat-settlement-grid,
  .tyx-chat-root .tyx-chat-app-grid {
    grid-template-columns: 1fr;
  }

  .tyx-chat-root .tyx-chat-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tyx-chat-root .tyx-chat-status-wide {
    grid-column: span 2;
  }

  .tyx-chat-root .tyx-chat-plan-cost {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tyx-chat-root {
    padding: 12px;
    border-radius: 14px;
    line-height: 1.72;
  }

  .tyx-chat-root .tyx-chat-scene-head,
  .tyx-chat-root .tyx-chat-opening-head,
  .tyx-chat-root .tyx-chat-plan-head,
  .tyx-chat-root .tyx-chat-risk-head,
  .tyx-chat-root .tyx-chat-settlement-head,
  .tyx-chat-root .tyx-chat-terminal-head {
    display: block;
    padding: 13px 13px 13px 16px;
  }

  .tyx-chat-root .tyx-chat-scene-tag,
  .tyx-chat-root .tyx-chat-terminal-state {
    display: inline-block;
    max-width: 100%;
    margin-top: 10px;
  }

  .tyx-chat-root .tyx-chat-plan-head strong,
  .tyx-chat-root .tyx-chat-risk-head strong,
  .tyx-chat-root .tyx-chat-settlement-head strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .tyx-chat-root .tyx-chat-prose {
    font-size: 15.5px;
    line-height: 1.88;
  }

  .tyx-chat-root .tyx-chat-change-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tyx-chat-root .tyx-chat-status-strip {
    grid-template-columns: 1fr;
  }

  .tyx-chat-root .tyx-chat-status-wide {
    grid-column: auto;
  }

  .tyx-chat-root .tyx-chat-plan-item {
    grid-template-columns: 1fr;
  }

  .tyx-chat-root .tyx-chat-plan-item time {
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tyx-chat-root,
  .tyx-chat-root * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* AI风月站内夜间模式补丁：平台根元素使用.dark；不得替换为prefers-color-scheme */
.dark .tyx-chat-root{
  --tyx-chat-jade-0:#111a19;
  --tyx-chat-jade-1:#172321;
  --tyx-chat-jade-2:#22322f;
  --tyx-chat-ink:#e8f4f0;
  --tyx-chat-text:#d3e1dd;
  --tyx-chat-muted:#9db2ac;
  --tyx-chat-line:rgba(151,207,193,.18);
  --tyx-chat-mint:#55cdb3;
  --tyx-chat-mint-soft:#193a34;
  --tyx-chat-gold:#d3aa5f;
  --tyx-chat-gold-soft:#382f20;
  --tyx-chat-blue:#72b4cc;
  --tyx-chat-violet:#a79ad3;
  --tyx-chat-red:#e17b75;
  --tyx-chat-red-soft:#3d2525;
  --tyx-chat-amber:#d7a64f;
  --tyx-chat-amber-soft:#3a2d19;
  --tyx-chat-shadow:0 18px 42px rgba(0,0,0,.34);
  color:var(--tyx-chat-text);
  background:linear-gradient(135deg,rgba(20,31,29,.98),rgba(13,23,21,.98));
}
.dark .tyx-chat-root .tyx-chat-scene-head,
.dark .tyx-chat-root .tyx-chat-opening-head,
.dark .tyx-chat-root .tyx-chat-plan-head,
.dark .tyx-chat-root .tyx-chat-risk-head,
.dark .tyx-chat-root .tyx-chat-settlement-head,
.dark .tyx-chat-root .tyx-chat-terminal-head{
  background:linear-gradient(105deg,rgba(27,53,47,.96),rgba(20,31,29,.96));
}
.dark .tyx-chat-root .tyx-chat-scene-tag,
.dark .tyx-chat-root .tyx-chat-terminal-state,
.dark .tyx-chat-root .tyx-chat-changes,
.dark .tyx-chat-root .tyx-chat-next,
.dark .tyx-chat-root .tyx-chat-opening-context,
.dark .tyx-chat-root .tyx-chat-plan-summary,
.dark .tyx-chat-root .tyx-chat-plan-cost,
.dark .tyx-chat-root .tyx-chat-settlement-summary,
.dark .tyx-chat-root .tyx-chat-app-section,
.dark .tyx-chat-root .tyx-chat-risk-range,
.dark .tyx-chat-root .tyx-chat-status-item,
.dark .tyx-chat-root .tyx-chat-phone-card,
.dark .tyx-chat-root details{
  color:var(--tyx-chat-text);
  background:rgba(27,42,39,.92);
  border-color:var(--tyx-chat-line);
}
.dark .tyx-chat-root .tyx-chat-change-list li,
.dark .tyx-chat-root .tyx-chat-phone-metric,
.dark .tyx-chat-root .tyx-chat-memory-item{
  color:var(--tyx-chat-text);
  background:rgba(38,56,52,.82);
}
.dark .tyx-chat-root summary,
.dark .tyx-chat-root .tyx-chat-app-label,
.dark .tyx-chat-root .tyx-chat-free-input{
  color:var(--tyx-chat-text);
}

/* 机器同步区：平台保留自定义标签时由标签与class双重隐藏 */
tyx-sync,
.tyx-chat-sync,
#customized-answer-content tyx-sync,
#customized-answer-content .tyx-chat-sync {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* =========================================================
   V1.0 单按钮手机终端 + 完整太一记忆回廊
   结构继承成熟终端机制，视觉为本卡独立设计
   ========================================================= */

/* 状态栏深色背景必须使用明亮文字，避免平台继承造成暗字 */
.tyx-chat-root .tyx-chat-status-strip,
.tyx-chat-root .tyx-chat-status-strip * { color:#f1fffb !important; }
.tyx-chat-root .tyx-chat-status-item span,
.tyx-chat-root .tyx-chat-status-label { color:#b9ded5 !important; }
.tyx-chat-root .tyx-chat-status-item strong,
.tyx-chat-root .tyx-chat-status-item b,
.tyx-chat-root .tyx-chat-status-value { color:#ffffff !important; }

.tyx-chat-root details.tyx-chat-phone {
  width:100%;
  margin:16px 0 0;
  padding:0;
  color:inherit;
  background:transparent;
  border:0;
  box-shadow:none;
  overflow:visible;
}
.tyx-chat-root .tyx-chat-phone > summary.tyx-chat-phone-launch {
  position:relative;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  width:min(430px,100%);
  min-height:58px;
  margin:0 auto;
  padding:10px 12px;
  color:#effff9;
  background:linear-gradient(135deg,#123e38,#17685a 58%,#22917a);
  border:1px solid rgba(111,235,205,.28);
  border-radius:18px;
  box-shadow:0 14px 30px rgba(17,79,68,.22),inset 0 1px rgba(255,255,255,.09);
  list-style:none;
  cursor:pointer;
  user-select:none;
  transition:transform .18s ease,box-shadow .18s ease;
}
.tyx-chat-root .tyx-chat-phone > summary::-webkit-details-marker { display:none; }
.tyx-chat-root .tyx-chat-phone > summary:hover { transform:translateY(-1px); box-shadow:0 18px 36px rgba(17,79,68,.28),0 0 24px rgba(59,206,171,.16); }
.tyx-chat-root .tyx-chat-phone-launch-icon {
  display:grid;place-items:center;width:36px;height:36px;border-radius:12px;
  color:#eafff8;background:linear-gradient(145deg,#3ac1a5,#1c7565);
  box-shadow:0 8px 18px rgba(5,51,43,.25),inset 0 1px rgba(255,255,255,.14);
  font-size:17px;font-weight:900;
}
.tyx-chat-root .tyx-chat-phone-launch-copy { min-width:0; }
.tyx-chat-root .tyx-chat-phone-launch-copy b { display:block;color:#fff!important;font-size:14px;line-height:1.35; }
.tyx-chat-root .tyx-chat-phone-launch-copy small { display:block;margin-top:2px;color:rgba(232,255,248,.76)!important;font-size:10px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tyx-chat-root .tyx-chat-phone-launch-badge { display:grid;place-items:center;min-width:27px;height:27px;padding:0 6px;color:#143c34;background:#d7fff4;border-radius:999px;font-size:10px;font-weight:900; }
.tyx-chat-root .tyx-chat-phone[open] > summary { border-radius:18px 18px 10px 10px; }

.tyx-chat-root .tyx-chat-phone-device {
  position:relative;
  width:min(398px,100%);
  margin:12px auto 0;
  padding:10px;
  color:#203f39;
  background:linear-gradient(180deg,#0d2925,#17463d);
  border:1px solid rgba(112,239,208,.24);
  border-radius:32px;
  box-shadow:0 28px 58px rgba(5,25,22,.36),inset 0 1px rgba(255,255,255,.08),0 0 30px rgba(50,192,159,.14);
  overflow:hidden;
}
.tyx-chat-root .tyx-chat-phone-device::before {
  content:"";position:absolute;left:50%;top:0;transform:translateX(-50%);width:86px;height:16px;
  background:#0b2a25;border-radius:0 0 13px 13px;z-index:2;
}
.tyx-chat-root .tyx-chat-phone-screen {
  position:relative;
  min-height:520px;
  padding:15px 12px 10px;
  color:#203f39!important;
  background:
    linear-gradient(rgba(25,130,110,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(25,130,110,.045) 1px,transparent 1px),
    radial-gradient(circle at 88% 5%,rgba(68,220,183,.18),transparent 26%),
    linear-gradient(155deg,#f2fbf7,#e3f1ec 55%,#eef8f4);
  background-size:22px 22px,22px 22px,auto,auto;
  border-radius:24px;
  overflow:hidden;
}
.tyx-chat-root .tyx-chat-phone-screen,
.tyx-chat-root .tyx-chat-phone-screen * { color:#203f39; }
.tyx-chat-root .tyx-chat-phone-statusbar { display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:23px;padding:0 4px;color:#48655f!important;font-size:9px;font-weight:700;letter-spacing:.04em; }
.tyx-chat-root .tyx-chat-phone-statusbar b { color:#168f7c!important;font-size:8px;letter-spacing:.12em; }
.tyx-chat-root .tyx-chat-phone-owner { display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:5px 0 9px;padding:11px 12px;background:rgba(255,255,255,.70);border:1px solid rgba(35,101,90,.14);border-radius:15px;box-shadow:0 10px 18px rgba(23,89,77,.06); }
.tyx-chat-root .tyx-chat-phone-owner small { display:block;color:#5c7871!important;font-size:8px;font-weight:800;letter-spacing:.10em; }
.tyx-chat-root .tyx-chat-phone-owner b { display:block;color:#173a35!important;font-size:19px;line-height:1.25; }
.tyx-chat-root .tyx-chat-phone-owner > span { color:#2f6e62!important;font-size:9px;font-weight:800;white-space:nowrap; }
.tyx-chat-root .tyx-chat-phone-quick { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:10px; }
.tyx-chat-root .tyx-chat-phone-quick div { min-width:0;padding:8px 5px;text-align:center;background:rgba(255,255,255,.77);border:1px solid rgba(35,101,90,.12);border-radius:10px; }
.tyx-chat-root .tyx-chat-phone-quick span { display:block;color:#6b817c!important;font-size:7.5px; }
.tyx-chat-root .tyx-chat-phone-quick b { display:block;color:#183b35!important;font-size:10px;line-height:1.35;overflow-wrap:anywhere; }
.tyx-chat-root .tyx-chat-phone-section-title { margin:10px 2px 7px;color:#496e67!important;font-size:9px;font-weight:900;letter-spacing:.12em; }
.tyx-chat-root .tyx-chat-phone-app-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px 6px;align-items:start; }
.tyx-chat-root .tyx-chat-phone-app { min-width:0;margin:0;padding:0;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible; }
.tyx-chat-root .tyx-chat-phone-app > summary { position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;min-height:69px;padding:0;color:#304a45!important;background:transparent!important;border:0!important;list-style:none;cursor:pointer;text-align:center; }
.tyx-chat-root .tyx-chat-phone-app > summary::-webkit-details-marker { display:none; }
.tyx-chat-root .tyx-chat-phone-app > summary > b { display:block;width:100%;color:#314844!important;font-size:9px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tyx-chat-root .tyx-chat-phone-icon { position:relative;display:grid;place-items:center;width:49px;height:49px;color:#fff!important;background:linear-gradient(145deg,#3ca88f,#1b7161);border:1px solid rgba(255,255,255,.24);border-radius:16px;box-shadow:0 10px 18px rgba(18,78,69,.17),inset 0 1px rgba(255,255,255,.10);font-style:normal;overflow:hidden; }
.tyx-chat-root .tyx-chat-phone-icon::before { content:"";position:absolute;inset:6px;border:1px solid rgba(255,255,255,.18);border-radius:11px;background:radial-gradient(circle at 28% 28%,rgba(255,255,255,.28),transparent 36%); }
.tyx-chat-root .tyx-chat-phone-icon::after { content:attr(data-code);position:absolute;right:4px;bottom:3px;color:rgba(255,255,255,.80)!important;font-size:5.5px;font-weight:900;letter-spacing:.04em; }
.tyx-chat-root .tyx-chat-phone-icon > span { position:relative;z-index:1;color:#fff!important;font-size:20px;line-height:1;font-weight:900; }
.tyx-chat-root .tyx-chat-phone-count { position:absolute;top:-3px;right:5px;display:grid;place-items:center;min-width:16px;height:16px;padding:0 4px;color:#fff!important;background:#b94e4a;border:2px solid #edf6f2;border-radius:999px;font-size:7px;font-style:normal;font-weight:900; }
.tyx-chat-root .tyx-chat-phone-app-memory .tyx-chat-phone-icon { background:linear-gradient(145deg,#7b6cac,#554a7b); }
.tyx-chat-root .tyx-chat-phone-app-today .tyx-chat-phone-icon { background:linear-gradient(145deg,#4aa5cf,#326f91); }
.tyx-chat-root .tyx-chat-phone-app-cultivation .tyx-chat-phone-icon { background:linear-gradient(145deg,#35ad87,#19735f); }
.tyx-chat-root .tyx-chat-phone-app-wallet .tyx-chat-phone-icon { background:linear-gradient(145deg,#c69c50,#96702f); }
.tyx-chat-root .tyx-chat-phone-app-contacts .tyx-chat-phone-icon { background:linear-gradient(145deg,#d77c72,#aa504b); }
.tyx-chat-root .tyx-chat-phone-app-schedule .tyx-chat-phone-icon { background:linear-gradient(145deg,#8c78d4,#6652aa); }
.tyx-chat-root .tyx-chat-phone-app-route .tyx-chat-phone-icon { background:linear-gradient(145deg,#3fa7a0,#2c7277); }
.tyx-chat-root .tyx-chat-phone-app-status .tyx-chat-phone-icon { background:linear-gradient(145deg,#438fa1,#2b6172); }
.tyx-chat-root .tyx-chat-phone-app[open] { grid-column:1/-1;display:block;padding:8px;background:rgba(255,255,255,.48)!important;border:1px solid rgba(35,101,90,.13)!important;border-radius:15px!important; }
.tyx-chat-root .tyx-chat-phone-app[open] > summary { display:grid;grid-template-columns:43px 1fr;align-items:center;gap:9px;min-height:50px;padding:4px 6px;text-align:left; }
.tyx-chat-root .tyx-chat-phone-app[open] > summary .tyx-chat-phone-icon { width:41px;height:41px;border-radius:13px; }
.tyx-chat-root .tyx-chat-phone-app[open] > summary > b { text-align:left;font-size:12px;white-space:normal; }
.tyx-chat-root .tyx-chat-phone-app[open] > .tyx-chat-phone-sheet { margin-top:7px; }
.tyx-chat-root .tyx-chat-phone-sheet { min-width:0;padding:12px;color:#29443f!important;background:rgba(255,255,255,.90)!important;border:1px solid rgba(35,101,90,.13)!important;border-radius:12px;box-shadow:0 10px 18px rgba(24,89,79,.05);overflow-wrap:anywhere; }
.tyx-chat-root .tyx-chat-phone-sheet > header { display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:9px;padding-bottom:7px;border-bottom:1px solid rgba(35,101,90,.12); }
.tyx-chat-root .tyx-chat-phone-sheet > header b { color:#173a35!important;font-size:14px; }
.tyx-chat-root .tyx-chat-phone-sheet > header small { color:#628079!important;font-size:7px;font-weight:800;letter-spacing:.11em; }
.tyx-chat-root .tyx-chat-phone-list { display:grid;gap:7px;color:#29443f!important;font-size:10px;line-height:1.65; }
.tyx-chat-root .tyx-chat-phone-homebar { width:92px;height:4px;margin:13px auto 0;background:rgba(23,70,62,.25);border-radius:999px; }

/* 完整记忆回廊 */
.tyx-chat-root .tyx-chat-memory-head { align-items:center!important; }
.tyx-chat-root .tyx-chat-memory-head div { min-width:0; }
.tyx-chat-root .tyx-chat-memory-head span { color:#6d5f93!important;background:#eee9f8;padding:3px 7px;border-radius:999px;font-size:8px;font-weight:800;white-space:nowrap; }
.tyx-chat-root .tyx-chat-memory-layer { margin:7px 0 0;padding:0;background:#fbfafc!important;border:1px solid rgba(91,76,130,.16)!important;border-radius:10px!important;box-shadow:none!important;overflow:hidden; }
.tyx-chat-root .tyx-chat-memory-layer > summary { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;color:#4b4268!important;background:linear-gradient(180deg,#f8f5fc,#eee9f6)!important;border:0!important;list-style:none;cursor:pointer; }
.tyx-chat-root .tyx-chat-memory-layer > summary::-webkit-details-marker { display:none; }
.tyx-chat-root .tyx-chat-memory-layer > summary b { color:#4b4268!important;font-size:10px; }
.tyx-chat-root .tyx-chat-memory-layer > summary span { color:#736695!important;font-size:8px;font-weight:800; }
.tyx-chat-root .tyx-chat-memory-body { padding:9px;color:#3f4652!important;background:#fff!important; }
.tyx-chat-root .tyx-chat-memory-empty { margin:0;color:#80848d!important;font-size:9px;line-height:1.6; }
.tyx-chat-root .tyx-chat-memory-table-wrap { overflow-x:auto; }
.tyx-chat-root .tyx-chat-memory-table { width:100%;min-width:560px;border-collapse:collapse;color:#35413e!important;font-size:8.5px;line-height:1.55; }
.tyx-chat-root .tyx-chat-memory-table th,.tyx-chat-root .tyx-chat-memory-table td { padding:7px;border:1px solid rgba(73,86,99,.12);text-align:left;vertical-align:top; }
.tyx-chat-root .tyx-chat-memory-table th { color:#544a73!important;background:#f0edf7!important;font-weight:900; }
.tyx-chat-root .tyx-chat-memory-table td { color:#3e4a47!important;background:#fff!important; }
.tyx-chat-root .tyx-chat-social-network,.tyx-chat-root .tyx-chat-character-book { display:grid;gap:7px; }
.tyx-chat-root .tyx-chat-social-card,.tyx-chat-root .tyx-chat-character-entry { padding:9px;color:#3d4845!important;background:#fbfbfc!important;border:1px solid rgba(89,76,127,.13);border-radius:9px; }
.tyx-chat-root .tyx-chat-social-card > header,.tyx-chat-root .tyx-chat-character-entry > header { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px; }
.tyx-chat-root .tyx-chat-social-card header b,.tyx-chat-root .tyx-chat-character-entry header b { color:#463e62!important;font-size:10px; }
.tyx-chat-root .tyx-chat-social-card header em,.tyx-chat-root .tyx-chat-character-entry header em { color:#75689a!important;background:#efeaf8;padding:2px 6px;border-radius:999px;font-size:7px;font-style:normal;font-weight:800; }
.tyx-chat-root .tyx-chat-social-card p,.tyx-chat-root .tyx-chat-character-entry p { margin:0 0 5px;color:#515b58!important;font-size:8.5px;line-height:1.6; }
.tyx-chat-root .tyx-chat-social-card dl { display:grid;gap:5px;margin:0; }
.tyx-chat-root .tyx-chat-social-card dl div { display:grid;grid-template-columns:60px 1fr;gap:6px; }
.tyx-chat-root .tyx-chat-social-card dt { color:#776b97!important;font-size:8px;font-weight:800; }
.tyx-chat-root .tyx-chat-social-card dd { margin:0;color:#4b5653!important;font-size:8.5px;line-height:1.55; }
.tyx-chat-root .tyx-chat-character-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px; }
.tyx-chat-root .tyx-chat-character-grid p { margin:0;padding:7px;background:#f4f2f8;border-radius:7px; }
.tyx-chat-root .tyx-chat-character-grid strong { display:block;margin-bottom:3px;color:#665a88!important;font-size:8px; }
.tyx-chat-root .tyx-chat-unresolved-list { display:grid;gap:7px;margin:0;padding:0;list-style:none; }
.tyx-chat-root .tyx-chat-unresolved-list li { padding:9px;color:#574c34!important;background:#fffaf0!important;border:1px solid rgba(183,131,47,.18);border-radius:9px; }
.tyx-chat-root .tyx-chat-unresolved-list header { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px; }
.tyx-chat-root .tyx-chat-unresolved-list b { color:#684d1e!important;font-size:10px; }
.tyx-chat-root .tyx-chat-unresolved-list em { color:#8a6527!important;font-size:7px;font-style:normal;font-weight:800; }
.tyx-chat-root .tyx-chat-unresolved-list p { margin:0;color:#6f624a!important;font-size:8.5px;line-height:1.6; }

/* 手机终端在平台夜间模式中仍保持浅色屏幕，确保文字不会黑上加黑或白上加白 */
.dark .tyx-chat-root .tyx-chat-phone-screen,
.dark .tyx-chat-root .tyx-chat-phone-screen details,
.dark .tyx-chat-root .tyx-chat-phone-screen section,
.dark .tyx-chat-root .tyx-chat-phone-screen article,
.dark .tyx-chat-root .tyx-chat-phone-screen table,
.dark .tyx-chat-root .tyx-chat-phone-screen td,
.dark .tyx-chat-root .tyx-chat-phone-screen th { color:#203f39!important; }
.dark .tyx-chat-root .tyx-chat-phone-screen { background:linear-gradient(rgba(25,130,110,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(25,130,110,.045) 1px,transparent 1px),radial-gradient(circle at 88% 5%,rgba(68,220,183,.18),transparent 26%),linear-gradient(155deg,#f2fbf7,#e3f1ec 55%,#eef8f4)!important;background-size:22px 22px,22px 22px,auto,auto!important; }
.dark .tyx-chat-root .tyx-chat-phone-app,
.dark .tyx-chat-root .tyx-chat-memory-layer { background:transparent!important; }
.dark .tyx-chat-root .tyx-chat-phone-app[open] { background:rgba(255,255,255,.48)!important;border-color:rgba(35,101,90,.13)!important; }
.dark .tyx-chat-root .tyx-chat-phone-sheet { color:#29443f!important;background:rgba(255,255,255,.90)!important;border-color:rgba(35,101,90,.13)!important; }
.dark .tyx-chat-root .tyx-chat-memory-layer > summary { color:#4b4268!important;background:linear-gradient(180deg,#f8f5fc,#eee9f6)!important; }
.dark .tyx-chat-root .tyx-chat-memory-body { color:#3f4652!important;background:#fff!important; }

@media(max-width:560px){
  .tyx-chat-root .tyx-chat-phone > summary.tyx-chat-phone-launch { width:100%; }
  .tyx-chat-root .tyx-chat-phone-device { width:100%;padding:7px;border-radius:25px; }
  .tyx-chat-root .tyx-chat-phone-screen { min-height:470px;padding:13px 9px 9px;border-radius:19px; }
  .tyx-chat-root .tyx-chat-phone-app-grid { gap:10px 5px; }
  .tyx-chat-root .tyx-chat-phone-icon { width:45px;height:45px;border-radius:14px; }
  .tyx-chat-root .tyx-chat-character-grid { grid-template-columns:1fr; }
  .tyx-chat-root .tyx-chat-phone-launch-copy small { white-space:normal; }
}

/* 玩家已经发送的消息气泡：使用平台官方稳定ID */
#customized-question-content {
  position: relative;
  display: block;
  width: fit-content;
  max-width: min(86%,760px);
  margin-left: auto !important;
  padding: 13px 16px !important;
  color: #effff9 !important;
  background: linear-gradient(135deg,#174b43,#1c7566 58%,#24927e) !important;
  border: 1px solid rgba(114,235,207,.28) !important;
  border-radius: 18px 18px 5px 18px !important;
  box-shadow: 0 12px 26px rgba(16,75,65,.20), inset 0 1px rgba(255,255,255,.08) !important;
  line-height: 1.72 !important;
  overflow-wrap: anywhere;
}
#customized-question-content::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: #24927e;
  clip-path: polygon(0 0,100% 100%,0 100%);
}
#customized-question-content,
#customized-question-content p,
#customized-question-content li,
#customized-question-content strong,
#customized-question-content em,
#customized-question-content span,
#customized-question-content a {
  color: #effff9 !important;
}
#customized-question-content p:first-child { margin-top: 0 !important; }
#customized-question-content p:last-child { margin-bottom: 0 !important; }
#customized-question-content code {
  color: #fff6c8 !important;
  background: rgba(7,39,34,.34) !important;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  padding: .12em .38em;
}
#customized-question-avatar {
  border: 2px solid rgba(42,157,135,.46) !important;
  box-shadow: 0 6px 16px rgba(24,102,89,.18) !important;
}
.dark #customized-question-content {
  color: #e8faf4 !important;
  background: linear-gradient(135deg,#173b36,#195e53 58%,#1d7566) !important;
  border-color: rgba(117,220,198,.24) !important;
  box-shadow: 0 13px 28px rgba(0,0,0,.30), inset 0 1px rgba(255,255,255,.05) !important;
}
.dark #customized-question-content::after { background: #1d7566; }
.dark #customized-question-content,
.dark #customized-question-content p,
.dark #customized-question-content li,
.dark #customized-question-content strong,
.dark #customized-question-content em,
.dark #customized-question-content span,
.dark #customized-question-content a { color: #e8faf4 !important; }

/* 玩家输入框与发送按钮：不改变平台布局，只补充视觉与可读性 */
#ai-chat-input {
  color: #193631 !important;
  caret-color: #168f7c !important;
  background: linear-gradient(180deg,rgba(255,255,255,.98),rgba(238,248,244,.96)) !important;
  border: 1px solid rgba(31,132,114,.28) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 24px rgba(28,96,84,.08), inset 0 1px rgba(255,255,255,.92) !important;
}
#ai-chat-input:focus,
#ai-chat-input:focus-visible {
  border-color: rgba(22,143,124,.62) !important;
  outline: 2px solid rgba(70,199,171,.18) !important;
  outline-offset: 2px !important;
  box-shadow: 0 12px 28px rgba(28,96,84,.13),0 0 0 3px rgba(52,183,155,.10) !important;
}
#ai-chat-input::placeholder { color: #7b918c !important; }
#ai-send-button {
  color: #effff9 !important;
  background: linear-gradient(135deg,#176f60,#22a087) !important;
  border: 1px solid rgba(102,231,201,.30) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 18px rgba(19,105,90,.22), inset 0 1px rgba(255,255,255,.10) !important;
}
#ai-send-button:hover { filter: brightness(1.05) saturate(1.04); }
#ai-send-button svg { color: currentColor !important; fill: currentColor !important; }
.dark #ai-chat-input {
  color: #e1efeb !important;
  caret-color: #6ad7bf !important;
  background: linear-gradient(180deg,rgba(26,40,38,.98),rgba(19,32,30,.98)) !important;
  border-color: rgba(132,202,185,.22) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.04) !important;
}
.dark #ai-chat-input::placeholder { color: #879d97 !important; }
.dark #ai-send-button {
  color: #eafff8 !important;
  background: linear-gradient(135deg,#205d52,#268a76) !important;
  border-color: rgba(117,220,198,.24) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.05) !important;
}

@media (max-width: 560px) {
  #customized-question-content {
    max-width: 92%;
    padding: 12px 14px !important;
    border-radius: 16px 16px 5px 16px !important;
  }
  .tyx-chat-root .tyx-chat-terminal-inline {
    padding: 11px;
    border-radius: 16px;
  }
}

/* 明暗模式最终可读性兜底 */
.dark .tyx-chat-root .tyx-chat-prose,
.dark .tyx-chat-root .tyx-chat-prose p,
.dark .tyx-chat-root .tyx-chat-next-copy,
.dark .tyx-chat-root .tyx-chat-free-input,
.dark .tyx-chat-root .tyx-chat-section-title { color:#dce9e5!important; }
.dark .tyx-chat-root .tyx-chat-status-strip,
.dark .tyx-chat-root .tyx-chat-status-strip * { color:#f1fffb!important; }
.dark .tyx-chat-root .tyx-chat-status-item span { color:#b9ded5!important; }
.dark .tyx-chat-root .tyx-chat-status-item strong,
.dark .tyx-chat-root .tyx-chat-status-item b { color:#fff!important; }

/* V1.1 完整记忆回廊外层：保证手机内单列阅读与明暗模式可读 */
.tyx-chat-root .tyx-chat-memory-corridor{
  display:block;
  min-width:0;
  width:100%;
  color:#173d36;
  background:linear-gradient(180deg,rgba(247,253,250,.98),rgba(231,246,240,.96));
  overflow:hidden;
}
.dark .tyx-chat-root .tyx-chat-memory-corridor{
  color:#173d36;
  background:linear-gradient(180deg,rgba(247,253,250,.98),rgba(231,246,240,.96));
}


/* V1.2 终端信息密度增强：玩家档案、交互人物、城市简报 */
.tyx-chat-root .tyx-chat-phone-quick{grid-template-columns:repeat(4,minmax(0,1fr));}
.tyx-chat-root .tyx-chat-phone-app-npc .tyx-chat-phone-icon{background:linear-gradient(145deg,#b06a70,#7e4650);}
.tyx-chat-root .tyx-chat-phone-app-brief .tyx-chat-phone-icon{background:linear-gradient(145deg,#3b8d70,#24634f);}
.tyx-chat-root .tyx-chat-dossier-grid,
.tyx-chat-root .tyx-chat-brief-grid,
.tyx-chat-root .tyx-chat-npc-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  min-width:0;
}
.tyx-chat-root .tyx-chat-info-card,
.tyx-chat-root .tyx-chat-brief-card,
.tyx-chat-root .tyx-chat-npc-card{
  min-width:0;
  padding:10px;
  color:#29443f!important;
  background:linear-gradient(180deg,rgba(246,252,249,.98),rgba(236,247,243,.94));
  border:1px solid rgba(35,101,90,.14);
  border-radius:11px;
  box-shadow:0 6px 13px rgba(24,89,79,.04);
}
.tyx-chat-root .tyx-chat-info-wide{grid-column:1/-1;}
.tyx-chat-root .tyx-chat-info-card h4,
.tyx-chat-root .tyx-chat-brief-card h4{
  margin:0 0 7px;
  padding-bottom:5px;
  color:#17453d!important;
  border-bottom:1px solid rgba(35,101,90,.11);
  font-size:10.5px;
  letter-spacing:.04em;
}
.tyx-chat-root .tyx-chat-data-list{display:grid;gap:5px;margin:0;}
.tyx-chat-root .tyx-chat-data-list>div{
  display:grid;
  grid-template-columns:minmax(58px,32%) 1fr;
  gap:7px;
  align-items:start;
  padding:5px 0;
  border-bottom:1px dashed rgba(35,101,90,.10);
}
.tyx-chat-root .tyx-chat-data-list>div:last-child{border-bottom:0;}
.tyx-chat-root .tyx-chat-data-list dt{
  color:#678079!important;
  font-size:8px;
  font-weight:800;
  line-height:1.45;
}
.tyx-chat-root .tyx-chat-data-list dd{
  min-width:0;
  margin:0;
  color:#263f3a!important;
  font-size:9.5px;
  line-height:1.58;
  overflow-wrap:anywhere;
}
.tyx-chat-root .tyx-chat-npc-card{grid-column:1/-1;padding:11px;}
.tyx-chat-root .tyx-chat-npc-card>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
  padding-bottom:7px;
  border-bottom:1px solid rgba(35,101,90,.12);
}
.tyx-chat-root .tyx-chat-npc-card>header b{display:block;color:#173a35!important;font-size:12px;}
.tyx-chat-root .tyx-chat-npc-card>header small{display:block;margin-top:2px;color:#738a84!important;font-size:7px;}
.tyx-chat-root .tyx-chat-npc-card>header em{
  flex:0 0 auto;
  padding:3px 7px;
  color:#7b3540!important;
  background:#f7e9eb;
  border:1px solid rgba(154,69,80,.15);
  border-radius:999px;
  font-size:7.5px;
  font-style:normal;
  font-weight:800;
}
.tyx-chat-root .tyx-chat-brief-card p{
  margin:0;
  color:#2d4741!important;
  font-size:9.5px;
  line-height:1.65;
}
.tyx-chat-root .tyx-chat-empty-state{
  grid-column:1/-1;
  margin:0;
  padding:16px 10px;
  color:#6d837e!important;
  background:rgba(255,255,255,.70);
  border:1px dashed rgba(35,101,90,.18);
  border-radius:10px;
  font-size:9.5px;
  text-align:center;
}
.tyx-chat-root .tyx-chat-timeline{display:grid;gap:7px;}
.tyx-chat-root .tyx-chat-timeline article{
  display:grid;
  grid-template-columns:52px 1fr;
  gap:8px;
  padding:8px;
  color:#29443f!important;
  background:#f5fbf8;
  border:1px solid rgba(35,101,90,.12);
  border-radius:9px;
  font-size:9px;
}
.tyx-chat-root .tyx-chat-ledger{display:grid;gap:6px;}
.tyx-chat-root .tyx-chat-ledger>div{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  padding:7px 8px;
  color:#2b443f!important;
  background:#f5fbf8;
  border:1px solid rgba(35,101,90,.11);
  border-radius:9px;
  font-size:9px;
}
.tyx-chat-root .tyx-chat-memory-overview{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  margin-bottom:9px;
}
.tyx-chat-root .tyx-chat-memory-overview div{
  min-width:0;
  padding:7px 4px;
  color:#38524d!important;
  background:#eef8f4;
  border:1px solid rgba(35,101,90,.12);
  border-radius:9px;
  text-align:center;
}
.tyx-chat-root .tyx-chat-memory-overview span{display:block;color:#718781!important;font-size:7px;}
.tyx-chat-root .tyx-chat-memory-overview b{display:block;margin-top:2px;color:#173a35!important;font-size:11px;}
.dark .tyx-chat-root .tyx-chat-info-card,
.dark .tyx-chat-root .tyx-chat-brief-card,
.dark .tyx-chat-root .tyx-chat-npc-card,
.dark .tyx-chat-root .tyx-chat-timeline article,
.dark .tyx-chat-root .tyx-chat-ledger>div{
  color:#29443f!important;
  background:linear-gradient(180deg,rgba(246,252,249,.98),rgba(236,247,243,.94))!important;
  border-color:rgba(35,101,90,.14)!important;
}
.dark .tyx-chat-root .tyx-chat-data-list dd,
.dark .tyx-chat-root .tyx-chat-brief-card p{color:#263f3a!important;}
.dark .tyx-chat-root .tyx-chat-data-list dt{color:#678079!important;}
@media(max-width:560px){
  .tyx-chat-root .tyx-chat-phone-quick{grid-template-columns:repeat(2,minmax(0,1fr));}
  .tyx-chat-root .tyx-chat-dossier-grid,
  .tyx-chat-root .tyx-chat-brief-grid,
  .tyx-chat-root .tyx-chat-npc-grid{grid-template-columns:1fr;}
  .tyx-chat-root .tyx-chat-info-wide{grid-column:auto;}
  .tyx-chat-root .tyx-chat-memory-overview{grid-template-columns:repeat(2,minmax(0,1fr));}
}
