Files
Jeason 8f4e0a2411 前后端数据流对齐:
后端改动:

GET /api/v1/accounts 现在返回分页格式 {items, total, page, size, total_pages, status_counts},默认每页 12 个
批量操作用 size=500 一次拉全部
前端改动:

base.html — 加了移动端汉堡菜单、全局响应式样式、pagination disabled 状态
dashboard.html — 账号卡片分页,统计数据从 API 的 status_counts 取,移动端单列布局
account_detail.html — 签到记录改成上下两行布局(topic+状态 / 消息+时间),分页用统一的上一页/下一页样式,移动端适配
分页逻辑统一:前后端都用 page/total_pages 字段,pagination 组件显示当前页 ±2 页码。
2026-03-18 09:45:55 +08:00

173 lines
8.4 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>{% block title %}微博超话签到{% endblock %}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
background: linear-gradient(135deg, #f0f2ff 0%, #faf5ff 50%, #fff0f6 100%);
color: #1a1a2e; min-height: 100vh;
}
/* ---- Navbar ---- */
.navbar {
background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(99,102,241,0.08);
padding: 0 16px; position: sticky; top: 0; z-index: 100;
}
.navbar-content {
max-width: 1200px; margin: 0 auto;
display: flex; justify-content: space-between; align-items: center; height: 52px;
}
.navbar-brand {
font-size: 18px; font-weight: 700;
background: linear-gradient(135deg, #6366f1, #a855f7);
-webkit-background-clip: text; background-clip: text;
-webkit-text-fill-color: transparent;
text-decoration: none; white-space: nowrap;
}
.navbar-menu { display: flex; gap: 20px; align-items: center; }
.navbar-menu > a {
color: #64748b; text-decoration: none; font-size: 14px;
font-weight: 500; transition: color 0.2s;
}
.navbar-menu > a:hover { color: #6366f1; }
.navbar-user { display: flex; gap: 10px; align-items: center; }
.navbar-user span { color: #475569; font-size: 13px; font-weight: 500; }
.btn-logout {
background: linear-gradient(135deg, #f43f5e, #e11d48); color: white;
padding: 5px 14px; border: none; border-radius: 20px; cursor: pointer;
text-decoration: none; font-size: 12px; font-weight: 500;
}
.navbar-toggle {
display: none; background: none; border: none;
font-size: 22px; cursor: pointer; color: #475569; padding: 4px;
}
/* ---- Layout ---- */
.container { max-width: 1200px; margin: 16px auto; padding: 0 16px; }
/* ---- Alerts ---- */
.alert { padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; color: #334155; font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0;
border-radius: 12px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus {
outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea { resize: vertical; min-height: 80px; }
/* ---- Buttons ---- */
.btn {
padding: 8px 16px; border: none; border-radius: 12px; cursor: pointer;
font-size: 13px; font-weight: 600; transition: all 0.2s;
text-decoration: none; display: inline-block; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, #6366f1, #818cf8); color: white; box-shadow: 0 2px 8px rgba(99,102,241,0.25); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.35); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); color: white; }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.btn-group { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
/* ---- Cards ---- */
.card {
background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
padding: 16px; margin-bottom: 14px; border: 1px solid rgba(255,255,255,0.6);
}
.card-header {
font-size: 15px; font-weight: 700; margin-bottom: 12px;
padding-bottom: 10px; border-bottom: 2px solid #f1f5f9; color: #1e293b;
}
/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #ecfdf5; color: #059669; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-danger { background: #fef2f2; color: #dc2626; }
.badge-info { background: #eff6ff; color: #2563eb; }
/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 8px 10px; text-align: left; font-weight: 600; font-size: 12px; color: #64748b; border-bottom: 2px solid #e2e8f0; }
td { padding: 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
/* ---- Pagination ---- */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
padding: 6px 12px; border: 1.5px solid #e2e8f0; border-radius: 10px;
text-decoration: none; color: #6366f1; font-size: 13px; font-weight: 500;
}
.pagination a:hover { background: #f1f5f9; }
.pagination .active { background: #6366f1; color: white; border-color: #6366f1; }
.pagination .disabled { color: #cbd5e1; pointer-events: none; }
/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
.navbar-toggle { display: block; }
.navbar-menu {
display: none; flex-direction: column; gap: 0;
position: absolute; top: 52px; left: 0; right: 0;
background: rgba(255,255,255,0.98); backdrop-filter: blur(12px);
border-bottom: 1px solid #e2e8f0; padding: 8px 0;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.navbar-menu.open { display: flex; }
.navbar-menu > a { padding: 12px 20px; font-size: 15px; border-bottom: 1px solid #f1f5f9; }
.navbar-user { padding: 12px 20px; gap: 12px; }
.container { padding: 0 12px; margin: 12px auto; }
.card { padding: 14px; border-radius: 14px; }
.btn { padding: 8px 14px; font-size: 12px; }
.btn-group { flex-direction: column; }
.btn-group .btn { width: 100%; text-align: center; }
}
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
{% if session.get('user') %}
<nav class="navbar">
<div class="navbar-content">
<a href="{{ url_for('dashboard') }}" class="navbar-brand">🔥 微博超话签到</a>
<button class="navbar-toggle" onclick="document.querySelector('.navbar-menu').classList.toggle('open')"></button>
<div class="navbar-menu">
<a href="{{ url_for('dashboard') }}">控制台</a>
{% if session.get('user', {}).get('is_admin') %}
<a href="{{ url_for('admin_panel') }}">🛡️ 管理</a>
{% endif %}
<div class="navbar-user">
<span>👤 {{ session.get('user').get('username') }}</span>
<a href="{{ url_for('logout') }}" class="btn-logout">退出</a>
</div>
</div>
</div>
</nav>
{% endif %}
<div class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>
</body>
</html>