/* ===== 登录页 ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}
.login-container::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -200px; right: -100px;
}
.login-container::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  bottom: -150px; left: -50px;
}
.login-box {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 380px;
  position: relative;
  z-index: 1;
}
.login-box h1 {
  text-align: center;
  color: var(--text);
  margin-bottom: 36px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
}
.login-box input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  transition: var(--transition);
  background: #fafbfc;
}
.login-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}
.login-box button {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 2px;
  margin-top: 4px;
}
.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(24,144,255,0.4);
}
.login-box button:active { transform: translateY(0); }
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 15px;
  text-align: center;
  min-height: 20px;
}

/* ===== 主布局 ===== */
.app-container { display: none; min-height: 100vh; }
.app-container.active { display: flex; }

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 200;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header .header-text { white-space: nowrap; overflow: hidden; }
.sidebar-toggle {
  background: none; border: none; color: rgba(255,255,255,0.45);
  cursor: pointer; font-size: 18px; padding: 4px; line-height: 1;
  flex-shrink: 0; transition: color 0.2s;
}
.sidebar-toggle:hover { color: #fff; }
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .sidebar-header h2,
body.sidebar-collapsed .sidebar-header p { display: none; }
body.sidebar-collapsed .sidebar-toggle { margin: 0 auto; }
body.sidebar-collapsed .sidebar-header { justify-content: center; }
body.sidebar-collapsed .menu-item span { display: none; }
body.sidebar-collapsed .menu-item { justify-content: center; padding: 13px 0; margin: 2px 4px; }
body.sidebar-collapsed .main-content { margin-left: 60px; }
.sidebar-header h2 { font-size: 16px; color: #fff; font-weight: 600; }
.sidebar-header p { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 6px; }
.sidebar-menu { padding: 12px 0; }
.menu-item {
  padding: 13px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  position: relative;
  margin: 2px 8px;
  border-radius: 6px;
}
.menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.menu-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(24,144,255,0.3);
}
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* 主内容区 */
.main-content { flex: 1; margin-left: 220px; }
.header {
  background: #fff;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-info {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 20px;
}

/* 角色切换器 */
.role-switch-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.role-switch-btn:hover {
  opacity: 0.85;
}
.role-switch-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 1000;
  padding: 4px 0;
  border: 1px solid #f0f0f0;
}
.role-switch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: background 0.15s;
}
.role-switch-item:hover {
  background: #f5f5f5;
}
.role-switch-item.active {
  background: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}
.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
