@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&display=swap');

/* --- 使用通用動畫：初始隱藏狀態 --- */
.bottom-left-info,
.pickup-box,
.character-display,
.work-navigation,
.return-link {
    opacity: 0;
}

:root {
    --bg-color: #fafafa; /* 淺紫/淡粉背景 */
    --shape-bg-color: #d4f2ff; /* 明亮天藍色 */
    --text-color: #333; /* 深紫色文字 */
    --text-light-color: #666; /* 中紫色文字 */
    --accent-color: #FF5A8D; /* 活潑桃紅色 (主要的強調色) */
    --secondary-accent: #FFCC33; /* 亮黃色 (第二強調色) */
    --button-hover-color: #46b036; /* 調整為更繽紛的顏色 */
    --font-family: 'M PLUS Rounded 1c', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* --- 桌面版 --- */
.work-container {
    position: relative;
    min-height: 100vh;
}

/* --- 左下角資訊 --- */
.bottom-left-info {
    position: absolute;
    bottom: 120px;
    left: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    z-index: 10;
}

.work-title {
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--button-hover-color);
    line-height: 1.2;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.7);
}

.work-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light-color);
}

.meta-item {
    position: relative;
}

.meta-item:not(:first-child)::before {
    content: '|';
    position: absolute;
    left: -10px;
    color: rgba(93, 64, 55, 0.2);
}

/* --- Return Link (Back 按鈕) --- */
.return-link {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background-color: #111;
    color: #fafafa;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    z-index: 10;
}

.return-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.return-arrow svg {
    display: block; 
    vertical-align: middle;
}

.return-link:hover {
    background-color: #46b036;
    transform: translateX(-5px);
}

/* --- 底部中央導航 --- */
.work-navigation {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 10;
    pointer-events: none;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    pointer-events: auto;
}

.nav-btn:hover:not(.disabled) {
    background: #009FE0;
    color: #fafafa;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.prev-btn:hover:not(.disabled) svg {
    transform: translateX(-2px);
}

.next-btn:hover:not(.disabled) svg {
    transform: translateX(2px);
}

.nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(200, 200, 200, 0.5);
    color: #999;
}

.nav-text {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-btn:focus {
    outline: 3px solid #46b036;
    outline-offset: 2px;
}

/* --- 右下角訊息框 --- */
.pickup-box {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background-color: #fff;
    border-radius: 15px;
    padding: 15px 20px;
    width: 280px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.pickup-header {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 500;
}

/* --- 中央主要內容 --- */
.main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    padding: 20px;
}

.character-display {
    position: relative;
    width: 60%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-shape {
    position: absolute;
    width: 100%;
    padding-bottom: 100%;
    background-color: var(--shape-bg-color);
    border-radius: 50%;
    z-index: 0;
    overflow: hidden;
}


/* --- 幾何雲朵 --- */
.cloud {
    position: absolute;
    display: flex;
    align-items: flex-end;
    animation: floatCloud linear infinite, slightBob 3s infinite alternate;
    z-index: 1;
    filter: blur(2px); /* 輕微模糊讓雲朵更柔和 */
}




/* 雲朵的每個部分（圓形組成）*/
.cloud-part {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    position: relative;
}

.cloud-part:nth-child(1) {
    width: 40px;
    height: 40px;
    margin-right: -15px;
}

.cloud-part:nth-child(2) {
    width: 50px;
    height: 50px;
    margin-right: -15px;
    z-index: 2;
}

.cloud-part:nth-child(3) {
    width: 35px;
    height: 35px;
}

/* 雲朵 1 - 從左到右，大雲 */
.cloud-1 {
    top: 15%;
    left: -15%;
    animation-duration: 25s;
    animation-delay: 0s;
    transform: scale(1.2);
}

/* 雲朵 2 - 從右到左，中雲 */
.cloud-2 {
    top: 55%;
    right: -15%;
    animation-duration: 30s;
    animation-delay: 5s;
    animation-name: floatCloudReverse;
    transform: scale(1);
}

/* 雲朵 3 - 從左到右，小雲 */
.cloud-3 {
    top: 35%;
    left: -12%;
    animation-duration: 35s;
    animation-delay: 10s;
    transform: scale(0.8);
}

/* 雲朵飄動動畫 - 從左到右 */
@keyframes floatCloud {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(calc(50vw - 50%)) translateY(-15px);
    }
    100% {
        transform: translateX(calc(120vw)) translateY(0);
    }
}

/* 雲朵飄動動畫 - 從右到左 */
@keyframes floatCloudReverse {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(calc(-50vw + 50%)) translateY(15px);
    }
    100% {
        transform: translateX(calc(-120vw)) translateY(0);
    }
}

/* 輕微上下浮動動畫 */
@keyframes slightBob {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

.character-image {
    position: relative;
    z-index: 1;
    width: 80%;
}

.character-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.15));
}

/* 3D 旋轉效果 */
.character-image.rotating img {
    transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
}

/* ===================================
   響應式設計
   =================================== */

/* 平板橫向 (1024px 以下) */
@media (max-width: 1024px) {
    .character-display {
        width: 70%;
    }
    
    .bottom-left-info {
        bottom: 100px;
        left: 30px;
    }
    
    .return-link {
        bottom: 30px;
        left: 30px;
    }
    
    .pickup-box {
        bottom: 30px;
        right: 30px;
        width: 260px;
    }
    
    .work-navigation {
        bottom: 30px;
    }
    
    .work-title {
        font-size: 2rem;
    }
}

/* 平板直向 / 大手機 (768px 以下) */
@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
    
    /* 手機版：使用 flexbox 控制順序 */
    .work-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: auto;
        padding-bottom: 40px;
    }
    
    /* 順序 1: 角色圖片 */
    .main-content {
        order: 1;
        position: static;
        height: auto;
        min-height: 50vh;
        padding: 20px 15px;
        width: 100%;
    }
    
    .character-display {
        width: 85%;
        max-width: 400px;
    }
    
    /* 順序 2: Info 區域 */
    .bottom-left-info {
        order: 2;
        position: static;
        width: 90%;
        max-width: 500px;
        margin: 20px auto;
        text-align: center;
        align-items: center;
        bottom: auto;
        left: auto;
    }
    
    .work-title {
        font-size: 1.8rem;
    }
    
    .work-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-item:not(:first-child)::before {
        content: none;
    }
    
    /* 順序 3: Pickup Message */
    .pickup-box {
        order: 3;
        position: static;
        width: 90%;
        max-width: 500px;
        margin: 20px auto;
        bottom: auto;
        right: auto;
    }
    
    /* 順序 4: Prev/Next 導航 */
    .work-navigation {
        order: 4;
        position: static;
        margin: 30px auto 20px;
        gap: 20px;
        pointer-events: auto;
        bottom: auto;
        left: auto;
        right: auto;
    }
    
    .nav-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* 順序 5: Back 按鈕（置中顯示）*/
    .return-link {
        order: 5;
        position: static;
        bottom: auto;
        left: auto;
        margin: 20px auto 40px;
        padding: 0.7rem 1.8rem;
        font-size: 0.85rem;
    }

    .cloud-part {
        width: 20px;
        height: 20px;
    }
    
    .cloud-part:nth-child(1) {
        width: 28px;
        height: 28px;
    }
    
    .cloud-part:nth-child(2) {
        width: 35px;
        height: 35px;
    }
    
    .cloud-part:nth-child(3) {
        width: 25px;
        height: 25px;
    }
    
    .cloud-1 {
        transform: scale(1);
    }
    
    .cloud-2 {
        transform: scale(0.8);
    }
    
    .cloud-3 {
        transform: scale(0.7);
    }
}

/* 手機 (480px 以下) */
@media (max-width: 480px) {
    body {
        padding-top: 70px;
    }
    
    .main-content {
        padding: 15px 10px;
        min-height: 40vh;
    }
    
    .character-display {
        width: 90%;
        max-width: 320px;
    }
    
    .bottom-left-info {
        width: 95%;
        margin: 15px auto;
    }
    
    .work-title {
        font-size: 1.5rem;
        text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.7);
    }
    
    .work-meta {
        font-size: 0.9rem;
        gap: 6px;
    }
    
    .pickup-box {
        width: 95%;
        padding: 12px 15px;
        margin: 15px auto;
    }
    
    .pickup-header {
        font-size: 1rem;
    }
    
    .message-box p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .work-navigation {
        margin: 20px auto 15px;
        gap: 15px;
    }
    
    .nav-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .nav-text {
        font-size: 0.75rem;
    }
    
    /* Back 按鈕 */
    .return-link {
        margin: 15px auto 30px;
        padding: 0.6rem 1.5rem;
        font-size: 0.8rem;
    }
    
    .return-arrow svg {
        width: 14px;
        height: 14px;
    }

    .cloud {
        filter: blur(0.5px);
    }
    
    .cloud-part {
        width: 15px;
        height: 15px;
        background: rgba(255, 255, 255, 0.4);
    }
    
    .cloud-part:nth-child(1) {
        width: 20px;
        height: 20px;
        margin-right: -8px;
    }
    
    .cloud-part:nth-child(2) {
        width: 25px;
        height: 25px;
        margin-right: -8px;
    }
    
    .cloud-part:nth-child(3) {
        width: 18px;
        height: 18px;
    }
    
    .cloud-1 {
        animation-duration: 20s;
        transform: scale(0.9);
    }
    
    .cloud-2 {
        animation-duration: 25s;
        transform: scale(0.7);
    }
    
    .cloud-3 {
        animation-duration: 30s;
        transform: scale(0.6);
    }
}

/* 超小手機 (360px 以下) */
@media (max-width: 360px) {
    .work-title {
        font-size: 1.3rem;
    }
    
    .work-meta {
        font-size: 0.85rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .return-link {
        padding: 0.5rem 1.2rem;
        font-size: 0.75rem;
    }
    
    .pickup-box {
        padding: 10px 12px;
    }
    
    .pickup-header {
        font-size: 0.95rem;
    }
    
    .message-box p {
        font-size: 0.8rem;
    }
}
