/*
======================================================================
                        COMMON STYLES - 共用樣式檔案
======================================================================
此檔案包含所有頁面共用的樣式，包括：
- 全域設定和變數
- 基礎佈局
- 導航列
- 頁腳
- 動畫效果
- 通用元件
======================================================================
*/

/* --- 0. Global Settings & Variables --- */
:root {
    --navbar-height: 70px;
    --tech-blue: #0a84ff;
    --tech-cyan: #64d2ff;
    --dark-bg: #0d1117;
    --light-bg: #161b22;
    --text-color: #c9d1d9;
    --nav-bg: rgba(22, 27, 34, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* --- 1. Base & Layout Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden; 
}

#page-content {
    scroll-margin-top: var(--navbar-height);
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: justify;
}

.page-container h1 {
    font-size: 2.5rem;
    color: var(--tech-cyan);
    margin-bottom: 1rem;
    text-align: center;
}

.page-container p {
    font-size: 1.2rem;
    color: rgba(162, 201, 255, 0.928);
    margin: 0;
    font-style: italic;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    margin-bottom: 1.3rem;
    margin-top: 1.3rem;
}


.table-container {
    overflow-x: visible;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    background-color: var(--light-bg);
    border-radius: 8px;
    margin-top: 2rem;
}

/* --- 2. Keyframes & Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpImage {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 3. Reusable Components --- */

/* Action Buttons */
.action-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.action-btn {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--dark-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    background-color: var(--tech-cyan);
    color: var(--dark-bg);
    box-shadow: 0 4px 10px rgba(100, 210, 255, 0.2);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 50px;
    height: 50px;
    background-color: var(--light-bg);
    border: 2px solid var(--tech-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: gentle-float 3s ease-in-out infinite;
}

.back-to-top-btn i {
    color: var(--tech-cyan);
    font-size: 18px;
    transition: color 0.3s ease;
}

.back-to-top-btn:hover {
    background-color: var(--tech-cyan);
}

.back-to-top-btn:hover i {
    color: var(--dark-bg);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 2rem 0;
    user-select: none;
}

.pagination-btn {
    background-color: var(--light-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--tech-cyan);
    color: var(--dark-bg);
    border-color: var(--tech-cyan);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-jump-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 10px;
}

#page-info,
#page-info-honor,
#page-info-highlight,
#page-info-project,
#page-info-work {
    font-size: 0.9rem;
    color: rgba(201, 209, 217, 0.8);
    line-height: 36px;
}

#page-input,
#page-input-honor,
#page-input-highlight,
#page-input-project,
#page-input-work {
    width: 60px;
    text-align: center;
    background-color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    height: auto;
    line-height: normal;
    appearance: textfield;
    -moz-appearance: textfield;
}

#page-input::-webkit-outer-spin-button,
#page-input::-webkit-inner-spin-button,
#page-input-honor::-webkit-outer-spin-button,
#page-input-honor::-webkit-inner-spin-button,
#page-input-highlight::-webkit-outer-spin-button,
#page-input-highlight::-webkit-inner-spin-button,
#page-input-project::-webkit-outer-spin-button,
#page-input-project::-webkit-inner-spin-button,
#page-input-work::-webkit-outer-spin-button,
#page-input-work::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- 4. Header & Navigation --- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px var(--shadow-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links i {
    margin-right: 0.5em; /* 或 8px，依需求調整 */
    vertical-align: middle;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--navbar-height);
    display: flex;
    justify-content: center;
    position: relative;
}

.nav-header {
    display: none;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.nav-links li {
    position: relative;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    border-radius: 50px;
    overflow: hidden;
}

.nav-links li:hover > a,
.nav-links li.active-link > a {
    color: #ffffff;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(to right, var(--tech-blue), var(--tech-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
}

.nav-links li:hover > a::before,
.nav-links li.active-link > a::before {
    transform: scaleX(1);
}

.nav-cv a {
    border: 2px solid var(--tech-cyan);
    border-radius: 50px;
    color: #55b0d7;
}

.nav-cv a:hover {
    border-color: #ffffff;
}

.dropdown-arrow {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.nav-item-dropdown:hover .dropdown-arrow {
    transform: rotate(225deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--light-bg);
    list-style: none;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 10;
    min-width: 180px;
}

.nav-item-dropdown:hover > .dropdown-menu {
    display: block;
    top: 100%;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    top: 100%;
}

.dropdown-menu li {
    padding: 0;
    border: none;
    width: 100%;
}

.dropdown-menu li a {
    font-weight: 400;
    padding: 12px 10px;
    color: #ffffff;
    justify-content: center;
    text-align: center;
    border-radius: 0;
}

.dropdown-menu li a::before {
    display: none;
}

.dropdown-menu > li:hover {
    background-color: rgba(100, 210, 255, 0.1);
}

.dropdown-menu > li:hover > a {
    color: var(--tech-cyan);
}

.dropdown-menu .nav-item-dropdown {
    position: relative;
}

.dropdown-menu .dropdown-submenu {
    position: absolute;
    left: 100%;
    top: -10px !important;
    transform: translateX(0);
    background-color: var(--light-bg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 11;
}

.dropdown-menu .nav-item-dropdown.is-open > .dropdown-submenu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu .nav-item-dropdown > a .dropdown-arrow {
    transform: rotate(-45deg);
    margin-left: 8px;
}

.dropdown-menu .nav-item-dropdown.is-open > a .dropdown-arrow {
    transform: rotate(45deg);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    width: 45px;
    height: 45px;
    position: relative;
}

.hamburger-btn span {
    display: block;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    position: absolute;
    right: 8px;
    transform-origin: center;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hamburger-btn span:nth-child(1) {
    top: 13px;
    width: 20px;
}

.hamburger-btn span:nth-child(2) {
    top: 21px;
    width: 28px;
    transition-delay: 0.1s;
}

.hamburger-btn span:nth-child(3) {
    top: 29px;
    width: 20px;
}

.hamburger-btn.is-active span:nth-child(2) {
    transform: scaleX(0);
    opacity: 0;
}

.hamburger-btn.is-active span:nth-child(1),
.hamburger-btn.is-active span:nth-child(3) {
    top: 21px;
    width: 28px;
}

.hamburger-btn.is-active span:nth-child(1) {
    transform: rotate(45deg);
    transition-delay: 0.1s;
}

.hamburger-btn.is-active span:nth-child(3) {
    transform: rotate(-45deg);
    transition-delay: 0.1s;
}

/* --- 5. Footer --- */
.site-footer {
    padding: 2.5rem 0;
    text-align: center;
    background-color: var(--dark-bg);
}

.site-footer p {
    color: rgba(201, 209, 217, 0.6);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* --- 6. Responsive Styles --- */
@media (max-width: 1200px) {
    .nav-container {
        justify-content: flex-start;
    }

    .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        color: inherit;
        text-decoration: none;
    }

    .mobile-logo { 
        height: 35px; 
    }

    .site-title {
        font-size: 1.2rem;
        font-weight: 600;
        background: linear-gradient(90deg, var(--tech-blue), var(--tech-cyan));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 80dvw;
        max-width: 280px;
        height: 100dvh;
        background-color: var(--light-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        padding-top: 100px;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
    }

    .nav-links.is-active {
        transform: translateX(0);
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0;
        margin: 0;
    }

    .nav-links > li > a {
        padding: 15px 20px;
        border-radius: 0;
        margin: 0;
    }

    .nav-links > li > a::before {
        border-radius: 0;
    }

    .nav-item-dropdown {
        width: 100%;
        flex-wrap: wrap; 
    }

    .nav-item-dropdown .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        min-width: unset;
        background-color: rgba(0, 0, 0, 0.2);
        box-shadow: inset 0 3px 8px rgba(0,0,0,0.3);
        border: none;
        border-radius: 0;
        margin-top: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
        display: block; /* 行動版預設 block，由 JS 控制 max-height */
        transition: max-height 0.4s ease-out, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out;
    }

    .nav-item-dropdown.is-open > .dropdown-menu {
        max-height: 500px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .dropdown-menu .dropdown-submenu {
        position: static;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.3);
        box-shadow: inset 0 3px 8px rgba(0,0,0,0.4);
        border-radius: 0;
        max-height: 0;
        padding: 0;
        transform: none !important;
        top: auto !important;
        left: auto !important;
    }
    
    .dropdown-menu .nav-item-dropdown.is-open > .dropdown-submenu {
        max-height: 500px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-item-dropdown.is-open .dropdown-arrow {
        transform: rotate(225deg);
    }

    .dropdown-menu .nav-item-dropdown > a .dropdown-arrow {
        transform: rotate(45deg);
    }
    
    .dropdown-menu .nav-item-dropdown.is-open > a .dropdown-arrow {
        transform: rotate(225deg);
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 4rem 1rem;
    }

    .page-container h1 {
        font-size: 2.5rem;
    }

    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .page-jump-section {
        order: 1;
        flex-basis: 100%;
        justify-content: center;
        margin: 0;
    }

    .pagination-btn {
        order: 2;
    }

    #page-info,
    #page-info-honor,
    #page-info-highlight,
    #page-info-project,
    #page-info-work {
        display: inline-block !important;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 1rem 0;
    }
    
    .site-footer p {
        font-size: 0.65rem !important;
    }
}

/* --- 7. Utility Classes --- */
.text-center {
    text-align: center;
}

.text-muted {
    color: #8b949e;
}

.hidden {
    display: none;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
    margin-bottom: 0.3rem;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.fw-medium {
    font-weight: 500;
}

.fw-bold {
    font-weight: 700;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

/* --- 8. Common Modal Styles --- */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.custom-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--dark-bg) 100%);
    border-radius: 12px;
    padding: 2rem;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 210, 255, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-title {
    color: var(--tech-cyan);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-body {
    margin-bottom: 2rem;
}

.modal-message {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-cyan));
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(10, 132, 255, 0.4);
}

.modal-btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid rgba(201, 209, 217, 0.3);
}

.modal-btn-secondary:hover {
    background-color: rgba(201, 209, 217, 0.1);
    border-color: rgba(201, 209, 217, 0.5);
}

/* --- 9. Author Highlight --- */
.author-highlight {
    background-color: transparent !important;
    color: var(--tech-cyan) !important;
    padding: 0 !important;
    font-weight: bold !important;
    text-shadow: 
        0 0 3px rgba(100, 210, 255, 0.6),
        0 0 6px rgba(100, 210, 255, 0.3);
    animation: breathing-glow 2.5s ease-in-out infinite;
}

@keyframes breathing-glow {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 
            0 0 3px rgba(100, 210, 255, 0.6),
            0 0 6px rgba(100, 210, 255, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 0 5px rgba(100, 210, 255, 0.9),
            0 0 10px rgba(100, 210, 255, 0.5),
            0 0 15px rgba(100, 210, 255, 0.2);
    }
}

/* --- 10. Generic Table Styles --- */
.publication-table,
.publication-table tbody {
    display: block;
    width: 100%;
    position: relative;
}

.publication-table {
    border-collapse: collapse;
    margin-top: 1rem;
}

.publication-table thead {
    display: none;
}

.publication-table tr {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: var(--light-bg);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication-table tr:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.publication-table td {
    padding: 0;
    border: none;
    display: block;
}

.publication-table td::before {
    display: none;
}

.publication-table td[data-label="#"] {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tech-cyan);
    line-height: 1;
}

.publication-table td[data-label="Title"] {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin-top: -0.5rem;
}

.publication-table td[data-label="Links"] {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.publication-table td[data-label="Links"]::before {
    content: 'Links:';
    display: inline-block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    white-space: nowrap;
}

/* --- 11. Common Control Styles --- */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

/* --- 改進的篩選選單樣式 --- */
.filter-bar {
    display: flex;
    flex-wrap: nowrap; /* 強制不換行 */
    gap: 12px; /* 桌面版較大間距 */
    justify-content: center; /* 居中對齊 */
    align-items: center;
    background: none; /* 移除背景 */
    border: none; /* 移除邊框 */
    border-radius: 0; /* 移除圓角 */
    padding: 0; /* 移除內邊距 */
    width: 100%;
    max-width: 100%; /* 確保不超過容器寬度 */
    overflow-x: auto; /* 如果內容太寬可以橫向滾動 */
    overflow-y: hidden;
    /* 隱藏滾動條但保持功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.filter-bar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.filter-bar button {
    background-color: var(--light-bg); /* 給每個按鈕背景色 */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 給每個按鈕邊框 */
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 25px; /* 圓角按鈕 */
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 0 0 auto; /* 不允許按鈕縮小，保持原始大小 */
    white-space: nowrap; /* 防止文字換行 */
    min-width: fit-content; /* 確保按鈕有足夠寬度 */
    font-size: 0.9rem;
}

.filter-bar button.active {
    background: linear-gradient(90deg, var(--tech-blue), var(--tech-cyan));
    color: var(--dark-bg);
    box-shadow: 0 2px 8px rgba(0, 162, 255, 0.2);
}

.filter-bar button:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 大螢幕優化 */
@media (min-width: 1200px) {
    .filter-bar {
        gap: 16px; /* 更大螢幕上更大的間距 */
    }
    
    .filter-bar button {
        padding: 12px 24px; /* 稍微增加按鈕大小 */
        font-size: 0.95rem;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .filter-bar {
        gap: 14px; /* 中大螢幕適中間距 */
    }
    
    .filter-bar button {
        padding: 11px 22px;
        font-size: 0.92rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .filter-bar {
        gap: 10px; /* 平板尺寸間距 */
    }
}

/* 手機版特殊樣式 - 增加按鈕之間的左右間距 */
@media (max-width: 768px) {
    .filter-bar {
        gap: 12px; /* 大幅增加按鈕之間的間距 */
        justify-content: center;
        padding: 0 15px;
        flex-wrap: wrap;
        row-gap: 12px;
    }
    
    .filter-bar button {
        padding: 12px 28px;
        font-size: 0.9rem;
        min-width: 85px;
        border-radius: 50px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 650px) {
    .filter-bar {
        gap: 10px; /* 增加間距 */
        padding: 0 10px;
        row-gap: 10px;
    }
    
    .filter-bar button {
        padding: 11px 26px;
        font-size: 0.85rem;
        min-width: 80px;
        border-radius: 50px;
        display: flex;
    }
}

@media (max-width: 600px) {
    .filter-bar {
        gap: 8px; /* 增加間距 */
        padding: 0 8px;
        row-gap: 10px;
    }
    
    .filter-bar button {
        padding: 11px 24px;
        font-size: 0.8rem;
        min-width: 75px;
        border-radius: 50px;
        display: flex;
    }
}

@media (max-width: 550px) {
    .filter-bar {
        gap: 7px; /* 增加間距 */
        padding: 0 5px;
        row-gap: 8px;
    }
    
    .filter-bar button {
        padding: 11px 24px;
        font-size: 0.78rem;
        min-width: 70px;
        border-radius: 50px;
        display: flex;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        gap: 10px; /* 增加間距，避免太擠 */
        row-gap: 8px;
    }
    
    .filter-bar button {
        padding: 11px 22px;
        font-size: 0.75rem;
        min-width: 60px;
        border-radius: 50px;
        display: flex;
    }
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}
/* 移除不需要的滑動提示和偽元素 */
.controls-container {
    position: relative;
}

/* 添加相對定位以支持偽元素 */
.controls-container {
    position: relative;
}

.search-container {
    width: 100%;
    position: relative;
}

.search-container input {
    background-color: var(--light-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 12px 20px;
    color: var(--text-color);
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-container input:focus {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.2);
}

.search-container i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(201, 209, 217, 0.5);
    pointer-events: none;
}

/* 
   在您現有的 common.css 檔案最底部添加以下樣式
   這些是分類標籤的樣式，用於 works 頁面顯示 Academic 和 Industry 分類
*/

/* --- 12. Category Badge Styles for Works Page --- */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.category-academic {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.category-industry {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* 分類標籤動畫效果 */
.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .category-badge {
        display: block;
        margin: 4px 0 0 0;
        text-align: center;
        max-width: fit-content;
    }
}

/* 
   在您現有的 common.css 檔案最底部添加以下樣式
   這些是所有頁面的分類標籤樣式
*/

/* --- 12. Category Badge Styles for All Pages --- */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

/* Honors 頁面分類 */
.category-competition {
    background-color: rgba(255, 140, 0, 0.2);
    color: #ffa726;
    border: 1px solid rgba(255, 140, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.1);
}

.category-invention {
    background-color: rgba(106, 90, 205, 0.2);
    color: #9c88ff;
    border: 1px solid rgba(106, 90, 205, 0.4);
    box-shadow: 0 0 8px rgba(106, 90, 205, 0.1);
}

.category-award {
    background-color: rgba(255, 215, 0, 0.2);
    color: #ffeb3b;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.1);
}

.category-certification {
    background-color: rgba(0, 229, 255, 0.2);  /* 改為更科技的青色 */
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
}

.category-pitch {
    background-color: rgba(233, 30, 99, 0.2);  /* 調整為更鮮明的粉色 */
    color: #ff4081;
    border: 1px solid rgba(233, 30, 99, 0.4);
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.1);
}

.category-other {
    background-color: rgba(76, 175, 80, 0.2);  /* 改為綠色系更有科技感 */
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.1);
}

/* Publications 頁面分類 */
.category-journal {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.4);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.1);
}

.category-conference {
    background-color: rgba(255, 140, 0, 0.2);
    color: #ff8c00;
    border: 1px solid rgba(255, 140, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.1);
}

.category-book {
    background-color: rgba(111, 66, 193, 0.2);
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.4);
    box-shadow: 0 0 8px rgba(111, 66, 193, 0.1);
}

.category-preprint {
    background-color: rgba(32, 201, 151, 0.2);
    color: #20c997;
    border: 1px solid rgba(32, 201, 151, 0.4);
    box-shadow: 0 0 8px rgba(32, 201, 151, 0.1);
}

/* Projects 頁面分類 */
.category-research {
    background-color: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.1);
}

.category-development {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.4);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.1);
}

.category-collaboration {
    background-color: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border: 1px solid rgba(138, 43, 226, 0.4);
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.1);
}


/* Works 頁面分類 */
.category-academic {
    background-color: rgba(111, 66, 193, 0.2);
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.4);
    box-shadow: 0 0 8px rgba(111, 66, 193, 0.1);
}

.category-industry {
    background-color: rgba(255, 140, 0, 0.2);
    color: #ff8c00;
    border: 1px solid rgba(255, 140, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.1);
}



/* Highlights 頁面分類 */
.category-talk {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.4);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.1);
}

.category-instruction {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.4);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.1);
}

.category-media {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.4);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.1);
}

/* 分類標籤動畫效果 */
.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .category-badge {
        display: block;
        margin: 4px 0 0 0;
        text-align: center;
        max-width: fit-content;
    }
}

/* --- 13. Custom Scrollbar Styles --- */

/* --- 完整的漸層標題樣式（圖標+文字統一漸層）--- */

/* 統一的標題樣式 - 整個標題（圖標+文字）一起漸層 */
body .page-container h1,
.honor-page .page-container h1,
.schedule-section h1,
.page-container h1 {
    /* 漸層效果套用到整個標題 */
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-cyan)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    
    /* 基本樣式 */
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
    font-weight: 700 !important;
    
    /* 置中效果 */
    display: block !important;
    text-align: center !important;
    width: 100% !important;
}

/* 圖標樣式 - 繼承父元素的漸層，不單獨設定 */
body .page-container h1 i,
.honor-page .page-container h1 i,
.schedule-section h1 i,
.page-container h1 i {
    margin-right: 0.5rem !important;
    font-size: 0.9em !important;
    /* 移除圖標的獨立漸層設定，讓它繼承父元素 */
    background: inherit !important;
    -webkit-background-clip: inherit !important;
    -webkit-text-fill-color: inherit !important;
    background-clip: inherit !important;
    color: inherit !important;
}

/* 如果 CSS 變數不work，使用具體顏色值 */
.page-container h1.fallback-gradient {
    background: linear-gradient(135deg, #0a84ff, #64d2ff) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
}

/* 瀏覽器兼容性降級 */
@supports not (-webkit-background-clip: text) {
    body .page-container h1,
    .honor-page .page-container h1,
    .schedule-section h1,
    .page-container h1 {
        color: var(--tech-cyan) !important;
        background: none !important;
        -webkit-text-fill-color: unset !important;
    }
    
    body .page-container h1 i,
    .honor-page .page-container h1 i,
    .schedule-section h1 i,
    .page-container h1 i {
        color: var(--tech-cyan) !important;
        background: none !important;
        -webkit-text-fill-color: unset !important;
    }
}

/* 動畫漸層選項（如果需要） */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.page-container h1.animated-gradient {
    background: linear-gradient(45deg, var(--tech-blue), var(--tech-cyan), var(--tech-blue)) !important;
    background-size: 200% 200% !important;
    animation: gradient-shift 3s ease-in-out infinite;
}

/* 響應式調整 */
@media (max-width: 768px) {
    body .page-container h1,
    .honor-page .page-container h1,
    .schedule-section h1,
    .page-container h1 {
        font-size: 2.2rem !important;
    }
}

@media (max-width: 600px) {
    body .page-container h1,
    .honor-page .page-container h1,
    .schedule-section h1,
    .page-container h1 {
        font-size: 2rem !important;
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 圖標樣式配合您的設計風格 */
.page-container h1 i {
    margin-right: 0.5rem;
    font-size: 0.9em;
    /* 選項 1: 圖標使用相同漸層 */
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 選項 2: 圖標使用純色 (更清晰) */
.page-container h1 i.solid-icon {
    color: var(--tech-cyan); /* 使用您定義的主色 */
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

/* 選項 3: 圖標有光暈效果 (配合您的 breathing-glow) */
.page-container h1 i.glow-icon {
    color: var(--tech-cyan);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-shadow: 
        0 0 5px rgba(100, 210, 255, 0.6),
        0 0 10px rgba(100, 210, 255, 0.3);
    animation: breathing-glow 2.5s ease-in-out infinite;
}

/* 確保在較老的瀏覽器中有降級方案 */
@supports not (-webkit-background-clip: text) {
    .page-container h1 {
        color: #64d2ff !important; /* 降級為具體顏色值 */
        background: none !important;
        -webkit-text-fill-color: unset !important;
    }
    
    .page-container h1 i {
        color: #64d2ff !important;
        background: none !important;
        -webkit-text-fill-color: unset !important;
    }
}

/* 如果您的 common.css 中有覆蓋樣式，用這個更強的選擇器 */
.page-container.gradient-titles h1 {
    background: linear-gradient(135deg, #0a84ff, #64d2ff) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    display: inline-block;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .page-container h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .page-container h1 {
        font-size: 2rem;
    }
}

/* === 小屏幕響應式修正 (992px 以下) === */
@media (max-width: 992px) {
    /* 確保所有時間軸內容左對齊 */
    .timeline-item .timeline-content {
        text-align: left !important;
    }
    
    /* 日期標籤左對齊 */
    .timeline-date {
        text-align: left !important;
        display: inline-block !important;
        margin-bottom: 0.75rem;
    }
    
    /* 科系名稱左對齊 */
    .timeline-content h3 {
        text-align: left !important;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    /* 學校名稱左對齊 */
    .timeline-school-name {
        text-align: left !important;
        font-style: italic;
        margin-bottom: 1.25rem;
        opacity: 0.9;
    }
    
    /* GPA 資訊左對齊 */
    .timeline-gpa {
        text-align: left !important;
        display: inline-block !important;
        margin-bottom: 0.75rem;
    }
    
    /* 確保其他段落內容也左對齊 */
    .timeline-content p {
        text-align: left !important;
    }
    
    /* 移除原本的奇偶數對齊規則在小屏幕上的影響 */
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        text-align: left !important;
    }
    
    .timeline-item:nth-child(odd) .timeline-content h3,
    .timeline-item:nth-child(even) .timeline-content h3 {
        text-align: left !important;
    }
    
    .timeline-item:nth-child(odd) .timeline-school-name,
    .timeline-item:nth-child(even) .timeline-school-name {
        text-align: left !important;
    }
}

/* === 平板屏幕優化 (768px 以下) === */
@media (max-width: 768px) {
    /* 保持左對齊並調整間距 */
    .timeline-content {
        padding: 1.5rem !important;
        text-align: left !important;
    }
    
    /* 調整日期標籤樣式 */
    .timeline-date {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
        padding: 0.25rem 0.6rem !important;
    }
    
    /* 調整科系標題大小 */
    .timeline-content h3 {
        font-size: 1.15rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    /* 調整學校名稱樣式 */
    .timeline-school-name {
        font-size: 0.95rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* 調整 GPA 樣式 */
    .timeline-gpa {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
        padding: 0.25rem 0.6rem !important;
    }
}

/* === 手機屏幕優化 (600px 以下) === */
@media (max-width: 600px) {
    .timeline-content {
        padding: 1.2rem !important;
    }
    
    .timeline-content h3 {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.6rem !important;
    }
    
    .timeline-school-name {
        font-size: 0.9rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .timeline-date,
    .timeline-gpa {
        font-size: 0.8rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

/* === 超小屏幕優化 (480px 以下) === */
@media (max-width: 480px) {
    .timeline-content {
        padding: 1rem !important;
    }
    
    .timeline-content h3 {
        font-size: 1rem !important;
        line-height: 1.25 !important;
    }
    
    .timeline-school-name {
        font-size: 0.85rem !important;
    }
    
    .timeline-date,
    .timeline-gpa {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* === 確保覆蓋原有樣式的強化選擇器 === */
@media (max-width: 992px) {
    .education-section .timeline-wrapper .timeline-item .timeline-content,
    .education-section .timeline-wrapper .timeline-item .timeline-content h3,
    .education-section .timeline-wrapper .timeline-item .timeline-content .timeline-school-name,
    .education-section .timeline-wrapper .timeline-item .timeline-content .timeline-date,
    .education-section .timeline-wrapper .timeline-item .timeline-content .timeline-gpa,
    .education-section .timeline-wrapper .timeline-item .timeline-content p {
        text-align: left !important;
    }
}

/* === 如果還是有問題，使用最強的選擇器 === */
@media (max-width: 992px) {
    body .education-section .timeline-wrapper .timeline-item .timeline-content * {
        text-align: left !important;
    }
}

