/* Modern Retro Style for Windsurf Website - Responsive Optimized */
:root {
    --primary-blue: #000080;
    --nav-bg: rgba(255, 255, 255, 0.1);
    --glass-gradient: linear-gradient(to bottom, #7abcff 0%, #4096ee 50%, #1152af 51%, #207ce5 100%);
    --glass-hover: linear-gradient(to bottom, #a0d0ff 0%, #60a6f0 50%, #2162bf 51%, #308cf5 100%);
}

body {
    margin: 0;
    padding: 0;
    font-family: "標楷體", "DFKai-SB", serif;
    background-image: url('files/image001.jpg');
    background-attachment: fixed;
    background-repeat: repeat;
    color: var(--primary-blue);
}

/* Layout Grid */
.container {
    display: grid;
    grid-template-areas: 
        "header header"
        "nav main"
        "footer footer";
    grid-template-columns: 160px 1fr; /* 縮小側邊欄寬度從 200px 到 160px */
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.is-edge .container {
    background: rgba(255, 255, 255, 0.85);
}

/* Header Section */
header {
    grid-area: header;
    padding: 10px 0;
    display: flex;
    flex-direction: column; /* 垂直堆疊：Banner -> 語言列 -> 跑馬燈 */
    align-items: center;
    border-bottom: 2px ridge #fff;
}

header img.banner {
    max-width: 100%;
    height: auto;
}

.header-nav-wrapper {
    display: flex;
    flex-direction: row; /* 強制水平排列 */
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
    width: 100%;
}

.header-nav-wrapper .nav-button {
    width: 60px !important;
    height: 28px;
    line-height: 28px;
    font-size: 13px;
    margin-bottom: 0;
}

/* Marquee Simulation */
.marquee-container {
    width: 100%; 
    background-color: #e5ff30;
    border: 2px ridge #ccc;
    overflow: hidden;
    white-space: nowrap;
    margin-top: 5px;
    padding: 5px;
}

.marquee-text {
    display: inline-block;
    font-size: 18pt;
    color: #4324de;
    letter-spacing: 2pt;
    animation: marquee 15s linear infinite alternate;
}

@keyframes marquee {
    from { transform: translateX(0%); }
    to { transform: translateX(50%); }
}

/* Navigation Section */
nav {
    grid-area: nav;
    padding: 20px;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.nav-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    display: block;
}

.nav-button {
    display: block;
    width: 140px;
    height: 30px;
    line-height: 30px;
    margin-bottom: 12px;
    background: var(--glass-gradient);
    border-radius: 15px;
    color: white;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.5);
    transition: all 0.2s;
    border: 1px solid #054a91;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-button:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.6);
}

/* Header Navigation Buttons */
.header-nav-wrapper .nav-button {
    display: inline-block;
    width: 60px;
    margin-bottom: 0;
}

/* Main Content Section */
main {
    grid-area: main;
    padding: 30px;
    line-height: 1.6;
}

main h1 {
    font-size: 24pt;
    margin-bottom: 20px;
}

.content-img, .myth-img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border: 5px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Video Responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 20px;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Footer Section */
footer {
    grid-area: footer;
    padding: 15px;
    text-align: center;
    background: rgba(128, 0, 128, 0.1);
    color: #800080;
    font-weight: bold;
    border-top: 2px ridge #fff;
}

/* --- Mobile Responsive Optimizations --- */
@media (max-width: 1080px) { /* 提高斷點以包含大螢幕手機橫向模式 */
    .container {
        grid-template-areas: 
            "header"
            "nav"
            "main"
            "footer";
        grid-template-columns: 1fr;
    }

    header {
        padding: 10px;
    }

    .header-nav-wrapper {
        text-align: center !important;
        margin-top: 10px;
        display: flex;
        justify-content: center;
        gap: 5px;
        flex-wrap: wrap;
    }

    .header-nav-wrapper .nav-button {
        width: 60px !important;
        margin-bottom: 5px;
    }

    nav {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 5px !important;
        padding: 10px !important;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .nav-logo {
        display: none !important;
    }

    /* 預設橫向模式 (或寬螢幕手機): 二分之一寬度 */
    nav .nav-button, .anchor-nav a {
        width: calc(50% - 10px) !important;
        display: inline-block !important;
        min-width: 0 !important;
        margin: 2px !important;
        font-size: 14px;
        height: 35px;
        line-height: 35px;
        box-sizing: border-box;
    }

    .anchor-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }

    main {
        padding: 15px;
    }

    main h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .content-img, .myth-img {
        float: none !important;
        display: block;
        margin: 0 auto 20px auto !important;
        width: 100% !important;
    }
}

/* 手機直向模式 (Portrait, < 480px): 四分之一寬度 */
@media (max-width: 480px) {
    nav .nav-button, .anchor-nav a {
        width: calc(25% - 5px) !important;
        font-size: 11px !important;
        height: 28px !important;
        line-height: 28px !important;
        padding: 0 !important;
    }
    
    .marquee-text {
        font-size: 12pt !important;
    }
}
