/* ========== 基础设置 ========== */
:root {
    font-size: 16px; /* 基准字体大小 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 0.875rem; /* 14px */
    padding-bottom: 4rem; /* 64px */
    padding-top: 3.5rem; /* 56px */
    min-height: 100vh;
    line-height: 1.5;
}

/* ========== 顶部导航 ========== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem; /* 56px */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem; /* 16px */
    z-index: 100;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.15);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* 10px */
}

.header-logo {
    height: 1.875rem; /* 30px */
    width: auto;
}

.header-title {
    color: #fff;
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.875rem; /* 14px */
}

.header-balance {
    color: #ffd700;
    font-size: 0.9375rem; /* 15px */
    font-weight: 600;
}

.header-bell {
    color: #fff;
    font-size: 1.25rem; /* 20px */
    cursor: pointer;
}

/* ========== 侧滑菜单 ========== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}

.mobile-overlay.show {
    display: block;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -17.5rem; /* 280px */
    width: 17.5rem;
    height: 100%;
    background: #1a1a2e;
    z-index: 201;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.show {
    left: 0;
}

.menu-header {
    padding: 1.875rem 1.25rem 1.25rem; /* 30px 20px 20px */
    text-align: center;
    border-bottom: 0.0625rem solid rgba(255,255,255,0.1);
}

.menu-avatar img {
    width: 4.375rem; /* 70px */
    height: 4.375rem;
    border-radius: 50%;
    border: 0.1875rem solid #2d8cf0;
    object-fit: cover;
}

.menu-name {
    color: #fff;
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    margin-top: 0.625rem;
}

.menu-id {
    color: #999;
    font-size: 0.8125rem; /* 13px */
    margin-top: 0.25rem;
}

.menu-nav {
    padding: 1rem 0;
}

.menu-nav a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem; /* 14px 24px */
    color: #aaa;
    text-decoration: none;
    font-size: 0.9375rem; /* 15px */
    transition: all 0.3s;
    border-left: 0.1875rem solid transparent;
}

.menu-nav a i {
    width: 1.75rem; /* 28px */
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

.menu-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.menu-nav a.active {
    background: rgba(45, 140, 240, 0.15);
    color: #2d8cf0;
    border-left-color: #2d8cf0;
}

.menu-nav .menu-logout {
    margin-top: 1.25rem;
    color: #f56c6c;
    border-top: 0.0625rem solid rgba(255,255,255,0.05);
    padding-top: 1rem;
}

/* ========== 主内容 ========== */
.mobile-main {
    padding: 1rem; /* 16px */
    min-height: calc(100vh - 7.875rem);
}

/* ========== 底部导航 ========== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4rem; /* 64px */
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -0.125rem 0.625rem rgba(0,0,0,0.08);
    z-index: 100;
    border-top: 0.0625rem solid #f0f0f0;
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    text-decoration: none;
    font-size: 0.75rem; /* 12px */
    padding: 0.375rem 0.75rem;
    transition: color 0.3s;
}

.mobile-bottom-nav a i {
    font-size: 1.375rem; /* 22px */
    margin-bottom: 0.125rem;
}

.mobile-bottom-nav a.active {
    color: #2d8cf0;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem; /* 10px */
    margin-bottom: 1rem;
}

.stat-card {
    background: #fff;
    padding: 0.875rem 0.75rem; /* 14px 12px */
    border-radius: 0.75rem;
    box-shadow: 0 0.0625rem 0.25rem rgba(0,0,0,0.06);
    text-align: center;
}

.stat-icon {
    font-size: 1.25rem; /* 20px */
    color: #2d8cf0;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
}

.stat-label {
    font-size: 0.6875rem; /* 11px */
    color: #999;
    margin-top: 0.125rem;
}

/* ========== 卡片 ========== */
.section-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem; /* 16px */
    margin-bottom: 0.875rem; /* 14px */
    box-shadow: 0 0.0625rem 0.25rem rgba(0,0,0,0.06);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.625rem;
    border-bottom: 0.0625rem solid #f0f0f0;
}

.section-header h3 {
    font-size: 0.9375rem; /* 15px */
    font-weight: 600;
}

.section-date {
    font-size: 0.75rem; /* 12px */
    color: #999;
}

/* ========== 今日统计 ========== */
.today-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.today-item {
    text-align: center;
}

.today-item .label {
    display: block;
    font-size: 0.6875rem; /* 11px */
    color: #999;
}

.today-item .value {
    font-size: 1rem; /* 16px */
    font-weight: 600;
}

/* ========== 活动列表 ========== */
.activity-list .activity-item {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 0.0625rem solid #f5f5f5;
    align-items: center;
    font-size: 0.875rem; /* 14px */
}

.activity-time {
    color: #999;
    font-size: 0.75rem;
    width: 3.125rem;
    flex-shrink: 0;
}

.activity-desc {
    flex: 1;
    padding: 0 0.625rem;
}

.activity-amount {
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem; /* 13px */
    min-width: 37.5rem;
}

table th,
table td {
    padding: 0.5rem 0.75rem; /* 8px 12px */
    text-align: left;
    border-bottom: 0.0625rem solid #f0f0f0;
    white-space: nowrap;
}

table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 0.75rem; /* 12px */
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem; /* 14px */
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem; /* 10px 12px */
    border: 0.0625rem solid #dcdfe6;
    border-radius: 0.5rem;
    font-size: 0.875rem; /* 14px */
    outline: none;
    background: #fff;
    -webkit-appearance: none;
}

/* ========== 按钮 ========== */
.btn {
    padding: 0.625rem 1.25rem; /* 10px 20px */
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem; /* 14px */
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background: #2d8cf0;
    color: #fff;
}

.btn-primary:active {
    background: #1a7adf;
}

.btn-success {
    background: #36b368;
    color: #fff;
}

.btn-danger {
    background: #f56c6c;
    color: #fff;
}

.btn-sm {
    padding: 0.375rem 0.875rem; /* 6px 14px */
    font-size: 0.75rem; /* 12px */
    width: auto;
}

/* ========== 颜色工具 ========== */
.text-green {
    color: #36b368;
}
.text-red {
    color: #f56c6c;
}
.text-yellow {
    color: #e6a23c;
}
.text-gray {
    color: #999;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 1.875rem 0;
    font-size: 0.875rem;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.pagination .btn {
    width: auto;
    min-width: 2rem;
    padding: 0.25rem 0.625rem;
    border: 0.0625rem solid #dcdfe6;
    background: #fff;
    color: #333;
    font-size: 0.8125rem;
}

.pagination .btn-primary {
    background: #2d8cf0;
    color: #fff;
    border-color: #2d8cf0;
}

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1.25rem;
    padding-top: 0;
}

.login-box {
    background: #fff;
    padding: 2rem 1.5rem; /* 32px 24px */
    border-radius: 1rem;
    width: 100%;
    max-width: 23.75rem;
    box-shadow: 0 1.25rem 3.75rem rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    font-size: 1.5rem; /* 24px */
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
}

.login-box h1 img {
    height: 2rem;
}

.login-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.login-box .form-group {
    margin-bottom: 1rem;
}

.login-box .btn {
    padding: 0.75rem;
    font-size: 1rem;
}

.login-box .error-msg {
    color: #f56c6c;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: none;
}

/* ========== 弹窗 ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.popup-overlay.show {
    display: flex;
}

.popup-box {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 25rem;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.popup-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.popup-actions .btn {
    flex: 1;
}

/* ========== 徽章 ========== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
    background: #f5f5f5;
    font-size: 0.8125rem;
    color: #666;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .today-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .stat-value {
        font-size: 1rem;
    }
    .header-title {
        font-size: 1rem;
    }
    .header-balance {
        font-size: 0.8125rem;
    }
    .login-box {
        padding: 1.5rem 1rem;
    }
    .login-box h1 {
        font-size: 1.25rem;
    }
    .section-card {
        padding: 0.75rem;
    }
    .mobile-main {
        padding: 0.75rem;
    }
}

@media (min-width: 768px) {
    :root {
        font-size: 17px; /* 平板稍大 */
    }
}

@media (min-width: 1024px) {
    :root {
        font-size: 18px; /* 桌面稍大 */
    }
}