/* ==========================================================================
   菊厂放置 —— 全局样式
   深色职场风：工牌蓝 + 荧光强调色
   ========================================================================== */

:root {
  --bg: #0d1117;
  --bg-2: #131a24;
  --bg-3: #1a2331;
  --bg-4: #223044;
  --line: #2a3648;
  --line-2: #38495f;
  --text: #e6edf6;
  --text-2: #9aa9bd;
  --text-3: #64748b;
  --accent: #4f9cf9;
  --accent-2: #58d3c8;
  --gold: #ffd166;
  --danger: #ff5f56;
  --good: #4ade80;
  --warn: #fbbf24;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .45);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #4a5d78; }

/* ---------------------------------------------------------------- 启动页 */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: radial-gradient(circle at 50% 40%, #16202e, #0a0e14 70%);
}
.boot-logo { font-size: 64px; animation: bob 1.6s ease-in-out infinite; }
.boot-title { font-size: 30px; font-weight: 800; letter-spacing: 4px; }
.boot-sub { color: var(--text-3); font-size: 13px; letter-spacing: 1px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------------------------------------------------------------- 布局 */
.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px; height: 58px; flex: 0 0 58px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.brand-icon { font-size: 20px; }
.menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 20px; padding: 4px 8px; }

.vitals { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.vital {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 9px; white-space: nowrap;
}
.vital-icon { font-size: 14px; }
.vital-num { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.hp-vital { min-width: 168px; }
.vital-body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.bar { height: 6px; background: #0a0e14; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .18s linear; }
.bar-hp > i { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar-xp > i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-enemy > i { background: linear-gradient(90deg, #b91c1c, #ef4444); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.status-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.status-chip.on { color: var(--good); border-color: #2c5c3f; background: #10261a; }
.icon-btn {
  background: var(--bg); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 8px; width: 34px; height: 34px; font-size: 15px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }

.body { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: 208px; flex: 0 0 208px; overflow-y: auto; padding: 10px 8px 20px;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.nav-group { margin-bottom: 14px; }
.nav-title {
  font-size: 11px; color: var(--text-3); letter-spacing: 2px;
  padding: 6px 10px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: none; background: none; color: var(--text-2);
  border-radius: var(--radius-sm); text-align: left; font-size: 13px; margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-4); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.nav-item .nav-name { flex: 1; }
.nav-item .nav-lv { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.nav-item.active .nav-lv { color: var(--accent); }
.nav-item .nav-lv.max { color: var(--gold); }

.main { flex: 1; overflow-y: auto; padding: 18px 20px 40px; min-width: 0; }

.logbar {
  flex: 0 0 92px; height: 92px; overflow: hidden;
  background: var(--bg-2); border-top: 1px solid var(--line); padding: 6px 12px;
}
.log-scroll { height: 100%; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 1px; }
.log-line { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.log-line .lt { color: var(--text-3); font-family: var(--mono); font-size: 11px; margin-right: 6px; }
.log-line.good { color: var(--good); }
.log-line.bad { color: var(--danger); }
.log-line.warn { color: var(--warn); }
.log-line.big { color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------------- 通用组件 */
h1.page-title { font-size: 21px; margin: 0 0 4px; font-weight: 800; letter-spacing: .5px; }
p.page-desc { color: var(--text-2); margin: 0 0 16px; font-size: 13px; line-height: 1.6; }

.section { margin-bottom: 22px; }
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  letter-spacing: 1.5px; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  background: var(--bg-4); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 16px; font-size: 13px; font-weight: 600;
  transition: .13s;
}
.btn:hover:not(:disabled) { background: #2c3d55; border-color: var(--accent); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06121f; }
.btn-primary:hover:not(:disabled) { background: #6aabfa; border-color: #6aabfa; }
.btn-danger { background: #4a1f1f; border-color: #7a3030; color: #ffb3ae; }
.btn-danger:hover:not(:disabled) { background: #5c2626; border-color: var(--danger); }
.btn-good { background: #14351f; border-color: #2c5c3f; color: #8ff0b0; }
.btn-good:hover:not(:disabled) { background: #1a4527; border-color: var(--good); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-block { width: 100%; }

.tag {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: var(--bg-4); color: var(--text-2); font-family: var(--mono);
}
.tag.gold { background: #3a2f10; color: var(--gold); }
.tag.good { background: #14351f; color: var(--good); }
.tag.bad { background: #3a1a1a; color: #ff9a94; }
.tag.info { background: #12293f; color: #7fc0ff; }
.tag.dim { background: var(--bg-3); color: var(--text-3); }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }

/* 技能卡片 */
.skill-card { display: flex; flex-direction: column; gap: 8px; }
.skill-head { display: flex; align-items: center; gap: 10px; }
.skill-icon { font-size: 22px; }
.skill-name { font-weight: 700; font-size: 14px; }
.skill-lv { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-left: auto; }
.skill-lv.max { color: var(--gold); }
.skill-desc { font-size: 12px; color: var(--text-2); line-height: 1.55; min-height: 34px; }

/* 活动行 */
.act {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px;
}
.act.locked { opacity: .45; }
.act.running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.act-icon { font-size: 22px; width: 30px; text-align: center; }
.act-main { flex: 1; min-width: 0; }
.act-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.act-meta b { color: var(--text-2); font-weight: 600; }
.act-bar { width: 100%; margin-top: 6px; }
.act-right { flex: 0 0 auto; }

/* 敌人卡片 */
.enemy {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: .13s;
}
.enemy:hover { border-color: var(--accent); transform: translateY(-1px); }
.enemy.locked { opacity: .45; cursor: not-allowed; }
.enemy.locked:hover { border-color: var(--line); transform: none; }
.enemy.fighting { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.enemy-top { display: flex; align-items: flex-start; gap: 8px; }
.enemy-name { font-weight: 700; font-size: 14px; flex: 1; }
.enemy-lv { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.enemy-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; font-style: italic; min-height: 32px; }
.enemy-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 11px; color: var(--text-2); }
.enemy-stats span { display: flex; justify-content: space-between; }
.enemy-stats b { font-family: var(--mono); color: var(--text); font-weight: 600; }

.kind-normal { color: var(--text-2); }
.kind-elite { color: #c084fc; }
.kind-boss { color: var(--warn); }
.kind-world { color: var(--gold); }

/* 战斗面板 */
.combat-panel {
  position: sticky; top: -18px; z-index: 10; margin: -18px -20px 18px;
  padding: 14px 20px; background: linear-gradient(180deg, #1b1016, var(--bg-2));
  border-bottom: 2px solid #4a1f1f; box-shadow: var(--shadow);
}
.combat-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.fighter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fighter-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.fighter-hp { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.fighter-stats { font-size: 11px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.vs { font-size: 20px; color: var(--danger); font-weight: 800; }
.hit-pop {
  font-family: var(--mono); font-weight: 800; font-size: 16px;
  color: var(--gold); animation: pop .5s ease-out; text-align: center;
}
@keyframes pop { 0% { transform: scale(.6) translateY(6px); opacity: 0; } 40% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* 背包 */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.item-chip {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; position: relative; text-align: center; transition: .12s;
}
.item-chip:hover { border-color: var(--accent); background: var(--bg-3); }
.item-chip .ic { font-size: 22px; }
.item-chip .inm { font-size: 11px; line-height: 1.3; }
.item-chip .iqty { position: absolute; right: 5px; top: 4px; font-family: var(--mono); font-size: 11px; color: var(--gold); font-weight: 700; }
.item-chip.equipped { border-color: var(--good); background: #10261a; }

/* 装备槽 */
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.equip-slot {
  background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 10px; min-height: 84px; display: flex; flex-direction: column; gap: 5px;
}
.equip-slot.filled { border-style: solid; border-color: var(--line); }
.slot-label { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }
.slot-item { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.slot-item .ic { font-size: 20px; }
.slot-stats { font-size: 11px; color: var(--text-2); font-family: var(--mono); display: flex; gap: 8px; flex-wrap: wrap; }

/* 属性面板 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.stat-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; }
.stat-box .k { font-size: 11px; color: var(--text-3); }
.stat-box .v { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-top: 2px; }

/* 摸鱼 / 灵感列表 */
.toggle-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px; margin-bottom: 7px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: .12s;
}
.toggle-item:hover { border-color: var(--line-2); }
.toggle-item.on { border-color: var(--good); background: #0f2418; }
.toggle-item.locked { opacity: .42; cursor: not-allowed; }
.toggle-item .ti-icon { font-size: 20px; width: 26px; text-align: center; }
.toggle-item .ti-main { flex: 1; min-width: 0; }
.toggle-item .ti-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.toggle-item .ti-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }

/* 商店 */
.shop-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px; margin-bottom: 7px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.shop-item .si-icon { font-size: 22px; width: 30px; text-align: center; }
.shop-item .si-main { flex: 1; min-width: 0; }
.shop-item .si-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-item .si-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.price { font-family: var(--mono); font-weight: 700; color: var(--gold); }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(3, 6, 11, .78); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 20px; max-width: 560px; width: 100%; max-height: 84vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Toast */
.toasts {
  position: fixed; right: 18px; bottom: 108px; z-index: 150;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; box-shadow: var(--shadow);
  animation: slideIn .22s ease-out; max-width: 320px;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty .e-icon { font-size: 40px; margin-bottom: 10px; }

/* 区域选择 */
.area-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.area-tab {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.area-tab:hover { border-color: var(--line-2); color: var(--text); }
.area-tab.active { background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 700; }
.area-tab.locked { opacity: .45; }

.cat-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--bg-3), var(--bg-2));
}
.cat-head .ch-icon { font-size: 30px; }
.cat-head .ch-name { font-size: 18px; font-weight: 800; }
.cat-head .ch-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* 进度条（技能） */
.xp-line { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }

/* 移动端 */
@media (max-width: 860px) {
  .topbar { height: auto; flex: 0 0 auto; padding: 8px 10px; flex-wrap: wrap; gap: 8px; }
  .menu-btn { display: block; }
  .brand-text { display: none; }
  .vitals { order: 3; width: 100%; gap: 6px; }
  .vital { padding: 4px 9px; font-size: 12px; }
  .hp-vital { min-width: 130px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 240px;
    transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 12px 12px 30px; }
  .combat-panel { margin: -12px -12px 14px; padding: 10px 12px; top: -12px; }
  .combat-grid { grid-template-columns: 1fr; gap: 8px; }
  .vs { text-align: center; }
  .logbar { flex: 0 0 70px; height: 70px; }
  .grid-4 { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
