/* --- 基礎設定 & 淺色網格背景 --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    background-image:
        linear-gradient(to right, #f4f7f9 1px, transparent 1px),
        linear-gradient(to bottom, #f4f7f9 1px, transparent 1px);
    background-size: 30px 30px;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden;
}

/* --- 頂部工具欄 (Utility Bar) --- */
.top-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 5px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 13px;
    height: 35px;
    box-sizing: border-box;
}

.top-bar-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-links a {
    text-decoration: none;
    color: #666;
    transition: color 0.2s;
    cursor: pointer;
}

.top-bar-links a:hover {
    color: #004b9b;
}

.nav-mobile-only {
    display: none;
}

/* --- 頂部導覽列 --- */
header {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 70px;
    /* 略微縮小高度 */
    border-bottom: 3px solid #004b9b;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 100%;
}

.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* --- 漢堡選單按鈕 --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    z-index: 2001;
    padding: 8px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 2px solid #004b9b;
    border-radius: 4px;
    box-sizing: border-box;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #004b9b;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- 導覽列選單 --- */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: #444;
    padding: 30px 12px;
    display: block;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 15px;
    cursor: pointer;
}

nav a:hover {
    color: #004b9b;
}

/* 導覽列 Mega Menu */
.nav-mega-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-top: 3px solid #004b9b;
    padding: 15px 0;
    min-width: 150px;
    z-index: 999;
}

.nav-mega-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

nav li:hover .nav-mega-menu,
.top-bar-item:hover .nav-mega-menu {
    display: block;
}

.nav-mega-menu a {
    padding: 10px 20px;
    font-weight: normal;
    font-size: 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.nav-mega-menu a:last-child {
    border-bottom: none;
}

.nav-mega-menu a:hover {
    background-color: #f4f7f9;
    color: #004b9b;
    padding-left: 25px;
}

/* 導覽列右側會員專屬 Mega Menu (直列式排版) */
.nav-mega-menu.right-aligned {
    left: auto;
    right: 0;
    width: 200px;
    padding: 20px;
    z-index: 1100;
}

.vertical-dropdown-group {
    margin-bottom: 20px;
}

.vertical-dropdown-group:last-child {
    margin-bottom: 0;
}

.vertical-dropdown-group h4 {
    color: #004b9b;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.1em;
    text-align: left;
}

.vertical-dropdown-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vertical-dropdown-group li {
    margin-bottom: 5px;
    text-align: left;
}

.vertical-dropdown-group a {
    color: #666;
    text-decoration: none;
    font-size: 1em;
    transition: all 0.2s;
    display: block;
    padding: 6px 10px;
    text-align: left;
    border-radius: 4px;
}

.vertical-dropdown-group a.indent-text {
    padding-left: 36px;
}

.vertical-dropdown-group a:hover {
    color: #004b9b;
    font-weight: 600;
    background-color: #f8f9fa;
}

/* 訂閱電子報獨立按鈕樣式 */
.nav-subscribe-btn {
    background-color: #004b9b;
    color: #ffffff !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
}

.nav-subscribe-btn:hover {
    background-color: #003366;
    transform: translateY(-1px);
}

/* --- 全網搜尋框樣式 (Top Bar 版) --- */
.search-container {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 4px;
    padding: 2px 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: #004b9b;
    box-shadow: 0 0 5px rgba(0, 75, 155, 0.1);
}

.search-container input {
    border: none;
    background: transparent;
    outline: none;
    width: 100px;
    font-size: 12px;
    color: #333;
}

.search-container button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #004b9b;
    font-size: 12px;
    padding: 0;
    margin-left: 5px;
}

/* 登入狀態文字變色 */
.logged-in-text {
    color: #28a745 !important;
    font-weight: bold;
}

/* --- 主視覺區 (Hero Section) & 底圖設定 --- */
.hero {
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 10;
    background-color: #000;
    overflow: hidden;
    width: 100%;
}

.hero.hidden {
    display: none;
}

.hero::before {
    display: none;
}

/* Carousel Structure */
.carousel-container {
    position: relative;
    width: 100%;
    height: 253px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Dynamic gradient overlay that only shows when the slide contains content */
.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.75), rgba(0, 75, 155, 0.75));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide:has(.carousel-content)::before {
    opacity: 1;
}

/* For video slides, keep the video fully clear without the heavy static image blue gradient overlay */
.carousel-slide:has(.carousel-video)::before {
    opacity: 0 !important;
    display: none;
}

.carousel-slide:has(.carousel-video) .carousel-content {
    pointer-events: none;
    max-width: 950px;
    padding: 12px 24px;
    background: radial-gradient(ellipse at center, rgba(0, 15, 35, 0.55) 0%, rgba(0, 15, 35, 0.25) 55%, rgba(0, 15, 35, 0) 80%);
    border-radius: 20px;
}

.carousel-slide:has(.carousel-video) .carousel-content h1 {
    font-size: 2.5em;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 25px rgba(0, 195, 255, 0.95), 0 2px 10px rgba(0, 0, 0, 0.95), 0 4px 20px rgba(0, 0, 0, 0.9);
    margin-bottom: 10px;
}

.carousel-slide:has(.carousel-video) .carousel-content p {
    display: inline-block;
    font-size: 1.35em;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 2px;
    padding: 6px 26px;
    background: rgba(0, 24, 55, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 195, 255, 0.3);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.9), 0 2px 6px rgba(0, 0, 0, 0.95);
    margin-top: 0;
}

.carousel-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 40px;
    text-align: center;
    color: #ffffff;
}

.hero h1 {
    font-size: 2.8em;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

.hero p {
    font-size: 1.25em;
    color: #f0f4f8;
    margin-bottom: 0;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.2s, opacity 0.8s ease 0.2s;
}

/* Active slide entry animations */
.carousel-slide.active h1 {
    transform: translateY(0);
    opacity: 1;
}

.carousel-slide.active p {
    transform: translateY(0);
    opacity: 1;
}

/* Control Arrows */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 2.2em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
    left: 30px;
}

.carousel-next {
    right: 30px;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.indicator {
    width: 24px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.7);
}

.indicator.active {
    width: 40px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* --- 雙欄排版區 (左側內容、右側廣告) --- */
.layout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 40px;
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    flex: 3;
    min-width: 0;
}

.sidebar {
    flex: 1;
    min-width: 300px;
}

.section-title {
    font-size: 1.6em;
    color: #333;
    border-left: 6px solid #004b9b;
    padding-left: 15px;
    margin-bottom: 25px;
    margin-top: 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-more-link {
    font-size: 0.52em;
    font-weight: 600;
    color: #004b9b;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
}

.section-more-link:hover {
    background: #004b9b;
    color: #ffffff !important;
    border-color: #004b9b;
    box-shadow: 0 2px 6px rgba(0, 75, 155, 0.25);
    transform: translateY(-1px);
}

.home-columns {
    display: flex;
    gap: 30px;
}

.home-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 內頁標題樣式 */
.page-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    border-left: 4px solid #d4af37;
    color: #666;
    font-size: 0.9em;
    text-align: left;
}

.page-header h2 {
    color: #004b9b;
    margin: 0 0 5px 0;
    font-size: 1.8em;
    border: none;
    padding-left: 0;
    text-align: left;
}

/* 動態頁面切換設定 */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease;
    text-align: left;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 內容卡片與清單樣式 --- */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.06);
    border-bottom: 3px solid #004b9b;
}

.card-date {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 8px;
    display: block;
    text-align: left;
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #222;
    text-align: left;
    line-height: 1.4;
}

.card p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin: 0;
    text-align: left;
}

.article-box {
    background: #fff;
    border: 1px solid #eee;
    padding: 30px;
    border-radius: 8px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    text-align: left;
}

.article-box h3 {
    text-align: left;
    color: #004b9b;
    margin-top: 0;
}

.article-box p {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: left;
}

.article-box ul {
    text-align: left;
    padding-left: 20px;
}

.content-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: block;
}

/* 嚴格置左的列表設計 */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.link-list li {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
    text-align: left;
}

.link-list li:hover {
    background: #f8f9fa;
}

.link-list li div {
    text-align: left;
}

.link-list a {
    text-decoration: none;
    color: #004b9b;
    font-weight: bold;
    font-size: 1.1em;
    display: block;
    margin-top: 4px;
}

.link-list a:hover {
    text-decoration: underline;
}

.tag {
    background: #e9ecef;
    color: #555;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    min-width: 85px;
    text-align: center;
    display: inline-block;
    font-weight: bold;
}

/* --- 組織架構名單列表樣式 (舊版保留) --- */
.org-list {
    list-style: none;
    padding: 0;
    margin: 25px 0 0 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #004b9b;
}

.org-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #ddd;
    display: flex;
    align-items: center;
}

.org-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.org-list .title {
    width: 90px;
    color: #004b9b;
    font-weight: bold;
    flex-shrink: 0;
}

.org-list .name {
    width: 100px;
    font-weight: bold;
    flex-shrink: 0;
}

.org-list .desc {
    color: #555;
}

/* --- [新增] 執行委員名單 直列單行排版 --- */
.committee-category {
    color: #004b9b;
    border-bottom: 2px solid #004b9b;
    padding-bottom: 8px;
    margin-top: 40px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.committee-list-container {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.committee-line-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
    /* 縮小比例 */
    transition: background 0.2s;
}

.committee-line-item:last-child {
    border-bottom: none;
}

.committee-line-item:hover {
    background-color: #f8fbfd;
    border-left: 3px solid #004b9b;
    padding-left: 17px;
}

.committee-line-item .name {
    font-weight: bold;
    color: #004b9b;
    width: 120px;
    /* 固定寬度讓右側對齊 */
    flex-shrink: 0;
    letter-spacing: 1px;
}

.committee-line-item .org-title {
    color: #444;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.committee-line-item .role-badge {
    background-color: #d4af37;
    color: #fff;
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: normal;
    letter-spacing: 1px;
}

.committee-line-item .role-badge.president {
    background-color: #e74c3c;
}

/* --- 會員名單手風琴樣式 (Accordion) --- */
.member-accordion-container {
    display: flex;
    gap: 30px;
}

.accordion-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

details.member-accordion {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

details.member-accordion[open] {
    border-color: #004b9b;
    box-shadow: 0 5px 15px rgba(0, 75, 155, 0.08);
}

details.member-accordion summary {
    padding: 15px 20px;
    font-size: 1.1em;
    cursor: pointer;
    color: #555;
    list-style: none;
    display: flex;
    align-items: center;
    user-select: none;
    background-color: #fafafa;
    border-radius: 6px;
}

details.member-accordion summary:hover {
    background-color: #f0f4f8;
}

details.member-accordion summary::-webkit-details-marker {
    display: none;
}

details.member-accordion summary::before {
    content: '●';
    color: #57a639;
    font-size: 1.2em;
    margin-right: 12px;
    line-height: 1;
}

.accordion-content {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.accordion-count {
    color: #d35400;
    text-decoration: underline;
    margin: 0 4px;
    font-weight: bold;
}

.member-list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.8;
}

.member-tag {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    color: #444;
    transition: all 0.2s;
}

.member-tag:hover {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #004b9b;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- 技術鏈結專用表格樣式 --- */
.tech-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    text-align: left;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tech-table thead {
    background-color: #004b9b;
    color: #fff;
}

.tech-table th {
    padding: 15px 20px;
    font-weight: bold;
    font-size: 1.05em;
    border-bottom: 2px solid #003366;
}

.tech-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    color: #444;
    line-height: 1.6;
}

.tech-table tbody tr:hover td {
    background-color: #f4f7f9;
}

.tech-table tbody tr:last-child td {
    border-bottom: none;
}

.tech-table td:first-child {
    font-weight: 600;
    color: #004b9b;
    width: 60%;
}

/* 登入與表單共通樣式 */
.form-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.form-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    width: 100%;
    max-width: 500px;
    text-align: left;
}

.form-box h3 {
    color: #004b9b;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.4em;
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95em;
}

.form-box input,
.form-box textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    background-color: #fcfcfc;
    transition: border 0.3s;
    font-family: inherit;
}

.form-box input:focus,
.form-box textarea:focus {
    outline: none;
    border-color: #004b9b;
    background-color: #fff;
}

.action-btn {
    background-color: #fff;
    border: 2px solid #004b9b;
    color: #004b9b;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background-color: #004b9b;
    color: #fff;
    width: 100%;
    margin-top: 10px;
}

.action-btn.primary:hover {
    background-color: #003366;
    border-color: #003366;
    box-shadow: 0 6px 15px rgba(0, 51, 102, 0.3);
    transform: translateY(-2px);
}

.login-links {
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
}

.login-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.login-links a:hover {
    color: #004b9b;
    text-decoration: underline;
}

/* 側邊欄廣告區塊 */
.ad-space {
    background: #f8f9fa;
    border: 2px dashed #cfd8dc;
    border-radius: 8px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #90a4ae;
    font-weight: bold;
    margin-bottom: 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.ad-space:hover {
    background: #f0f4f8;
    border-color: #b0bec5;
}

.sidebar-title {
    font-size: 1.2em;
    color: #555;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 0;
    text-align: left;
}

/* --- 頁尾 Footer --- */
footer {
    background-color: #004b9b;
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
}

footer p {
    margin: 5px 0;
}

/* 響應式 */
@media (max-width: 1200px) {
    header {
        padding: 0 15px;
    }

    nav a {
        padding: 30px 8px;
        font-size: 14px;
    }

    .search-container {
        margin: 0 5px;
    }

    .search-container input {
        width: 80px;
    }

    .search-container input:focus {
        width: 120px;
    }
}

@media (max-width: 1024px) {
    header {
        height: 70px !important;
        padding: 0 15px !important;
        position: relative !important;
    }

    .logo img {
        max-height: 40px !important;
    }

    .top-bar {
        display: none !important;
    }

    .nav-mobile-only {
        display: block !important;
    }

    .menu-toggle {
        display: flex !important;
        position: absolute !important;
        right: 15px !important;
        top: 15px !important;
        z-index: 9999 !important;
    }

    nav#main-nav {
        display: none !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 70px) !important;
        background-color: #ffffff !important;
        z-index: 5000 !important;
        overflow-y: auto !important;
        padding-bottom: 50px !important;
    }

    nav#main-nav.active {
        display: block !important;
    }

    nav ul {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        width: 100% !important;
        display: flex !important;
    }

    nav li {
        border-bottom: 1px solid #eee !important;
        width: 100% !important;
        display: block !important;
    }

    nav a {
        padding: 15px 25px !important;
        font-size: 16px !important;
        color: #333 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .nav-mega-menu {
        position: static !important;
        display: none !important;
        background-color: #f8f9fa !important;
        padding-left: 20px !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
    }

    nav li.active .nav-mega-menu {
        display: block !important;
    }

    .nav-mega-menu a {
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-bottom: none !important;
    }

    .layout-container {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sidebar {
        min-width: auto !important;
        width: 100% !important;
        order: 2 !important;
    }

    .main-content {
        width: 100% !important;
        order: 1 !important;
    }
}

@media (max-width: 992px) {
    .home-columns {
        flex-direction: column;
        gap: 30px;
    }

    .member-accordion-container {
        flex-direction: column;
        gap: 15px;
    }

    .carousel-container {
        height: 320px;
    }

    .hero h1 {
        font-size: 2.2em;
    }

    .hero p {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    .org-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .org-list .title,
    .org-list .name {
        width: auto;
    }

    .nav-mega-menu.right-aligned {
        width: 100%;
        padding: 0;
    }

    nav a.nav-subscribe-btn {
        margin: 15px 30px;
        display: block;
        text-align: center;
    }

    .tech-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tech-table th,
    .tech-table td {
        padding: 10px;
        font-size: 0.9em;
        min-width: 120px;
    }

    .tech-table td:first-child {
        width: auto;
    }

    .committee-line-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 12px;
    }

    .committee-line-item:hover {
        padding-left: 12px;
        border-left: none;
    }

    .committee-line-item .name {
        width: auto;
    }

    .form-box {
        padding: 20px;
    }

    .hero {
        padding: 0;
    }

    .carousel-container {
        height: 250px;
    }

    .hero h1 {
        font-size: 1.6em;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 0.95em;
    }

    .carousel-prev,
    .carousel-next {
        width: 36px;
        height: 36px;
        font-size: 1.4em;
    }

    .carousel-prev {
        left: 15px;
    }

    .carousel-next {
        right: 15px;
    }

    .carousel-indicators {
        bottom: 15px;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.5em;
    }

    .section-title {
        font-size: 1.3em;
    }

    .card {
        padding: 15px;
    }

    .action-btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}

/* --- 廠商列表升級樣式 --- */
.company-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #004b9b;
    padding-bottom: 12px;
}

.category-tab {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background-color: #e3f2fd;
    color: #004b9b;
    border-color: #90caf9;
}

.category-tab.active {
    background-color: #004b9b;
    color: #fff;
    border-color: #004b9b;
}

.company-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.company-search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 10px;
    width: 280px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.company-search-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #333;
}

.company-search-wrapper button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #004b9b;
    font-size: 14px;
}

.company-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.company-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    border-color: #004b9b;
}

.company-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #004b9b;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.company-card:hover::after {
    transform: scaleX(1);
}

.company-logo-box {
    width: 80px;
    height: 80px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4em;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #004b9b, #007bff);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    user-select: none;
    overflow: hidden;
}

.company-logo-box.color-1 {
    background: linear-gradient(135deg, #004b9b, #3b82f6);
}

.company-logo-box.color-2 {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.company-logo-box.color-3 {
    background: linear-gradient(135deg, #b45309, #f59e0b);
}

.company-logo-box.color-4 {
    background: linear-gradient(135deg, #be185d, #ec4899);
}

.company-logo-box.color-5 {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

.company-logo-box.color-6 {
    background: linear-gradient(135deg, #1e293b, #475569);
}

.company-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.company-card-info h6 {
    margin: 0 0 6px 0;
    font-size: 1.15em;
    color: #004b9b;
    font-weight: bold;
    letter-spacing: 0.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.company-card-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination Style */
.company-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-link {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    border-color: #004b9b;
    color: #004b9b;
    background: #e3f2fd;
}

.pagination-link.cur {
    background: #004b9b;
    color: #fff;
    border-color: #004b9b;
    cursor: default;
}

.pagination-link.disabled {
    color: #ccc;
    border-color: #eee;
    background: #fafafa;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

/* Accordion Count interactive style */
.accordion-count {
    color: #d35400;
    text-decoration: underline;
    margin: 0 4px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
}

.accordion-count:hover {
    color: #004b9b;
    background-color: #e3f2fd;
}

/* Detail Modal */
.company-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease;
}

.company-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.company-modal-header {
    background: #004b9b;
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.company-modal-logo {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25em;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.company-modal-header-text h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.company-modal-header-text span {
    font-size: 0.85em;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

.company-modal-body {
    padding: 25px;
    line-height: 1.8;
    max-height: 70vh;
    overflow-y: auto;
}

.company-detail-item {
    margin-bottom: 15px;
    border-bottom: 1px dashed #f0f0f0;
    padding-bottom: 10px;
    display: flex;
}

.company-detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.company-detail-item strong {
    color: #004b9b;
    display: inline-block;
    width: 100px;
    flex-shrink: 0;
}

.company-detail-item span {
    color: #333;
    flex: 1;
}

.company-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.2s;
}

.company-modal-close-btn:hover {
    color: #fff;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .carousel-slide:has(.carousel-video) .carousel-content h1 {
        font-size: 1.6em;
        letter-spacing: 1px;
    }

    .carousel-slide:has(.carousel-video) .carousel-content p {
        font-size: 0.95em;
        padding: 4px 14px;
        letter-spacing: 1px;
    }

    .company-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .company-pagination {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}