/* Shared shell: left rail + top bar (Liblib-like). Injected/linked by shell-nav. */
:root {
  --yume-rail-w: 200px;
  --yume-nav-h: 60px;
  --yume-primary: #7c5cff;
}

body.yume-shell {
  padding-left: var(--yume-rail-w);
}

/* Top bar sits in content column (body already padded for rail) */
body.yume-shell .nav {
  width: auto;
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
body.yume-shell .nav .links { display: none !important; } /* moved to rail / nav-right */
/* Rail already brands; keep a compact top logo */
body.yume-shell .nav .logo .logo-jp { display: none; }
/* boss9：顶栏左上为当前页面名（无 logo 图标） */
body.yume-shell .nav .logo.yume-page-logo { cursor: default; gap: 0; }
body.yume-shell .nav .yume-page-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; color: var(--text, #f2f2f7); }

.yume-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.yume-rail-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border, #2a2a36);
  border-radius: 8px;
  background: #1a1a22;
  color: #f2f2f7;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Language switcher */
.yume-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  background: #1a1a22;
  border: 1px solid var(--border, #2a2a36);
}
.yume-lang button {
  height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9a9aa8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.yume-lang button.on {
  background: rgba(124,92,255,.22);
  color: #fff;
}
.yume-lang button:hover { color: #fff; }

/* Credits badge in top-right (from yume-wallet) */
.yume-nav-right .yume-balance-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, rgba(124,92,255,.45), rgba(79,125,255,.45));
  box-shadow: 0 0 0 1px rgba(124,92,255,.4) inset;
  min-width: 30px; justify-content: center;
}
.yume-nav-right .yume-balance-badge.low {
  background: linear-gradient(135deg, rgba(224,86,86,.5), rgba(217,70,239,.4));
}
.yume-nav-right .yume-balance-badge::before { content: '✦'; font-size: 10px; opacity: .85; }
.yume-nav-right #navLogout {
  padding: 7px 12px; border-radius: 999px;
  color: #9a9aa8; text-decoration: none; font-size: 13px;
}
.yume-nav-right #navLogout:hover { color: #fff; background: rgba(255,255,255,.06); }

/* Left rail */
.yume-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--yume-rail-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: #121218;
  border-right: 1px solid var(--border, #2a2a36);
  padding: 12px 10px 16px;
  box-sizing: border-box;
}
.yume-rail-brand {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 8px; margin-bottom: 10px;
  color: #f2f2f7; text-decoration: none; font-weight: 700; font-size: 14px;
}
.yume-rail-brand img {
  width: 28px; height: 28px; border-radius: 8px; object-fit: cover;
}
.yume-rail-primary {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
}
.yume-rail-item {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 12px;
  border-radius: 10px;
  color: #9a9aa8; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.yume-rail-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.yume-rail-item.active {
  color: #fff;
  background: rgba(124,92,255,.14);
}
.yume-rail-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--yume-primary);
}
.yume-rail-item .ico {
  width: 18px; height: 18px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  opacity: .9;
}
.yume-rail-item.ur-link { /* 仅激活时强调，避免在其它页面看起来像高亮 */ }
.yume-rail-item.ur-link.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, rgba(217,70,239,.2), rgba(124,92,255,.18));
}

.yume-rail-account {
  margin-top: auto; flex-shrink: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border, #2a2a36);
  display: flex; flex-direction: column; gap: 4px;
}
.yume-rail-group {
  font-size: 11px; color: #6b6b7a;
  padding: 6px 12px 4px; letter-spacing: .04em;
}
.yume-rail-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,.45);
}

@media (max-width: 767px) {
  body.yume-shell { padding-left: 0; }
  .yume-rail-toggle { display: inline-flex; }
  .yume-rail {
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,.4);
  }
  body.yume-rail-open .yume-rail { transform: translateX(0); }
  body.yume-rail-open .yume-rail-backdrop { display: block; }
  .yume-lang button { padding: 0 6px; font-size: 11px; }
}

/* ---- boss6: top-right account panel ---- */
.yume-top-credits { text-decoration: none; display: inline-flex; }
.yume-login-btn {
  height: 32px; padding: 0 16px; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #7c5cff, #4f7dff); color: #fff; font-size: 13px; font-weight: 600;
}
.yume-login-btn:hover { filter: brightness(1.08); }
.yume-acct { position: relative; }
.yume-avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(124,92,255,.5);
  background: linear-gradient(135deg, #3a2a7a, #24306a); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0;
}
.yume-avatar.lg { width: 40px; height: 40px; font-size: 16px; cursor: default; }
.yume-acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 292px; z-index: 300;
  background: #17171f; border: 1px solid #2a2a36; border-radius: 12px; padding: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5); box-sizing: border-box;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s, transform .16s, visibility .16s;
}
.yume-acct.open .yume-acct-menu { opacity: 1; visibility: visible; transform: none; }
.yume-acct-head { display: flex; gap: 10px; align-items: center; }
.yume-acct-head .who { min-width: 0; flex: 1; }
.yume-acct-head .name { color: #f2f2f7; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yume-acct-head .mail { color: #9a9aa8; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yume-acct-head .uid { color: #6b6b7a; font-size: 11px; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.yume-acct-head .uid code { color: #b9b9c8; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.yume-acct-head .uid .copy {
  margin-left: auto; height: 20px; padding: 0 8px; border-radius: 5px; border: 1px solid #2a2a36;
  background: transparent; color: #a996ff; font-size: 11px; cursor: pointer;
}
.yume-acct-card {
  margin-top: 12px; border-radius: 10px; padding: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(79,125,255,.14));
  border: 1px solid rgba(124,92,255,.3);
}
.yume-acct-card .top { display: flex; align-items: flex-end; justify-content: space-between; }
.yume-acct-card .lbl { font-size: 12px; color: #c9c9d6; }
.yume-acct-card .bal { font-size: 24px; font-weight: 700; color: #fff; margin-top: 2px; }
.yume-acct-card .recharge {
  height: 28px; padding: 0 14px; border-radius: 999px; background: #fff; color: #3a2a9a;
  font-size: 12px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center;
}
.yume-acct-card .split { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: #c9c9d6; flex-wrap: wrap; }
.yume-acct-card .split b { color: #fff; font-weight: 600; }
.yume-acct-card .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.yume-acct-card .dot.d1 { background: #3ecf8e; }
.yume-acct-card .dot.d2 { background: #ffb13c; }
.yume-acct-card .tip { font-size: 11px; color: #9a9aa8; margin-top: 6px; }
.yume-acct-card .tip:empty { display: none; }
.yume-acct-list { margin-top: 10px; display: flex; flex-direction: column; }
.yume-acct-menu .yume-acct-item {
  display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 8px;
  color: #d6d6e0; font-size: 13px; text-decoration: none; cursor: pointer;
}
.yume-acct-menu .yume-acct-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.yume-acct-menu .yume-acct-logout { margin-top: 6px; border-top: 1px solid #2a2a36; border-radius: 0 0 8px 8px; padding-top: 2px; color: #ff8a8a; }
@media (max-width: 767px) { .yume-acct-menu { width: min(292px, 92vw); } }
