/* ============================================================
   SALON WorkBase · main.css（UI-1）
   依 design/mockups/salon_backend_mockup_v1.html 視覺定稿實作。
   鐵則：全檔禁止 hex 色碼，一律 var(--lhrm-*) / var(--c-*)（LEBRI §0 / §7）。
   mockup 的 data-device 控制列翻成 @media (max-width:760px)。
   ============================================================ */

:root {
  --salon-rail: 56px;   /* 版面尺寸，非主題色 */
  --salon-fly: 200px;
  --salon-top: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  background: var(--lhrm-bg);
  color: var(--lhrm-text);
  font-family: var(--lhrm-font-sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--lhrm-font-mono); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { display: block; }
a { text-decoration: none; color: inherit; }

/* ── 通用按鈕 ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--lhrm-border-2); border-radius: 3px;
  font-size: 13px; font-weight: 400; letter-spacing: 1px;
  transition: border-color .18s, color .18s, background .18s, opacity .18s;
}
.btn:hover { border-color: var(--lhrm-gold); color: var(--lhrm-gold-text); }
.btn.primary { background: var(--lhrm-text); color: var(--lhrm-bg); border-color: var(--lhrm-text); }
/* 不做金色滿版 hover：LEBRI 用金原則禁止整顆金底大按鈕 */
.btn.primary:hover { opacity: .85; color: var(--lhrm-bg); border-color: var(--lhrm-text); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { border-color: var(--lhrm-border-2); color: inherit; opacity: .45; }

/* 圖示鈕 */
.ib {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; color: var(--lhrm-text-dim);
  transition: color .15s, background .15s;
}
.ib:hover { color: var(--lhrm-gold-text); background: var(--lhrm-surface); }
.ib svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── 登入 ──────────────────────────────────────────────── */
#view-login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.login-box { width: 340px; animation: rise .5s ease both; }
.login-box .eyebrow { font-family: var(--lhrm-font-mono); font-size: 11px; letter-spacing: 4px; color: var(--lhrm-text-faint); text-transform: uppercase; }
.login-box h1 { font-weight: 400; font-size: 22px; margin: 8px 0 2px; letter-spacing: .5px; }
.login-box .sub { font-family: var(--lhrm-font-mono); font-size: 11px; color: var(--lhrm-text-dim); letter-spacing: 1px; }
.login-box form { margin-top: 36px; display: flex; flex-direction: column; gap: 18px; }
.fld label {
  display: block; margin-bottom: 6px;
  font-family: var(--lhrm-font-mono); font-size: 10px; letter-spacing: 2.5px;
  color: var(--lhrm-text-faint); text-transform: uppercase;
}
.fld input {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1px solid var(--lhrm-border-2);
  padding: 8px 0; font-size: 15px; outline: none; border-radius: 0;
  transition: border-color .2s;
}
.fld input:focus { border-bottom-color: var(--lhrm-gold); }
.fld input.mono { letter-spacing: 2px; }
.login-err { font-size: 12px; color: var(--lhrm-danger); min-height: 18px; }
.login-foot { margin-top: 60px; font-family: var(--lhrm-font-mono); font-size: 10px; letter-spacing: 2px; color: var(--lhrm-text-faint); }

/* ── App 外殼 ──────────────────────────────────────────── */
#view-app { position: fixed; inset: 0; display: flex; flex-direction: row; }

.rail {
  width: var(--salon-rail); flex: none;
  border-right: 1px solid var(--lhrm-border-2);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 4px; position: relative; z-index: 5;
  background: var(--lhrm-bg);
}
.rail .logo {
  width: 28px; height: 28px; margin-bottom: 18px;
  border: 1px solid var(--lhrm-gold-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--lhrm-font-mono); font-size: 10px; color: var(--lhrm-gold-text);
}
.rail .nav { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.rail .nav a {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 44px; color: var(--lhrm-text-dim);
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.rail .nav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rail .nav a:hover { color: var(--lhrm-text); background: var(--lhrm-surface); }
.rail .nav a.active { color: var(--lhrm-gold-text); border-left-color: var(--lhrm-gold); background: var(--lhrm-surface); }
.rail .spacer { flex: 1; }
.rail .me {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--lhrm-surface-2); border: 1px solid var(--lhrm-border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--lhrm-font-mono); font-size: 11px; color: var(--lhrm-text-dim);
}

/* flyout：hover rail 展開 */
.fly {
  position: absolute; left: var(--salon-rail); top: 0; bottom: 0;
  width: var(--salon-fly); padding: 14px 0; z-index: 4;
  background: var(--lhrm-surface);
  border-right: 1px solid var(--lhrm-border-2);
  transform: translateX(-8px); opacity: 0; pointer-events: none;
  transition: transform .18s, opacity .18s;
}
.rail:hover ~ .fly, .fly:hover { transform: none; opacity: 1; pointer-events: auto; }
.fly .brand {
  height: 28px; display: flex; align-items: center; padding: 0 16px; margin-bottom: 18px;
  font-family: var(--lhrm-font-mono); font-size: 11px; letter-spacing: 2px; color: var(--lhrm-gold-text);
}
.fly .item {
  height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  color: var(--lhrm-text-dim); font-size: 13px;
  transition: color .15s, background .15s;
}
.fly .item:hover { color: var(--lhrm-text); background: var(--lhrm-surface-2); }
.fly .item.active { color: var(--lhrm-text); }
.fly .item .k { font-family: var(--lhrm-font-mono); font-size: 10px; color: var(--lhrm-text-faint); letter-spacing: 1px; margin-left: auto; }

/* ── 主欄 + 頂列 ───────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  height: var(--salon-top); flex: none;
  border-bottom: 1px solid var(--lhrm-border-2);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.top h2 { font-weight: 400; font-size: 15px; letter-spacing: .5px; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top .who { font-family: var(--lhrm-font-mono); font-size: 11px; color: var(--lhrm-text-dim); letter-spacing: 1px; }
.top .who b { font-weight: 500; color: var(--lhrm-text); }
.top .who i { font-style: normal; color: var(--lhrm-gold-text); margin-left: 6px; }

#pageHost { flex: 1; overflow: auto; min-height: 0; position: relative; }
[data-page-view] { display: none; height: 100%; }
[data-page-view].on { display: flex; align-items: center; justify-content: center; }
.empty {
  font-family: var(--lhrm-font-mono); font-size: 11px; letter-spacing: 2px;
  color: var(--lhrm-text-faint); text-transform: uppercase;
}

/* ── 底列（手機）────────────────────────────────────────── */
.bottombar { display: none; }
.bottombar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--lhrm-text-faint);
  font-family: var(--lhrm-font-mono); font-size: 9px; letter-spacing: 1px;
}
.bottombar a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bottombar a.active { color: var(--lhrm-gold-text); }

/* ── 進場（一次性 staggered，LEBRI 克制手感）──────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rail { animation: rise .4s ease .02s both; }
.top { animation: rise .4s ease .06s both; }
#pageHost .empty { animation: rise .4s ease .12s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── 響應：斷點 760 ────────────────────────────────────── */
@media (max-width: 760px) {
  .rail, .fly { display: none; }
  #view-app { flex-direction: column; }
  .top { height: 52px; padding: 0 14px; gap: 8px; }
  .top .who { display: none; }
  .bottombar {
    display: flex; flex: none; height: 58px; padding-bottom: 6px;
    border-top: 1px solid var(--lhrm-border-2); background: var(--lhrm-bg);
  }
  .login-box { width: calc(100% - 64px); max-width: 340px; }
  .login-foot { margin-top: 40px; }
}
