/* ======================================
   物电学院设备工具借用管理系统 - 全局样式
   ====================================== */

/* --- 字体 & 根变量 --- */
:root {
  --primary:       #0B6B4E;
  --primary-light: #E8F5F0;
  --primary-dark:  #084D38;
  --accent:        #F59E0B;
  --danger:        #DC2626;
  --success:       #16A34A;
  --bg-page:       #F4F7F6;
  --card-shadow:   0 2px 12px rgba(0,0,0,0.08);
  --radius:        12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-page);
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- 导航栏 --- */
.navbar-custom {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0.75rem 0;
  min-height: 60px;
}

.navbar-custom .navbar-brand {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* --- 底部 --- */
.footer-custom {
  background: #fff;
  border-top: 1px solid #E5EAE8;
  margin-top: auto;
}

/* --- 卡片通用样式 --- */
.card-custom {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-custom .card-header-custom {
  background: var(--primary-light);
  border-bottom: 2px solid var(--primary);
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- 首页大按钮 --- */
.home-btn-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  min-height: 200px;
}

.home-btn-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.home-btn-card:active {
  transform: translateY(-1px);
}

.home-btn-card.btn-borrow {
  background: linear-gradient(135deg, #0B6B4E 0%, #1D9E75 100%);
  color: #fff;
}

.home-btn-card.btn-return {
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  color: #fff;
}

.home-btn-card.btn-admin {
  background: linear-gradient(135deg, #374151 0%, #6B7280 100%);
  color: #fff;
}

.home-btn-card .btn-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.home-btn-card .btn-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.home-btn-card .btn-desc {
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

/* --- 表单样式 --- */
.form-label {
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(11, 107, 78, 0.2);
}

.form-control, .form-select {
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .form-control, .form-select {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    min-height: 52px;
  }
}

/* --- 按钮 --- */
.btn-primary-custom {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.15s;
}

.btn-primary-custom:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

/* --- 页面标题区 --- */
.page-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-header .page-icon {
  font-size: 1.75rem;
  color: var(--primary);
}

.page-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.page-header p {
  margin: 0.1rem 0 0;
  color: #6B7280;
  font-size: 0.9rem;
}

/* --- 工具状态徽章 --- */
.badge-status {
  padding: 0.35em 0.7em;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-available  { background: #D1FAE5; color: #065F46; }
.badge-borrowed   { background: #DBEAFE; color: #1E40AF; }
.badge-repair     { background: #FEF3C7; color: #92400E; }
.badge-disabled   { background: #F3F4F6; color: #6B7280; }
.badge-lost       { background: #FEE2E2; color: #991B1B; }
.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-overdue    { background: #FEE2E2; color: #991B1B; }
.badge-returned   { background: #D1FAE5; color: #065F46; }
.badge-active     { background: #DBEAFE; color: #1E40AF; }

/* --- 表格 --- */
.table-custom {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.table-custom thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.table-custom tbody tr:hover {
  background-color: var(--primary-light);
}

.table-custom tbody td {
  padding: 0.8rem 1rem;
  vertical-align: middle;
  border-color: #E5EAE8;
  font-size: 0.9rem;
}

/* --- 工具列表卡片 (借用选择) --- */
.tool-select-card {
  border: 2px solid #E5EAE8;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  position: relative;
}

.tool-select-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tool-select-card input[type="radio"] {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.tool-select-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tool-select-card .tool-name {
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a1a;
}

.tool-select-card .tool-meta {
  font-size: 0.82rem;
  color: #6B7280;
  margin-top: 0.2rem;
}

/* --- 管理员侧边栏 --- */
.admin-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  min-height: 300px;
}

.admin-sidebar .sidebar-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-sidebar .nav-link {
  color: #374151;
  padding: 0.75rem 1.25rem;
  border-radius: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #F3F4F6;
  transition: all 0.1s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* --- 统计卡片 --- */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card .stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1a1a;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 0.2rem;
}

/* --- 登录页 --- */
.login-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card .login-logo i {
  font-size: 3rem;
  color: var(--primary);
}

.login-card .login-logo h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 0.5rem;
}

/* --- 摄像头区域 --- */
.camera-box {
  background: #F9FAFB;
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  overflow: hidden;
}

.camera-box video {
  background: #000;
}

/* --- 响应式 --- */
@media (max-width: 576px) {
  .home-btn-card { min-height: 160px; padding: 1.75rem 1rem; }
  .home-btn-card .btn-icon { font-size: 2.5rem; }
  .home-btn-card .btn-title { font-size: 1.2rem; }
  .page-header h2 { font-size: 1.1rem; }
}
