:root {
  --paper: #f4ecd8;
  --paper-2: #ece0c4;
  --ink: #2b2620;
  --ink-soft: #6b5d49;
  --seal: #9e2b25;
  --gold: #b8893b;
  --line: #cdbb95;
  --shadow: rgba(60, 45, 20, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  background:
    radial-gradient(circle at 20% 10%, #fbf5e6 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #efe3c6 0%, transparent 40%),
    var(--paper);
  color: var(--ink);
  line-height: 1.7;
}

.site-header {
  text-align: center;
  padding: 28px 16px 8px;
}
.site-header h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: 8px;
  color: var(--seal);
  text-shadow: 1px 1px 0 var(--gold);
}
.subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  letter-spacing: 1px;
  font-size: 14px;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
}

.panel {
  background: linear-gradient(180deg, #fbf6e8, #f1e6cb);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px var(--shadow);
}
.panel h2 {
  margin: 0 0 6px;
  color: var(--seal);
  letter-spacing: 4px;
  border-left: 5px solid var(--seal);
  padding-left: 10px;
}
.hint {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 选将槽 */
.slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.slot {
  flex: 1;
  max-width: 240px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.4);
}
.slot-tag {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 4px;
  letter-spacing: 2px;
}
.slot-name {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.vs {
  font-weight: 800;
  color: var(--seal);
  font-size: 22px;
  letter-spacing: 2px;
}

/* 阵容卡 */
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.hero-card {
  position: relative;
  border: 1px solid var(--line);
  border-top: 4px solid var(--theme, var(--gold));
  border-radius: 8px;
  background: #fffdf6;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px var(--shadow);
}
.hero-card.selected {
  outline: 3px solid var(--seal);
  background: #fff7e9;
}
.badge {
  position: absolute;
  top: -10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--seal);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px var(--shadow);
}
.hero-card .top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-card .emoji {
  font-size: 30px;
}
.hero-card .hname {
  font-size: 18px;
  font-weight: 700;
}
.hero-card .htitle {
  font-size: 12px;
  color: var(--ink-soft);
}
.attrs {
  margin: 10px 0 6px;
}
.attr-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 3px;
}
.attr-row .an {
  width: 30px;
  color: var(--ink-soft);
}
.attr-bar {
  flex: 1;
  height: 8px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
}
.attr-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--seal));
}
.attr-row .av {
  width: 26px;
  text-align: right;
  color: var(--ink);
  font-weight: 600;
}
.skill {
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  padding-top: 6px;
  margin-top: 4px;
}
.skill b {
  color: var(--seal);
}

/* 按钮 */
.actions {
  margin-top: 16px;
  text-align: center;
}
.battle-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 9px 22px;
  border-radius: 6px;
  border: 1px solid var(--seal);
  background: #fffdf6;
  color: var(--seal);
  cursor: pointer;
  transition: all 0.12s ease;
}
.btn:hover {
  background: var(--seal);
  color: #fff;
}
.btn.primary {
  background: var(--seal);
  color: #fff;
}
.btn.primary:hover {
  background: #84211c;
}
.btn.ghost {
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 对战面板 */
.combatants {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.combatant {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf6;
}
.combatant .avatar {
  font-size: 40px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border-radius: 50%;
}
.combat-meta {
  flex: 1;
}
.combat-name {
  font-size: 18px;
  font-weight: 700;
}
.combat-title {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.hp-bar {
  height: 12px;
  background: var(--paper-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5a8f3c, #7fb85a);
  transition: width 0.5s ease;
}
.hp-num {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
  margin-top: 2px;
}
.combat-vs {
  font-size: 26px;
  color: var(--seal);
}

/* 战报 */
.report {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  min-height: 120px;
}
.round-block {
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 12px;
  margin-bottom: 14px;
  animation: fadein 0.4s ease;
}
.round-block .rtitle {
  font-weight: 700;
  color: var(--seal);
  letter-spacing: 1px;
}
.round-block .rbody {
  white-space: pre-wrap;
  margin-top: 4px;
}
.round-block .rtags {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gold);
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.summary-block {
  border: 1px solid var(--seal);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbf0df;
  white-space: pre-wrap;
  font-size: 15px;
  animation: fadein 0.4s ease;
}

.summary-block .polishing {
  color: var(--ink-soft);
  font-style: italic;
  opacity: 0.8;
}

.result-banner {
  text-align: center;
  font-size: 26px;
  letter-spacing: 4px;
  color: #fff;
  background: linear-gradient(90deg, var(--seal), #b8392f);
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
  box-shadow: 0 6px 16px var(--shadow);
  animation: pop 0.4s ease;
}
@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 18px;
}
