/* mobile.css - 移动端优化样式 */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f7fa;
  -webkit-text-size-adjust: 100%; /* 防止手机横屏时字体放大 */
}

/* 通用容器 */
.container {
  width: 100%;
  max-width: 100%;
  padding: 15px;
  margin: 0 auto;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 15px;
  margin-bottom: 15px;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.btn:hover, .btn:active {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-block {
  display: block;
  width: 100%;
}

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

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

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

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

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

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 表格样式 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* 平滑滚动 */
}

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

.table th, .table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--dark-color);
}

/* 导航栏 */
.navbar {
  background: white;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 15px;
}

.navbar-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark-color);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin-top: 10px;
  overflow-x: auto; /* 水平滚动 */
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.navbar-nav li {
  margin-right: 15px;
}

.navbar-nav a {
  color: #666;
  text-decoration: none;
  padding: 5px 0;
  display: block;
  font-size: 14px;
}

.navbar-nav a.active {
  color: var(--primary-color);
  font-weight: 500;
  border-bottom: 2px solid var(--primary-color);
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
  box-shadow: var(--box-shadow);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #666;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

/* 响应式工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-15 { margin-top: 15px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* 移动端特定优化 */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .card {
    padding: 12px;
  }
  
  .btn {
    padding: 12px 15px; /* 更大的触摸区域 */
  }
  
  .table th, .table td {
    padding: 8px 6px;
    font-size: 13px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 防止iOS Safari的弹性滚动问题 */
.modal-content {
  -webkit-overflow-scrolling: touch;
}

/* 提高触摸目标大小 */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}