/* ==========================================================
   layout.css  侧栏 + 顶栏 + 主区
   ========================================================== */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
}

/* —— 侧栏 —— */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  overflow: hidden;
  transition: background var(--t-base);
}
.sidebar::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-1), transparent);
  opacity: .5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-0), var(--gold-1));
  color: var(--gold-on);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-md);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 18px; letter-spacing: .5px; }
.brand-sub  { font-size: 11px; color: var(--text-2); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-1);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-base);
  user-select: none;
}
.nav-item:hover { background: var(--input-bg); color: var(--text-0); }
.nav-item.active {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-soft-2));
  color: var(--gold-0);
  border-color: var(--gold-soft);
  box-shadow: inset 0 1px 0 rgba(245,230,211,.05);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-deep));
  color: var(--gold-on);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 14px;
}
.who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-name { font-size: 13px; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 11px; color: var(--text-2); letter-spacing: 1px; text-transform: uppercase; }
.btn-logout {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-1);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  transition: all var(--t-base);
}
.btn-logout:hover { color: var(--gold-0); border-color: var(--gold-1); }

/* —— 主区 —— */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 64px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--t-base);
}
.crumb {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-0);
  letter-spacing: .5px;
}
.crumb .sep { color: var(--text-3); margin: 0 8px; }
.crumb .now { color: var(--gold-0); }

.topbar .spacer { flex: 1; }
.topbar .meta {
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.topbar .meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* —— 响应式:平板 —— */
@media (max-width: 1024px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 20px 10px; }
  .brand-text, .nav-item span, .who, .btn-logout { display: none; }
  .brand { justify-content: center; padding: 4px 0 18px; }
  .nav-item { justify-content: center; }
}

/* —— 响应式:手机 —— */
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 64px 1fr; }
  .sidebar {
    flex-direction: row;
    padding: 12px;
    border-right: none; border-bottom: 1px solid var(--line);
    align-items: center;
  }
  .brand { padding: 0; border: 0; margin: 0; }
  .brand-text, .sidebar-foot, .nav { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
