/* Zepp步数API - 前端样式 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ===== 动画 ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.fade-in { animation: fadeIn .5s ease both; }
.slide-up { animation: slideUp .4s cubic-bezier(.16,1,.3,1) both; }

/* ===== 登录/注册 ===== */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-card { background: var(--card); border-radius: 20px; padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.auth-header { text-align: center; margin-bottom: 28px; }
.logo-icon { font-size: 40px; display: inline-block; animation: float 3s ease-in-out infinite; }
.auth-header h1 { font-size: 22px; margin-top: 8px; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { color: var(--text-light); font-size: 13px; margin-top: 4px; }

.auth-tabs { display: flex; border-radius: 10px; overflow: hidden; margin-bottom: 24px; background: var(--bg); }
.auth-tabs .tab { flex: 1; padding: 10px; border: none; background: none; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-light); transition: all .3s; }
.auth-tabs .tab.active { background: var(--primary); color: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(99,102,241,.3); }

.form-group { margin-bottom: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; transition: all .25s; background: #fafafa; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 42px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); transition: transform .2s; }
.captcha-row img:hover { transform: scale(1.05); }

.auth-msg { display: none; margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-size: 13px; text-align: center; }
.auth-msg.error { background: #fef2f2; color: #dc2626; }
.auth-msg.success { background: #ecfdf5; color: #059669; }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border: none; border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .25s; text-decoration: none; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,.35); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ===== 仪表盘 ===== */
.dashboard { min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--card); box-shadow: 0 1px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-left .logo-icon { font-size: 24px; }
.site-name { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.level-normal { background: #f3f4f6; color: #6b7280; }
.level-vip { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.level-svip { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.user-name { font-size: 14px; color: var(--text-light); }

.main-content { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }

/* 统计卡片 */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* 面板 */
.panel { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.panel-header h2 { font-size: 16px; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; }

/* 账号列表 */
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #f9fafb; border-radius: 10px; border: 1px solid var(--border); transition: all .25s; }
.account-item:hover { border-color: var(--primary); background: #f5f3ff; }
.account-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-name { font-weight: 600; font-size: 14px; }
.account-step { font-size: 12px; color: var(--text-light); }
.badge-auto { font-size: 11px; background: #dbeafe; color: #2563eb; padding: 2px 8px; border-radius: 10px; }
.account-actions { display: flex; gap: 6px; }

/* 日志列表 */
.log-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.log-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 8px; background: #f9fafb; border-left: 3px solid var(--border); font-size: 13px; }
.log-item.success { border-left-color: var(--success); }
.log-item.failed { border-left-color: var(--danger); }
.log-info { display: flex; gap: 10px; align-items: center; }
.log-type { font-size: 11px; background: #e0e7ff; color: #4338ca; padding: 2px 6px; border-radius: 6px; }
.log-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-light); }
.log-result.success { color: var(--success); font-weight: 600; }
.log-result.failed { color: var(--danger); font-weight: 600; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.page-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty-state { text-align: center; padding: 30px; color: var(--text-light); font-size: 14px; }

/* ===== 弹窗 ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 100; justify-content: center; align-items: center; }
.modal { background: var(--card); border-radius: 16px; padding: 28px; width: 90%; max-width: 420px; box-shadow: var(--shadow-lg); }
.modal h3 { margin-bottom: 18px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.announce-content { max-height: 300px; overflow-y: auto; }
.announce-item { padding: 12px; border-bottom: 1px solid var(--border); }
.announce-item:last-child { border-bottom: none; }
.announce-item h4 { font-size: 14px; margin-bottom: 6px; }
.announce-item p { font-size: 13px; color: var(--text-light); line-height: 1.6; }
.announce-item small { color: #9ca3af; font-size: 11px; }

/* 浮动按钮 */
.fab-group { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.fab { width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 22px; cursor: pointer; box-shadow: var(--shadow-lg); transition: all .3s; background: var(--card); }
.fab:hover { transform: scale(1.1) rotate(5deg); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .panel-header { flex-direction: column; align-items: flex-start; }
    .account-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .log-item { flex-direction: column; align-items: flex-start; gap: 6px; }
}
