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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #003366;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app {
    width: 100vw;
    height: 177.78vw;
    max-height: 100vh;
    max-width: 56.25vh;
    position: relative;
    overflow: hidden;
    background: #003366;
}

.page {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateX(100%);
    overflow: hidden;
    z-index: 1;
}

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

.page-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.page-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page1 {
    background: linear-gradient(180deg, #006994 0%, #003366 100%);
}

.page1 .page-bg {
    opacity: 0;
    animation: fadeIn 2s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    animation: rise 4s infinite ease-in;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bubble:nth-child(1) {
    width: 24px;
    height: 24px;
    left: 8%;
    bottom: 15%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 16px;
    height: 16px;
    left: 25%;
    bottom: 25%;
    animation-delay: 0.8s;
}

.bubble:nth-child(3) {
    width: 28px;
    height: 28px;
    left: 45%;
    bottom: 12%;
    animation-delay: 1.5s;
}

.bubble:nth-child(4) {
    width: 12px;
    height: 12px;
    left: 65%;
    bottom: 20%;
    animation-delay: 0.3s;
}

.bubble:nth-child(5) {
    width: 20px;
    height: 20px;
    left: 82%;
    bottom: 15%;
    animation-delay: 1.2s;
}

.bubble:nth-child(6) {
    width: 14px;
    height: 14px;
    left: 35%;
    bottom: 8%;
    animation-delay: 2s;
}

.bubble:nth-child(7) {
    width: 18px;
    height: 18px;
    left: 75%;
    bottom: 28%;
    animation-delay: 0.6s;
}

@keyframes rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    15% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) scale(0.4);
        opacity: 0;
    }
}

.title-container {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    animation: fadeInUp 1.5s ease 1s forwards;
    width: 100%;
}

.main-title {
    width: 85%;
    max-width: 480px;
    margin-bottom: 25px;
    filter: drop-shadow(0 6px 20px rgba(0, 100, 150, 0.6));
    animation: floatTitle 4s infinite ease-in-out;
}

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

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 17px;
    line-height: 2;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    letter-spacing: 3px;
    font-weight: 300;
}

.start-btn {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 35px;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.95) 0%, rgba(68, 160, 141, 0.95) 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeInUp 1s ease 1.8s forwards;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.35);
}

.start-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 30px rgba(78, 205, 196, 0.5);
}

.start-btn:active {
    transform: translateX(-50%) scale(0.95);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

@keyframes fadeInUp {
    from {
        transform: translateX(-50%) translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.fish-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.fish {
    position: absolute;
    width: 70px;
    height: auto;
    animation: swim 10s infinite ease-in-out;
}

.fish1 {
    bottom: 30%;
    left: -120px;
    animation-delay: 1.5s;
}

@keyframes swim {
    0% {
        transform: translateX(-120px) translateY(0);
    }
    25% {
        transform: translateX(calc(50vw - 35px)) translateY(-40px);
    }
    50% {
        transform: translateX(calc(100vw + 120px)) translateY(0);
    }
    51% {
        transform: translateX(calc(100vw + 120px)) translateY(0) scaleX(-1);
    }
    75% {
        transform: translateX(calc(50vw - 35px)) translateY(30px) scaleX(-1);
    }
    100% {
        transform: translateX(-120px) translateY(0) scaleX(-1);
    }
}

.page2 {
    background: #003366;
    overflow: hidden;
}

.split-container {
    width: 200%;
    height: 100%;
    display: flex;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    top: 0;
    will-change: transform;
    backface-visibility: hidden;
}

.split-panel {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.split-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.split-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    z-index: 5;
    transform: translateX(-50%);
}

.swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    z-index: 10;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.swipe-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 8px;
    animation: swipeAnim 1.5s infinite;
}

@keyframes swipeAnim {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}

.swipe-hint span {
    font-size: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.page2-text {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 17px;
    line-height: 2;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    z-index: 20;
    width: 92%;
    letter-spacing: 2px;
    pointer-events: none;
}

.page2-next {
    position: absolute;
    bottom: 6%;
    right: 8%;
    color: white;
    font-size: 17px;
    padding: 12px 25px;
    background: rgba(78, 205, 196, 0.9);
    border-radius: 25px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.page3 {
    background: #003366;
}

.creature-container {
    position: absolute;
    top: 12%;
    left: 0;
    width: 100%;
    height: 65%;
    z-index: 5;
}

.creature {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.creature:nth-child(2) {
    flex-direction: row-reverse;
}

.creature:nth-child(4) {
    flex-direction: row-reverse;
}

.creature.active {
    opacity: 1;
    transform: translateX(0);
}

.creature-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    animation: float 3s infinite ease-in-out;
    flex-shrink: 0;
}

.creature:nth-child(2) .creature-img {
    margin-left: 20px;
}

.creature:nth-child(4) .creature-img {
    margin-left: 20px;
}

.creature-img.whale {
    width: 220px;
    height: 110px;
    animation-duration: 4s;
}

.creature-img.turtle {
    width: 140px;
    height: 110px;
    animation-duration: 3.5s;
}

.creature-img.coral {
    width: 110px;
    height: 110px;
    animation: sway 3s infinite ease-in-out;
}

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

@keyframes sway {
    0%, 100% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(8deg);
    }
}

.creature-text {
    flex: 1;
}

.creature-text p {
    color: white;
    font-size: 15px;
    line-height: 1.8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: rgba(0, 105, 148, 0.5);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #4ECDC4;
    backdrop-filter: blur(5px);
}

.creature:nth-child(2) .creature-text p {
    border-left: none;
    border-right: 5px solid #4ECDC4;
}

.creature:nth-child(4) .creature-text p {
    border-left: none;
    border-right: 5px solid #4ECDC4;
}

.page3-footer {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 15px;
    line-height: 2;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    width: 90%;
    letter-spacing: 2px;
}

.progress-dots {
    position: absolute;
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.4s ease;
}

.dot.active {
    background: #4ECDC4;
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.6);
}

.page3-next, .page4-next {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    padding: 14px 50px;
    border-radius: 30px;
    font-size: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.5);
    animation: pulse 2s infinite;
    z-index: 20;
}

.page3-next span, .page4-next span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tap-hint {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: center;
    animation: fadeInOut 2s infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.page4 {
    background: #87CEEB;
}

.page4-title {
    position: absolute;
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    color: #006994;
    font-size: 19px;
    line-height: 1.8;
    text-align: center;
    font-weight: 600;
    z-index: 10;
    width: 90%;
    letter-spacing: 2px;
}

.action-grid {
    position: absolute;
    top: 14%;
    left: 3%;
    width: 94%;
    height: 78%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    z-index: 5;
}

.action-item {
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.8);
}

.action-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.action-item.completed {
    transform: scale(0.98);
    border-color: #4ECDC4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
}

.action-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #4ECDC4;
    color: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.action-item.completed .action-check {
    background: #4ECDC4;
    border-color: #4ECDC4;
    color: white;
    animation: checkAnim 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkAnim {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}



.page5 {
    background: #87CEEB;
}

.page5-title {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    color: #006994;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    font-weight: 600;
    z-index: 10;
    width: 85%;
    letter-spacing: 1px;
}

.signature-area {
    position: absolute;
    top: 22%;
    left: 5%;
    width: 90%;
    height: 55%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    z-index: 5;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 30px rgba(255,255,255,0.1);
}

#signatureCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.signature-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 12px;
}

.sig-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.sig-btn:active {
    transform: scale(0.88);
}

.sig-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.submit-btn {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 50px;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.submit-btn:active {
    transform: translateX(-50%) scale(0.95);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

.page6 {
    background: #003366;
}

.page6-title {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 10;
    width: 85%;
    letter-spacing: 1px;
}

.commitment-card {
    position: absolute;
    top: 20%;
    left: 8%;
    width: 84%;
    height: 58%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 22px;
    overflow: hidden;
    z-index: 5;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    animation: cardFloat 4s infinite ease-in-out;
}

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

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    position: relative;
    z-index: 2;
    color: #006994;
    font-size: 15px;
    line-height: 1.8;
    text-align: center;
    padding: 22px 18px 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.card-signature {
    position: relative;
    z-index: 2;
    width: 85%;
    height: 48%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border: 2px dashed #4ECDC4;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

#signaturePreview {
    width: 100%;
    height: 100%;
}

.share-btn {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 50px;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.share-btn:active {
    transform: translateX(-50%) scale(0.95);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

.share-hint {
    position: absolute;
    top: 7%;
    right: 8%;
    color: white;
    font-size: 13px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    animation: hintBlink 2s infinite;
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 15px;
}

@keyframes hintBlink {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@media (max-width: 375px) {
    .main-title {
        width: 94%;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .start-btn {
        padding: 12px 45px;
        font-size: 18px;
    }
    
    .fish {
        width: 50px;
    }
    
    .page2-text {
        font-size: 14px;
    }
    
    .creature-img {
        width: 85px;
        height: 85px;
    }
    
    .creature-img.whale {
        width: 140px;
        height: 70px;
    }
    
    .creature-img.turtle {
        width: 90px;
        height: 70px;
    }
    
    .creature-img.coral {
        width: 80px;
        height: 80px;
    }
    
    .creature-text p {
        font-size: 12px;
        padding: 12px;
        line-height: 1.6;
    }
    
    .page3-footer {
        font-size: 12px;
    }
    
    .action-text {
        font-size: 12px;
    }
    
    .action-tag {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    .page4-title, .page5-title {
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 11px 55px;
        font-size: 18px;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .share-btn {
        padding: 11px 45px;
        font-size: 18px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .main-title {
        width: 85%;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .start-btn {
        padding: 18px 65px;
        font-size: 24px;
    }
    
    .fish {
        width: 80px;
    }
    
    .page2-text {
        font-size: 18px;
    }
    
    .creature-img {
        width: 140px;
        height: 140px;
    }
    
    .creature-img.whale {
        width: 240px;
        height: 120px;
    }
    
    .creature-img.turtle {
        width: 150px;
        height: 120px;
    }
    
    .creature-text p {
        font-size: 16px;
        padding: 20px;
    }
    
    .page3-footer {
        font-size: 16px;
    }
    
    .action-text {
        font-size: 16px;
    }
    
    .action-tag {
        font-size: 14px;
        padding: 6px 16px;
    }
    
    .page4-title, .page5-title {
        font-size: 20px;
    }
    
    .submit-btn {
        padding: 16px 80px;
        font-size: 24px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .share-btn {
        padding: 16px 65px;
        font-size: 24px;
    }
}