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

:root {
    --white: #ffffff;
    --bg: #fafafa;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --accent: #111827;
    --accent-light: #374151;
    --danger: #ef4444;
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    background: var(--white);
    color: var(--gray-900);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    width: 100%;
    user-select: none;
}

/* 页面容器 */
.page-container {
    display: flex;
    width: 200%;
    height: calc(100dvh - 24px - var(--safe-bottom));
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    padding-top: var(--safe-top);
}

.page-container.swiping {
    transition: none;
}

.page {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px 40px;
    -webkit-overflow-scrolling: touch;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 12px;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.subtitle {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 6px;
    font-weight: 400;
}

/* 计数环 */
.count-display {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}

.count-ring {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--gray-50);
    border: 2px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.count-ring.pulse {
    transform: scale(1.05);
    border-color: var(--gray-300);
    background: var(--gray-100);
}

.count-number {
    font-size: 64px;
    font-weight: 200;
    color: var(--gray-900);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: all 0.15s ease;
}

.count-number.bump {
    transform: scale(1.15);
}

.count-label {
    font-size: 14px;
    color: var(--gray-400);
    margin-top: 4px;
    font-weight: 400;
}

/* 按钮组 */
.btn-group {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
}

.btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.btn:active {
    transform: scale(0.92);
    background: var(--gray-50);
    box-shadow: none;
}

.btn-plus {
    width: 72px;
    height: 72px;
    border-color: var(--gray-900);
    color: var(--gray-900);
    background: var(--gray-900);
    color: var(--white);
}

.btn-plus:active {
    background: var(--gray-700);
    border-color: var(--gray-700);
}

/* 今日记录 */
.today-records {
    margin-top: 8px;
}

.today-records h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 12px;
    font-size: 14px;
    color: var(--gray-600);
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.record-item .time {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--gray-700);
}

.record-item .delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.record-item .delete-btn:active {
    background: var(--gray-200);
    color: var(--danger);
}

.record-empty {
    text-align: center;
    color: var(--gray-300);
    font-size: 14px;
    padding: 24px 0;
}

/* 滑动提示 */
.swipe-hint {
    text-align: center;
    color: var(--gray-300);
    font-size: 12px;
    margin-top: 24px;
    padding-bottom: 20px;
}

/* 页面指示器 */
.page-indicator {
    position: fixed;
    bottom: calc(12px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--gray-900);
    width: 20px;
    border-radius: 3px;
}

/* 统计卡片 */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    flex: 1;
    background: var(--gray-50);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 300;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 图表 */
.chart-container {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 20px;
}

#trendChart {
    width: 100%;
    height: 220px;
}

/* Toast */
.toast {
    position: fixed;
    top: calc(60px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--gray-900);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 滚动条 */
.page::-webkit-scrollbar {
    display: none;
}

.page {
    scrollbar-width: none;
}
