/* 全局样式重置 */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: #1f2937;
}

/* 全局按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-text {
  background: none;
  color: #6b7280;
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  color: #374151;
  background: #f3f4f6;
}

/* 移动端按钮样式 */
.btn-mobile {
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  min-height: 44px; /* 符合移动端触摸标准 */
}

.btn-mobile-sm {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

/* 全局容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1rem;
}

/* 移动端导航相关样式 */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: #6b7280;
  transition: all 0.2s;
}

.mobile-nav-toggle:hover {
  background: #f3f4f6;
  color: #374151;
}

.mobile-nav-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.mobile-nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.mobile-nav-menu.active {
  display: block;
}

.mobile-nav-item {
  display: block;
  padding: 1rem 2rem;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s;
}

.mobile-nav-item:hover {
  background: #f8fafc;
  color: #3b82f6;
}

.mobile-nav-item.router-link-active {
  color: #3b82f6;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}

/* 移动端用户信息 */
.mobile-user-section {
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-username {
  font-weight: 600;
  color: #374151;
  font-size: 1.125rem;
}

.mobile-auth-actions {
  display: flex;
  gap: 0.75rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  /* 显示移动端导航切换按钮 */
  .mobile-nav-toggle {
    display: flex;
  }
  
  /* 隐藏桌面端导航菜单 */
  .desktop-nav-menu {
    display: none;
  }
  
  /* 移动端特定的间距调整 */
  .mobile-spacing {
    padding: 1rem;
  }
  
  .mobile-spacing-sm {
    padding: 0.5rem;
  }
  
  .mobile-spacing-lg {
    padding: 1.5rem;
  }
  
  /* 移动端文本大小调整 */
  .mobile-text-sm {
    font-size: 0.875rem;
  }
  
  .mobile-text-base {
    font-size: 1rem;
  }
  
  .mobile-text-lg {
    font-size: 1.125rem;
  }
  
  /* 移动端布局工具类 */
  .mobile-stack {
    flex-direction: column !important;
  }
  
  .mobile-full {
    width: 100% !important;
  }
  
  .mobile-hide {
    display: none !important;
  }
  
  .mobile-show {
    display: block !important;
  }
  
  /* 移动端卡片样式 */
  .mobile-card {
    margin: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  /* 移动端表单样式 */
  .mobile-form-group {
    margin-bottom: 1.25rem;
  }
  
  .mobile-input {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    min-height: 44px;
  }
  
  /* 移动端网格布局 */
  .mobile-grid-1 {
    grid-template-columns: 1fr !important;
  }
  
  .mobile-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .mobile-nav-item {
    padding: 0.875rem 1rem;
  }
  
  .mobile-user-section {
    padding: 1rem;
  }
  
  .btn-mobile {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.rounded {
  border-radius: 0.25rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.bg-white {
  background-color: white;
}

.bg-gray-50 {
  background-color: #f9fafb;
}

.bg-gray-100 {
  background-color: #f3f4f6;
}

.text-gray-500 {
  color: #6b7280;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-700 {
  color: #374151;
}

.text-gray-900 {
  color: #111827;
}

.text-blue-600 {
  color: #2563eb;
}

.text-red-600 {
  color: #dc2626;
}

.text-green-600 {
  color: #059669;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}
