/* CSS变量 & 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; background: #f5f7fa; }
a { text-decoration: none; color: inherit; }

/* 布局 */
#app { min-height: 100vh; }
.page-wrap { padding: 12px; max-width: 1200px; margin: 0 auto; }
.page-wrap-nav { padding-bottom: 70px; }
@media (min-width: 768px) {
  .page-wrap { padding: 20px; }
  .page-wrap-nav { padding-bottom: 20px; }
}

/* 桌面导航 */
.desktop-top-nav { display: none; background: #fff; height: 56px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; align-items: center; padding: 0 24px; }
.desktop-top-nav .nav-logo { font-size: 17px; font-weight: 600; color: #303133; }
.desktop-top-nav .nav-links { display: flex; gap: 4px; margin-left: auto; }
.desktop-top-nav .nav-link { padding: 8px 14px; color: #606266; border-radius: 4px; font-size: 14px; cursor: pointer; }
.desktop-top-nav .nav-link:hover, .desktop-top-nav .nav-link.active { color: #409eff; background: #ecf5ff; }
.desktop-top-nav .nav-user { margin-left: 20px; font-size: 14px; color: #606266; cursor: pointer; padding: 6px 12px; border-radius: 4px; }
.desktop-top-nav .nav-user:hover { background: #f5f7fa; }

/* 移动端底部导航 */
.mobile-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: #fff; display: flex; justify-content: space-around; align-items: center; border-top: 1px solid #ebeef5; z-index: 100; }
.mobile-bottom-nav .mb-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; height: 100%; color: #909399; cursor: pointer; font-size: 11px; }
.mobile-bottom-nav .mb-nav-item.active { color: #409eff; }
.mobile-bottom-nav .mb-nav-icon { font-size: 20px; margin-bottom: 2px; }

@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
  .desktop-top-nav { display: flex; }
}

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 12px; }
.card-header-title { font-size: 16px; font-weight: 600; color: #303133; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 16px; font-size: 14px; border-radius: 4px; border: 1px solid #dcdfe6; background: #fff; cursor: pointer; text-align: center; line-height: 1.4; font-family: inherit; }
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #409eff; color: #fff; border-color: #409eff; }
.btn-success { background: #67c23a; color: #fff; border-color: #67c23a; }
.btn-danger { background: #f56c6c; color: #fff; border-color: #f56c6c; }
.btn-warning { background: #e6a23c; color: #fff; border-color: #e6a23c; }
.btn-text { background: transparent; border: none; color: #409eff; padding: 4px 8px; font-size: 13px; }
.btn-text:hover { color: #66b1ff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: 6px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; color: #606266; font-weight: 500; }
.form-input { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #dcdfe6; border-radius: 4px; outline: none; font-family: inherit; background: #fff; }
.form-input:focus { border-color: #409eff; }
.form-textarea { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #dcdfe6; border-radius: 4px; resize: vertical; min-height: 80px; outline: none; font-family: inherit; }
.form-select { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #dcdfe6; border-radius: 4px; outline: none; font-family: inherit; background: #fff; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 4px; line-height: 1.6; }
.tag-success { background: #f0f9eb; color: #67c23a; }
.tag-warning { background: #fdf6ec; color: #e6a23c; }
.tag-danger { background: #fef0f0; color: #f56c6c; }
.tag-info { background: #f4f4f5; color: #909399; }
.tag-primary { background: #ecf5ff; color: #409eff; }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.tbl th { background: #fafafa; font-weight: 600; color: #606266; font-size: 13px; }
.tbl td { color: #303133; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .link { color: #409eff; cursor: pointer; }
.tbl .link:hover { text-decoration: underline; }

/* 加载 */
.spinner-wrap { display: flex; justify-content: center; align-items: center; min-height: 200px; }
.spinner { width: 32px; height: 32px; border: 3px solid #409eff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: #909399; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }

/* Toast消息 */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 4px; font-size: 14px; z-index: 9999; animation: toastIn 0.3s; pointer-events: none; }
.toast-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.toast-error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.toast-warning { background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 统计卡片 */
.stat-cards { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.stat-cards .stat-card { -webkit-flex: 0 0 calc(50% - 6px); flex: 0 0 calc(50% - 6px); }
@media (min-width: 768px) { .stat-cards .stat-card { -webkit-flex: 0 0 calc(25% - 9px); flex: 0 0 calc(25% - 9px); } }
.stat-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card-value { font-size: 24px; font-weight: 700; color: #303133; }
.stat-card-label { font-size: 13px; color: #909399; margin-top: 4px; }
.stat-card-icon { font-size: 28px; margin-bottom: 8px; }

/* 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 16px; }
.pager-btn { padding: 6px 12px; border: 1px solid #dcdfe6; background: #fff; cursor: pointer; border-radius: 4px; font-size: 13px; }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-btn.active { background: #409eff; color: #fff; border-color: #409eff; }
.pager-info { font-size: 13px; color: #909399; }

/* 对话框 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 8px; width: 100%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; color: #303133; }
.modal-close { font-size: 20px; cursor: pointer; color: #909399; background: none; border: none; padding: 4px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; }
.login-box { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto; width: 100%; }
.login-brand { text-align: center; margin-bottom: 32px; color: #fff; }
.login-brand-icon { font-size: 48px; width: 80px; height: 80px; background: #fff; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.login-brand h1 { font-size: 24px; font-weight: 600; }
.login-brand p { opacity: 0.85; font-size: 14px; margin-top: 8px; }
.login-tabs { display: flex; background: rgba(255,255,255,0.2); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.login-tab { flex: 1; text-align: center; padding: 12px; color: rgba(255,255,255,0.8); cursor: pointer; border-radius: 8px; font-size: 15px; }
.login-tab.active { background: #fff; color: #667eea; font-weight: 500; }
.login-form-box { background: #fff; border-radius: 16px; padding: 24px; }
.login-btn { width: 100%; height: 48px; font-size: 16px; border-radius: 8px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; color: #fff; cursor: pointer; margin-top: 8px; }
.wecom-btn { width: 100%; height: 48px; font-size: 16px; border-radius: 8px; background: #07c160; border: none; color: #fff; cursor: pointer; }
.login-footer { text-align: center; padding: 20px; color: rgba(255,255,255,0.5); font-size: 12px; }
