/* 《墨劫行》· 极简高级新国风宣纸朱砂样式（零 AI 杂乱边框，95% 画面留给山水长卷与打斗） */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0d1116; color: #f4efe4;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}

.ink-serif { font-family: 'STKaiti', 'KaiTi', 'Songti SC', 'Noto Serif SC', Georgia, serif; }
#stage { position: fixed; inset: 0; overflow: hidden; }
#cv { display: block; width: 100%; height: 100%; touch-action: none; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 4px; border: 1px solid rgba(230, 194, 128, 0.45);
  background: rgba(16, 20, 26, 0.88); color: #f4efe4;
  font-family: inherit; font-size: 14px; letter-spacing: 1.5px; cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { transform: translateY(-1px); background: rgba(30, 38, 46, 0.96); border-color: #f3cc7a; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.crimson {
  background: linear-gradient(180deg, #b52b27, #7f1918);
  border-color: #f3cc7a; color: #fffaf0; font-weight: bold;
  box-shadow: 0 6px 24px rgba(181, 43, 39, 0.45);
}
.btn.crimson:hover { background: linear-gradient(180deg, #cb3631, #921e1c); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.lg { padding: 14px 36px; font-size: 18px; letter-spacing: 4px; }

.screen {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(10, 12, 16, 0.78); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}

/* ---------- 电影感水墨主菜单 ---------- */
#menu {
  background: linear-gradient(95deg, rgba(12, 16, 20, 0.90) 0%, rgba(12, 16, 20, 0.45) 48%, rgba(12, 16, 20, 0.88) 100%), url('../assets/ink/menu_bg.webp') center/cover no-repeat;
  display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 0.95fr);
  align-items: center; gap: 36px; padding: 28px clamp(20px, 6vw, 72px);
  overflow-y: auto;
}
.title-col { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.seal-row { display: flex; align-items: center; gap: 12px; }
.seal-stamp {
  padding: 3px 8px; background: #9e221e; color: #fff6e6; border: 1px solid #f0958a;
  font-size: 12px; letter-spacing: 2px; border-radius: 2px;
}
.main-logo { font-size: clamp(46px, 6.5vw, 76px); line-height: 1; color: #f6e7c8; letter-spacing: 10px; text-shadow: 0 6px 24px rgba(0, 0, 0, 0.85); }
.main-lead { max-width: 440px; font-size: 14px; color: #d6cec0; line-height: 1.75; }

.hero-preview {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-left: 2px solid #d4af5f;
  background: linear-gradient(90deg, rgba(16, 22, 28, 0.85), rgba(16, 22, 28, 0.15));
}
.hero-preview img { height: 150px; width: auto; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.65)); }

.menu-panel {
  background: rgba(14, 18, 24, 0.86); border: 1px solid rgba(212, 175, 95, 0.35);
  border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  max-height: 88vh; overflow-y: auto;
}
.sec-hd { font-size: 12px; color: #d4af5f; letter-spacing: 2px; margin-bottom: 8px; }
.row-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chap-list { display: flex; flex-direction: column; gap: 8px; }
.pick-card {
  padding: 10px 14px; border-radius: 4px; cursor: pointer; text-align: left;
  background: rgba(24, 30, 38, 0.82); border: 1px solid rgba(255, 248, 230, 0.14); color: #f4efe4;
  transition: border-color .12s, background .12s;
}
.pick-card.active { border-color: #e6b85c; background: rgba(54, 42, 24, 0.86); }
.pick-title { font-size: 14px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.pick-sub { font-size: 12px; color: #a7b0b8; margin-top: 3px; }
.cleared-tag { font-size: 11px; color: #4ade80; }

/* ---------- 极简高端横版 ACT HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 18px; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.status-block { display: flex; align-items: center; gap: 12px; background: rgba(12, 16, 22, 0.72); padding: 8px 12px; border-radius: 6px; border-left: 3px solid #c8322c; }
.hud-ava { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; border: 1.5px solid #d4af5f; background: #1c252e; }
.bars-col { display: flex; flex-direction: column; gap: 5px; width: min(210px, 42vw); }
.hp-track { height: 10px; background: #1e1416; border: 1px solid rgba(255,248,230,0.22); border-radius: 2px; position: relative; overflow: hidden; }
.hp-ghost { position: absolute; inset: 0 auto 0 0; background: #fff3d6; transition: width 0.08s linear; }
.hp-real { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #991b1b, #e11d48); }
.qi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 6px; }
.qi-seg { background: rgba(255,255,255,0.14); border-radius: 2px; overflow: hidden; }
.qi-fill { height: 100%; background: linear-gradient(90deg, #d97706, #fde047); }
.meta-mini { display: flex; gap: 10px; font-size: 12px; color: #e6dfd2; }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: auto; }
.top-ctrl { display: flex; align-items: center; gap: 8px; }
.chap-tag { background: rgba(12, 16, 22, 0.75); border: 1px solid rgba(212, 175, 95, 0.35); padding: 4px 10px; border-radius: 4px; font-size: 13px; color: #f3cc7a; }
.combo-badge {
  font-size: 26px; font-weight: bold; color: #f6d58b; letter-spacing: 2px;
  padding: 2px 10px; border-radius: 4px; background: rgba(14, 18, 24, 0.62);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.hud-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.boss-hud { width: min(520px, 86vw); background: rgba(12, 14, 18, 0.84); border: 1px solid rgba(225, 29, 72, 0.6); border-radius: 6px; padding: 6px 12px; }
.boss-hud-name { display: flex; justify-content: space-between; font-size: 14px; color: #fecdd3; margin-bottom: 4px; }
.boss-hp-bar { height: 9px; background: #260d12; border-radius: 2px; overflow: hidden; }
.boss-hp-fill { height: 100%; background: linear-gradient(90deg, #991b1b, #f43f5e); }
.boss-pos-bar { height: 4px; background: #1e242c; border-radius: 2px; overflow: hidden; margin-top: 3px; }
.boss-pos-fill { height: 100%; background: #facc15; }

.interact-pill {
  pointer-events: auto; cursor: pointer;
  padding: 8px 18px; border-radius: 99px; font-size: 14px; font-weight: bold;
  background: linear-gradient(180deg, #eab308, #b45309); color: #160d03; border: 1.5px solid #fef08a;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.45);
}
.key-guide {
  font-size: 12px; color: rgba(244, 239, 228, 0.86);
  background: rgba(12, 16, 22, 0.65); padding: 4px 14px; border-radius: 99px;
}

/* 移动端虚拟动作键（<= 860px 或触屏自动显示） */
.touch-pad { display: none; width: 100%; justify-content: space-between; align-items: flex-end; pointer-events: none; padding-top: 4px; }
.t-group { display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; }
.t-btn {
  width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid rgba(230, 184, 92, 0.55);
  background: rgba(16, 22, 30, 0.72); color: #fff8eb; font-size: 13px; font-weight: bold;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.t-btn.atk { width: 58px; height: 58px; background: rgba(168, 34, 34, 0.8); border-color: #fde68a; }

/* ---------- 电影式底部水墨剧情对白剧场 ---------- */
#dialogue {
  position: absolute; inset: 0; z-index: 35;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 18px 26px; background: linear-gradient(180deg, transparent 52%, rgba(8, 10, 14, 0.82) 100%);
  cursor: pointer;
}
.dlg-card {
  width: min(760px, 95vw); display: flex; align-items: center; gap: 18px;
  background: rgba(14, 18, 24, 0.94); border: 1px solid rgba(212, 175, 95, 0.55);
  border-radius: 8px; padding: 16px 20px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72);
}
.dlg-portrait { height: 112px; width: auto; object-fit: contain; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }
.dlg-body { flex: 1; min-width: 0; }
.dlg-spk { font-size: 17px; color: #f3cc7a; font-weight: bold; margin-bottom: 6px; letter-spacing: 2px; }
.dlg-text { font-size: 15px; color: #f4efe4; line-height: 1.7; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: #9ca3af; }

/* ---------- 行商秘籍 / 暂停 / 结算弹窗 ---------- */
.panel {
  background: rgba(14, 18, 24, 0.95); border: 1px solid rgba(212, 175, 95, 0.45);
  border-radius: 8px; padding: 22px 24px; width: min(620px, 94vw); max-height: 88vh; overflow-y: auto;
}
.scroll-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.scroll-card {
  padding: 12px; border-radius: 6px; background: rgba(24, 31, 40, 0.9);
  border: 1px solid rgba(212, 175, 95, 0.3); display: flex; flex-direction: column; gap: 6px;
}

#toasts { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: rgba(16, 22, 30, 0.92); border: 1px solid #d4af5f; color: #fff8eb; padding: 6px 16px; border-radius: 99px; font-size: 13px; }

@media (max-width: 860px) {
  #menu { grid-template-columns: 1fr; padding: 16px; align-content: start; gap: 16px; }
  .hero-preview img { height: 108px; }
  .key-guide { display: none; }
  .touch-pad { display: flex; }
  .scroll-grid { grid-template-columns: 1fr; }
  .hud-ava { width: 36px; height: 36px; }
  .combo-badge { font-size: 20px; }
}
