:root {
  --navy-950: #061b38;
  --navy-900: #082852;
  --navy-700: #23466c;
  --navy-100: #eaf0f6;
  --gold: #b8954f;
  --gold-soft: #f5eedf;
  --ink: #17263a;
  --muted: #6d7989;
  --line: #e3e7ec;
  --canvas: #f4f6f8;
  --white: #fff;
  --success: #257258;
  --warning: #9b6825;
  --shadow: 0 8px 24px rgba(8,40,82,.06);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100%; margin: 0; color: var(--ink); background: var(--canvas); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(184,149,79,.42); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.page-loading { min-height: 100vh; display: grid; place-items: center; color: var(--navy-700); background: #f7f8fa; font-size: 13px; }
.page-loading span { display: inline-flex; align-items: center; gap: 10px; }
.page-loading span::before { content: ""; width: 17px; height: 17px; border: 2px solid #dce3eb; border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0,1fr); background: #eef2f6; }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 20px; color: var(--navy-900); background: rgba(255,255,255,.98); border-right: 1px solid #dce2e9; }
.brand { height: 96px; display: flex; align-items: center; justify-content: center; padding: 4px 14px 20px; border-bottom: 1px solid var(--line); background: transparent; }
.brand img { display: block; width: 178px; height: 78px; object-fit: contain; object-position: center; }
.nav-label { margin: 25px 14px 10px; color: #9aa5b2; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.nav { display: grid; gap: 6px; }
.nav-link { min-height: 47px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border-radius: 9px; color: #657387; font-size: 13px; font-weight: 650; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--navy-900); background: #f1f4f7; }
.nav-link.active { color: #fff; background: var(--navy-900); box-shadow: 0 8px 18px rgba(8,40,82,.13); }
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-spacer { flex: 1; }
.version { padding: 14px; border-top: 1px solid var(--line); color: #9aa5b2; font-size: 10px; line-height: 1.7; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(10px); }
.topbar-left { display: flex; align-items: center; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--navy-900); }
.mobile-title, .menu-button { display: none; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy-900); font-size: 12px; font-weight: 700; }
.user-copy strong, .user-copy span { display: block; }
.user-copy strong { max-width: 230px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logout-button { min-height: 34px; margin-left: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--navy-700); background: #fff; font-size: 11px; font-weight: 750; }
.logout-button:hover { border-color: #bdc7d2; background: #f8fafb; }
.content { width: min(1440px,100%); margin: 0 auto; padding: 34px 36px 52px; }
.overlay { display: none; }

@media (max-width: 768px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; width: min(280px,85vw); transform: translateX(-105%); transition: transform .22s; box-shadow: 20px 0 50px rgba(6,27,56,.2); }
  body.menu-open .sidebar { transform: translateX(0); }
  .overlay { position: fixed; inset: 0; z-index: 20; background: rgba(6,27,56,.5); }
  body.menu-open .overlay { display: block; }
  .topbar { height: 64px; padding: 0 17px; }
  .menu-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--navy-900); background: var(--navy-100); }
  .mobile-title { display: block; margin-left: 11px; color: var(--navy-900); font-size: 13px; font-weight: 750; }
  .breadcrumb, .user-copy { display: none; }
  .logout-button { margin-left: 0; }
  .content { padding: 26px 17px 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
