
:root {
    --primary-color: #D4A76A;  /* 砂糖色 */
    --secondary-color: #F5E6C8;  /* 米色 */
    --accent-color: #A0522D;  /* 紅糖色 */
    --text-color: #333;
    --light-bg: #FFFDF9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft JhengHei', '微軟正黑體', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}


.progress-container {
    width: 100%;
    height: 8px;
    background-color: #f1f1f1;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s;
}


header {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('assets/header-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.scroll-down {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
}

.scroll-down span {
    display: block;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    margin: -10px;
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-10px, -10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) translate(10px, 10px);
    }
}


.tab-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 5px;
}

.tab {
    padding: 12px 25px;
    background-color: var(--secondary-color);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    border-radius: 5px 5px 0 0;
    transform: translateY(0);
}

.tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.tab.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.tab-content.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

h3 {
    color: var(--accent-color);
    margin: 20px 0 15px;
}

.icon {
    margin-right: 8px;
}


.fun-fact {
    background-color: var(--secondary-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.fun-fact:hover {
    transform: scale(1.02);
}

.fun-fact img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.fun-fact img:hover {
    transform: scale(1.03);
}

.quick-info ul {
    list-style-type: none;
    padding-left: 0;
}

.quick-info li {
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
    transition: padding-left 0.3s;
}

.quick-info li:hover {
    padding-left: 10px;
}


.timeline-story {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 20px 0;
}

.time-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.5s ease;
}

.time-card.animate__animated {
    opacity: 1;
    transform: translateX(0);
}

.year {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 3px;
    transition: transform 0.3s;
}

.time-card:hover .year {
    transform: scale(1.1);
}

.time-card .content {
    flex-grow: 1;
}

.did-you-know {
    background-color: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #6ab0f3;
}


.exploration-game {
    background-color: #f9f4e6;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    transition: box-shadow 0.3s;
}

.exploration-game:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.clue-box {
    background-color: white;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
}

.before-after {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.before-after > div {
    flex: 1;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.before-after > div.animate__animated {
    opacity: 1;
    transform: translateY(0);
}

.before-after img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.before-after img:hover {
    transform: scale(1.03);
}

.before-after p {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}


.science-box {
    background-color: #f9f5f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border-left: 5px solid var(--accent-color);
}

.process-steps {
    counter-reset: step;
    padding-left: 0;
    margin-top: 15px;
}

.process-steps li {
    list-style: none;
    position: relative;
    padding: 10px 0 10px 40px;
    border-bottom: 1px dashed #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.process-steps li:hover {
    background-color: #fff8e8;
    transform: translateX(5px);
}

.process-steps li:before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 10px;
    background-color: var(--primary-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    font-size: 14px;
    transition: transform 0.3s;
}

.process-steps li:hover:before {
    transform: scale(1.1);
}


.sugar-process-animation {
    background-color: #f9f5f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.animation-container {
    position: relative;
    height: 200px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}


.sugarcane, .juice, .syrup, .sugar-crystals, .final-sugar {
    position: absolute;
    transition: all 1s ease;
}

.sugarcane {
    width: 30px;
    height: 100px;
    background-color: #2e8b57;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    border-radius: 5px;
}

.juice {
    width: 80px;
    height: 40px;
    background-color: #f5e6a4;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    border-radius: 5px;
}

.syrup {
    width: 60px;
    height: 30px;
    background-color: #d4a76a;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    border-radius: 5px;
}

.sugar-crystals {
    width: 100px;
    height: 50px;
    background-image: radial-gradient(circle, white 10%, transparent 10%),
                      radial-gradient(circle, white 10%, transparent 10%);
    background-size: 20px 20px;
    background-color: #f5e6c8;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    opacity: 0;
    border-radius: 5px;
}

.final-sugar {
    width: 80px;
    height: 40px;
    background-color: white;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    opacity: 0;
    border-radius: 5px;
}

.animation-controls {
    margin-top: 15px;
}

.animation-controls button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.animation-controls button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}


.process-steps li.highlighted {
    background-color: #fff8e8;
    font-weight: bold;
}


.activity-cards {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
    width: 100%;
}

.card {
    flex: 1;
    min-width: 250px;
    max-width: calc(50% - 10px);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

.card.animate__animated {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.card:hover img {
    transform: scale(1.05);
}

.card h3 {
    margin: 10px 15px 5px;
    color: var(--accent-color);
}

.card p {
    margin: 0 15px 15px;
    font-size: 14px;
    color: #666;
}

.card button {
    width: calc(100% - 30px);
    margin: 0 15px 15px;
    padding: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.card button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}


.quiz-container {
    background-color: #f9f9f9;
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    transition: transform 0.3s;
}

.quiz-container:hover {
    transform: translateX(5px);
}

.quiz-question {
    font-weight: bold;
    margin-bottom: 10px;
}

.quiz-options {
    margin-left: 20px;
}

.quiz-option {
    margin-bottom: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.quiz-option:hover {
    background-color: #eee;
    transform: translateX(5px);
}

.quiz-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    display: none;
    font-size: 14px;
}

.quiz-feedback.correct {
    background-color: #d4edda;
    color: #155724;
}

.quiz-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
}


.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-popup:hover {
    color: var(--accent-color);
}


footer {
    text-align: center;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
    font-size: 14px;
}

.social-links {
    margin-top: 15px;
}

.social-icon {
    display: inline-block;
    margin: 0 10px;
    font-size: 1.2rem;
    color: white;
    transition: transform 0.3s;
}

.social-icon:hover {
    transform: translateY(-3px);
}


@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tab {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .before-after {
        flex-direction: column;
    }
    
    .activity-cards {
        flex-direction: column;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
    }
}


@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-52%) rotate(-5deg); }
    75% { transform: translateX(-48%) rotate(5deg); }
}

@keyframes bubble {
    0% { box-shadow: 0 0 0 0 rgba(212, 167, 106, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(212, 167, 106, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 167, 106, 0); }
}

@keyframes glow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}
