/* ==========================================
   Material Design 3 样式 - 安全签到系统 H5 Demo
   ========================================== */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局变量 */
:root {
    /* Minimalism & Swiss Style 色彩系统 */
    --md-sys-color-primary: #0F172A;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #F1F5F9;
    --md-sys-color-on-primary-container: #0F172A;
    --md-sys-color-secondary: #334155;
    --md-sys-color-secondary-container: #F8FAFC;
    --md-sys-color-background: #F8FAFC;
    --md-sys-color-surface: #ffffff;
    --md-sys-color-surface-variant: #F1F5F9;
    --md-sys-color-on-surface: #020617;
    --md-sys-color-on-surface-variant: #475569;
    --md-sys-color-outline: #E2E8F0;
    --md-sys-color-error: #B91C1C;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-success: #059669;
    --md-sys-color-warning: #B45309;
    --md-sys-color-cta: #0369A1;

    /* 阴影 - 极简主义风格，更锐利、更精确 */
    --md-sys-elevation-1: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --md-sys-elevation-2: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --md-sys-elevation-3: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* 圆角 - 略微减小以符合极简主义美学 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 字体组合 */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --font-family: var(--font-body);
}

/* 页面容器 - 手机模拟器背景升级 */
/* 全屏移动端布局 */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
}

/* 页面展示容器 */
.page-container {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--md-sys-color-background);
}

/* 页面内容区 */
.page-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 120px;
    /* 为底部导航留出空间 */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.page-content::-webkit-scrollbar {
    display: none;
}

/* 底部导航 - 提升协调感 */
.bottom-nav {
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    border-radius: 20px;
    z-index: 1000;
    box-shadow: var(--md-sys-elevation-3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    flex: 1;
    padding: 8px 0;
    /* 增加点击区域 */
    position: relative;
}

.nav-item.active {
    color: var(--md-sys-color-primary);
}

/* 现代激活指示器（Pill Shape） */
.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -85%) scaleX(0);
    width: 52px;
    height: 30px;
    background: var(--md-sys-color-primary-container);
    border-radius: 15px;
    opacity: 0;
    z-index: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active::before {
    transform: translate(-50%, -85%) scaleX(1);
    opacity: 1;
}

.nav-item-icon {
    width: 24px;
    height: 24px;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active .nav-item-icon {
    transform: translateY(-2px);
}

.nav-item-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    z-index: 1;
}

/* 页面样式 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(30px);
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.page.prev {
    transform: translateX(-30px);
}

/* 卡片升级 */
.card {
    background: var(--md-sys-color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md);
    box-shadow: var(--md-sys-elevation-1);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* 统计卡片 - 炫彩渐变 */
.stats-card {
    background: var(--md-sys-color-primary);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: var(--spacing-md);
    box-shadow: var(--md-sys-elevation-2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-item {
    text-align: center;
    flex: 1;
}

.stats-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 2px;
}

.stats-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 签到按钮 - 现代悬浮风格 */
.checkin-container {
    padding: 24px;
    text-align: center;
}

.checkin-button-wrapper {
    position: relative;
    display: inline-block;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: var(--md-sys-color-primary);
    filter: blur(20px);
    opacity: 0.3;
    border-radius: var(--radius-full);
    z-index: 1;
    animation: glow-pulse 2s infinite ease-in-out;
}

.button {
    position: relative;
    z-index: 2;
    padding: 18px 42px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.button-filled {
    background: var(--md-sys-color-cta);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(3, 105, 161, 0.39);
}

.button-filled:active {
    transform: scale(0.95);
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* 用户状态标签 */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

.status-pill.success {
    background: #ecfdf5;
    color: #059669;
}

.status-pill.warning {
    background: #fffbeb;
    color: #d97706;
}

.status-pill.danger {
    background: #fef2f2;
    color: #dc2626;
}

/* 列表项优化 - 柔和过渡 */
.list-item {
    margin: 4px 16px;
    padding: 14px 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid transparent;
}

.list-item:active {
    background: var(--md-sys-color-primary-container);
    transform: scale(0.98);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 8px rgba(0, 0, 0, 0.02);
}

#history .list-item-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

#profile .list-item-icon {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.list-item-title {
    font-weight: 700;
    font-size: 15px;
}

.list-item-subtitle {
    font-weight: 500;
    font-size: 13px;
}

/* 其它元素 */
.title-large {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.025em;
}

.title-medium {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
}

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.05), transparent);
    margin: 16px 0;
}

/* ================ 动画 ================ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 入场动画 */
.fade-up {
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}