:root {
  --bg: #f6f7f9; --surface: #fff; --line: #e1e6ee; --text: #121826;
  --muted: #667085; --primary: #1f4f8f; --primary-dark: #173b6b; --primary-soft: #edf3fa;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: linear-gradient(180deg, #fff 0, var(--bg) 360px); font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--primary); color: white; border-radius: 10px; font-size: 25px; }
.sidebar-nav { flex: 1; margin-top: 28px; }
.sidebar-nav h2 { margin: 0 12px 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; }
.sidebar-link:hover, .sidebar-link.is-active { color: var(--primary); background: var(--primary-soft); }
.sidebar-link.is-active { font-weight: 600; }
.sidebar-footer { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 16px 8px 0; }
.username { overflow-wrap: anywhere; min-width: 0; }
.sidebar-footer form { flex-shrink: 0; }
.text-button { background: none; border: 0; color: var(--muted); padding: 4px; }
.text-button:hover { color: var(--primary); }
.app-main { min-width: 0; }
.app-header { min-height: 68px; display: flex; align-items: center; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.page { max-width: 1280px; margin: 0 auto; padding: 32px; }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 18px; }
.page-heading p, .muted, .empty-state p { color: var(--muted); margin: 0; }
.page-heading { margin-bottom: 24px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(18,24,38,.06); }
.empty-state { text-align: center; padding: 72px 24px; }
.empty-icon { margin: 0 auto 20px; width: 72px; padding: 14px; background: var(--primary-soft); border-radius: 18px; color: var(--primary); }
.empty-icon svg { display: block; width: 100%; }
.empty-state h2 { margin: 0 0 8px; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 36px; }
.login-card .brand { padding: 0; margin-bottom: 32px; }
.login-card h1 { font-size: 24px; }
.login-card form { margin-top: 26px; }
label { display: block; font-weight: 600; margin-bottom: 8px; }
input:not([type="hidden"]) { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 20px; background: white; color: var(--text); }
.button { width: 100%; background: var(--primary); color: white; border: 0; border-radius: 8px; padding: 12px 18px; font-weight: 600; }
.button:hover { background: var(--primary-dark); }
.notice, .error { padding: 12px; border-radius: 8px; margin-bottom: 16px; background: var(--primary-soft); }
.error { color: #c93434; background: #fff0f0; margin-top: 20px; }
@media (max-width: 700px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-nav { margin-top: 20px; }
  .sidebar-nav h2 { display: none; }
  .sidebar-footer { margin-top: 10px; }
  .page { padding: 24px 16px; }
  .app-header { padding: 0 20px; min-height: 56px; }
  .login-card { padding: 28px; }
}
