@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css");

/* 基础布局 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: #f8f9fc;
  color: #2c3e50;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

main {
  flex: 1 0 auto;
  padding: 2rem 0;
}

/* 卡片样式现代化 */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 2rem;
}

.card:hover {
  /* transform: translateY(-2px); */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  border-radius: 12px 12px 0 0 !important;
}

.card-body {
  padding: 1.5rem;
}

/* 表格现代化 */
.table {
  margin-bottom: 0;
}

.table th {
  font-weight: 600;
  color: #6c757d;
  border-top: none;
  padding: 1rem;
}

.table td {
  padding: 1rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
  transition: background-color 0.2s;
}

/* 按钮样式优化 */
.btn {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  border: none;
  box-shadow: 0 2px 6px rgba(78, 115, 223, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* 徽章样式优化 */
.badge {
  padding: 0.5em 0.8em;
  font-weight: 500;
  border-radius: 6px;
}

/* 表单控件美化 */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #e0e3e7;
  padding: 0.625rem 1rem;
  transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

/* 模态框美化 */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

/* 图片预览容器样式 */
.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
}

.image-preview-item {
  position: relative;
  width: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.image-preview-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #dc3545;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remove-image:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .card {
    margin-bottom: 0;
  }

  .btn {
    padding: 0.375rem 0.75rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-header {
    padding: 1rem 1.25rem;
  }

  .list-group-item {
    padding: 1rem 1.25rem;
  }
}

:root {
  /* Branding Variables */
  --primary-gradient: linear-gradient(135deg, #1a237e 0%, #303f9f 100%);
  --secondary-bg: #f8f9fc;
  --text-color: #2c3e50;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --card-hover-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  --nav-hover-bg: rgba(255, 255, 255, 0.1);
  
  /* Legacy variables mapping if needed, or just keep them */
  --nav-primary-start: #1a237e;
  --nav-primary-end: #303f9f;
  --nav-hover: rgba(255, 255, 255, 0.12);
}

/* Navigation Bar Styling */
.navbar {
  padding: 0.75rem 0;
  background: var(--primary-gradient) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  letter-spacing: -0.5px;
  color: #fff;
}

.navbar-brand i {
  margin-right: 8px;
}

/* Nav Links */
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0.6rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff !important;
  background-color: var(--nav-hover-bg);
  transform: translateY(-1px);
}

/* Dropdown Menus */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  margin-top: 10px;
  padding: 0.5rem;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  color: #4a5568;
}

.dropdown-item:hover {
  background-color: #e3f2fd;
  color: #1565c0;
}

.dropdown-item.active {
  background-color: #1565c0;
  color: white;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-color: #f0f0f0;
}

.dropdown-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #adb5bd;
  padding: 0.5rem 1rem;
}

.dropdown-item-text {
  color: #4a5568;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.user-menu .dropdown-menu {
  min-width: 16rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
}

.user-meta {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.2;
}

@media (max-width: 992px) {
  .navbar .nav-link {
    margin-bottom: 0.25rem;
  }

  .user-name,
  .user-meta {
    color: #2c3e50;
  }
}

/* 页脚样式优化 */
.footer {
  background-color: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #6c757d;
  font-size: 0.875rem;
}

.footer .separator {
  color: #dee2e6;
  font-size: 0.75rem;
}

.footer .copyright,
.footer .rights {
  opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .footer {
    padding: 1rem 0;
    margin-top: 2rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
  }

  .footer .separator {
    display: none;
  }
}

/* 添加新的间距工具类 */
.mb-xs-3 {
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .mb-xs-3 {
    margin-bottom: 0;
  }
}

/* 优化列表组样式 */
.list-group-item {
  border-left: none;
  border-right: none;
  padding: 1rem 1.5rem;
  transition: background-color 0.2s;
}

.list-group-item:first-child {
  border-top: none;
}

.list-group-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}
