/* Tailwind CSS 配置已通过 CDN 引入，这里只包含自定义样式 */

/* 自定义工具类 */
.content-auto {
  content-visibility: auto;
}

.sidebar-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background-color: #1f2937;
  color: #165DFF;
  border-radius: 1.5rem;
  transition: all 300ms ease-in-out;
  cursor: pointer;
}

.sidebar-icon:hover {
  background-color: #165DFF;
  color: white;
  border-radius: 0.5rem;
}

.sidebar-tooltip {
  position: absolute;
  width: auto;
  padding: 0.5rem;
  margin: 0.5rem;
  min-width: max-content;
  left: 3.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  color: white;
  background-color: #111827;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 100ms;
  transform: scale(0);
  transform-origin: left;
}

.sidebar-icon .sidebar-tooltip {
  transform: scale(0);
}

.sidebar-icon:hover .sidebar-tooltip {
  transform: scale(1);
}

.card-hover {
  transition: all 300ms;
}

.card-hover:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-0.25rem);
}

.btn-primary {
  background-color: #165DFF;
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 150ms;
}

.btn-primary:hover {
  background-color: rgba(22, 93, 255, 0.9);
}

.btn-secondary {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #1D2129;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 150ms;
}

.btn-secondary:hover {
  background-color: #f9fafb;
}

.btn-danger {
  background-color: #FF4D4F;
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}

.btn-danger:hover {
  background-color: rgba(255, 77, 79, 0.9);
}

/* 禁用态按钮样式，提升不可点的视觉反馈 */
.btn-primary[disabled],
.btn-secondary[disabled],
.btn-danger[disabled],
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: all 150ms;
}

.form-input:focus {
  outline: none;
  ring: 2px;
  ring-color: rgba(22, 93, 255, 0.5);
  border-color: #165DFF;
}

.table-row-hover {
  transition: background-color 150ms;
}

.table-row-hover:hover {
  background-color: #f9fafb;
}

/* 侧边栏自定义滚动条 */
.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
  border-radius: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 10px;
  transition: background 0.3s;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
}

/* 主内容区域自定义滚动条 */
#page-content {
  scroll-behavior: smooth;
}

#page-content::-webkit-scrollbar {
  width: 8px;
}

#page-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#page-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  transition: background 0.3s;
}

#page-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 导航项样式 */
.nav-item {
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, #3b82f6, #60a5fa);
  border-radius: 0 3px 3px 0;
  transition: height 0.3s ease;
}

.nav-item.active::before {
  height: 70%;
}

.nav-item.active {
  background: linear-gradient(to right, rgba(59, 130, 246, 0.15), transparent);
}

.nav-item.active span {
  color: white !important;
  font-weight: 600;
}

.nav-item.active .w-10 {
  background-color: rgba(59, 130, 246, 0.3) !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* 页面内容样式 */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* 响应式设计 - 在移动端隐藏侧边栏文字 */
@media (max-width: 768px) {
  .sidebar-link span:not(.sidebar-icon) {
    display: none;
  }
}


/* 轮播图管理样式 */
.carousel-management {
  padding: 20px;
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.header-section h1 {
  color: #333;
  margin: 0;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 2em;
}

.stat-card p {
  margin: 0;
  opacity: 0.9;
}

.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box select,
.search-box input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #1e7e34;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #e0a800;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.carousel-table {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-table table {
  width: 100%;
  border-collapse: collapse;
}

.carousel-table th,
.carousel-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.carousel-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.carousel-table tr:hover {
  background: #f8f9fa;
}

.carousel-image {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

.actions {
  display: flex;
  gap: 5px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 5px;
}

.pagination button:hover:not(:disabled) {
  background: #f8f9fa;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .current-page {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #333;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

.image-upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-upload-area:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.image-upload-area.dragover {
  border-color: #007bff;
  background: #e3f2fd;
}

.upload-icon {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 10px;
}

.image-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 5px;
  margin-top: 10px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.loading {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.alert {
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  display: none;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.sort-input {
  width: 60px;
  text-align: center;
}

@media (max-width: 768px) {
  .carousel-management {
    padding: 10px;
  }
  
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .carousel-table {
    overflow-x: auto;
  }
  
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
}

