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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 85%;
    max-width: 1100px;
    margin: auto;
    overflow: hidden;
    padding: 2rem 0;
}

/* Navigation Bar */
header {
    background: #003366;
    color: #fff;
    padding: 1.5rem 0;
    border-bottom: 4px solid #00509e;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.logo-text h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.logo-text p {
    color: #a0c4ff;
    font-size: 0.9rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    padding-bottom: 5px;
    transition: color 0.3s;
}

nav a:hover {
    color: #a0c4ff;
    border-bottom: 2px solid #a0c4ff;
}

/* Page Content */
main {
    flex: 1;
}

.page-title {
    color: #003366;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.hero {
    background: #fff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.hero h2 {
    color: #00509e;
    margin-bottom: 1rem;
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card h3, .card h4 {
    color: #00509e;
    margin-bottom: 10px;
}

/* Publications List */
.pub-year {
    color: #003366;
    margin: 30px 0 15px 0;
    font-size: 1.4rem;
}

.pub-list {
    list-style: none;
}

/* 🌟 幫你修復了這個斷掉的語法 */
.pub-list li {
    background: transparent; 
}

/* ========== 手機版排版：終極全站統一版 (按鈕換行) ========== */
@media (max-width: 768px) {
    /* 1. 破解外層限制 */
    body, html {
        overflow-x: hidden; 
    }
    .container {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }
    
    /* 2. Logo 區塊置中 */
    header .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding-top: 20px !important;
    }
    .logo-text h1 { font-size: 1.6rem !important; margin-bottom: 5px !important; }
    .logo-text p { font-size: 0.85rem !important; margin-bottom: 15px !important; }

    /* 3. 選單區塊變成「自動換行的按鈕」 */
    nav { width: 100% !important; }
    nav ul {
        display: flex !important;
        flex-wrap: wrap !important; /* 🌟 允許按鈕掉到第二行 */
        justify-content: center !important; /* 保持置中 */
        gap: 10px !important; /* 按鈕間距 */
        padding: 10px 0 !important;
        margin: 0 !important;
    }
    nav ul li {
        margin: 0 !important;
    }
    nav ul li a {
        display: block !important;
        background-color: rgba(255,255,255,0.15) !important;
        border: 1px solid rgba(255,255,255,0.4) !important;
        padding: 10px 15px !important; 
        border-radius: 8px !important;
        font-size: 0.95rem !important;
        white-space: nowrap !important;
    }
}
