/* my_borrows.css - 少女粉色风格图书管理系统 */
:root {
  --primary-color: #e686a5;  /* 主要粉色 */
  --primary-light: #ffedf2;  /* 浅粉色 */
  --primary-dark: #d26a8c;   /* 深粉色 */
  --accent-color: #9a83c9;   /* 紫色点缀 */
  --text-primary: #4a4a4a;   /* 主要文字颜色 */
  --text-secondary: #848484; /* 次要文字颜色 */
  --border-color: #f4d7e1;   /* 边框颜色 */
  --success-color: #7ac9a1;  /* 成功色 */
  --danger-color: #ff8f9e;   /* 危险色 */
  --white: #ffffff;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background-color: #fdf6f8;
}

/* 容器 */
.container {
  width: 95% !important;
  max-width: 1200px !important;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background-color: var(--white);
  box-shadow: 0 3px 15px rgba(230, 134, 165, 0.15);
  border-radius: 20px;
  box-sizing: border-box;
  position: relative;
}

/* 页面标题 */
.page-title {
  margin-bottom: 1.8rem;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  font-size: 1.8rem;
  font-weight: 600;
  position: relative;
  text-align: center;
}

.page-title:after {
  content: "";
  position: absolute;
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;
}

/* 标签页样式 */
.tabs {
  display: flex;
  width: 100%;
  margin-bottom: 25px;
  border: none;
  background-color: var(--primary-light);
  border-radius: 25px;
  padding: 5px;
  box-shadow: 0 3px 10px rgba(230, 134, 165, 0.1);
}

/* tab 项 */
.tab {
  flex: 1;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-primary);
  margin-right: 2px;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
}

.tab:hover {
  background-color: rgba(230, 134, 165, 0.1);
  color: var(--primary-dark);
  text-decoration: none;
}

.tab.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 3px 8px rgba(230, 134, 165, 0.3);
}

.count {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.75em;
  display: inline-block;
  margin-left: 5px;
  font-weight: 600;
}

.tab.active .count {
  background-color: rgba(255, 255, 255, 0.4);
}

/* 借阅列表与表格 */
.borrow-list {
  margin-top: 20px;
  margin-bottom: 2rem;
  width: 100%;
  overflow-x: auto;
}

.borrow-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 25px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(230, 134, 165, 0.08);
}

/* 调整列宽 - 解决状态列和操作列问题 */
.borrow-table th:nth-child(1),
.borrow-table td:nth-child(1) { width: 90px; }
.borrow-table th:nth-child(2),
.borrow-table td:nth-child(2) { width: 20%; }
.borrow-table th:nth-child(3),
.borrow-table td:nth-child(3),
.borrow-table th:nth-child(4),
.borrow-table td:nth-child(4) { width: 15%; }

/* 状态列 */
.borrow-table th:nth-child(5),
.borrow-table td:nth-child(5) {
  width: 15%;
  min-width: 120px;
  position: relative;
  overflow: visible;
  padding: 14px 25px;
  vertical-align: middle;
}

/* 状态表头文字微调 - 向右移动2px */
.borrow-table th:nth-child(5) {
  padding-left: 28px; /* 增加左内边距，使文字看起来稍微向右移动 */
}

/* 操作列 */
.borrow-table th:nth-child(6),
.borrow-table td:nth-child(6) {
  width: 18%;
  min-width: 140px;
  padding: 14px 18px;
  vertical-align: middle;
  text-align: left;
  padding: 14px 0 14px 15px; /* 减少右内边距，增加左内边距 */
}

.borrow-table th,
.borrow-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

.borrow-table th {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-color);
}

.borrow-table tr {
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.borrow-table tbody tr:last-child {
  border-bottom: none;
}

.borrow-item {
  background-color: var(--white);
}

.borrow-item:hover {
  background-color: rgba(230, 134, 165, 0.03);
}

.borrow-item.overdue {
  background-color: rgba(255, 143, 158, 0.08);
}

/* 图书封面 */
.book-cover img {
  width: 65px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  border: 3px solid var(--white);
}

.book-cover img:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(230, 134, 165, 0.3);
}

/* 书名与作者 */
.book-title {
  font-weight: 600;
  font-size: 1rem;
}

.book-title a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.book-title a:hover {
  color: var(--primary-color);
}

.book-author {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.book-author:before {
  content: "🖋";
  margin-right: 5px;
  font-size: 0.9em;
}

/* 徽章 - 修复状态显示问题 */
.borrow-table .badge,
.book-status .badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  display: inline-block;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-align: center;
  min-width: 60px;
}

.borrow-table .badge {
  position: static;
  top: auto;
  right: auto;
}

.badge-primary { background-color: var(--primary-color); color: white; }
.badge-success { background-color: var(--success-color); color: white; }
.badge-danger  { background-color: var(--danger-color); color: white; }
.badge-info    { background-color: var(--accent-color); color: white; }

.return-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.return-date:before {
  content: "📅";
  margin-right: 5px;
}

.text-danger {
  color: var(--danger-color) !important;
  font-weight: 600;
}

/* 操作按钮 - 简化样式 */
.actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding-left: 15px; /* 整体左移5px */
  margin-top: 17px;
  margin-right: 30px;
}

.actions .btn {
  min-width: 60px;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  border: none;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #65b088;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(122, 201, 161, 0.3);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(230, 134, 165, 0.3);
}

.btn-secondary {
  background-color: #a0a0a0;
  color: white;
}

/* 无记录状态 */
.no-records {
  text-align: center;
  padding: 60px 30px;
  background-color: var(--primary-light);
  border-radius: 15px;
  margin: 30px 0;
  box-shadow: inset 0 0 15px rgba(230, 134, 165, 0.1);
}

.empty-icon {
  font-size: 4em;
  color: var(--primary-color);
  margin-bottom: 20px;
  opacity: 0.7;
}

.empty-text {
  color: var(--text-primary);
  margin-bottom: 25px;
  font-size: 1.1rem;
  max-width: 450px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 分页 */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 5px;
}

.page-item { margin: 0 2px; }

.page-link {
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.page-item.active .page-link,
.page-link:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 3px 8px rgba(230, 134, 165, 0.3);
}

/* 模态框 */
.modal-dialog {
  max-width: 95%;
  width: 500px;
  margin: 1.75rem auto;
}

.modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-header {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px;
}

.modal-body {
  padding: 25px 20px;
  font-size: 1.1rem;
  text-align: center;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 15px 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* 响应式 */
@media (max-width: 992px) {
  .container {
    width: 98% !important;
    padding: 1rem;
    margin: 0.5rem auto;
  }
}

@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
    background: none;
    padding: 0;
  }

  .tab {
    border-radius: 15px;
    margin-bottom: 8px;
    margin-right: 0;
    padding: 12px 15px;
    background-color: var(--primary-light);
  }

  .borrow-table {
    min-width: 700px; /* 确保在小屏幕上可以滚动 */
  }

  .book-cover img {
    width: 45px;
    height: 65px;
  }
}
