* {
  box-sizing: border-box;
}

header {
  display: none !important;
}

#app-global-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  z-index: 9999;
  background: #ffffff;
  color: #1f2937;
  border-right: 1px solid #e2e8f0;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: stretch;
}

.sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 18px 16px 18px 18px;
  gap: 18px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: #1e3a5f;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.brand i {
  color: #2563eb;
  font-size: 20px;
}

.brand-main {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.nav-link span {
  flex: 1;
}

.nav-link:hover {
  color: #1e3a5f;
  background: #f1f5f9;
}

.nav-link.active {
  color: #1d4ed8;
  background: #e8f0fe;
  border-color: transparent;
  font-weight: 700;
}

.fav-badge {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1d4ed8;
  font-size: 11px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  background: transparent;
  border: 1px solid #d8e0ea;
  color: #475569;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  background: #f1f5f9;
  border-color: #b9c4d3;
  color: #1e3a5f;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  padding: 9px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.hamburger {
  display: none;
  background: transparent;
  border: 0;
  color: #475569;
  font-size: 20px;
  padding: 6px 8px;
  border-radius: 999px;
}

.hamburger:hover {
  background: #f1f5f9;
}

.mobile-panel {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  padding: 70px 18px 24px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
}

.mobile-panel.open {
  display: flex;
}

.mobile-item {
  display: block;
  color: #475569;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
}

.mobile-item:hover {
  background: #f1f5f9;
  color: #1e3a5f;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: 340px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  color: #1f2937;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.modal-title {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 10px;
}

.field {
  margin-bottom: 10px;
}

.input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  color: #1f2937;
}

.input:focus {
  outline: none;
  border-color: #2563eb;
}

.primary {
  width: 100%;
  padding: 9px 0;
  border-radius: 999px;
  border: 0;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  margin-top: 4px;
  cursor: pointer;
}

.primary:hover {
  background: #1d4ed8;
}

.close-x {
  position: absolute;
  right: 12px;
  top: 8px;
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
}

#mainNav {
  display: none;
}

@media (max-width: 960px) {
  #app-global-nav {
    width: auto;
    height: 56px;
    inset: 0 0 auto 0;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
  }

  .sidebar-header {
    flex: 1;
  }

  .nav-links,
  .sidebar-footer {
    display: none;
  }

  .hamburger {
    display: inline-flex;
  }
}

.with-sidebar {
  padding-left: 240px;
  transition: padding-left 0.25s ease;
}

@media (max-width: 960px) {
  .with-sidebar {
    padding-left: 0;
  }
}

/* ============================================================
   账号区（自动生成账号 · 账号中心）
   ============================================================ */
.btn-strong {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}
.btn-strong:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.acct-wrap { position: relative; width: 100%; }

.acct-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}
.acct-chip:hover { border-color: #bfd4f0; background: #f1f5f9; }

.acct-avatar {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-weight: 800; font-size: 13px;
}

.acct-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.acct-meta b { font-size: 13px; color: #1e3a5f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta em { font-size: 11px; font-style: normal; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip .fa-chevron-up { font-size: 10px; color: #94a3b8; transition: transform .18s ease; }
.acct-wrap.open .acct-chip .fa-chevron-up { transform: rotate(180deg); }

.acct-menu {
  position: absolute;
  bottom: calc(100% + 6px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  padding: 6px;
  display: none;
  z-index: 20;
}
.acct-wrap.open .acct-menu { display: block; }
.acct-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px;
  color: #475569; text-decoration: none; font-size: 13px; font-weight: 600;
}
.acct-menu a:hover { background: #f1f5f9; color: #1d4ed8; }
.acct-menu a i { width: 14px; text-align: center; color: #94a3b8; }

/* 登录 / 注册弹窗 */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: #f1f5f9; padding: 4px; border-radius: 999px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer;
}
.auth-tab.on { background: #fff; color: #1d4ed8; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.auth-note { font-size: 12px; color: #94a3b8; line-height: 1.7; margin: 2px 0 8px; }
.auth-err { display: none; font-size: 12.5px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; padding: 7px 10px; margin-bottom: 8px; }
.auth-foot { margin-top: 10px; text-align: center; font-size: 12px; color: #94a3b8; }
.auth-foot a { color: #2563eb; text-decoration: none; font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; }

/* 侧栏轻提示 */
.fx-nav-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1e3a5f; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  z-index: 12000; opacity: 1; transition: opacity .4s ease, transform .4s ease;
  max-width: 82vw; text-align: center;
}
.fx-nav-toast.out { opacity: 0; transform: translateX(-50%) translateY(8px); }
/* 未登录时的三个入口 */
.btn-ghost-account { flex: 1 1 100%; text-align: center; border-style: dashed; }
/* 注册 / 登录窗口（新版） */
.auth-card { width: 420px; max-height: 88vh; overflow: auto; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: #f1f5f9; padding: 4px; border-radius: 999px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: #64748b; cursor: pointer; }
.auth-tab.on { background: #fff; color: #1d4ed8; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.auth-hint { display: none; font-size: 12.5px; color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 9px 11px; line-height: 1.7; margin-bottom: 12px; }
.auth-field-label { font-size: 12.5px; font-weight: 700; color: #475569; margin: 10px 0 5px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.auth-tip { font-weight: 500; font-size: 11.5px; color: #94a3b8; }
.auth-name-row { display: flex; gap: 8px; align-items: stretch; }
.auth-name-row .input { flex: 1; min-width: 0; }
.auth-mini { flex: 0 0 auto; border: 1px solid #d8e0ea; background: #fff; color: #475569; border-radius: 10px; padding: 0 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.auth-mini:hover { background: #f1f5f9; border-color: #bfd4f0; color: #1d4ed8; }
.auth-mini[disabled] { opacity: .6; cursor: wait; }
.auth-status { font-size: 12px; min-height: 18px; margin-top: 5px; color: #94a3b8; }
.auth-status.ok { color: #047857; }
.auth-status.bad { color: #dc2626; }
.auth-meter { height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 8px 0 5px; }
.auth-meter span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s ease, background .2s ease; background: #e2e8f0; }
.auth-meter span.lv1 { background: #dc2626; }
.auth-meter span.lv2 { background: #f59e0b; }
.auth-meter span.lv3 { background: #2563eb; }
.auth-meter span.lv4 { background: #16a34a; }
.auth-strength { font-size: 12px; color: #64748b; }
.auth-rules { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.auth-rules li { font-size: 11.5px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.auth-rules li i { font-size: 10px; color: #cbd5e1; }
.auth-rules li.ok { color: #047857; }
.auth-rules li.ok i { color: #16a34a; }
.auth-rules li.bad { color: #dc2626; }
.auth-rules li.bad i { color: #f87171; }
.auth-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #64748b; line-height: 1.7; margin: 12px 0 4px; cursor: pointer; }
.auth-agree input { margin-top: 3px; }
.auth-agree a { color: #2563eb; text-decoration: none; }
.auth-agree a:hover { text-decoration: underline; }
.auth-err { display: none; font-size: 12.5px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; padding: 8px 11px; margin-top: 10px; }
.auth-foot { margin-top: 12px; text-align: center; font-size: 12.5px; color: #94a3b8; }
.auth-foot a { color: #2563eb; text-decoration: none; font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; }