body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 应用容器 - 响应式设计 */
#app {
    width: 100%;
    height: 100vh;
    max-width: 390px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    background-color: #f9fafb;
}

/* 在PC设备上添加模拟手机边框 */
@media (min-width: 768px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background-color: #f0f2f5;
    }
    
    #app {
        height: 844px;
        border-radius: 30px;
        border: 10px solid #333;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
        position: relative;
        overflow: hidden;
    }
    
    /* 添加手机顶部刘海 */
    #app::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 20px;
        background: #333;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        z-index: 100;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 环形图表 */
.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.8;
    stroke-linecap: round;
}

.percentage {
    fill: #ffffff;
    font-size: 5px;
    text-anchor: middle;
    font-weight: bold;
}

/* 确保主内容区域有足够的底部内边距，避免被导航栏覆盖 */
main {
    padding-bottom: 80px;
}

/* 修复底部导航栏 */
nav.bottom-nav {
    position: absolute; /* 修改为absolute而不是fixed */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 8px;
}

/* 在移动设备上保持固定位置 */
@media (max-width: 767px) {
    nav.bottom-nav {
        position: fixed;
        width: 100%;
        max-width: 390px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 优化图表显示 */
canvas {
    max-width: 100%;
}

/* 添加内容容器填充高度样式 */
.content-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

/* 确保主内容区域占据剩余空间 */
.content-container main {
    flex: 1;
    overflow-y: auto;
}

/* 添加快速操作按钮样式 */
.action-button {
    position: absolute;
    bottom: 70px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 浮动菜单样式 */
.floating-menu {
    position: absolute;
    bottom: 138px; /* 加号按钮高度+间距 */
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 39;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.floating-menu.active .menu-item {
    transform: translateX(0);
    opacity: 1;
}

.floating-menu.active .menu-item:nth-child(1) {
    transition-delay: 0.05s;
}

.floating-menu.active .menu-item:nth-child(2) {
    transition-delay: 0.1s;
}

.floating-menu.active .menu-item:nth-child(3) {
    transition-delay: 0.15s;
}

.floating-menu.active .menu-item:nth-child(4) {
    transition-delay: 0.2s;
}

.menu-label {
    padding: 8px 16px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    margin-right: 12px;
    white-space: nowrap;
}

.menu-icon {
    width: 46px;
    height: 46px;
    border-radius: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 覆盖层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 35;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 加号旋转动画 */
.action-button.rotate-45 {
    transform: rotate(45deg);
}

/* 添加菜单项点击动画 */
.menu-icon {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.menu-item:active .menu-icon {
    transform: scale(0.95);
}

.menu-label {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.menu-item:active .menu-label {
    background-color: #f9fafb;
}

/* 浮动菜单图标颜色 */
.menu-icon i {
    font-size: 20px;
}

/* 计划管理页样式 */
.plan-filter-btn {
    transition: background-color 0.2s, color 0.2s;
}

.plan-filter-btn.active {
    background-color: #4f46e5;
    color: white;
}

.plan-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:active {
    transform: scale(0.98);
}

/* 进度条动画 */
@keyframes progress-fill {
    0% { width: 0; }
    100% { width: var(--progress-width); }
}

.progress-bar .fill {
    animation: progress-fill 1s ease-out forwards;
}

/* 计划详情页样式 */
.day-completed, .day-current, .day-upcoming {
    text-align: center;
}

.day-current {
    position: relative;
}

.day-current::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #4f46e5;
}

/* 打卡热力图样式 */
@keyframes pop-in {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

#tag-container > div {
    animation: pop-in 0.3s forwards;
}

/* 模板选择和按钮样式 */
.template-select-btn {
    transition: background-color 0.2s, color 0.2s;
}

.difficulty-btn, .frequency-btn, .time-btn {
    transition: background-color 0.2s, color 0.2s;
}

/* 表单元素焦点样式增强 */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* 添加输入范围滑块自定义样式 */
input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 弹出层动画效果 */
@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

#options-modal > div {
    animation: slide-up 0.3s forwards;
}

/* 成功弹窗动画 */
@keyframes fade-zoom-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

#check-in-success > div {
    animation: fade-zoom-in 0.3s forwards;
}

/* 创建页面类型选择按钮 */
.plan-type-btn {
    transition: border 0.2s, transform 0.2s;
}

.plan-type-btn:active {
    transform: scale(0.95);
}

.plan-type-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 按钮通用过渡效果 */
button {
    transition: background-color 0.2s, transform 0.2s, color 0.2s, border-color 0.2s;
}

button:active:not(:disabled) {
    transform: scale(0.98);
} 