/* 基本样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.main-content {
  padding: 20px 0;
  min-height: calc(100vh - 120px);
}

/* 页眉 */
.main-header {
  background-color: #343a40;
  padding: 15px 0;
  color: #fff;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  margin: 0;
}

.main-nav ul {
  display: flex;
  align-items: center;
}

.main-nav li {
  margin-left: 20px;
}

.main-nav a {
  color: #fff;
  font-weight: 500;
}

/* 用户信息和注销按钮 */
.user-info {
  display: flex;
  align-items: center;
  color: #ddd;
}

.logout-btn {
  margin-left: 10px;
  padding: 3px 8px;
  background-color: #dc3545;
  border-radius: 3px;
  color: white;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background-color: #c82333;
  text-decoration: none;
}

/* 页脚 */
.main-footer {
  background-color: #343a40;
  color: #fff;
  padding: 15px 0;
  text-align: center;
  margin-top: 20px;
}

/* 页面标题区 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  background-color: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #5a6268;
  text-decoration: none;
}

.btn-primary {
  background-color: #007bff;
}

.btn-primary:hover {
  background-color: #0069d9;
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-view {
  background-color: #28a745;
}

.btn-view:hover {
  background-color: #218838;
}

.btn-ban {
  background-color: #dc3545;
}

.btn-ban:hover {
  background-color: #c82333;
}

.btn-unban {
  background-color: #28a745;
}

.btn-unban:hover {
  background-color: #218838;
}

.btn-view-data {
  background-color: #17a2b8;
  margin-top: 10px;
}

.btn-view-data:hover {
  background-color: #138496;
}

/* 搜索表单 */
.search-form {
  display: flex;
}

.search-form input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px 0 0 4px;
  width: 250px;
}

.search-form button {
  border-radius: 0 4px 4px 0;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.data-table tr:hover {
  background-color: #f8f9fa;
}

.data-table .actions {
  display: flex;
  gap: 8px;
}

/* 用户状态样式 */
.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status.active {
  background-color: #d4edda;
  color: #155724;
}

.status.banned {
  background-color: #f8d7da;
  color: #721c24;
}

/* 设备信息样式 */
.device-info {
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin-top: 5px;
  font-size: 0.9rem;
}

/* 统计信息样式 */
.stats-summary {
  font-size: 0.9rem;
}

.stat-item {
  margin-bottom: 5px;
}

.stat-label {
  font-weight: 600;
}

/* 内联表单 */
.inline-form {
  display: inline-block;
}

/* 空数据状态 */
.empty-state {
  text-align: center;
  padding: 40px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

/* 用户详情页样式 */
.user-profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .user-profile {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  padding: 20px;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-item {
  display: flex;
}

.label {
  font-weight: 600;
  min-width: 120px;
}

.device-details {
  display: grid;
  gap: 5px;
}

.device-item {
  display: flex;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 15px;
  text-align: center;
}

.stat-card h4 {
  margin-bottom: 10px;
}

.stat-numbers {
  margin-bottom: 10px;
}

.total {
  font-weight: 600;
  font-size: 1.1rem;
}

.today {
  color: #28a745;
}

/* 图片和视频展示样式 */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  overflow: hidden;
}

.image-container {
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-info {
  padding: 10px;
}

.info-row {
  display: flex;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.info-row .label {
  min-width: 80px;
  font-weight: 600;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.video-item {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  overflow: hidden;
}

.video-container {
  width: 100%;
}

.video-container video {
  width: 100%;
}

.video-info {
  padding: 10px;
}

.video-info h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

/* 短信展示样式 */
.message-filters {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}

.filter-btn {
  opacity: 0.7;
}

.filter-btn.active {
  opacity: 1;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message-item {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  padding: 15px;
  border-left: 5px solid #6c757d;
}

.message-item.sent {
  border-left-color: #28a745;
}

.message-item.received {
  border-left-color: #007bff;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.message-people {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.message-sender,
.message-receiver {
  display: flex;
}

.message-time {
  color: #6c757d;
}

.message-body {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 10px;
}

.message-content {
  white-space: pre-wrap;
}

/* 通讯录列表样式 */
.no-bullet {
  list-style: none;
  padding: 0;
}

/* 错误页面 */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70vh;
}

.error-container {
  text-align: center;
  max-width: 500px;
  padding: 30px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.error-container h1 {
  font-size: 4rem;
  color: #dc3545;
  margin-bottom: 10px;
}

.error-container h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.error-container p {
  margin-bottom: 20px;
}

.error-details {
  margin-top: 20px;
  text-align: left;
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
}

.error-details pre {
  font-family: monospace;
  font-size: 0.85rem;
}

/* 手机媒体统计样式 */
.phone-stats {
  margin-top: 20px;
}

.phone-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 15px;
}

.phone-stat-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.phone-stat-card h4 {
  color: #495057;
  margin-bottom: 15px;
  font-size: 16px;
}

.phone-stat-numbers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-total {
  font-size: 18px;
  font-weight: bold;
  color: #007bff;
}

.uploaded {
  font-size: 16px;
  color: #28a745;
}

.progress-info {
  margin-top: 10px;
}

.progress-text {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 5px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.last-reported {
  text-align: center;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
  padding-top: 10px;
  margin-top: 15px;
}

/* 响应式设计更新 */
@media (max-width: 768px) {
  .phone-stats-grid {
    grid-template-columns: 1fr;
  }

  .phone-stat-card {
    padding: 15px;
  }
}