/* ============================================
   徒步登山打卡小程序 - 后台管理系统样式
   主题色: #1a5f3c (深绿)
   ============================================ */

/* === 基础重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; line-height: 1.6; }
a { color: #1a5f3c; text-decoration: none; }
a:hover { color: #2d8a5e; }
ul { list-style: none; }

/* === 布局 === */
.admin-layout { display: flex; min-height: 100vh; }
.admin-body { background: #f0f2f5; }
.admin-wrapper { display: flex; min-height: 100vh; }

/* === 左侧菜单 === */
.admin-sidebar { width: 220px; background: #1a5f3c; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; transition: width 0.3s; }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 16px; font-weight: 500; color: #fff; margin-bottom: 4px; }
.sidebar-header p { font-size: 12px; color: rgba(255,255,255,0.6); }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { display: block; }
.sidebar-nav li a { display: block; padding: 12px 20px; color: rgba(255,255,255,0.8); font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-nav li a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav li.active a { background: rgba(255,255,255,0.15); color: #fff; border-left-color: #fff; font-weight: 500; }
.sidebar-nav .nav-icon { margin-right: 8px; }
.sidebar-menu { list-style: none; padding: 10px 0; }
.sidebar-menu-item { display: block; padding: 12px 20px; color: rgba(255,255,255,0.8); font-size: 14px; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-menu-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-menu-item.active { background: rgba(255,255,255,0.15); color: #fff; border-left-color: #fff; font-weight: 500; }
.sidebar-menu-item .menu-icon { margin-right: 8px; font-size: 16px; }
.sidebar-menu-group { padding: 8px 20px 4px; font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }

/* === 主内容区 === */
.admin-main { flex: 1; margin-left: 220px; min-height: 100vh; }

/* === 顶部导航 === */
.admin-topbar { background: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 50; }
.admin-header { background: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 50; }
.topbar-left { display: flex; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-info { font-size: 14px; color: #333; }
.btn-logout { font-size: 13px; color: #e53935; cursor: pointer; padding: 4px 12px; border: 1px solid #e53935; border-radius: 4px; transition: all 0.2s; }
.btn-logout:hover { background: #e53935; color: #fff; }
.header-breadcrumb { font-size: 14px; color: #666; }
.header-breadcrumb span { color: #999; }
.header-breadcrumb a { color: #666; }
.header-breadcrumb a:hover { color: #1a5f3c; }
.header-user { display: flex; align-items: center; gap: 12px; }
.header-user .user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #e8f5ee; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #1a5f3c; font-weight: 500; }
.header-user .user-name { font-size: 14px; color: #333; }
.header-user .user-role { font-size: 12px; color: #888; background: #f5f5f5; padding: 2px 8px; border-radius: 4px; }
.header-user .logout-btn { font-size: 13px; color: #e53935; cursor: pointer; }
.header-user .logout-btn:hover { color: #c62828; }
.breadcrumb { display: flex; list-style: none; padding: 0; margin: 0; gap: 4px; }
.breadcrumb li { font-size: 13px; color: #999; }
.breadcrumb li::after { content: '/'; margin-left: 4px; color: #ccc; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb li a { color: #666; }

/* === 内容区 === */
.admin-content { padding: 24px; }

/* === 统计卡片 === */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; border: 1px solid #e8e8e8; transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.stat-card .stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 600; color: #1a5f3c; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: #888; }
.stat-card.orange .stat-value { color: #e65100; }
.stat-card.red .stat-value { color: #e53935; }
.stat-card.blue .stat-value { color: #1565c0; }

/* === 搜索/筛选栏 === */
.filter-bar { background: #fff; border-radius: 8px; padding: 16px 20px; border: 1px solid #e8e8e8; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-bar .filter-item { display: flex; align-items: center; gap: 6px; }
.filter-bar .filter-item label { font-size: 13px; color: #666; white-space: nowrap; }

/* === 表格 === */
.data-table { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; overflow: hidden; }
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f5f5f5; padding: 12px 16px; font-size: 13px; color: #666; font-weight: 500; text-align: left; border-bottom: 1px solid #e0e0e0; }
.data-table td { padding: 10px 16px; font-size: 13px; color: #444; border-bottom: 0.5px solid #f0f0f0; vertical-align: middle; }
.data-table tr:hover td { background: #f8f9fa; }
.data-table tr:last-child td { border-bottom: none; }

/* === 表单 === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; color: #333; transition: border-color 0.2s; background: #fff; }
.form-control:focus { outline: none; border-color: #1a5f3c; box-shadow: 0 0 0 2px rgba(26,95,60,0.1); }
.form-control::placeholder { color: #bbb; }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* === 按钮 === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; gap: 4px; white-space: nowrap; }
.btn-primary { background: #1a5f3c; color: #fff; }
.btn-primary:hover { background: #2d8a5e; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #388e3c; }
.btn-warning { background: #e65100; color: #fff; }
.btn-warning:hover { background: #f57c00; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-outline { background: #fff; color: #1a5f3c; border: 1px solid #1a5f3c; }
.btn-outline:hover { background: #e8f5ee; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; }

/* === 状态标签 === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-green, .badge-success { background: #e8f5ee; color: #1a5f3c; }
.badge-orange, .badge-warning { background: #fff3e0; color: #e65100; }
.badge-red, .badge-danger { background: #fce4ec; color: #c62828; }
.badge-blue, .badge-info { background: #e3f2fd; color: #1565c0; }
.badge-gray { background: #f5f5f5; color: #666; }

/* === 分页 === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px 0; }
.pagination .page-item { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 4px; font-size: 13px; color: #666; cursor: pointer; border: 1px solid #d9d9d9; transition: all 0.2s; }
.pagination .page-item:hover { border-color: #1a5f3c; color: #1a5f3c; }
.pagination .page-item.active { background: #1a5f3c; color: #fff; border-color: #1a5f3c; }
.pagination .page-info { font-size: 13px; color: #888; margin: 0 8px; }

/* === 详情页 === */
.detail-section { background: #fff; border-radius: 8px; padding: 20px; border: 1px solid #e8e8e8; margin-bottom: 16px; }
.detail-section h3 { font-size: 15px; font-weight: 500; color: #333; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { display: flex; gap: 8px; }
.detail-item .label { font-size: 13px; color: #888; min-width: 80px; }
.detail-item .value { font-size: 13px; color: #333; }

/* === 登录页 === */
.admin-login-page { background: linear-gradient(135deg, #1a5f3c, #2d8a5e); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a5f3c, #2d8a5e); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 22px; font-weight: 600; color: #1a5f3c; margin-bottom: 8px; }
.login-header p { font-size: 13px; color: #888; }
.login-form { margin-top: 20px; }
.login-box h1 { font-size: 22px; font-weight: 600; color: #1a5f3c; text-align: center; margin-bottom: 8px; }
.login-box p { font-size: 13px; color: #888; text-align: center; margin-bottom: 24px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box .btn-primary { width: 100%; padding: 12px; font-size: 16px; }

/* === 卡片面板 === */
.panel { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; margin-bottom: 16px; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-size: 15px; font-weight: 500; color: #333; }
.panel-body { padding: 20px; }

/* === 空状态 === */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 48px; color: #d9d9d9; margin-bottom: 16px; }
.empty-state .empty-text { font-size: 14px; color: #888; }

/* === 操作按钮组 === */
.action-bar { display: flex; align-items: center; gap: 8px; }
.action-bar .btn-sm { font-size: 12px; }

/* === 提示框 === */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e8f5ee; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.alert-danger, .alert-error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* === 权限复选框 === */
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.permission-item { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #e8e8e8; border-radius: 6px; background: #f8f9fa; }
.permission-item input[type="checkbox"] { accent-color: #1a5f3c; }
.permission-item label { font-size: 13px; color: #444; cursor: pointer; }

/* === 日志表格 === */
.log-detail { font-size: 12px; color: #888; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* === 响应式 === */
@media (max-width: 768px) {
  .admin-sidebar { width: 0; overflow: hidden; }
  .admin-main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}

/* === 辅助类 === */
.text-green { color: #1a5f3c; }
.text-orange { color: #e65100; }
.text-red { color: #e53935; }
.text-blue { color: #1565c0; }
.text-gray { color: #888; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
