/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* 登录页面 */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #666;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.error-msg {
  color: #f56c6c;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  min-width: 80px;
  text-align: center;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #e0e0e0;
  color: #666;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-success {
  background: #67c23a;
  color: white;
}

.btn-success:hover {
  background: #5daf34;
}

.btn-danger {
  background: #f56c6c;
  color: white;
}

.btn-danger:hover {
  background: #f45454;
}

/* 文字按钮 - 用于表格操作列 */
.btn-text {
  background: transparent;
  border: 1px solid #667eea;
  color: #667eea;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
  min-width: 60px;
  text-align: center;
  display: inline-block;
}

.btn-text:hover {
  background: #667eea;
  color: white;
}

.btn-text.btn-danger {
  border-color: #f56c6c;
  color: #f56c6c;
  background: transparent;
}

.btn-text.btn-danger:hover {
  background: #f56c6c;
  color: white;
}

.btn-text.disabled {
  border-color: #ddd;
  color: #999;
  cursor: not-allowed;
}

.btn-text.disabled:hover {
  background: transparent;
  color: #999;
}

/* 布局 */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #2c3e50;
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  margin-left: 240px;
}

.logo {
  padding: 30px 20px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: block;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left: 3px solid #667eea;
}

.user-info {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h2 {
  font-size: 24px;
  color: #333;
}

/* 筛选栏 */
.filter-bar {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-bar .btn-primary,
.filter-bar .btn-secondary {
  min-width: 80px;
  height: 36px;
  padding: 0 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 14px;
  color: #666;
}

.filter-group input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 150px;
}

.filter-group input:focus {
  outline: none;
  border-color: #667eea;
}

/* 表格 */
.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f5f7fa;
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  font-size: 14px;
  border-bottom: 1px solid #ebeef5;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid #ebeef5;
  font-size: 14px;
  color: #606266;
}

.data-table tbody tr:hover {
  background: #f5f7fa;
}

.data-table .loading {
  text-align: center;
  color: #999;
  padding: 40px;
}

/* 表格操作列按钮 */
.data-table td .btn-text {
  margin: 2px 4px;
  min-width: 56px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

#pageInfo {
  color: #666;
  font-size: 14px;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  color: #333;
}

.close {
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.detail-item {
  margin-bottom: 15px;
  display: flex;
}

.detail-label {
  width: 150px;
  color: #666;
  font-size: 14px;
}

.detail-value {
  flex: 1;
  color: #333;
  font-size: 14px;
}

/* 详情弹窗特殊样式 */
.modal-detail {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-detail .modal-header {
  flex-shrink: 0;
}

/* 详情头部（固定不滚动） */
.detail-header {
  flex-shrink: 0;
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #ebeef5;
}

.detail-header-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

.detail-header-item {
  display: flex;
  align-items: flex-start;
}

.detail-header-label {
  color: #909399;
  font-size: 14px;
  white-space: nowrap;
  margin-right: 8px;
}

.detail-header-value {
  color: #303133;
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

/* 详情内容（可滚动） */
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-height: calc(90vh - 200px);
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.status-active {
  background: #e1f3d8;
  color: #67c23a;
}

.status-inactive {
  background: #fde2e2;
  color: #f56c6c;
}

.type-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  background: #e8f4ff;
  color: #409eff;
}

/* 弹窗表单输入框 */
.modal-body .form-group input,
.modal-body .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.modal-body .form-group .required {
  color: #f56c6c;
}

/* 弹窗底部按钮 */
.modal-footer .btn-primary,
.modal-footer .btn-secondary {
  min-width: 80px;
  flex: 1;
}

/* 图片缩略图样式 */
.thumbnail-container {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ddd;
  transition: all 0.3s;
}

.thumbnail:hover {
  border-color: #667eea;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 详情弹窗中的图片缩略图 */
.detail-thumbnail-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ddd;
  transition: all 0.3s;
}

.detail-thumbnail:hover {
  border-color: #667eea;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 图片预览弹窗 */
.image-preview-modal {
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.image-preview-modal.show {
  display: flex;
}

.image-preview-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.3s;
}

.image-preview-close:hover {
  color: #bbb;
}

.image-preview-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

/* 导入提示样式 */
.import-tips {
  background: #f5f7fa;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 15px;
  margin: 15px 0;
  font-size: 13px;
  line-height: 1.8;
}

.import-tips p {
  margin: 0;
}

.import-tips strong {
  color: #333;
}
