/* 重置和基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #a67c52 0%, #784E23 100%);
  background-attachment: fixed;
  color: #333;
  line-height: 1.6;
}

a {
  color: #784E23;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #5e3d19;
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 顶部导航栏 */
.topbar {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .logo {
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(45deg, #a67c52, #784E23);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  color: #e5e7eb;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.2);
}

/* 卡片样式 */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #784E23;
  box-shadow: 0 0 0 3px rgba(120, 78, 35, 0.15);
}

/* 按钮样式 */
.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background: #f3f4f6;
  color: #374151;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #8f5f2e, #784E23);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #784E23, #5e3d19);
}

.btn-secondary {
  background: linear-gradient(135deg, #9a6d3a, #6f4a24);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: #fff;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* 提醒框样式 */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin: 16px 0;
  border-left: 4px solid;
  font-weight: 500;
}

.alert-info {
  background: #f5efe8;
  color: #5e3d19;
  border-color: #784E23;
}

.alert-error {
  background: #fbebeb;
  color: #8a1c1c;
  border-color: #e53935;
}

.alert-success {
  background: #ebf7ee;
  color: #1b5e20;
  border-color: #4caf50;
}

.alert-warning {
  background: #fff6e5;
  color: #6f4a24;
  border-color: #ffb74d;
}

/* 布局工具类 */
.grid {
  display: grid;
  gap: 16px;
}

.flex {
  display: flex;
}

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

.center {
  align-items: center;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

/* 表格样式 */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.table tr:hover {
  background: #f8fafc;
}

/* 分页样式 */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.page-link {
  display: inline-block;
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  transition: all 0.2s ease;
}

.page-link:hover {
  border-color: #784E23;
  color: #784E23;
}

.page-link.active {
  background: #784E23;
  color: #fff;
  border-color: #784E23;
}

/* 选项卡样式 */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 12px;
}

.tab {
  padding: 10px 20px;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.tab.active {
  background: #fff;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 详情展示 */
.detail .row {
  margin: 12px 0;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail .row:last-child {
  border-bottom: none;
}

.detail .row strong {
  color: #374151;
  font-weight: 600;
}

/* 内联表单 */
.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.inline-form input,
.inline-form select {
  margin: 0 !important;
}

/* 移动端底部导航 */
.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e5e7eb;
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-tabbar a {
  color: #6b7280;
  text-align: center;
  font-size: 0.875rem;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-tabbar a:hover {
  color: #784E23;
  background: rgba(120, 78, 35, 0.1);
}

/* 页脚样式修复 */
.footer {
  text-align: center;
  padding: 20px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

/* 确保有移动端tabbar时底部留出空间 */
@media (max-width: 768px) {
  main {
    padding-bottom: 80px; /* 给底部导航栏留出空间 */
  }
}

/* 状态标签（已移除DOM使用，保留为空以避免引用报错） */
.status-tag, .status-enabled, .status-disabled, .status-admin { display: none; }

/* 滚动控制 */
body {
  overflow: hidden; /* 默认禁用页面滚动 */
}

/* 需要滚动的页面 */
body.allow-scroll {
  overflow: auto; /* 允许滚动 */
}

/* 内容区域滚动控制 */
.scrollable-content {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .nav a:not(:last-child) {
    display: none;
  }
  
  .mobile-tabbar {
    display: flex;
  }
  
  .card {
    margin: 16px 0;
    padding: 20px;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .topbar .logo {
    font-size: 1.1rem;
  }
  
  .card {
    padding: 16px;
  }
  
  .table th,
  .table td {
    padding: 8px 6px;
  }
}