/* ============================================================
   步数助手 - 前台样式（移动优先，自适应）
   ============================================================ */
:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --primary-bg: #f5f3ff;
    --success: #00b894;
    --danger: #e17055;
    --warn: #fdcb6e;
    --text: #2d3436;
    --text-sub: #636e72;
    --text-light: #b2bec3;
    --bg: #f6f7fb;
    --card: #ffffff;
    --border: #e9ecf2;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(108, 92, 231, 0.08);
    --shadow-lg: 0 10px 40px rgba(108, 92, 231, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }

/* ---------- 顶部导航 ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-inner {
    max-width: 1080px; margin: 0 auto; padding: 0 16px;
    height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo-icon { font-size: 1.4rem; }
.logo-text { background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-toggle { display: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    padding: 8px 14px; border-radius: 999px; color: var(--text-sub);
    font-size: 0.92rem; font-weight: 500; transition: all 0.2s;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-bg); }
.nav-links a.active { color: var(--primary); background: var(--primary-bg); font-weight: 700; }
.nav-links .nav-btn-register {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}
.nav-links .nav-btn-register:hover { color: #fff; opacity: 0.92; }
.nav-links .nav-logout { color: var(--text-light); }

.nav-burger { display: none; cursor: pointer; width: 36px; height: 36px; }
.nav-burger span {
    display: block; width: 20px; height: 2px; background: var(--text);
    margin: 4px 8px; border-radius: 2px; transition: all 0.25s;
}

/* ---------- 公告条 ---------- */
.notice-bar { background: linear-gradient(90deg, #fff8e6, #ffefd0); border-bottom: 1px solid #ffe8b0; }
.notice-inner {
    max-width: 1080px; margin: 0 auto; padding: 10px 16px;
    font-size: 0.88rem; color: #92600a; display: flex; align-items: center; gap: 6px;
}
.notice-icon { flex-shrink: 0; }

/* ---------- 首页 Hero ---------- */
.hero {
    background: linear-gradient(150deg, var(--primary) 0%, #8e7cf3 55%, var(--primary-light) 100%);
    border-radius: var(--radius);
    padding: 44px 28px 32px;
    color: #fff; text-align: center;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); top: -120px; right: -80px;
}
.hero::after {
    content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.06); bottom: -70px; left: -50px;
}
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: 2rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 10px; }
.hero-sub { font-size: 0.95rem; opacity: 0.92; max-width: 560px; margin: 0 auto 22px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
    position: relative; z-index: 1;
    display: flex; justify-content: center; gap: 34px;
    margin-top: 30px; padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    flex-wrap: wrap;
}
.stat-num { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.78rem; opacity: 0.85; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; border: none; cursor: pointer;
    padding: 11px 26px; border-radius: 999px;
    font-size: 0.95rem; font-weight: 700; font-family: inherit;
    transition: all 0.2s; text-align: center;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45); }
.btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-bg); }
.btn-danger { background: #ffe9e3; color: var(--danger); }
.btn-danger:hover { background: #ffd8cd; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }
.btn-sm { padding: 5px 13px; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.75); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 1.02rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-more { font-size: 0.85rem; color: var(--primary); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: inherit; color: var(--text);
    background: #fff; transition: border 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
input:disabled { background: #f5f6f8; color: var(--text-light); }
textarea { resize: vertical; }
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636e72' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.form-actions { display: flex; align-items: flex-end; }

.input-pwd { position: relative; }
.input-pwd input { padding-right: 64px; }
.toggle-pwd {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: none; color: var(--text-light); font-size: 0.8rem;
    cursor: pointer; padding: 6px 8px; font-family: inherit;
}
.input-code { display: flex; gap: 8px; }
.input-code input { flex: 1; }
.input-code .btn { white-space: nowrap; }

/* ---------- 认证页 ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0 20px; }
.auth-card {
    width: 100%; max-width: 420px; background: #fff;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 32px 28px;
}
.auth-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.auth-sub { font-size: 0.88rem; color: var(--text-sub); margin-bottom: 22px; }
.auth-links {
    display: flex; justify-content: space-between; margin-top: 18px;
    font-size: 0.86rem; flex-wrap: wrap; gap: 8px;
}

/* ---------- 页头 ---------- */
.page-head { margin-bottom: 18px; }
.page-head h2 { font-size: 1.4rem; font-weight: 800; }
.page-desc { font-size: 0.88rem; color: var(--text-sub); margin-top: 4px; }

/* ---------- 提示框 ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; }
.alert-success { background: #e6f9f2; color: #00805e; border: 1px solid #b8ecd9; }
.alert-danger { background: #fdeee8; color: #c0502f; border: 1px solid #f6cfc0; }
.alert-warn { background: #fff8e6; color: #92600a; border: 1px solid #ffe8b0; }
.tip-box {
    background: var(--primary-bg); border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: 0.83rem; color: var(--text-sub); margin-top: 14px; line-height: 1.7;
}
.tip-box b { color: var(--primary); }
.tip-box code { background: rgba(108, 92, 231, 0.12); padding: 1px 6px; border-radius: 4px; font-size: 0.82rem; }

/* ---------- 表格（移动端卡片化） ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
    text-align: left; padding: 12px 16px; font-size: 0.78rem; color: var(--text-light);
    font-weight: 600; border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbff; }
.table .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin: 2px 3px 2px 0; }
.td-sub { font-size: 0.75rem; color: var(--text-light); }
.msg-cell { max-width: 260px; word-break: break-all; font-size: 0.82rem; color: var(--text-sub); }
.user-link { font-weight: 600; }

/* 移动端表格转卡片 */
@media (max-width: 720px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        border-bottom: 1px solid var(--border); padding: 10px 14px;
    }
    .table tr:last-child { border-bottom: none; }
    .table td {
        border: none; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px;
    }
    .table td::before {
        content: attr(data-label); font-size: 0.76rem; color: var(--text-light); flex-shrink: 0; font-weight: 600;
    }
    .table td:not([data-label])::before { content: ''; }
    .table td.td-actions { justify-content: flex-end; padding-top: 8px; }
    .table td.msg-cell { max-width: none; justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 2px; }
    .table td.msg-cell::before { display: none; }
}

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
.badge-ok { background: #e6f9f2; color: #00805e; }
.badge-fail { background: #fdeee8; color: #c0502f; }
.badge-warn { background: #fff8e6; color: #92600a; }
.badge-plain { background: #f0f2f5; color: var(--text-sub); }
.badge-vip { background: linear-gradient(135deg, #f7b733, #fc4a1a); color: #fff; }
.badge-type { background: var(--primary-bg); color: var(--primary); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--text-light); font-size: 0.92rem; }

/* ---------- 分页 ---------- */
.pagination-wrap { display: flex; justify-content: center; margin: 18px 0; }
.pagination { display: flex; list-style: none; gap: 6px; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: block; padding: 7px 13px; border-radius: 8px;
    background: #fff; color: var(--text-sub); font-size: 0.86rem;
    border: 1px solid var(--border);
}
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination li.disabled span { color: var(--text-light); background: #fafbfd; }

/* ---------- 同步中心 ---------- */
.sync-layout { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px 18px; align-items: end; }
.quick-steps { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.quick-steps button {
    border: 1px solid var(--border); background: #fafbfd; color: var(--text-sub);
    padding: 5px 13px; border-radius: 999px; font-size: 0.8rem; cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.quick-steps button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.sync-result {
    margin-top: 16px; padding: 15px 18px; border-radius: var(--radius-sm);
    font-size: 0.92rem; font-weight: 600; text-align: center;
}
.sync-ok { background: #e6f9f2; color: #00805e; border: 1px solid #b8ecd9; }
.sync-fail { background: #fdeee8; color: #c0502f; border: 1px solid #f6cfc0; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stat-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 14px; text-align: center;
}
.stat-card-num { font-size: 1.35rem; font-weight: 800; color: var(--primary); word-break: break-all; }
.stat-card-label { font-size: 0.76rem; color: var(--text-light); margin-top: 4px; }

/* ---------- VIP卡片 ---------- */
.vip-card {
    border-radius: var(--radius); padding: 2px; margin-bottom: 18px;
    background: linear-gradient(135deg, #dfe6e9, #f0f2f5);
    box-shadow: var(--shadow);
}
.vip-card.vip-active { background: linear-gradient(135deg, #f7b733, #fc4a1a); }
.vip-card-inner {
    background: #fff; border-radius: 14px; padding: 24px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
}
.vip-badge {
    display: inline-block; padding: 5px 16px; border-radius: 999px;
    font-weight: 800; font-size: 0.9rem; margin-bottom: 8px;
    background: #f0f2f5; color: var(--text-sub);
}
.vip-active .vip-badge { background: linear-gradient(135deg, #f7b733, #fc4a1a); color: #fff; }
.vip-email { font-size: 0.88rem; color: var(--text-sub); }
.vip-expire { font-size: 0.95rem; font-weight: 700; text-align: right; }
.vip-days { font-size: 0.8rem; color: var(--text-light); text-align: right; margin-top: 3px; }
.vip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.benefit-list { list-style: none; }
.benefit-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; font-size: 0.9rem; border-bottom: 1px dashed var(--border);
}
.benefit-list li:last-child { border-bottom: none; }
.benefit-check {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    background: #e6f9f2; color: #00805e; font-size: 0.75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- 筛选条 ---------- */
.filter-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-form input, .filter-form select { width: auto; min-width: 130px; padding: 8px 12px; font-size: 0.86rem; }
.filter-count { font-size: 0.82rem; color: var(--text-light); }
.chip {
    display: inline-block; padding: 6px 16px; border-radius: 999px;
    background: #fff; border: 1px solid var(--border); color: var(--text-sub);
    font-size: 0.85rem;
}
.chip-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* ---------- 弹层 ---------- */
.modal {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    align-items: center; justify-content: center; padding: 16px;
}
.modal.show { display: flex; }
.modal-box {
    background: #fff; border-radius: var(--radius); width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease;
    max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 1rem; }
.modal-close { border: none; background: none; font-size: 1.5rem; color: var(--text-light); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 功能特性 ---------- */
.section-title { text-align: center; font-size: 1.3rem; font-weight: 800; margin: 34px 0 22px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 26px 20px; text-align: center; transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.84rem; color: var(--text-sub); }

.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.guide-item { text-align: center; padding: 20px 12px; }
.guide-num {
    width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-weight: 800; font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}
.guide-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.guide-item p { font-size: 0.8rem; color: var(--text-light); }

/* ---------- 页脚 ---------- */
.footer { background: #fff; border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner {
    max-width: 1080px; margin: 0 auto; padding: 22px 16px;
    text-align: center; font-size: 0.82rem; color: var(--text-light); line-height: 2;
}
.footer-icp a { color: var(--text-light); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .feature-grid, .guide-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .vip-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .sync-layout { grid-template-columns: 1fr; }
    .form-actions { padding-bottom: 4px; }
}

@media (max-width: 720px) {
    /* 手机端汉堡菜单 */
    .nav-burger { display: block; }
    .nav-links {
        display: none; position: absolute; top: 60px; left: 0; right: 0;
        background: #fff; flex-direction: column; align-items: stretch;
        padding: 10px 16px 16px; gap: 2px;
        border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-links a { padding: 11px 14px; border-radius: 10px; }
    .nav-links .nav-btn-register { text-align: center; margin-top: 6px; }

    .hero { padding: 34px 18px 26px; }
    .hero-title { font-size: 1.5rem; }
    .hero-sub { font-size: 0.86rem; }
    .hero-stats { gap: 20px; margin-top: 22px; padding-top: 18px; }
    .stat-num { font-size: 1.2rem; }

    .container { padding: 14px 12px 32px; }
    .card-body { padding: 16px; }
    .auth-card { padding: 26px 20px; }
    .hero .btn-lg, .btn-lg { padding: 12px 26px; font-size: 0.98rem; }
    .filter-form input, .filter-form select { min-width: 110px; }
    .vip-card-inner { justify-content: flex-start; }
    .vip-expire, .vip-days { text-align: left; }
}

@media (max-width: 400px) {
    .stat-row { grid-template-columns: 1fr 1fr; }
    .feature-grid, .guide-grid { grid-template-columns: 1fr; }
}
