* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Serif SC", "STSong", "Songti SC", "SimSun", Georgia, serif;
  font-size: 15px;
  background: #faf6ef;
  color: #3d2e1f;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(180, 140, 100, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 160, 120, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(160, 120, 80, 0.04) 0%, transparent 50%);
}

#app {
  max-width: 1024px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(120, 90, 40, 0.06);
}

/* 顶部标题栏 */
#title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f5ede0;
  border-bottom: 1px solid #e0d0bb;
  box-shadow: 0 1px 4px rgba(120, 90, 40, 0.04);
  flex-shrink: 0;
}

#title-bar h1 {
  font-size: 18px;
  font-weight: 700;
  color: #2d1f10;
  letter-spacing: 0.05em;
}

#new-chat-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: #5a4a35;
  border: 1px solid #d0c0a8;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

#new-chat-btn:hover {
  background: #ede0d0;
  border-color: #c0a878;
}

/* 聊天区域 */
#chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 消息气泡 */
.message {
  max-width: 78%;
  padding: 14px 20px;
  border-radius: 12px;
  line-height: 1.75;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease;
}

.message.user {
  align-self: flex-end;
  background: #c07830;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e8d5c0;
  border-left: 4px solid #b8702a;
  border-bottom-left-radius: 2px;
  box-shadow: 0 3px 12px rgba(120, 90, 40, 0.08), 0 1px 3px rgba(120, 90, 40, 0.06);
}

/* === 消息收起/展开（仅显示一行）=== */

.collapsible-msg {
  position: relative;
}

/* 右上角展开/收起按钮 — 磨砂灰质感 */
.collapse-btn-wrap { position: absolute; top: 6px; right: 8px; z-index: 10; }

.collapse-toggle-btn { padding: 3px 14px; border: none; border-radius: 12px; background: rgba(55,48,42,0.58); color: #ede8e0; font-size: 11px; font-family: inherit; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: all 0.15s; white-space: nowrap; letter-spacing: 0.3px; }

.collapse-toggle-btn:hover { background: rgba(45,38,32,0.72); color: #ffffff; }

/* 收起态 — 第一行全显 + 底部透明渐隐（mask，无白色遮挡） */
.collapse-content {
  position: relative;
}

.collapse-content.collapsed {
  max-height: 34px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
}

.collapse-content.expanded {
  max-height: none;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

.message.system {
  align-self: center;
  max-width: 90%;
  background: transparent;
  color: #7a6a55;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}

.message.hint-gray {
  align-self: center;
  max-width: 90%;
  background: transparent;
  color: #a09080;
  text-align: center;
  font-size: 12px;
  padding: 8px 16px;
}

.message.hint-yellow {
  align-self: center;
  max-width: 90%;
  background: #fff8e8;
  border: 1px solid #e8d0a0;
  color: #8a6d30;
  text-align: center;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 8px;
}

.message.error {
  align-self: center;
  background: #fff0ed;
  border: 1px solid #f0c0b0;
  color: #c04030;
  text-align: center;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
}

/* 消息内 markdown 样式 */
.message.assistant strong {
  color: #8a4a18;
  font-weight: 700;
}

.message.assistant ul, .message.assistant ol {
  margin: 6px 0 6px 20px;
}

.message.assistant li {
  margin-bottom: 3px;
}

/* === 操作按钮组（奇策+皮肤，放在反馈卡片下方）=== */
.action-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
}

.action-btn { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px; padding: 8px 12px; font-size: 13px; font-weight: 600; font-family: inherit; background: #8b6914; border: none; border-radius: 6px; cursor: pointer; transition: background 0.15s; color: #ffffff; }

.action-btn-icon { display: inline-flex; align-items: center; flex-shrink: 0; color: rgba(255,255,255,0.8); }

.action-btn:hover { background: #a07818; }
.action-btn:hover .action-btn-icon { color: #ffffff; }

.action-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-hint { flex-basis: 100%; font-size: 11px; font-weight: 400; opacity: 0.70; text-align: center; }

/* 移动端纵向排列 */
@media (max-width: 600px) {
  .action-buttons {
    flex-direction: column;
    gap: 6px;
  }
}

/* 重试按钮 */
.retry-btn {
  display: block;
  margin: 6px auto 0;
  padding: 4px 14px;
  font-size: 12px;
  background: #c07830;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.retry-btn:hover {
  background: #a06528;
}

/* 加载指示器 — 轻量状态条（非聊天气泡） */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: #a09080;
  font-size: 13px;
  animation: fadeIn 0.3s ease;
}

/* 加载水滴动画 */
.loader { position:relative; width:26px; height:32px; flex-shrink:0; }
.loader-surface { position:absolute; bottom:2px; left:1px; z-index:0; width:24px; height:5px; background:radial-gradient(ellipse at center,rgba(210,180,145,.5) 0%,rgba(200,165,125,.35) 60%,rgba(190,155,115,.1) 100%); border-radius:50%; animation:surfaceWave 2.2s ease-in-out infinite; }
.loader-surface::after { content:''; position:absolute; top:0; left:2px; right:2px; height:1px; border-radius:1px; background:rgba(200,150,100,.45); animation:surfaceGlint 2.2s ease-in-out infinite; }
@keyframes surfaceWave { 0%,30%,100%{transform:scaleX(1) scaleY(1)} 48%{transform:scaleX(1.06) scaleY(.82)} 56%{transform:scaleX(.94) scaleY(1.08)} 64%{transform:scaleX(1.02) scaleY(.98)} 70%{transform:scaleX(1) scaleY(1)} }
@keyframes surfaceGlint { 0%,28%,100%{opacity:.2} 45%{opacity:.7} 58%{opacity:.35} }
.loader-trail { position:absolute; left:11px; top:4px; z-index:1; width:2.5px; height:0; background:linear-gradient(to bottom,transparent,rgba(200,125,55,.28)); border-radius:1.5px; animation:trailFall 2.2s cubic-bezier(.33,0,.66,1) infinite; }
@keyframes trailFall { 0%,100%{height:0;opacity:0} 12%{height:6px;opacity:.3} 30%{height:16px;opacity:.5} 38%{height:3px;opacity:.12} 48%{height:0;opacity:0} }
.loader-drop { position:absolute; left:8px; top:-12px; z-index:2; width:10px; height:15px; opacity:0; animation:dropFall 2.2s cubic-bezier(.33,0,.66,1) infinite; }
.loader-drop svg { display:block; width:100%; height:100%; }
@keyframes dropFall { 0%{top:-12px;opacity:0;transform:scale(1.06)} 8%{opacity:.95} 34%{top:11px;opacity:1;transform:scale(1)} 40%{top:14px;opacity:.7;transform:scale(.82,.32)} 46%{top:16px;opacity:0;transform:scale(.4,.06)} 100%{top:-12px;opacity:0;transform:scale(1.06)} }
.loader-ripple { position:absolute; z-index:1; border:1px solid rgba(200,140,90,.45); border-radius:50%; opacity:0; }
.loader-ripple:first-of-type { left:2px; bottom:5px; width:18px; height:4px; animation:rippleOut 2.2s ease-out infinite; animation-delay:.88s; }
.loader-ripple:last-of-type { left:-1px; bottom:4px; width:26px; height:6px; border-color:rgba(190,150,110,.3); animation:rippleOut 2.2s ease-out infinite; animation-delay:.95s; }
@keyframes rippleOut { 0%{opacity:.5;transform:scale(.4)} 100%{opacity:0;transform:scale(2.8)} }
.loader-splash { position:absolute; z-index:3; width:1.8px; height:1.8px; background:#c07830; border-radius:50%; opacity:0; }
.loader-splash:first-of-type { left:14px; bottom:7px; animation:splashL 2.2s ease-out infinite; animation-delay:.92s; }
.loader-splash:last-of-type { left:9px; bottom:7px; animation:splashR 2.2s ease-out infinite; animation-delay:.95s; }
@keyframes splashL { 0%{opacity:.7;transform:translate(0,0)} 100%{opacity:0;transform:translate(4px,-7px)} }
@keyframes splashR { 0%{opacity:.6;transform:translate(0,0)} 100%{opacity:0;transform:translate(-4px,-5px)} }
.loading-text { color:#5a4a35; font-size:13px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 底部输入栏 */
#input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: #f5ede0;
  border-top: 1px solid #e0d0bb;
  flex-shrink: 0;
}

#user-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 8px;
  resize: none;
  outline: none;
  max-height: 120px;
}

#user-input::placeholder {
  color: #a09080;
}

#user-input:focus {
  border-color: #c07830;
}

#send-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #c07830;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(160, 100, 40, 0.2);
}

#send-btn:hover {
  background: #a06528;
  box-shadow: 0 2px 8px rgba(160, 100, 40, 0.3);
  transform: translateY(-1px);
}

#send-btn:active {
  transform: translateY(0) scale(0.98);
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#send-btn.stop {
  background: #d44a3a;
  box-shadow: 0 1px 3px rgba(200, 60, 40, 0.25);
}

#send-btn.stop:hover {
  background: #b83a2a;
  box-shadow: 0 2px 8px rgba(200, 60, 40, 0.35);
}

/* 标题栏右侧 */
#title-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#remaining-badge {
  font-size: 12px;
  color: #7a6a55;
  background: #ede0d0;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

#remaining-badge span {
  color: #b07028;
  font-weight: 600;
}

/* 密钥验证界面 */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-box {
  text-align: center;
  width: 360px;
  padding: 40px 32px;
}

.auth-box h1 {
  font-size: 22px;
  font-weight: 600;
  color: #2d1f10;
  margin-bottom: 24px;
}

.auth-box h2 {
  font-size: 20px;
  font-weight: 600;
  color: #d44a3a;
  margin-bottom: 12px;
}

.auth-box p {
  font-size: 14px;
  color: #7a6a55;
  margin-bottom: 20px;
}

#key-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 8px;
  outline: none;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#key-input::placeholder {
  letter-spacing: 2px;
  font-size: 14px;
  color: #a09080;
}

#key-input:focus {
  border-color: #c07830;
}

#verify-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #c07830;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#verify-btn:hover {
  background: #a06528;
}

#verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#auth-error {
  margin-top: 12px;
  font-size: 13px;
  color: #d44a3a;
  min-height: 20px;
}

/* 额度用完/异常使用遮罩（固定覆盖层，不隐藏聊天区） */
#exhausted-overlay, #abuse-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 246, 239, 0.97);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#exit-btn, #abuse-exit-btn {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #c07830;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#exit-btn:hover, #abuse-exit-btn:hover {
  background: #a06528;
}

.overlay-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.ghost-overlay-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #7a6a55;
  background: transparent;
  border: 1px solid #d0c0a8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.ghost-overlay-btn:hover {
  color: #5a4a35;
  background: #ede0d0;
}

/* 测试结果反馈表单 */
.test-feedback-form {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fffbf5;
  border: 1px solid #e0d0bb;
  border-left: 3px solid #b8702a;
  border-radius: 8px;
}

/* 方案标题前跳转按钮 */
.plan-jump-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; margin-right: 8px; border: none; border-radius: 10px; background: #8b6914; color: #ffffff; font-size: 10px; font-family: inherit; font-weight: 600; cursor: pointer; vertical-align: middle; transition: background 0.15s; }
.plan-jump-btn:hover { background: #a07818; }

/* 反馈卡片：表头居中 */
.feedback-header { text-align: center; margin-bottom: 14px; padding: 10px 12px; background: #f5f0e8; border-bottom: 1px solid #e8dcc8; }
.feedback-title { font-size: 14px; font-weight: 600; color: #7a6a55; letter-spacing: 0.5px; }

/* 反馈卡片：填写区 */
.feedback-body { padding: 4px 0 8px; }

/* 反馈卡片：提交区 */
.feedback-footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid #ede0d0; }

.feedback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 0;
  transition: background .2s;
}

.feedback-label {
  color: #7a6a55;
  font-size: 12px;
  white-space: nowrap;
}

.win-input,
.loss-input {
  width: 42px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 4px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.win-input::-webkit-outer-spin-button,
.win-input::-webkit-inner-spin-button,
.loss-input::-webkit-outer-spin-button,
.loss-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.win-input:focus {
  border-color: #5a9a4a;
}

.loss-input:focus {
  border-color: #d44a3a;
}


/* ========== 引导输入面板 ========== */
#guided-panel {
  background: #ede3d4;
  border-top: 3px solid #d4a060;
  max-height: 42vh;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow:
    inset 0 6px 12px rgba(120, 90, 40, 0.06),
    0 -2px 8px rgba(120, 90, 40, 0.04);
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out;
  opacity: 1;
}

#guided-panel.collapsing {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.guided-inner {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guided-section {
  background: #ffffff;
  border: 1px solid #e8d5c0;
  border-left: 3px solid #d4a060;
  border-radius: 0 8px 8px 0;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(120, 90, 40, 0.05), 0 1px 2px rgba(120, 90, 40, 0.03);
  overflow: visible;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, padding 0.2s ease-out, margin 0.2s ease-out;
  max-height: 800px;
  opacity: 1;
}

.guided-section.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.guided-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #7a6a55;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.scenario-tabs {
  display: flex;
  gap: 8px;
}

.scenario-tab {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  font-family: inherit;
  color: #7a6a55;
  background: transparent;
  border: 1px solid #d0c0a8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.scenario-tab.active {
  color: #ffffff;
  background: #c07830;
  border-color: #c07830;
}

.scenario-tab:hover:not(.active) {
  color: #5a4a35;
  border-color: #c0a878;
}

.guided-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #5a4a35;
}

.guided-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.guided-row input[type="number"] {
  width: 64px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 4px;
  text-align: center;
  -moz-appearance: textfield;
}

.guided-row input[type="number"]::-webkit-outer-spin-button,
.guided-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.guided-row input[type="number"]:focus {
  border-color: #c07830;
  outline: none;
}

.guided-row-label {
  font-size: 12px;
  color: #7a6a55;
  margin: 8px 0 4px;
}

.limit-hint {
  font-size: 11px;
  color: #a09080;
  margin-left: 4px;
}

.limit-hint.over {
  color: #d44a3a;
  font-weight: 600;
}

/* === 敌方阵容站位网格 === */

#enemy-positions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.enemy-pos-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-num {
  width: 24px;
  font-size: 11px;
  color: #a09080;
  text-align: center;
  flex-shrink: 0;
}

.hero-select, .artifact-select {
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.hero-select { width: 108px; }
.artifact-select { width: 78px; }

.hero-select:focus, .artifact-select:focus {
  border-color: #c07830;
}

.hero-select optgroup {
  font-style: normal;
  font-weight: 600;
  color: #7a6a55;
  background: #fffdf9;
}

.hero-select option, .artifact-select option {
  background: #ffffff;
  color: #3d2e1f;
}

/* 隐藏已选项（互斥逻辑通过 disabled 属性控制，CSS 负责视觉隐藏） */
.hero-select option:disabled,
.artifact-select option:disabled {
  display: none;
}

.config-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.config-label {
  width: 36px;
  font-size: 13px;
  color: #5a4a35;
  flex-shrink: 0;
}

.toggle-btn {
  padding: 4px 14px;
  font-size: 12px;
  font-family: inherit;
  color: #7a6a55;
  background: transparent;
  border: 1px solid #d0c0a8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  color: #ffffff;
  background: #c07830;
  border-color: #c07830;
}

.toggle-btn.forced-max {
  opacity: 0.35;
  cursor: not-allowed;
  color: #b0a090;
  text-decoration: line-through;
}

.toggle-btn.forced-max:hover {
  color: #b0a090;
  border-color: #d0c0a8;
}

.toggle-btn:hover:not(.active):not(.forced-max) {
  color: #5a4a35;
  border-color: #c0a878;
}

.config-detail {
  margin: 6px 0 2px 44px;
  padding: 8px;
  background: #fffbf5;
  border-radius: 4px;
  border: 1px solid #f0e5d5;
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, padding 0.2s ease-out, margin 0.2s ease-out;
  max-height: 400px;
  opacity: 1;
}

.config-detail.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
}

.hero-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.hero-custom-row label {
  font-size: 12px;
  color: #7a6a55;
  white-space: nowrap;
}

.hero-custom-row input[type="number"] {
  width: 48px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  color: #3d2e1f;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 4px;
  text-align: center;
  -moz-appearance: textfield;
}

.hero-custom-row input[type="number"]::-webkit-outer-spin-button,
.hero-custom-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hero-custom-row input[type="number"]:focus {
  border-color: #c07830;
  outline: none;
}

.remove-row-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  color: #d44a3a;
  background: transparent;
  border: 1px solid #f0c0b0;
  border-radius: 4px;
  cursor: pointer;
}

.remove-row-btn:hover {
  background: #fff0ed;
}

.add-row-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-family: inherit;
  color: #b07028;
  background: transparent;
  border: 1px dashed #d4a060;
  border-radius: 4px;
  cursor: pointer;
}

.add-row-btn:hover {
  background: #f5e0c0;
}

.beast-multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.beast-chip {
  padding: 6px 14px;
  min-height: 34px;
  font-size: 13px;
  font-family: inherit;
  color: #7a6a55;
  background: #fffdf9;
  border: 1px solid #d0c0a8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.beast-chip.selected {
  color: #5a3a10;
  background: #f5e0c0;
  border-color: #d4a060;
  font-weight: 600;
}

.beast-chip:hover:not(.selected) {
  color: #5a4a35;
  border-color: #c0a878;
  background: #fef9f2;
}

.beast-selected {
  font-size: 11px;
  color: #a09080;
  margin-top: 4px;
  min-height: 16px;
}

/* ====== 帮我组队 — 豪杰多选 ====== */
.build-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
}

.build-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #5a3a10;
  background: #f5e0c0;
  border: 1px solid #d4a060;
  border-radius: 6px;
  font-weight: 600;
}

.build-hero-chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  color: #a08060;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}

.build-hero-chip .chip-remove:hover {
  color: #d44a3a;
  background: rgba(200, 60, 40, 0.1);
}

.add-hero-btn {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  color: #b07028;
  background: transparent;
  border: 1px dashed #d4a060;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
}

.add-hero-btn:hover {
  background: #f5e0c0;
  border-color: #c07830;
}

/* 豪杰选择弹出面板 */
.hero-pick-popover {
  position: absolute;
  z-index: 100;
  background: #ffffff;
  border: 1px solid #e0d0bb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(120, 90, 40, 0.12);
  padding: 8px 0;
  max-height: 260px;
  overflow-y: auto;
  min-width: 140px;
}

.hero-pick-category {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #a09080;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-pick-option {
  display: block;
  width: 100%;
  padding: 6px 16px;
  font-size: 13px;
  font-family: inherit;
  color: #5a4a35;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.hero-pick-option:hover {
  background: #f5ede0;
  color: #2d1f10;
}

.hero-pick-option.picked {
  color: #c0b0a0;
  cursor: not-allowed;
  pointer-events: none;
}

/* 帮我组队引导提示 */
.build-guide-hint {
  font-size: 12px;
  color: #a09080;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* 场景内提交按钮 */
.section-submit-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
}

/* 星级下拉（chip内嵌） */
.chip-star-select {
  padding: 1px 4px;
  font-size: 11px;
  font-family: inherit;
  color: #5a3a10;
  background: #fffdf9;
  border: 1px solid #d4a060;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-left: 2px;
}

/* 按钮暗色禁用态 */
.primary-btn.dimmed {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* 红色必填标记 */
.req-mark {
  color: #d44a3a;
  font-weight: 700;
  margin-right: 2px;
}

/* 提交按钮下方提示 */
.submit-hint {
  font-size: 11px;
  color: #a09080;
  text-align: center;
  margin-top: 2px;
}

/* 帮我组队序号标签 */
.section-num {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #c07830;
  background: #f5e0c0;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.guided-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
}

.primary-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: #c07830;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(160, 100, 40, 0.25);
  transition: all 0.15s;
  white-space: nowrap;
}

.primary-btn:hover {
  background: #a06528;
  box-shadow: 0 3px 10px rgba(160, 100, 40, 0.35);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(160, 100, 40, 0.2);
}

.ghost-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-family: inherit;
  color: #7a6a55;
  background: transparent;
  border: 1px solid #d0c0a8;
  border-radius: 6px;
  cursor: pointer;
}

.ghost-btn:hover {
  color: #5a4a35;
  background: #ede0d0;
}

#guided-toggle-btn {
  padding: 10px 8px;
  font-size: 16px;
  background: transparent;
  border: 1px solid #d0c0a8;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

#guided-toggle-btn:hover {
  background: #ede0d0;
}

#guided-toggle-btn.active {
  background: #c07830;
  border-color: #c07830;
}


/* 平板端 */
@media (min-width: 601px) and (max-width: 1024px) {
  #app {
    max-width: 100%;
  }

  #chat-area {
    padding: 20px 24px;
  }

  .message {
    max-width: 84%;
  }
}

/* 移动端 */
@media (max-width: 600px) {
  #title-bar {
    padding: 12px 14px;
  }

  #title-bar h1 {
    font-size: 16px;
  }

  #chat-area {
    padding: 12px 10px;
  }

  .message {
    max-width: 92%;
    padding: 12px 14px;
  }

  #input-bar {
    padding: 10px 12px;
    gap: 8px;
  }

  #send-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .feedback-row {
    gap: 4px;
    font-size: 12px;
  }

  .win-input,
  .loss-input {
    width: 36px;
    padding: 3px 4px;
    font-size: 12px;
  }

  .guided-inner {
    padding: 12px 10px;
    gap: 8px;
  }

  .guided-section {
    padding: 8px;
  }

  /* 移动端敌方站位变为单列 */
  #enemy-positions {
    grid-template-columns: 1fr;
  }

  .enemy-pos-row {
    gap: 6px;
  }

  .hero-select { width: 96px; font-size: 11px; }
  .artifact-select { width: 68px; font-size: 11px; }

  .guided-actions {
    flex-wrap: wrap;
  }

  .guided-actions button {
    flex: 1;
    min-width: 80px;
  }

  .config-detail {
    margin-left: 36px;
  }

  .collapse-toggle-btn { padding: 3px 14px; border: none; border-radius: 12px; background: rgba(55,48,42,0.58); color: #ede8e0; font-size: 11px; font-family: inherit; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: all 0.15s; white-space: nowrap; letter-spacing: 0.3px; }
}

/* 反馈卡片：方案标签按钮 */
.feedback-plan-btn { padding: 5px 14px; border: none; border-radius: 5px; background: #8b6914; color: #ffffff; font-size: 12px; font-family: inherit; font-weight: 600; cursor: pointer; transition: background 0.15s; min-width: 54px; }
.feedback-plan-btn:hover { background: #a07818; }
.feedback-row.active .feedback-plan-btn { background: #a07818; font-weight: 700; }

/* 反馈卡片：行高亮 */
.feedback-row.active { background: rgba(139,105,20,0.06); border-radius: 4px; }

/* 反馈卡片：提交按钮 */
.feedback-submit { display: block; width: 100%; margin-top: 0; padding: 11px 0; border: none; border-radius: 6px; background: #8b6914; color: #ffffff; font-size: 14px; font-family: inherit; font-weight: 600; cursor: pointer; transition: background 0.15s; letter-spacing: 1.5px; }
.feedback-submit:hover { background: #a07818; }

/* 御进 cell —— 与下拉框统一风格：浅底深字、细边框、同高 */
.yujin-cell {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1px;
	width: 44px;
	height: 28px;
	padding: 0 2px;
	background: #fffdf9;
	border: 1px solid #d0c0a8;
	border-radius: 4px;
	font-size: 11px;
	font-family: inherit;
	flex-shrink: 0;
	transition: opacity .2s, border-color .2s;
}

/* 未选豪杰：暗色 */
.yujin-cell:has(.yujin-input:disabled) {
	opacity: .38;
}

/* 已选豪杰：正常色 */
.yujin-cell:has(.yujin-input:not(:disabled)) {
	opacity: 1;
}
.yujin-cell:has(.yujin-input:not(:disabled)):hover {
	border-color: #c0a080;
}

.yujin-prefix {
	font-size: 10px;
	color: #8a7560;
	flex-shrink: 0;
}

.yujin-cell .yujin-input {
	width: 22px;
	height: 100%;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 0;
	color: #3d2e1f;
	font-size: 12px;
	font-family: inherit;
	font-weight: 500;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	cursor: default;
}
.yujin-cell .yujin-input:disabled {
	color: #3d2e1f;
}
.yujin-cell .yujin-input:not(:disabled) {
	cursor: text;
}
.yujin-cell .yujin-input:not(:disabled):focus {
	outline: none;
}
.yujin-cell:has(.yujin-input:focus) {
	border-color: #c07830;
	box-shadow: 0 0 0 2px rgba(192,120,48,0.12);
}
.yujin-cell .yujin-input::-webkit-inner-spin-button,
.yujin-cell .yujin-input::-webkit-outer-spin-button {
	-webkit-appearance: none; margin: 0;
}

/* 非满配 */
.yujin-cell.nonmax {
	border-color: rgba(192,120,48,.35);
	background: rgba(255,245,235,1);
}

/* T2 神器分组——"不推荐"标签自带语义，optgroup 由浏览器原生渲染 */

/* 神器已满3件——其余下拉禁用态 */
select.artifact-locked {
	opacity: 0.35;
	pointer-events: none;
	filter: grayscale(30%);
}

/* 反馈卡片：返回方案按钮 */
.feedback-goto {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	padding: 0;
	border: none;
	border-radius: 3px;
	background: rgba(255,255,255,0.06);
	color: rgba(255,255,255,0.4);
	font-size: 11px;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.feedback-goto:hover {
	background: rgba(255,255,255,0.12);
	color: rgba(255,255,255,0.8);
}

/* 反馈卡片：当前记录方案高亮 */
.feedback-active-plan {
	color: #c0a060;
	font-weight: 500;
}

/* 反馈卡片：方案标签 */
.feedback-plan-label {
	min-width: 48px;
	font-size: 13px;
	color: rgba(255,255,255,0.7);
}

/* 方案表头跳转高亮闪烁 */
}
/* 方案表头跳转高亮 */
.feedback-row.flash { animation: feedback-flash 2s ease-out; }
/* 方案跳转高亮 */
@keyframes plan-flash {
  0%   { background: rgba(139,105,20,0.30); outline: 4px solid rgba(139,105,20,0.60); outline-offset: 2px; }
  100% { background: transparent; outline: 4px solid transparent; outline-offset: 2px; }
}
.plan-flash { animation: plan-flash 2.5s ease-out; display: inline-block; padding: 0 4px; margin: 0 -4px; }

/* 反馈行高亮 */
@keyframes feedback-flash {
  0%   { background: rgba(139,105,20,0.25); }
  100% { background: transparent; }
}
.feedback-row.flash { animation: feedback-flash 2.5s ease-out; }