
/* 基础变量定义 */
:root {
    --primary-color: #4A90E2;
    --primary-light: #6BA4E7;
    --primary-dark: #2E7AD1;
    --background-color: #E6EEF8;
    --surface-color: #F0F5FA;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --shadow-color: rgba(149, 157, 165, 0.2);
    --highlight-color: rgba(255, 255, 255, 0.8);
    --water-color: rgba(74, 144, 226, 0.6);
    --border-radius: 15px;
    --neumorphic-shadow: 
        8px 8px 16px var(--shadow-color),
        -8px -8px 16px var(--highlight-color);
    --neumorphic-inset: 
        inset 6px 6px 12px var(--shadow-color),
        inset -6px -6px 12px var(--highlight-color);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    padding-bottom: 70px;
    position: relative;
}

/* 容器样式 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

/* 拟态卡片样式 */
.neumorphic {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--neumorphic-shadow);
    padding: 20px;
    margin: 20px 0;
}

/* 进度展示区域 */
.progress-section {
    text-align: center;
    padding: 30px 20px;
}

.water-glass-container {
    position: relative;
    width: 200px;
    height: 300px;
    margin: 0 auto 30px;
}

.water-glass {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: var(--surface-color);
    box-shadow: var(--neumorphic-shadow);
    overflow: hidden;
}

.water-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

#webgl-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.percentage-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px var(--highlight-color);
    z-index: 1;
}

/* 水滴动画 */
.water-drops {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.water-drop {
    width: 30px;
    height: 30px;
    fill: var(--primary-color);
    opacity: 0.6;
}

.water-drop.floating {
    animation: float 2s ease-in-out infinite;
}

/* 进度信息 */
.progress-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.progress-stat {
    text-align: center;
}

.progress-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.progress-stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* 进度条 */
.progress-bar {
    height: 10px;
    background: var(--surface-color);
    border-radius: 5px;
    box-shadow: var(--neumorphic-inset);
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-light), var(--primary-color));
    border-radius: 5px;
    width: 0;
    transition: width 0.3s ease-in-out;
}

/* 快捷操作按钮 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.quick-btn {
    padding: 15px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--surface-color);
    box-shadow: var(--neumorphic-shadow);
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:active {
    box-shadow: var(--neumorphic-inset);
    transform: scale(0.98);
}

/* 表单样式 */
.form-group {
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--surface-color);
    box-shadow: var(--neumorphic-inset);
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--neumorphic-shadow);
}

.btn:hover {
    background: var(--primary-light);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: var(--neumorphic-inset);
}

/* 底部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    box-shadow: 0 -4px 12px var(--shadow-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.tab-item {
    text-decoration: none;
    color: var(--text-light);
    text-align: center;
    transition: all 0.2s ease;
    padding: 5px 20px;
    border-radius: var(--border-radius);
}

.tab-item.active {
    color: var(--primary-color);
    background: var(--surface-color);
    box-shadow: var(--neumorphic-inset);
}

.tab-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.tab-label {
    font-size: 12px;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--neumorphic-shadow);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.modal-title {
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
}

.modal-content {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--neumorphic-shadow);
}

.modal-btn.secondary {
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: var(--neumorphic-shadow);
}

.modal-btn:active {
    transform: scale(0.98);
    box-shadow: var(--neumorphic-inset);
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .progress-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .water-glass-container {
        width: 150px;
        height: 225px;
    }
}