/* ============================================================
   睿动AI — Luminous Glass Design Tokens
   Teal / Cyan color system + sidebar utilities
   ============================================================ */

:root {
  /* ── Primary Teal ── */
  --teal:          #14B8A6;

  /* ── Legacy blue overrides (redirect old design-system variables to teal) ── */
  --accent-blue:        #14B8A6;
  --accent-blue-hover:  #0f9688;
  --brand-blue:         #14B8A6;
  --brand-blue-hover:   #0f9688;
  --teal-dark:     #0f9688;
  --teal-dim:      #0d8a7c;
  --teal-light:    rgba(20, 184, 166, 0.12);
  --teal-glow:     rgba(20, 184, 166, 0.25);
  --teal-border:   rgba(20, 184, 166, 0.3);

  /* ── Slate scale ── */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  /* ── Status ── */
  --success: #10b981;
  --error:   #ef4444;
  --warning: #f59e0b;
  --info:    #3b82f6;

  /* ── Font ── */
  --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* ── Sidebar ── */
  --sidebar-width: 169px;
  --sidebar-bg:    rgba(255, 255, 255, 0.72);
  --sidebar-border: rgba(20, 184, 166, 0.12);
  --sidebar-item-hover: rgba(20, 184, 166, 0.08);
  --sidebar-item-active-bg: rgba(20, 184, 166, 0.1);
  --sidebar-item-active-bar: #14B8A6;

  /* ── Glass ── */
  --glass-bg:     rgba(255, 255, 255, 0.55);
  --glass-blur:   20px;
  --glass-border: rgba(255, 255, 255, 0.7);

  /* ── Shadows ── */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

/* ─── Glass Card ─── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.glass-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ─── Capsule Input ─── */
.input-capsule {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--slate-900);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-capsule::placeholder { color: var(--slate-400); }
.input-capsule:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-light);
}

/* ─── Primary Button ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 6px 20px var(--teal-glow);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: linear-gradient(135deg, rgba(20,184,166,0.45), rgba(15,150,136,0.45));
  cursor: not-allowed;
  transform: none;
}

/* ─── Console Sidebar ─── */
.console-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: left 0.25s ease, box-shadow 0.25s ease;
}

/* ─── Sidebar Logo ─── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
}

/* ─── Sidebar nav sections ─── */
.sidebar-nav {
  flex: 1;
  padding: 4px 8px;
  overflow-y: auto;
}

/* ─── Group Label ─── */
.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 14px 8px 4px;
  user-select: none;
}

/* ─── Nav Item ─── */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--slate-900);
}
.sidebar-nav-item.active {
  background: var(--sidebar-item-active-bg);
  color: var(--teal-dark);
  font-weight: 600;
}
.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-nav-item.active svg,
.sidebar-nav-item:hover svg {
  opacity: 1;
}

/* ─── Sidebar Divider ─── */
.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 6px 8px;
}

/* ─── Sidebar Footer (user profile) ─── */
.console-sidebar .sidebar-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  position: relative;
  display: block;  /* 防止被 chat/style.css 的 .sidebar-footer flex 覆盖 */
}
.console-sidebar .sidebar-footer-row {
  display: grid !important;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
}
.console-sidebar .sidebar-user-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  text-align: center;
  min-width: 0;
}
.console-sidebar .sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--slate-400);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.console-sidebar .sidebar-logout-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}
.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.sidebar-user-btn:hover { background: var(--sidebar-item-hover); }
.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-dropdown {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 8px;
  right: 8px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--slate-200);
  padding: 6px 0;
  display: none;
  z-index: 300;
}
.sidebar-user-dropdown.open { display: block; }
.sidebar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--slate-700);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-dropdown-item:hover { background: var(--slate-50); }
.sidebar-dropdown-item.danger { color: #ef4444; }
.sidebar-dropdown-divider {
  height: 1px;
  background: var(--slate-200);
  margin: 4px 0;
}

/* ─── Console Main Area ─── */
.console-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ─── Mobile Sidebar Toggle Button ─── */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 201;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--slate-700);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background 0.15s;
  padding: 0;
}
.sidebar-mobile-toggle:hover { background: var(--sidebar-item-hover); }
.sidebar-mobile-toggle .icon-ham { display: block; }
.sidebar-mobile-toggle .icon-close { display: none; }
.sidebar-mobile-toggle.active .icon-ham { display: none; }
.sidebar-mobile-toggle.active .icon-close { display: block; }

/* ─── Mobile Sidebar Overlay ─── */
.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* ─── Sidebar toggle: inline variant (injected into page mobile headers) ─── */
.sidebar-mobile-toggle.sidebar-toggle-inline {
  position: static !important;
  top: auto !important;
  left: auto !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background: transparent !important;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-mobile-toggle.sidebar-toggle-inline:hover {
  background: rgba(0,0,0,0.06) !important;
}

/* ─── Console Mobile Top Bar ─── */
/* 替代浮动 toggle，在微信 / 所有移动端提供标准顶部导航入口 */
.console-mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 200;
  align-items: center;
  padding: 0 16px 0 4px;
  gap: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
.console-mobile-topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1D1D1F;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
  /* 常规控制台页面：顶部栏整体显示（toggle 已被 JS 移入其中） */
  .console-mobile-topbar { display: flex; }
  /* chat/docs 专用内联 toggle 直接由其自身容器的 display 控制 */
  .sidebar-mobile-toggle.sidebar-toggle-inline { display: flex; }

  .console-sidebar {
    left: calc(-1 * var(--sidebar-width) - 20px);
  }
  .console-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }

  .console-main {
    margin-left: 0;
  }
}

/* ─── Landing Nav Pill (override for landing page) ─── */
/* Allow dropdowns to overflow the pill pill boundaries (landing.css sets overflow:hidden) */
.nav-pill { overflow: visible; }

.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 16px 24px;
  pointer-events: none;
}
.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1080px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-full);
  padding: 8px 12px 8px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  pointer-events: all;
  transition: max-width 0.3s ease;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}
.nav-logo-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
}
.nav-right-landing {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-help-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  transition: color 0.15s, background 0.15s;
}
.nav-help-link:hover {
  color: var(--teal);
  background: var(--teal-light);
}
.nav-login-btn {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border: none;
  border-radius: var(--radius-full);
  padding: 7px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.nav-login-btn:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px var(--teal-glow);
}

/* ─── Landing nav user dropdown ─── */
.nav-user-wrap {
  position: relative;
}
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--slate-200);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}
.nav-user-btn:hover { border-color: var(--teal-border); }
.nav-user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-user-name-sm {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 6px 0;
  display: none;
  z-index: 500;
}
.nav-user-dropdown.open { display: block; }
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--slate-700);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
}
.nav-dropdown-item:hover { background: var(--slate-50); }
.nav-dropdown-divider {
  height: 1px;
  background: var(--slate-200);
  margin: 4px 0;
}

/* ─── Console Header Bar ─── */
.console-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 48px;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sidebar-border);
}
.console-header-left { display: flex; align-items: center; gap: 10px; }
.console-header-right { display: flex; align-items: center; gap: 6px; }
.console-header-btn {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.console-header-btn:hover { background: var(--slate-100); color: var(--slate-900); }

/* Console header language switcher */
.console-lang-wrap { position: relative; }
.console-lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  display: none;
  z-index: 400;
}
.console-lang-dropdown.open { display: block; }
.console-lang-item {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--slate-700);
  cursor: pointer;
  transition: background 0.12s;
}
.console-lang-item:hover { background: var(--slate-50); }

/* Console header user avatar */
.console-user-wrap { position: relative; }
.console-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--slate-200);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  transition: border-color 0.15s;
  max-width: 180px;
}
.console-user-btn:hover { border-color: var(--teal-border); }
.console-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.console-user-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.console-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 6px 0;
  display: none;
  z-index: 500;
}
.console-user-dropdown.open { display: block; }

/* ─── Global overrides: shift old blue classes to teal ─── */
/* Covers .brand-gradient and .text-gradient used in console page templates */
.brand-gradient {
  background: linear-gradient(120deg, #14B8A6 0%, #0f9688 100%) !important;
}
.text-gradient {
  background: linear-gradient(120deg, #14B8A6 0%, #0f9688 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* ─── Console page body layout ─── */
/* Ensure main content clears the sidebar + header */
body.console-layout main,
body.console-layout .main-content {
  padding-top: 0;
}
