/* Global Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  width: 100%;
  font-family: var(--bs-body-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  background: #f7f8fa;
  overflow-x: hidden;
}

/* Navigation Styles */
.nav-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  height: 64px;
}

.nav-page .navbar {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  height: 64px;
}

.navbar-brand:hover {
  color: #ffffff !important;
  text-decoration: none;
}

.navbar-brand .material-icons {
  font-size: 24px;
  color: #ffffff;
}

/* User Dropdown */
.navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  height: 64px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
}

.nav-item.dropdown {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.2s;
  cursor: pointer;
  height: 48px;
  min-height: 48px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  text-decoration: none;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  padding: 8px 0;
  margin-top: 4px;
  display: none;
  z-index: 1050;
}

/* 确保下拉菜单在用户按钮下方正确显示 */
.navbar-nav .nav-item.dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: -8px;
  left: auto;
  transform: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
  color: #1f2937;
  text-decoration: none;
}

.dropdown-item .material-icons {
  font-size: 18px;
  color: #6b7280;
}

/* Main Content Layout */
.main-content {
  margin-top: 64px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Bootstrap Override */
.container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.col, .col-*, [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-page .navbar {
    padding: 0 16px;
  }
  
  .navbar-brand {
    font-size: 16px;
  }
}
