/* 建安风骨 · 三国本命将星录（汉末军帐器物版）
 * 兼容基线：Android 8.1 Chrome / WebView 61 + iOS 18.4+
 * 彻底摒弃现代 SaaS 胶囊、发光状态灯与 Notion 引用块：采用八角斜切木牍、燕尾战旗、双细铜界线与金石残印
 */

:root {
  --bg-obsidian: #0F0C07;
  --bg-wood: #1B1510;
  --bg-slat: #1E1711;
  --bronze: #C89B54;
  --bronze-bright: #E6C182;
  --cinnabar: #A63429;
  --jade-ally: #356B4E;
  --text-bone: #F3EAD9;
  --text-body: #DFD3BF;
  --text-muted: #B0A28D;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "HiraMinProN-W6", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --app-height: 100vh;
  --host-bottom-inset: 0px;
  --tent-top: -38px;
}

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

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  touch-action: manipulation;
  background-color: #0F0C07;
}

body {
  min-height: 100%;
  background-color: #0F0C07;
  color: #F3EAD9;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:focus {
  outline: 1.5px solid #E6C182;
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: var(--app-height, 100vh);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-color: #0F0C07;
}

/* 桌面端两侧：深绛帷幕暗晕与细织竹简界纹，延展中军帅帐气场且绝不重复放大铜灯与舆图器物 */
@media (min-width: 768px) {
  body {
    background-color: #090705;
    background-image:
      radial-gradient(ellipse 46% 52% at 50% 24%, rgba(164, 78, 30, 0.14) 0%, rgba(9, 7, 5, 0) 70%),
      radial-gradient(ellipse 30% 70% at 14% 12%, rgba(98, 28, 22, 0.16) 0%, rgba(9, 7, 5, 0) 65%),
      radial-gradient(ellipse 30% 70% at 86% 12%, rgba(98, 28, 22, 0.16) 0%, rgba(9, 7, 5, 0) 65%),
      repeating-linear-gradient(
        90deg,
        rgba(200, 155, 84, 0.022) 0px,
        rgba(200, 155, 84, 0.022) 1px,
        transparent 1px,
        transparent 48px
      );
  }
  .app-shell {
    max-width: 480px;
    box-shadow:
      -1px 0 0 rgba(200, 155, 84, 0.22),
      1px 0 0 rgba(200, 155, 84, 0.22),
      0 24px 90px rgba(0, 0, 0, 0.9);
  }
}

/* 全屏一体式汉末中军帅帐实景层（z-index: 0，零割裂贯穿全屏） */
.tent-backdrop {
  position: absolute;
  top: var(--tent-top, -38px);
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.app-shell.is-result-mode .tent-backdrop {
  opacity: 0.32;
}

.app-shell.is-result-mode .tent-map-svg {
  display: none;
}

.tent-backdrop-img {
  width: 100%;
  height: auto;
  display: block;
}

/* 汉代豆形铜灯与青铜炭火盆呼吸火光（精准叠合原画光源位） */
.tent-lamp-glow {
  position: absolute;
  left: 5%;
  top: 14%;
  width: 34%;
  height: 20%;
  background: radial-gradient(circle, rgba(255, 166, 68, 0.26) 0%, rgba(232, 118, 38, 0.08) 46%, rgba(232, 118, 38, 0) 74%);
  animation: lampFlicker 2.8s ease-in-out infinite alternate;
}

.tent-brazier-glow {
  position: absolute;
  left: 16%;
  top: 22%;
  width: 32%;
  height: 16%;
  background: radial-gradient(circle, rgba(236, 108, 36, 0.24) 0%, rgba(236, 108, 36, 0) 72%);
  animation: emberBreath 3.6s ease-in-out infinite alternate;
}

@keyframes lampFlicker {
  0% { opacity: 0.72; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.84; transform: scale(0.99); }
}

@keyframes emberBreath {
  0% { opacity: 0.62; }
  100% { opacity: 1; }
}

.tent-embers-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 与 768x1376 帅帐原图 1:1 对齐的舆图 SVG 层 */
.tent-map-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.march-track-bg {
  fill: none;
  stroke: rgba(48, 31, 17, 0.62);
  stroke-width: 3.1;
  stroke-dasharray: 6 6;
}

.march-track-active {
  fill: none;
  stroke: #D84830;
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-node .city-outer {
  fill: #2B2015;
  stroke: #DFC394;
  stroke-width: 2.5;
}

.map-node .city-inner {
  fill: #FFE3AA;
}

.map-node.is-visited .city-outer {
  fill: #663E22;
  stroke: #ECC98B;
}

.map-node.is-current .city-outer {
  fill: #AC3427;
  stroke: #FFE7B3;
  stroke-width: 3;
}

.map-node .city-pennant {
  fill: #CC3B2A;
  stroke: #FFE5AE;
  stroke-width: 1.5;
}

.map-node .node-pulse {
  fill: rgba(204, 58, 40, 0.3);
  stroke: #FFE2A6;
  stroke-width: 2;
  animation: beaconPulse 2.2s ease-out infinite;
}

.map-node .node-label {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  fill: #F5EAD6;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(20, 15, 10, 0.94);
  stroke-width: 6.5px;
  stroke-linejoin: round;
}

.map-node.is-current .node-label {
  fill: #FFE7B2;
}

@keyframes beaconPulse {
  0% { transform: scale(0.65); opacity: 0.95; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* 顶栏：悬浮于帅帐穹顶夜雾之上；宿主有右上角胶囊时与之同行并列，不叠罗汉 */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  padding-top: var(--host-top-inset, calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))));
  padding-right: 16px;
  padding-bottom: 6px;
  padding-left: 16px;
  z-index: 16;
}

.has-host-capsule .top-bar {
  min-height: 28px;
  padding-right: var(--host-capsule-right, 100px);
  padding-left: 14px;
}

.has-host-capsule .brand-sep,
.has-host-capsule .brand-title {
  display: none;
}

.has-host-capsule .brand-era {
  font-size: 15.5px;
  white-space: nowrap;
}

.has-host-capsule .sound-toggle {
  width: 26px;
  height: 26px;
  margin-right: 5px;
  font-size: 12px;
}

.has-host-capsule .roster-trigger {
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.app-shell.is-result-mode .top-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 28;
  padding-bottom: 10px;
  background: linear-gradient(180deg, #0F0C07 0%, rgba(15, 12, 7, 0.96) 76%, rgba(15, 12, 7, 0) 100%);
}

.brand-group {
  display: flex;
  align-items: center;
  min-width: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.88);
}

.brand-seal-mini {
  display: inline-block;
  padding: 1px 5px;
  background-color: rgba(146, 44, 34, 0.94);
  color: #F7EFE2;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-right: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.brand-era {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.08em;
  color: #EBC98C;
}

.brand-sep {
  margin-left: 5px;
  margin-right: 5px;
  color: #B3A289;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: #EAE0CE;
  letter-spacing: 0.06em;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sound-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  padding: 0;
  background-color: rgba(31, 23, 16, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(228, 190, 126, 0.38),
    inset 0 -1px 0 rgba(228, 190, 126, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.5);
  color: #ECC98B;
  -webkit-clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  transition: transform 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.sound-icon {
  display: block;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.has-host-capsule .sound-icon {
  width: 14px;
  height: 14px;
}

.sound-toggle .sound-icon-off {
  display: none;
}

.sound-toggle.is-muted .sound-icon-on {
  display: none;
}

.sound-toggle.is-muted .sound-icon-off {
  display: block;
}

.sound-toggle.is-muted .mute-slash {
  stroke: #D25C4A;
}

.sound-toggle:active {
  transform: scale(0.94);
}

.sound-toggle.is-muted {
  color: #9E907B;
  background-color: rgba(22, 17, 12, 0.78);
}

.roster-trigger {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background-color: rgba(31, 23, 16, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(228, 190, 126, 0.42),
    inset 0 -1px 0 rgba(228, 190, 126, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.55);
  color: #ECC98B;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  -webkit-clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.roster-trigger.is-just-unlocked {
  background-color: #3D2C1A;
  transform: scale(1.05);
}

.roster-trigger:active {
  transform: scale(0.97);
}

.roster-trigger-mark {
  font-size: 11px;
  color: #D2A55D;
  margin-right: 5px;
}

/* 答题主视图：撑满整座帅帐，底席常驻贴底 */
.stage-quiz {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: var(--app-height, 100vh);
}

.stage-result {
  position: relative;
  z-index: 4;
  padding-top: 46px;
  padding-top: calc(38px + var(--host-top-inset, calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))));
  padding-bottom: 14px;
  padding-bottom: calc(14px + var(--host-bottom-inset, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))));
}

/* 精准贴合帅帐舆图下沿（y=562 / w=768 ≈ 73.2%）的透景视窗 */
.tent-stage-window {
  width: 100%;
  padding-top: 73.2%;
  margin-top: var(--tent-top, -38px);
  flex-shrink: 0;
  pointer-events: none;
}

/* 帅案中央工作区：在标准视口与桌面端自动均分上下暗木案面留白，消除单侧大空档 */
.tabletop-middle {
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
}

/* 刻于帅案木面上的古典卷目眉栏 + 四面燕尾小牙旗 */
.scroll-brow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 16px 8px 16px;
  padding: 5px 0;
  box-shadow: inset 0 1px 0 rgba(214, 168, 96, 0.26), inset 0 -1px 0 rgba(214, 168, 96, 0.16);
}

.brow-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.scroll-vol-stamp {
  display: inline-block;
  padding: 1px 6px;
  background-color: #8E2C22;
  color: #F7EFE2;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

.crisis-era {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: #DACBA8;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.pennant-row {
  display: flex;
  align-items: center;
}

.war-pennant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 24px;
  padding-bottom: 3px;
  margin-left: 5px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  color: #C7BA9F;
  background-color: rgba(34, 26, 18, 0.85);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.war-pennant.is-leading.is-wei {
  background-color: #967034;
  color: #FFF4DC;
  transform: translateY(-1px);
}

.war-pennant.is-leading.is-shu {
  background-color: #3A7254;
  color: #F4FFF8;
  transform: translateY(-1px);
}

.war-pennant.is-leading.is-wu {
  background-color: #9E3927;
  color: #FFF2EE;
  transform: translateY(-1px);
}

.war-pennant.is-leading.is-qun {
  background-color: #586472;
  color: #F5F8FA;
  transform: translateY(-1px);
}

/* 铺陈在帅案深褐漆面上的军议文书与三枚竹木令签 */
.crisis-panel {
  padding: 4px 16px 8px 16px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.crisis-panel.is-switching {
  opacity: 0.55;
  transform: translateY(2px);
}

.crisis-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.32;
  color: #F8F0E2;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.crisis-scene {
  font-size: 13.5px;
  line-height: 1.56;
  color: #E0D4BF;
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88);
}

.choices-stack {
  display: flex;
  flex-direction: column;
}

.choices-stack.has-pick .choice-slat:not(.is-picked) {
  opacity: 0.44;
  transform: scale(0.992);
}

.choice-slat {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 12px 10px 10px;
  margin-bottom: 9px;
  background-color: rgba(31, 22, 15, 0.84);
  background-image: linear-gradient(94deg, rgba(226, 150, 68, 0.13) 0%, rgba(34, 25, 17, 0.8) 34%, rgba(22, 16, 11, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(224, 182, 112, 0.28),
    inset 2px 0 0 rgba(218, 134, 54, 0.24),
    0 8px 18px rgba(5, 3, 2, 0.6);
  -webkit-clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  transition: background-color 0.15s ease, transform 0.14s ease, opacity 0.16s ease, box-shadow 0.15s ease;
}

.choice-slat:last-child {
  margin-bottom: 0;
}

@media (hover: hover) {
  .choice-slat:hover {
    background-color: rgba(44, 32, 21, 0.9);
  }
}

.choice-slat:active,
.choice-slat.is-picked {
  background-color: rgba(56, 39, 24, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(246, 212, 148, 0.72),
    inset 2px 0 0 rgba(236, 158, 72, 0.65),
    0 10px 22px rgba(0, 0, 0, 0.68);
  transform: translateX(3px);
}

.slat-seal {
  width: 26px;
  height: 35px;
  flex-shrink: 0;
  margin-right: 10px;
  background-color: rgba(56, 38, 23, 0.92);
  color: #ECC98B;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(214, 168, 96, 0.42);
}

.choice-slat.is-picked .slat-seal {
  background-color: #9E3326;
  color: #FFF4E6;
}

.slat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.slat-tag {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #ECC98B;
  line-height: 1.26;
  margin-bottom: 1px;
}

.slat-text {
  display: block;
  font-size: 13px;
  line-height: 1.44;
  color: #F2E8D7;
}

/* 底部常驻前景席：「月旦评 · 观局先生」（免抠跨界半身像 + 锁高逐字慢打竹帛席） */
.chronicler-dock {
  position: relative;
  margin-top: auto;
  width: 100%;
  padding-top: 22px;
  flex-shrink: 0;
}

.chronicler-aura {
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 126px;
  height: 118px;
  background: radial-gradient(circle at 44% 58%, rgba(226, 124, 46, 0.2) 0%, rgba(226, 124, 46, 0) 70%);
  pointer-events: none;
  opacity: 0.72;
  transition: opacity 0.25s ease;
}

.chronicler-dock.is-speaking .chronicler-aura {
  opacity: 1;
}

.chronicler-cutout {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 92px;
  height: auto;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.85));
}

.chronicler-scroll-sheet {
  position: relative;
  z-index: 3;
  min-height: 86px;
  padding: 9px 16px 12px 102px;
  padding-bottom: calc(12px + var(--host-bottom-inset, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))));
  background: linear-gradient(180deg, rgba(22, 16, 11, 0.86) 0%, rgba(14, 10, 7, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(214, 168, 96, 0.34);
}

.chronicler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 19px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.chronicler-name {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 700;
  color: #E6BF78;
  letter-spacing: 0.03em;
}

.kanji-progress {
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: #8E806C;
  flex-shrink: 0;
}

.kanji-progress span,
.kanji-progress b {
  margin-left: 2px;
}

.kanji-progress span:first-child,
.kanji-progress b:first-child {
  margin-left: 0;
}

.kanji-progress .is-done {
  color: #B89458;
}

.kanji-progress b.is-cur {
  color: #FFE2A6;
  font-weight: 700;
}

.chronicler-speech {
  min-height: 41px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.52;
  color: #EDE1CC;
}

.chronicler-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  background-color: #E8BC72;
  opacity: 0;
}

.chronicler-dock.is-speaking .chronicler-cursor {
  opacity: 0.92;
  animation: brushBlink 0.55s ease-in-out infinite alternate;
}

@keyframes brushBlink {
  0% { opacity: 0.25; }
  100% { opacity: 1; }
}

/* 答题中途翻阅将星谱的吸顶返回条 */
.resume-quiz-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 6px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 16px 8px 16px;
  padding: 8px 12px;
  background-color: #282017;
  box-shadow: inset 0 1px 0 rgba(228, 190, 126, 0.35), 0 8px 20px rgba(0, 0, 0, 0.55);
}

.resume-quiz-note {
  font-size: 12.5px;
  color: #C8B9A2;
}

.resume-quiz-btn {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: #F2D59B;
}

/* 结果页：武将立绘主舞台 + 玉玺下砸盖印演出 */
.hero-card-stage {
  position: relative;
  width: 100%;
  transition: transform 0.14s ease-out;
}

.hero-card-stage.is-impact {
  transform: translateY(2.5px);
}

.hero-portrait-box {
  position: relative;
  width: 100%;
  height: 292px;
  overflow: hidden;
  background-color: #12100E;
}

@media (min-width: 768px) {
  .hero-portrait-box {
    height: 332px;
  }
}

.hero-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  transition: transform 0.22s ease-out;
}

.hero-sheen-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--sheen-x, 72%) var(--sheen-y, 28%),
    rgba(244, 214, 156, 0.22) 0%,
    rgba(244, 214, 156, 0) 52%
  );
}

.hero-portrait-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      90deg,
      rgba(18, 16, 14, 0.45) 0%,
      rgba(18, 16, 14, 0) 12%,
      rgba(18, 16, 14, 0) 88%,
      rgba(18, 16, 14, 0.45) 100%
    ),
    linear-gradient(
      180deg,
      rgba(18, 16, 14, 0.52) 0%,
      rgba(18, 16, 14, 0) 24%,
      rgba(18, 16, 14, 0.44) 58%,
      #12100E 100%
    );
}

.flying-jade-seal {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 96px;
  height: 96px;
  object-fit: contain;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translate(-14px, -42px) scale(1.42);
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.8));
}

.hero-card-stage.is-poised .flying-jade-seal {
  opacity: 1;
  transform: translate(-10px, -34px) scale(1.36);
  transition: opacity 0.14s ease, transform 0.18s ease-out;
}

.hero-card-stage.is-slammed .flying-jade-seal {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.24s cubic-bezier(0.2, 0.92, 0.3, 1.08);
}

.hero-card-stage.is-lifted .flying-jade-seal {
  opacity: 0;
  transform: translate(0, -14px) scale(1.06);
  transition: opacity 0.34s ease, transform 0.34s ease;
}

.seal-shockwave {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 56, 42, 0.62) 0%, rgba(188, 56, 42, 0) 72%);
  opacity: 0;
  transform: scale(0.45);
  pointer-events: none;
  z-index: 4;
}

.hero-card-stage.is-slammed .seal-shockwave {
  opacity: 1;
  transform: scale(1.65);
  transition: opacity 0.38s ease-out, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-card-stage.is-lifted .seal-shockwave {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* 金石刀刻斑驳飞白朱文方印 */
.cinnabar-stamp {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 60px;
  height: 60px;
  transform: rotate(-3.5deg);
  z-index: 5;
  transition: opacity 0.16s ease, transform 0.2s ease;
}

.hero-card-stage.is-poised .cinnabar-stamp {
  opacity: 0;
  transform: rotate(-3.5deg) scale(0.86);
}

.cinnabar-stamp-frame {
  width: 100%;
  height: 100%;
  padding: 4px;
  background-color: rgba(158, 42, 31, 0.92);
  background-image:
    radial-gradient(circle at 22% 80%, rgba(18, 16, 14, 0.32) 0%, transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(18, 16, 14, 0.26) 0%, transparent 22%);
  filter: url(#seal-rough);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48);
}

.cinnabar-stamp span {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1.5px solid rgba(247, 236, 220, 0.86);
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.12;
  color: #F7ECE0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 2px 1px;
}

.cinnabar-stamp span::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
  background-color: rgba(247, 236, 220, 0.42);
  transform: translateX(-50%);
}

.cinnabar-stamp .seal-col {
  font-style: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  transform: scale(0.92, 1.08);
}

.hero-identity-overlay {
  position: absolute;
  right: 16px;
  bottom: 6px;
  left: 16px;
  z-index: 5;
}

.hero-faction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hero-faction-pill {
  display: inline-block;
  padding: 2px 9px 2px 4px;
  background-color: rgba(27, 21, 16, 0.92);
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.3);
  color: #E6C182;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
}

.hero-match-rate {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: #DFD2BC;
  background-color: rgba(18, 16, 14, 0.82);
  padding: 2px 8px;
}

.hero-name-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 2px;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.08;
  color: #F7EFE2;
  letter-spacing: 0.04em;
}

.hero-courtesy {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #E6C182;
  margin-left: 10px;
}

.hero-moment {
  font-size: 12.5px;
  color: #C7B9A3;
  line-height: 1.42;
}

/* 结果正文、单一五维命盘与错金虎符按钮 */
.result-body {
  padding: 6px 16px 16px 16px;
}

.hero-quote {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.56;
  color: #EDD6AA;
  text-indent: -0.46em;
  margin-bottom: 6px;
}

.hero-verdict {
  font-size: 14px;
  line-height: 1.62;
  color: #D9CCB7;
  margin-bottom: 10px;
}

.radar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #18130E;
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.2), inset 0 -1px 0 rgba(200, 155, 84, 0.12);
  margin-bottom: 12px;
}

.radar-svg-wrap {
  width: 214px;
  height: 152px;
  flex-shrink: 0;
}

.radar-side-meta {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
}

.radar-caption-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #F3EAD9;
  margin-bottom: 2px;
}

.radar-caption-sub {
  font-size: 12px;
  line-height: 1.38;
  color: #B0A28D;
  margin-bottom: 8px;
}

.traits-col {
  display: flex;
  flex-wrap: wrap;
}

.trait-tag {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 700;
  color: #E6C182;
  background-color: #241C14;
  box-shadow: inset 0 0 0 1px rgba(200, 155, 84, 0.26);
  padding: 3px 9px;
  margin-right: 6px;
  margin-bottom: 5px;
}

.result-actions {
  margin-bottom: 18px;
}

/* 错金虎符主令牌（双金线包边，告别网贷圆角亮金条） */
.primary-cta-btn {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(180deg, #CEA158 0%, #9E702E 100%);
  box-shadow:
    inset 0 0 0 1.5px #E5BF7D,
    inset 0 0 0 4px #20160E,
    inset 0 0 0 5px rgba(245, 221, 176, 0.42),
    0 8px 22px rgba(0, 0, 0, 0.48);
  color: #16110B;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  -webkit-clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  margin-bottom: 9px;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.primary-cta-btn:active {
  transform: scale(0.98);
}

.primary-cta-btn[disabled] {
  opacity: 0.6;
}

/* 评论区直达朱漆铜纹令：次主操作，直晒个人命格卡到评论区 */
.comment-cta-btn {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 9px;
  background: linear-gradient(180deg, #5A231B 0%, #3A1611 100%);
  box-shadow:
    inset 0 0 0 1px rgba(230, 193, 130, 0.58),
    inset 0 0 0 3px #1A110C,
    0 6px 18px rgba(0, 0, 0, 0.45);
  color: #F6ECDC;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  -webkit-clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.comment-cta-btn:active {
  transform: scale(0.985);
}

.comment-cta-btn[disabled] {
  opacity: 0.6;
}

.secondary-actions-row {
  display: flex;
  justify-content: space-between;
}

.sec-action-btn {
  flex: 1;
  padding: 9px 6px;
  background-color: #1E1711;
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  color: #DFD2BC;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  margin-left: 8px;
}

.sec-action-btn:first-child {
  margin-left: 0;
}

.sec-action-btn:active {
  background-color: #2B2118;
}

/* 宿命羁绊 */
.bonds-section {
  padding-top: 2px;
}

.section-kicker {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #C89B54;
  margin-bottom: 9px;
}

.bonds-grid {
  display: flex;
  flex-direction: column;
}

.bond-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background-color: #1A140F;
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
  transition: background-color 0.16s ease;
}

.bond-item:last-child {
  margin-bottom: 0;
}

.bond-item:active {
  background-color: #261E16;
}

.bond-avatar {
  width: 54px;
  height: 70px;
  object-fit: cover;
  object-position: center 18%;
  flex-shrink: 0;
  margin-right: 12px;
}

.bond-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.bond-head-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 3px;
}

.bond-badge {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  color: #F7EFE2;
}

.bond-badge.is-ally {
  background-color: #2F5E44;
}

.bond-badge.is-rival {
  background-color: #872F20;
}

.bond-cta-hint {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: #DFB56E;
}

.bond-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #F3EAD9;
  margin-bottom: 2px;
}

.bond-callout {
  font-size: 12.5px;
  line-height: 1.46;
  color: #C2B49E;
}

.storage-hint {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #B0A28D;
  text-align: center;
}

/* 弹层（将星谱 & 战报检视） */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  background-color: rgba(10, 8, 7, 0.84);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .modal-backdrop {
    background-color: rgba(10, 8, 7, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  background-color: #17130F;
  box-shadow: inset 0 2px 0 rgba(200, 155, 84, 0.42);
  padding: 16px 16px 34px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #F5EDE0;
  margin-bottom: 2px;
}

.modal-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: #B5A792;
}

.modal-close-btn {
  padding: 5px 12px;
  background-color: #261E16;
  box-shadow: inset 0 0 0 1px rgba(200, 155, 84, 0.3);
  color: #E6C182;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 12px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
}

.roster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
  background-color: #201913;
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.2);
  padding-bottom: 8px;
}

.roster-card.is-locked {
  cursor: default;
}

.roster-thumb {
  width: 100%;
  height: 118px;
  object-fit: cover;
  object-position: center 16%;
  margin-bottom: 6px;
}

.roster-card.is-locked .roster-thumb {
  filter: brightness(0.36) contrast(1.08) sepia(0.28) saturate(0.32);
}

.roster-new-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 6px;
  background-color: #9A2F23;
  color: #F7EFE2;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
}

.roster-card-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #F3EAD9;
  padding-left: 8px;
  padding-right: 8px;
}

.roster-card.is-locked .roster-card-name {
  color: #ACA08D;
}

.roster-card-role {
  font-size: 12px;
  color: #B8AA95;
  padding-left: 8px;
  padding-right: 8px;
  text-indent: -0.42em;
}

.poster-tabs {
  display: flex;
  margin-bottom: 10px;
}

.poster-tab {
  flex: 1;
  padding: 7px 6px;
  background-color: #201913;
  color: #BFB29D;
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  margin-left: 6px;
}

.poster-tab:first-child {
  margin-left: 0;
}

.poster-tab.is-active {
  background-color: #36281A;
  box-shadow: inset 0 -2px 0 #E6C182;
  color: #F5DEB0;
}

.poster-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 10px;
  margin-bottom: 12px;
}

.poster-preview-grid.is-single {
  grid-template-columns: 1fr;
}

.poster-preview-item {
  cursor: pointer;
}

.poster-preview-item img {
  width: 100%;
  margin-bottom: 5px;
}

.poster-preview-item figcaption {
  font-size: 12px;
  color: #C2B49E;
  text-align: center;
}

.share-copy-box {
  padding: 10px 12px;
  background-color: #201913;
  box-shadow: inset 0 1px 0 rgba(200, 155, 84, 0.2);
}

.share-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.share-copy-label {
  font-size: 12px;
  font-weight: 600;
  color: #E6C182;
}

.select-copy-btn {
  padding: 3px 9px;
  background-color: #2F2418;
  color: #F2D59B;
  font-size: 12px;
  font-weight: 600;
}

.share-copy-text {
  font-size: 13px;
  line-height: 1.55;
  color: #DFD2BC;
  -webkit-user-select: text;
  user-select: text;
}

.nowrap-token {
  white-space: nowrap;
}

.toast-banner {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: 88%;
  padding: 8px 16px;
  background-color: #2B2117;
  box-shadow: inset 0 0 0 1px rgba(228, 190, 126, 0.4), 0 10px 28px rgba(0, 0, 0, 0.65);
  color: #F6EFE2;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.supports-flex-gap .secondary-actions-row {
  column-gap: 8px;
}
.supports-flex-gap .secondary-actions-row .sec-action-btn {
  margin-left: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
