/* 《凡人修仙：掌天瓶》宣纸墨香风 —— 2G 时代简洁质感 */
:root {
  --bg: #efe6cf;
  --panel: #f8f1dd;
  --panel2: #f2e8cd;
  --ink: #3b3125;
  --ink2: #7a6c52;
  --line: #b9a77f;
  --accent: #7a5c2e;
  --good: #3d6b35;
  --bad: #8c2f2f;
  --warn: #9a6b1f;
  --story: #5b4a8a;
  --event: #2e5f8a;
  --hit: #6b4f1d;
}
body.theme-lvjing {
  --bg: #0c110b;
  --panel: #101a0f;
  --panel2: #0d150c;
  --ink: #9adf88;
  --ink2: #5d9150;
  --line: #2c4a26;
  --accent: #6fcf5f;
  --good: #6fcf5f;
  --bad: #e07a6a;
  --warn: #d8b45a;
  --story: #b39ddb;
  --event: #7fc4e8;
  --hit: #c9e89a;
}
body.theme-dark {
  --bg: #131110;
  --panel: #1c1917;
  --panel2: #262220;
  --ink: #d6cfc2;
  --ink2: #948a7c;
  --line: #3d372f;
  --accent: #c9a86a;
  --good: #85b46f;
  --bad: #e07a6a;
  --warn: #d8a84e;
  --story: #ab93dd;
  --event: #82b6d8;
  --hit: #d8c08a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", "NSimSun", serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- 顶部状态条 ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 13px;
}
#topbar .row1 { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
#topbar .nm { font-weight: bold; font-size: 15px; }
#topbar .rlm { color: var(--accent); font-weight: bold; }
#topbar .sub { color: var(--ink2); }
#topbar .bar { height: 8px; background: var(--panel2); border: 1px solid var(--line); margin: 4px 0 2px; }
#topbar .bar .fill { height: 100%; background: var(--accent); }
#topbar .row2 { display: flex; justify-content: space-between; color: var(--ink2); font-size: 12px; }

/* ---------- 主区 ---------- */
#page { flex: 1; padding: 10px 10px 112px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 10px; }
.panel h3 { font-size: 14px; color: var(--accent); border-bottom: 1px dashed var(--line); padding-bottom: 4px; margin-bottom: 6px; }
.panel .hint { color: var(--ink2); font-size: 12px; }
.dim { color: var(--ink2); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.story { color: var(--story); }
.event { color: var(--event); }
.hit { color: var(--hit); }
.boss { color: #fff; background: var(--bad); display: inline-block; padding: 0 4px; }
.big { font-size: 17px; font-weight: bold; }

/* ---------- 日志 ---------- */
#log { max-height: 46vh; overflow-y: auto; }
.logline { margin: 3px 0; }
.logline .d { color: var(--ink2); font-size: 11px; margin-right: 4px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; cursor: pointer; user-select: none;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 12px; margin: 3px 4px 3px 0;
  font-family: inherit; font-size: 14px;
  min-height: 38px;
}
.btn:active { background: var(--accent); color: #fff; }
.btn.primary { border-color: var(--accent); color: var(--accent); font-weight: bold; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.dis { opacity: 0.45; pointer-events: none; }
.btn.wide { display: block; width: 100%; text-align: center; margin: 4px 0; }
.btnrow { display: flex; flex-wrap: wrap; }

/* ---------- 底部导航（两行 5+4，移动端大触控格） ---------- */
#nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 20;
  display: flex; flex-wrap: wrap;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#nav .nb {
  flex: 1 1 20%;              /* 第一行：5 个主功能 */
  min-width: 0; min-height: 46px;
  text-align: center; padding: 13px 0 11px; cursor: pointer;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 13px; position: relative;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
#nav .nb:nth-child(n+6) { flex-basis: 25%; border-bottom: none; }   /* 第二行：4 个占满整行 */
#nav .nb:nth-child(5) { border-right: none; }
#nav .nb:last-child { border-right: none; }
#nav .nb:active { background: var(--panel2); }
#nav .nb.on {
  background: var(--panel2); color: var(--accent); font-weight: bold;
  box-shadow: inset 0 2px 0 var(--accent);
}
#nav .nb .dot {
  position: absolute; top: 4px; right: 6px;
  width: 7px; height: 7px; background: var(--bad); border-radius: 50%;
}

/* ---------- 列表 ---------- */
.li { border-bottom: 1px dashed var(--line); padding: 6px 0; }
.li:last-child { border-bottom: none; }
.li .t { font-weight: bold; }
.li .ops { margin-top: 4px; }
.tag { display: inline-block; border: 1px solid var(--line); color: var(--ink2); font-size: 11px; padding: 0 4px; margin-left: 4px; }
.bar.big { height: 14px; background: var(--panel2); border: 1px solid var(--line); margin: 4px 0; }
.bar.big .fill { height: 100%; background: var(--accent); }
.bar.hp .fill { background: var(--bad); }
.bar.mp .fill { background: var(--event); }
.bar.foe .fill { background: #555; }

/* ---------- 遮罩 ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 14, 4, 0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#overlay.hidden, #toast.hidden, .hidden { display: none !important; }
#overlay .box {
  background: var(--panel); border: 2px solid var(--accent);
  max-width: 480px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 14px;
}
#overlay .box h2 { color: var(--accent); font-size: 17px; margin-bottom: 8px; text-align: center; }
#overlay .box .txt { margin-bottom: 10px; white-space: pre-wrap; }

#toast {
  position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--bg);
  padding: 8px 14px; font-size: 13px; max-width: 90%;
  white-space: pre-wrap;
}

input[type="text"], textarea, select {
  font-family: inherit; font-size: 14px;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); padding: 6px 8px; width: 100%;
}
textarea { min-height: 70px; }

.title-art {
  text-align: center; color: var(--accent); font-size: 22px;
  letter-spacing: 6px; margin: 8px 0 2px; font-weight: bold;
}
.subtitle { text-align: center; color: var(--ink2); font-size: 12px; margin-bottom: 10px; }
hr.sep { border: none; border-top: 1px dashed var(--line); margin: 8px 0; }
