* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; box-shadow: 0 8px 40px rgba(0,0,0,0.08); width: 420px; max-width: 90vw; text-align: center; }
.login-box h1 { font-size: 24px; margin-bottom: 8px; }
.login-box p { font-size: 14px; color: #999; margin-bottom: 32px; }
.login-box label { display: block; text-align: left; font-size: 13px; color: #666; margin-bottom: 6px; margin-top: 16px; }
.login-box input { width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; transition: border 0.2s; }
.login-box input:focus { border-color: #667eea; }
.login-btn { width: 100%; height: 44px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; margin-top: 28px; transition: opacity 0.2s; }
.login-btn:hover { opacity: 0.9; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error { color: #f56c6c; font-size: 13px; margin-top: 12px; min-height: 20px; }
.login-hint { font-size: 12px; color: #aaa; margin-top: 16px; line-height: 1.6; }
.divider { display: flex; align-items: center; margin: 20px 0; color: #ccc; font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #eee; }
.divider::before { margin-right: 10px; }
.divider::after { margin-left: 10px; }

/* 主页面 */
.main-page { display: none; }
.main-page.active { display: block; }

/* 头部 */
.header { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 20px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header .admin-name { font-size: 13px; opacity: 0.7; }
.btn { padding: 8px 20px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn-refresh { background: rgba(255,255,255,0.2); color: #fff; }
.btn-refresh:hover { background: rgba(255,255,255,0.3); }
.btn-logout { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); font-size: 13px; }
.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* Tab 导航 */
.tabs { display: flex; gap: 0; background: #fff; border-bottom: 2px solid #f0f0f0; max-width: 1000px; margin: 0 auto; }
.tab-btn { padding: 14px 28px; font-size: 15px; color: #666; cursor: pointer; border: none; background: none; border-bottom: 3px solid transparent; transition: all 0.2s; font-weight: 500; }
.tab-btn:hover { color: #667eea; }
.tab-btn.active { color: #667eea; border-bottom-color: #667eea; }

/* 内容 */
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow: hidden; }
.toolbar { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; }
.toolbar h2 { font-size: 16px; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 8px 20px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; }
.btn-primary:hover { opacity: 0.9; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th { background: #fafafa; padding: 12px 16px; text-align: left; font-size: 13px; color: #666; font-weight: 600; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; font-size: 14px; vertical-align: middle; }
tr:hover td { background: #fafbff; }
.openid { font-family: monospace; font-size: 12px; color: #888; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.openid:hover { color: #667eea; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-new { background: #f0f9eb; color: #67c23a; }
.badge-type { background: #ecf5ff; color: #409eff; }
.btn-delete { background: #ff4d4f; color: #fff; padding: 4px 14px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-delete:hover { background: #e04345; }
.btn-edit { background: #409eff; color: #fff; padding: 4px 14px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; margin-right: 6px; }
.btn-edit:hover { background: #3a8ee6; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-associate { background: #e6a23c; color: #fff; }
.btn-associate:hover { background: #cf9236; }

.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.loading { text-align: center; padding: 40px; color: #999; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 32px; width: 520px; max-width: 90vw; max-height: 85vh; overflow-y: auto; }
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; margin-top: 14px; }
.modal label:first-of-type { margin-top: 0; }
.modal input, .modal select { width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 6px; padding: 0 12px; font-size: 14px; outline: none; }
.modal input:focus, .modal select:focus { border-color: #667eea; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.modal-actions .btn-cancel { padding: 8px 20px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 14px; color: #666; }
.modal-actions .btn-confirm { padding: 8px 20px; border-radius: 6px; border: none; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; cursor: pointer; font-size: 14px; }
.modal-error { color: #f56c6c; font-size: 13px; margin-top: 8px; min-height: 18px; }
.tag-prefix { font-family: monospace; background: #f0f0f0; padding: 2px 8px; border-radius: 4px; font-weight: 600; color: #667eea; }

/* 响应式 */
@media (max-width: 768px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab-btn { white-space: nowrap; padding: 12px 16px; font-size: 14px; }
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5) { display: none; }
}

/* 搜索栏 */
.search-bar { display: flex; gap: 8px; padding: 12px 24px; border-bottom: 1px solid #f0f0f0; align-items: center; }
.search-bar input { flex: 1; height: 36px; border: 1px solid #ddd; border-radius: 6px; padding: 0 12px; font-size: 14px; outline: none; }
.search-bar input:focus { border-color: #667eea; }
.btn-search { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 0 16px; height: 36px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn-search:hover { opacity: 0.9; }
.btn-clear-search { background: #fff; color: #666; padding: 0 16px; height: 36px; border-radius: 6px; border: 1px solid #ddd; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn-clear-search:hover { border-color: #999; }

/* 筛选面板 */
.filter-panel { padding: 16px 24px; border-bottom: 1px solid #f0f0f0; background: #fafbff; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.filter-item { display: flex; flex-direction: column; }
.filter-item label { font-size: 12px; color: #888; margin-bottom: 4px; font-weight: 500; }
.filter-item select, .filter-item input { height: 34px; border: 1px solid #ddd; border-radius: 6px; padding: 0 10px; font-size: 13px; outline: none; background: #fff; }
.filter-item select:focus, .filter-item input:focus { border-color: #667eea; }
.filter-item-span2 { grid-column: span 2; }
.date-range, .range-input { display: flex; align-items: center; gap: 6px; }
.date-range input, .range-input input { flex: 1; height: 34px; border: 1px solid #ddd; border-radius: 6px; padding: 0 10px; font-size: 13px; outline: none; }
.date-range span, .range-input span { color: #999; font-size: 13px; white-space: nowrap; }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.btn-reset { padding: 6px 16px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 13px; color: #666; }
.btn-reset:hover { border-color: #999; }

/* 筛选按钮 */
.toolbar-btns { display: flex; gap: 8px; align-items: center; }
.btn-filter-toggle { padding: 8px 16px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 14px; color: #666; }
.btn-filter-toggle:hover { border-color: #667eea; color: #667eea; }
.btn-filter-toggle.active { background: #667eea; color: #fff; border-color: #667eea; }

/* 导出按钮 */
.btn-export { padding: 8px 16px; border-radius: 6px; border: 1px solid #67c23a; background: #f0f9eb; cursor: pointer; font-size: 14px; color: #67c23a; }
.btn-export:hover { background: #67c23a; color: #fff; }

/* 状态徽章 */
.badge-out { background: #fdf6ec; color: #e6a23c; }
.badge-dead { background: #fef0f0; color: #f56c6c; }
.badge-pending { background: #e8f4fd; color: #409eff; }

/* 可点击行 */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f0f2ff !important; }

/* 详情按钮 */
.btn-detail { background: #667eea; color: #fff; padding: 4px 12px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-detail:hover { opacity: 0.9; }

/* 详情弹窗 */
.modal-lg { width: 720px; max-width: 95vw; max-height: 90vh; }
.detail-content { max-height: 60vh; overflow-y: auto; }
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 15px; color: #333; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #f0f0f0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.detail-field { display: flex; padding: 6px 0; }
.detail-label { color: #888; font-size: 13px; min-width: 80px; white-space: nowrap; }
.detail-value { color: #333; font-size: 14px; }
.detail-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.detail-table th { background: #fafafa; padding: 8px 12px; font-size: 12px; color: #666; text-align: left; }
.detail-table td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }

@media (max-width: 768px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}

/* 公安备案 */
.site-footer {
  padding: 12px 0;
  text-align: center;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  color: #666;
}
.site-footer .beian img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}
.site-footer .beian a {
  color: #666;
  text-decoration: none;
}
.site-footer .beian a:hover {
  color: #667eea;
}

