/* ========== 问道长生 · 水墨仙侠样式 ========== */
:root {
  --ink: #2a2620;            /* 浓墨 */
  --ink-2: #4a443a;          /* 淡墨 */
  --ink-3: #857c6c;          /* 灰墨 */
  --paper: #f2ecd9;          /* 宣纸 */
  --paper-2: #eae1c8;        /* 陈纸 */
  --paper-3: #e0d4b4;
  --cinnabar: #a83226;       /* 朱砂 */
  --cinnabar-2: #c04a3a;
  --indigo: #33566b;         /* 黛青 */
  --gold: #9c7a1c;           /* 鎏金 */
  --jade: #4a7c59;           /* 玉青 */
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "Noto Serif SC", "Songti SC", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-kai);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(51,86,107,.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 100%, rgba(168,50,38,.07), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(42,38,32,.012) 2px 4px),
    var(--paper);
  line-height: 1.6;
  overflow: hidden;
}
.hidden { display: none !important; }
.dim { color: var(--ink-3); font-size: 12px; }
/* 纸卡 */
.paper-card {
  background: linear-gradient(160deg, rgba(255,252,240,.65), rgba(234,225,200,.35));
  border: 1px solid rgba(42,38,32,.22);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(42,38,32,.10), inset 0 0 40px rgba(224,212,180,.35);
}
/* ========== 开局 ========== */
#startScreen {
  height: 100%; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 30px 16px;
}
.start-inner { max-width: 760px; width: 100%; text-align: center; position: relative; }
.ink-circle {
  width: 120px; height: 120px; margin: 0 auto 6px;
  border-radius: 50%;
  border: 3px solid rgba(42,38,32,.75);
  border-left-color: transparent;
  transform: rotate(-20deg);
  position: relative;
}
.ink-circle::after {
  content: "仙"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; font-weight: 700; color: var(--cinnabar);
}
.game-title { font-size: 44px; letter-spacing: 14px; text-indent: 14px; font-weight: 700; margin-top: 10px; }
.game-sub { color: var(--ink-3); letter-spacing: 4px; margin-bottom: 22px; }
.start-block { margin: 18px 0; text-align: left; }
.start-label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 10px; letter-spacing: 2px; }
#nameInput {
  width: 260px; padding: 9px 14px;
  font-family: var(--font-kai); font-size: 16px;
  background: rgba(255,252,240,.8);
  border: 1px solid rgba(42,38,32,.35); border-radius: 8px;
  outline: none;
}
#nameInput:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(168,50,38,.12); }
.pick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick-card {
  text-align: left; padding: 12px 14px; cursor: pointer;
  background: rgba(255,252,240,.7);
  border: 1.5px solid rgba(42,38,32,.25); border-radius: 10px;
  transition: all .2s;
}
.pick-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(42,38,32,.15); }
.pick-card.sel { border-color: var(--cinnabar); box-shadow: 0 0 0 2px rgba(168,50,38,.25); background: #fdf6e4; }
.pick-card .pk-name { font-weight: 700; font-size: 16px; }
.pick-card .pk-rare { font-size: 11px; color: var(--gold); margin-left: 6px; }
.pick-card .pk-desc { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.btn-seal {
  font-family: var(--font-kai);
  margin-top: 10px; padding: 12px 42px;
  font-size: 19px; font-weight: 700; letter-spacing: 6px; text-indent: 6px;
  color: #f6efdc; background: var(--cinnabar);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(168,50,38,.4), inset 0 0 0 2px rgba(246,239,220,.35);
  transition: all .2s;
}
.btn-seal:hover:not(:disabled) { background: var(--cinnabar-2); transform: translateY(-2px); }
.btn-seal:disabled { background: var(--ink-3); cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  font-family: var(--font-kai);
  background: transparent; color: var(--ink-2);
  border: 1px solid rgba(42,38,32,.4); border-radius: 8px;
  padding: 7px 16px; cursor: pointer; font-size: 14px; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(42,38,32,.06); }
.btn-ghost.small { font-size: 12px; padding: 4px 12px; }
.start-tip { margin-top: 14px; font-size: 12px; color: var(--gold); letter-spacing: 1px; }
/* ========== 主界面布局 ========== */
#gameScreen { height: 100vh; display: flex; flex-direction: column; }
#topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(42,38,32,.94), rgba(58,52,42,.92));
  color: #efe6cd;
  box-shadow: 0 2px 12px rgba(42,38,32,.4);
  z-index: 5;
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.tb-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.tb-tag {
  font-size: 12px; padding: 2px 10px; border-radius: 12px;
  background: rgba(156,122,28,.25); border: 1px solid rgba(156,122,28,.6); color: #e8d48a;
}
.tb-mid { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 260px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-name { font-size: 12px; width: 28px; text-align: right; color: #cfc4a6; }
.bar { flex: 1; height: 12px; background: rgba(0,0,0,.45); border-radius: 8px; overflow: hidden; border: 1px solid rgba(239,230,205,.25); }
.bar i { display: block; height: 100%; width: 0%; border-radius: 8px; transition: width .4s; }
.bar.exp i { background: linear-gradient(90deg, #7a5cc4, #b08ae8); box-shadow: 0 0 8px rgba(176,138,232,.8); }
.bar.hp i { background: linear-gradient(90deg, #8c2f24, #cf5f4d); }
.bar-text { font-size: 11px; width: 92px; color: #cfc4a6; }
.tb-right { display: flex; align-items: center; gap: 12px; }
.tb-res { font-size: 14px; }
.tb-res b { color: #e8d48a; }
#topbar .btn-ghost { color: #efe6cd; border-color: rgba(239,230,205,.4); }
#topbar .btn-ghost:hover { background: rgba(239,230,205,.12); }
#layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 250px 1fr 300px;
  gap: 12px; padding: 12px;
}
#charPanel, #rightPanel { overflow-y: auto; padding: 14px; }
#centerPanel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.panel-title {
  font-size: 14px; letter-spacing: 3px; margin: 12px 0 8px;
  padding-left: 8px; border-left: 3px solid var(--cinnabar);
}
.panel-title:first-child { margin-top: 0; }
.attr-list { font-size: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.attr-list div span { color: var(--ink-3); font-size: 12px; }
.attr-list div b { font-size: 13px; }
/* 装备槽 */
.equip-slots { display: flex; flex-direction: column; gap: 6px; }
.equip-slot {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: 1px dashed rgba(42,38,32,.3);
  border-radius: 8px; font-size: 13px; min-height: 38px;
}
.equip-slot .es-type { font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.equip-slot.filled { border-style: solid; cursor: pointer; }
.equip-slot.filled:hover { background: rgba(168,50,38,.06); }
/* 灵物 */
.pet-list { display: flex; flex-direction: column; gap: 6px; }
.pet-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(74,124,89,.08);
  border: 1px solid rgba(74,124,89,.3); border-radius: 8px; font-size: 12.5px;
}
.pet-item b { color: var(--jade); }
/* ========== 场景 ========== */
.scene {
  position: relative; flex-shrink: 0; height: 240px;
  border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 108%, rgba(51,86,107,.28), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% -20%, rgba(224,212,180,.5), transparent 70%),
    linear-gradient(180deg, #efe8d4, #e4d9ba);
  border: 1px solid rgba(42,38,32,.22);
  box-shadow: inset 0 0 60px rgba(51,86,107,.12);
}
.mountain { position: absolute; inset: auto 0 0 0; width: 100%; height: 150px; color: var(--indigo); }
.meditator { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); text-align: center; }
.daoist { font-size: 46px; position: relative; z-index: 2; filter: drop-shadow(0 3px 4px rgba(42,38,32,.3)); }
.aura {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%,-50%);
  width: 110px; height: 110px; border-radius: 50%;
  border: 2px solid rgba(122,92,196,.5);
  box-shadow: 0 0 24px rgba(122,92,196,.35), inset 0 0 24px rgba(122,92,196,.25);
  animation: auraBreath 3.2s ease-in-out infinite;
}
@keyframes auraBreath { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity:.7 } 50% { transform: translate(-50%,-50%) scale(1.18); opacity:1 } }
.particles { position: absolute; inset: 0; pointer-events: none; }
.pt {
  position: absolute; bottom: 40px; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, rgba(176,138,232,.95), rgba(176,138,232,0));
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  12% { opacity: .95; }
  100% { transform: translateY(-190px) scale(.4); opacity: 0; }
}
.scene.sword .aura { border-color: rgba(168,50,38,.55); box-shadow: 0 0 24px rgba(168,50,38,.35), inset 0 0 24px rgba(168,50,38,.2); animation-duration: 1.6s; }
.scene.sword .daoist { font-size: 42px; }
.scene-state {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 13px; letter-spacing: 2px;
  background: rgba(42,38,32,.75); color: #efe6cd;
  padding: 4px 16px; border-radius: 14px; white-space: nowrap;
}
/* 模式切换 */
.mode-row { display: flex; gap: 10px; }
.btn-mode {
  flex: 1; font-family: var(--font-kai);
  padding: 10px; font-size: 15px; font-weight: 700; letter-spacing: 2px;
  background: rgba(255,252,240,.7); color: var(--ink-2);
  border: 1.5px solid rgba(42,38,32,.3); border-radius: 10px; cursor: pointer; transition: all .2s;
}
.btn-mode.active { background: var(--ink); color: #efe6cd; border-color: var(--ink); box-shadow: 0 3px 10px rgba(42,38,32,.35); }
/* 秘境 */
.dungeon-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dg-card {
  text-align: center; padding: 9px 6px; cursor: pointer;
  background: rgba(255,252,240,.7);
  border: 1.5px solid rgba(42,38,32,.25); border-radius: 10px; transition: all .2s;
}
.dg-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(42,38,32,.15); }
.dg-card.sel { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(51,86,107,.25); background: #eef3f0; }
.dg-card.locked { opacity: .45; cursor: not-allowed; }
.dg-name { font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.dg-lv { font-size: 10.5px; color: var(--gold); }
.dg-desc { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.dg-risk { font-size: 10.5px; }
.risk-low { color: var(--jade); } .risk-mid { color: var(--gold); } .risk-high { color: var(--cinnabar); }
/* 突破区 */
.break-area {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
}
.break-info { font-size: 14px; }
.break-info b { color: var(--cinnabar); }
#breakArea .btn-seal { margin: 0; padding: 8px 26px; font-size: 15px; letter-spacing: 3px; }
/* 日志 */
.log-box {
  flex: 1; min-height: 90px; overflow-y: auto;
  padding: 10px 14px; font-size: 12.5px;
}
.log-line { padding: 2px 0; border-bottom: 1px dashed rgba(42,38,32,.12); }
.log-line .lt { color: var(--ink-3); font-size: 10.5px; margin-right: 6px; }
.log-good { color: var(--jade); } .log-bad { color: var(--cinnabar); } .log-epic { color: var(--gold); }
/* ========== 右栏页签 ========== */
.rtabs { display: flex; gap: 4px; margin-bottom: 10px; }
.rtab {
  flex: 1; font-family: var(--font-kai);
  padding: 7px 2px; font-size: 13.5px; font-weight: 700;
  background: transparent; color: var(--ink-3);
  border: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.rtab.active { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }
.rpane { display: none; } .rpane.active { display: block; }
.subtabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.subtab {
  font-family: var(--font-kai); font-size: 12px;
  padding: 3px 12px; border-radius: 12px; cursor: pointer;
  background: rgba(42,38,32,.06); border: 1px solid rgba(42,38,32,.2); color: var(--ink-2);
}
.subtab.active { background: var(--ink); color: #efe6cd; border-color: var(--ink); }
.bag-body { font-size: 13px; }
.item-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px;
  background: rgba(255,252,240,.6);
  border: 1px solid rgba(42,38,32,.2); border-radius: 8px;
}
.item-card .ic-main { flex: 1; min-width: 0; }
.item-card .ic-name { font-weight: 700; font-size: 13.5px; }
.item-card .ic-sub { font-size: 11px; color: var(--ink-3); }
.q-fan { color: #8a8378; } .q-liang { color: #4a7c59; } .q-shang { color: #33658b; }
.q-jipin { color: #7a4fb0; } .q-xian { color: #b8860b; }
.btn-mini {
  font-family: var(--font-kai); font-size: 12px;
  padding: 4px 12px; border-radius: 7px; cursor: pointer;
  background: var(--indigo); color: #fff; border: none; white-space: nowrap;
}
.btn-mini:hover { filter: brightness(1.15); }
.btn-mini.warn { background: var(--cinnabar); }
.btn-mini:disabled { background: var(--ink-3); cursor: not-allowed; }
/* 炼丹 */
.recipe {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid rgba(42,38,32,.2); border-radius: 10px;
  background: rgba(255,252,240,.6);
}
.recipe .rc-head { display: flex; justify-content: space-between; align-items: center; }
.recipe .rc-name { font-weight: 700; font-size: 14.5px; }
.recipe .rc-mats { font-size: 11.5px; color: var(--ink-2); margin: 4px 0; }
.recipe .rc-mats .lack { color: var(--cinnabar); }
.recipe .rc-rate { font-size: 11.5px; color: var(--gold); }
/* 功法 */
.gf-card {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid rgba(42,38,32,.2); border-radius: 10px;
  background: rgba(255,252,240,.6);
}
.gf-card.owned { border-color: rgba(74,124,89,.5); }
.gf-card.active { border-color: var(--cinnabar); box-shadow: 0 0 0 1.5px rgba(168,50,38,.3); }
.gf-head { display: flex; justify-content: space-between; align-items: center; }
.gf-name { font-weight: 700; font-size: 15px; }
.gf-desc { font-size: 11.5px; color: var(--ink-2); margin: 4px 0 6px; }
/* 设置 */
.set-body { display: flex; flex-direction: column; gap: 10px; }
.btn-ink, .btn-danger {
  font-family: var(--font-kai); font-size: 14px; font-weight: 700;
  padding: 9px; border-radius: 8px; cursor: pointer; border: none; letter-spacing: 2px;
}
.btn-ink { background: var(--ink); color: #efe6cd; }
.btn-danger { background: transparent; color: var(--cinnabar); border: 1.5px solid var(--cinnabar); }
.set-help { margin-top: 6px; padding: 10px 12px; background: rgba(51,86,107,.07); border-radius: 8px; font-size: 12px; }
.set-help b { display: block; margin-bottom: 4px; letter-spacing: 2px; }
.set-help p { margin-bottom: 3px; color: var(--ink-2); }
/* ========== 弹窗 ========== */
#modalOverlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(42,38,32,.55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal {
  width: min(520px, 92vw); max-height: 84vh; overflow-y: auto;
  padding: 22px 24px; text-align: center;
}
.modal h3 { font-size: 20px; letter-spacing: 4px; margin-bottom: 12px; }
.modal .m-body { font-size: 14px; text-align: left; margin-bottom: 14px; }
.modal .m-btns { display: flex; gap: 10px; justify-content: center; }
.tribulation { position: relative; height: 120px; margin: 8px 0; overflow: hidden; border-radius: 10px; background: linear-gradient(180deg, #2c3040, #454a63); }
.tribulation .bolt {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 3px; height: 0; background: linear-gradient(180deg, #fff, #ffd966, rgba(255,217,102,0));
  animation: boltStrike .5s ease-in forwards;
}
@keyframes boltStrike { 0% { height: 0; opacity: 1; } 30% { height: 100%; opacity: 1; } 100% { height: 100%; opacity: 0; } }
.tribulation .tk-cloud { position: absolute; top: 6px; width: 100%; text-align: center; font-size: 22px; opacity: .85; }
.success-seal {
  display: inline-block; margin: 6px auto; padding: 10px 26px;
  border: 2.5px solid var(--cinnabar); border-radius: 8px;
  color: var(--cinnabar); font-size: 22px; font-weight: 700; letter-spacing: 6px;
  transform: rotate(-6deg); animation: sealIn .5s cubic-bezier(.2,1.6,.4,1);
}
@keyframes sealIn { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
/* Toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: rgba(42,38,32,.92); color: #efe6cd;
  padding: 10px 26px; border-radius: 24px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .35s cubic-bezier(.2,1.4,.4,1); z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(42,38,32,.3); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
/* 响应式 */
@media (max-width: 1000px) {
  body { overflow: auto; }
  #gameScreen { height: auto; }
  #layout { grid-template-columns: 1fr; }
  .dungeon-row { grid-template-columns: repeat(2, 1fr); }
  .pick-row { grid-template-columns: 1fr 1fr; }
  .scene { height: 200px; }
}