/* ==========================================
   INNOSERVE FRONTEND STYLESHEET
   優化版本 - 增強共用性與通用性
   ========================================== */

/* ==========================================
   1. CSS 變數定義
   ========================================== */
:root {
    /* 品牌色彩 */
    --primary: #667eea; --primary-dark: #5568d3; --secondary: #764ba2;
    --success: #28a745; --success-light: #20c997; --danger: #dc3545;
    --warning: #ffc107; --info: #17a2b8;
    /* 中性色 */
    --text-dark: #1a202c; --text-gray: #4a5568; --text-muted: #6c757d;
    --border-color: #e2e8f0; --bg-light: #f8fafc; --bg-white: #ffffff;
    /* 漸變 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    /* 陰影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 12px 24px rgba(102, 126, 234, 0.2);
    /* 動畫 */
    --transition-base: all 0.3s ease;
}

/* ==========================================
   2. 基礎樣式
   ========================================== */
html { font-size: 87.5%; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 100%; } }
body { margin-bottom: 60px; background: var(--bg-light) !important; color: var(--text-dark) !important; }
img { max-width: 100%; height: auto; }
a { color: #0077cc; text-decoration: none; transition: var(--transition-base); }

/* ==========================================
   3. 通用工具類
   ========================================== */
.gradient-primary { background: var(--gradient-primary); }
.gradient-success { background: var(--gradient-success); }
.text-gradient { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.transition-all { transition: var(--transition-base); }
.hover-lift, .hover-lift * { cursor: pointer; transition: var(--transition-base); }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.shadow-soft { box-shadow: var(--shadow-sm); }
.shadow-hover { transition: box-shadow 0.3s ease; }
.shadow-hover:hover { box-shadow: var(--shadow-lg) !important; }
.img-hover { transition: transform 0.3s, opacity 0.3s; }
.img-hover:hover { transform: scale(1.05); opacity: 0.9; }

/* ==========================================
   4. LAYOUT - 頁首、頁尾、容器
   ========================================== */
/* 頁首 */
.top-header { background: var(--gradient-primary); color: white; padding: 10px 0; font-size: 0.875rem; }
.main-header { background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 10px 0; }
.logo-text { font-size: 1.714rem; font-weight: bold; color: var(--primary); }
.top-logo { width: 140px; height: 70px; }
/* 頁尾 */
.main-footer { background: #2c3e50 !important; color: white !important; padding: 40px 0 20px; margin-top: 50px; }
.footer-links a { color: #bdc3c7; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: white; }
.social-links a { color: white; font-size: 1.714rem; margin: 0 10px; transition: transform 0.3s; display: inline-block; }
.social-links a:hover { transform: translateY(-3px); }
/* 頁面容器 - 統一所有頁面使用 */
.page-container { max-width: 1200px; margin: 0 auto; background: var(--bg-light); min-height: 100vh; }
/* 內容卡片 */
.content-card { background: var(--bg-white); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 2rem; margin-bottom: 2rem; border: 1px solid #e9ecef; }
@media (max-width: 576px) { .content-card { padding: 1.5rem; } }

/* ==========================================
   5. NAVIGATION - 導航與標籤
   ========================================== */
.navbar-nav .nav-link { color: #333; font-weight: 500; padding: 5px 15px !important; transition: var(--transition-base); }
.navbar-nav .nav-link:hover { color: var(--primary); background: #f8f9fa; border-radius: 5px; }
a.navbar-brand { white-space: normal; text-align: center; word-break: break-all; }
.dropdown-menu { border: none; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
/* 導航標籤 */
.nav-tabs { border-bottom: solid var(--border-color); background: var(--bg-white); padding: 0.5rem 1rem 0; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link { border: none; border-bottom: 3px solid transparent; color: var(--text-gray); padding: 0.75rem 1rem; transition: var(--transition-base); font-weight: 500; background: transparent; }
.nav-tabs .nav-link:hover { border-bottom-color: var(--primary); color: var(--primary); background: #f7fafc; }
.nav-tabs .nav-link.active { border-bottom-color: var(--primary); color: var(--text-dark); font-weight: 600; background: var(--bg-white); }
.nav-tabs .nav-link:focus, .nav-tabs .nav-link:active { outline: none; box-shadow: none; }
.nav-tabs .nav-link .badge { background: var(--border-color) !important; color: #2d3748 !important; }
.nav-tabs .nav-link.active .badge { background: var(--primary) !important; color: white !important; }
/* 麵包屑 */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; font-size: 1.2em; color: var(--text-muted); }

/* ==========================================
   6. BUTTONS - 按鈕樣式
   ========================================== */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; font-size: 1rem; font-weight: 600; line-height: 1.5; border-radius: 6px; transition: all 0.2s; text-decoration: none; border: 2px solid transparent; }
.btn:focus { outline: 3px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-outline-primary { background: white; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-outline-danger { background: white; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-group-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-group-actions .btn { min-width: 100px; }

/* ==========================================
   7. CARDS - 卡片組件
   ========================================== */
.card { transition: transform 0.3s, box-shadow 0.3s; overflow: hidden; border-radius: 12px !important; border: 1px solid var(--border-color); }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }
.card-body { padding: 1rem; box-sizing: border-box; }
/* 新聞卡片 */
article.card { background: var(--bg-white); border: 1px solid #e9ecef; }
article.card .card-header { background: var(--gradient-primary); border-bottom: 3px solid rgba(0, 0, 0, 0.1); font-weight: 600; }
article.card .card-header.gradient-success { background: var(--gradient-success); }
article.card .list-group-item { border: none; border-bottom: 1px solid #e9ecef; padding: 0; transition: background-color 0.2s ease; }
article.card .list-group-item:last-child { border-bottom: none; }
article.card .list-group-item a { display: block; padding: 1rem 1.25rem; text-decoration: none; color: inherit; transition: all 0.2s ease; }
article.card .list-group-item a:hover { background-color: #f8f9fa; color: var(--primary); }
article.card .card-footer { background: var(--bg-white) !important; border-top: 1px solid #e9ecef; }

/* ==========================================
   8. FORMS - 表單元素
   ========================================== */
.form-control, .form-select { padding: 0.625rem 0.75rem; font-size: 1rem; border: 2px solid #dee2e6; border-radius: 6px; transition: border-color 0.2s, box-shadow 0.2s; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25); outline: none; }
.form-label { font-weight: 600; margin-bottom: 0.5rem; color: #2c3e50; }
.form-text { font-size: 0.875rem; line-height: 1.5; }
/* Floating labels */
.floating-label { position: relative; margin-bottom: 1.5rem; }
.floating-label input, .floating-label textarea { width: 100%; padding: 0.75rem 0.5rem; border: 2px solid #dee2e6; border-radius: 6px; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; }
.floating-label label { position: absolute; top: 10px; left: 10px; transition: all 0.3s; color: var(--text-muted); pointer-events: none; }
.floating-label input:focus + label, .floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:focus + label, .floating-label textarea:not(:placeholder-shown) + label { top: -8px; left: 8px; font-size: 0.875rem; color: var(--primary); }
.form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }
.form-floating > .form-control:focus::placeholder { text-align: start; }
.required::after { content: " *"; color: var(--danger); font-weight: bold; }
input[readonly], textarea[readonly] { background-color: #e9ecef; cursor: not-allowed; }
/* 檔案上傳 */
input[type="file"] { cursor: pointer; }
input[type="file"]::-webkit-file-upload-button { background: var(--primary); color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; transition: background 0.3s; }
input[type="file"]::-webkit-file-upload-button:hover { background: var(--primary-dark); }
/* 表單驗證 */
.text-danger.small { display: block; margin-top: 5px; font-size: 0.875rem; }
.validation-summary-errors { background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 5px; padding: 15px; margin-bottom: 20px; }
.validation-summary-errors ul { margin-bottom: 0; padding-left: 20px; }
.form-section-title { border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 20px; font-weight: 600; }
.file-info-alert { background-color: #f8f9fa; border-left: 4px solid var(--primary); padding: 15px; margin: 15px 0; }
.file-info-alert .alert-heading { color: var(--primary); font-size: 1rem; font-weight: 600; margin-bottom: 10px; }

/* ==========================================
   9. ALERTS & BADGES - 提示與標籤
   ========================================== */
.alert { padding: 1rem 1.5rem; border-radius: 8px; border-left: 4px solid; margin-bottom: 1rem; background: var(--bg-white); box-shadow: var(--shadow-sm); }
.alert i { margin-right: 0.5rem; font-size: 1.25rem; }
.alert-info { background: #e6f7ff; border-left-color: #1890ff; color: #0c5460; }
.alert-info i { color: #1890ff; }
.alert-success { background: #f6ffed; border-left-color: #52c41a; color: #155724; }
.alert-success i { color: #52c41a; }
.alert-warning { background: #fffbe6; border-left-color: #faad14; color: #856404; }
.alert-warning i { color: #faad14; }
.alert-danger { background: #fff1f0; border-left-color: #ff4d4f; color: #721c24; }
.alert-danger i { color: #ff4d4f; }
.alert-light { background-color: #f8f9fa; border: 1px solid #dee2e6; }
.badge { font-weight: 500; padding: 0.5em 0.8em; }
.badge.bg-info { background-color: var(--info) !important; }
.badge.bg-info.text-dark { color: white !important; }

/* ==========================================
   10. LISTS & TABLES - 列表與表格
   ========================================== */
/* 列表 */
.list-group-item-action:hover, .list-group-item:hover:not(.active) { background-color: #f8f9fa; }
.list-group-item.active { background-color: var(--primary); border-color: var(--primary); }
.list-group-item i { margin-right: 0.5rem; }
.content-list-item { padding: 1.5rem 0; border-bottom: 1px solid #e9ecef; background: var(--bg-white); }
.content-list-item:last-child { border-bottom: none; }
.content-list-item h2, .content-list-item h3, .content-list-item h4 { margin-top: 0; margin-bottom: 0.5rem; color: var(--text-dark); font-weight: 600; }
/* 表格 */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--bg-white); border-radius: 8px; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; background: var(--bg-white); margin-bottom: 0; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-weight: 600; color: var(--text-dark); background: #f7fafc; text-transform: uppercase; font-size: 0.875rem; letter-spacing: 0.05em; }
.table tbody tr { background: var(--bg-white); transition: background 0.2s; }
.table tbody tr:hover { background: #f7fafc; }
.table tbody td { color: #2d3748; }
.table-striped tbody tr:nth-of-type(odd) { background: #f7fafc; }
.table-striped tbody tr:nth-of-type(odd):hover { background: #edf2f7; }

/* ==========================================
   11. PAGINATION - 分頁
   ========================================== */
.pagination { gap: 0.5rem; }
.pagination .page-link { color: var(--primary); border: 2px solid var(--border-color); border-radius: 6px; padding: 0.5rem 0.75rem; font-weight: 500; transition: all 0.2s; min-width: 40px; text-align: center; }
.pagination .page-link:hover { color: var(--primary-dark); background-color: #f7fafc; border-color: var(--primary); transform: translateY(-2px); }
.pagination .page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }
.pagination .page-item.disabled .page-link { color: #a0aec0; background-color: #f8fafc; border-color: var(--border-color); cursor: not-allowed; }
.pagination .page-link i { font-size: 0.875rem; }

/* ==========================================
   12. PAGE-SPECIFIC STYLES - 頁面特定樣式
   ========================================== */
/* 頁面標題 */
.page-title { border-bottom: 3px solid var(--primary); padding-bottom: 15px; margin-bottom: 30px; }
.page-header-section { margin-bottom: 2rem; padding: 1.5rem; border-bottom: 3px solid var(--primary); background: var(--bg-white); border-radius: 8px; box-shadow: var(--shadow-sm); }
.page-header-section h1 { font-size: 2rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; line-height: 1.2; }
.page-header-section h1 i { color: var(--primary); }
@media (min-width: 768px) { .page-header-section h1 { font-size: 2.5rem; } }
.page-header-section .lead { font-size: 1.125rem; color: var(--text-gray); margin-bottom: 0; font-weight: 400; }
.article_title, .article_content h2 { font-weight: bold; padding: 5px 5px 5px 1rem; margin-bottom: 1.5rem; border-left: 5px solid #144199; scroll-margin-top: 180px;}
.scroll_section { scroll-margin-top: 200px; }
/* 規則頁面分類按鈕 */
.rules-category-btn { position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; padding: 2.5rem 2rem; border: 3px solid var(--primary); border-radius: 12px; text-decoration: none; transition: var(--transition-base); overflow: hidden; font-weight: 600; box-shadow: var(--shadow-md); background: var(--gradient-primary); color: white; }
.rules-category-btn:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4); border-color: white; color: white; }
.rules-category-btn i { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.95; transition: transform 0.3s ease; }
.rules-category-btn:hover i { transform: scale(1.15); }
.rules-category-btn-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: 0.5px; }
.rules-category-btn-description { font-size: 1rem; font-weight: 400; opacity: 0.9; margin-top: 0.5rem; }
/* 規則頁面分類按鈕尺寸（配合 btn-outline-primary 使用） */
.rules-category-btn-size { position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; padding: 2.5rem 2rem; border-width: 3px; border-radius: 12px; text-decoration: none; transition: var(--transition-base); overflow: hidden; font-weight: 600; box-shadow: var(--shadow-md); width: 100%; }
.rules-category-btn-size:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4); }
.rules-category-btn-size i { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.95; transition: transform 0.3s ease; }
.rules-category-btn-size:hover i { transform: scale(1.15); }
.rules-category-btn-size .rules-category-btn-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: 0.5px; display: block; }
.rules-category-btn-size .rules-category-btn-description { font-size: 1rem; font-weight: 400; opacity: 0.9; margin-top: 0.5rem; display: block; }
/* 新聞列表 */
.news-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.news-card-btn { min-width: 110px; width: 110px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.news-item-row { gap: 0.5rem; }
.news-item-right { margin-left: 0.75rem; }
/* Gallery */
.gallery-item { background: var(--bg-white); border-radius: 8px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; }
.gallery-item:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important; }
.gallery-item .card-img-top-wrapper { position: relative; overflow: hidden; background: var(--bg-light); display: flex; align-items: center; justify-content: center; }
.gallery-item .gallery-image { object-fit: contain !important; width: 100%; height: 100%; }
.gallery-item .card-body { padding: 1.25rem; background: var(--bg-white); }
.gallery-item .card-title { color: var(--text-dark); font-weight: 600; margin-bottom: 0.75rem; }
/* Sitemap */
.sitemap-page { min-height: 60vh; background-color: var(--bg-light); }
.sitemap-gradient-header { background: var(--gradient-primary); }
.sitemap-container { max-width: 1200px; margin: 0 auto; }
.sitemap-section { background: white; border-radius: 8px; padding: 1.5rem; height: 100%; box-shadow: var(--shadow-sm); transition: var(--transition-base); }
.sitemap-section:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sitemap-title { font-size: 1.1rem; font-weight: bold; color: white; background: var(--gradient-primary); padding: 0.75rem 1rem; margin: -1.5rem -1.5rem 1rem -1.5rem; border-radius: 8px 8px 0 0; display: flex; align-items: center; gap: 0.5rem; }
.sitemap-list { list-style: none; padding: 0; margin: 0; }
.sitemap-list li { margin-bottom: 0.75rem; padding-left: 1.5rem; position: relative; }
.sitemap-list li:before { content: "▸"; position: absolute; left: 0; color: var(--primary); font-weight: bold; }
.sitemap-list a { color: #495057; text-decoration: none; transition: var(--transition-base); display: inline-block; }
.sitemap-list a:hover { color: var(--primary); padding-left: 0.25rem; }
/* 競賽辦法詳細頁 - 競賽類別下拉選單 */
.dropdown { position: relative; }
.dropdown:hover .dropdown-menu { display: block; margin-top: 0; }
.dropdown-menu { min-width: 280px; z-index: 1050; box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15); border-radius: 0.375rem; border: 1px solid rgba(0, 0, 0, 0.15); padding: 0.2rem 2rem; }
.dropdown-header { font-weight: 600; color: #212529; font-size: 2rem; padding: 0.1rem; margin: 0; background-color: transparent; border-bottom: none; }
.dropdown-item { padding: 0.5rem 1rem; font-size: 0.875rem; color: #212529; transition: background-color 0.15s ease-in-out; border: none; background-color: transparent; }
.dropdown-item:hover { background-color: #f8f9fa; color: #0d6efd; }
.dropdown-divider { margin: 0.5rem 0; border-color: rgba(0, 0, 0, 0.1); }
/* 競賽辦法詳細頁 - 錨點偏移設定（避免被固定導航欄遮蔽） */
html { scroll-padding-top: 183px; }

/* ==========================================
   13. MEDIA & CAROUSEL - 多媒體與輪播
   ========================================== */
/* Banner */
.big-banners { padding-bottom: 5px; }
.banner-frame { width: 100%; margin: 0 auto; box-sizing: border-box; padding: 0; overflow: hidden; }
.banner-section { position: relative; overflow: hidden; border-radius: 8px; box-shadow: var(--shadow-sm); margin: 2rem 0; aspect-ratio: 16 / 9; }
.banner-section img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-item > div { transition: var(--transition-base); }
.carousel-hero { height: 500px; display: flex; align-items: center; justify-content: center; }
.carousel-hero-1 { background: var(--gradient-primary); }
.carousel-hero-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.carousel-hero-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }


/* YouTube Embed */
.youtube-lite-embed { position: relative; cursor: pointer; overflow: hidden; aspect-ratio: 16 / 9; background-color: #000; }
.youtube-lite-embed img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }
.youtube-lite-embed:hover img { opacity: 0.8; }
.youtube-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px; background: transparent; border: none; cursor: pointer; transition: transform 0.2s; z-index: 1; }
.youtube-lite-embed:hover .youtube-play-btn { transform: translate(-50%, -50%) scale(1.1); }
.youtube-lite-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
/* Social Cards */
.social-card { display: block; text-align: center; }
.social-card-body { max-height: 550px; overflow-y: auto; overflow-x: hidden; }
.facebook-container { width: 100%; max-width: 540px; margin: 0 auto; }
.facebook-container iframe { width: 500px; height: 500px; border: none; overflow: hidden; display: block; }
.instagram-container { width: 100%; max-width: 540px; max-height: 500px; overflow: hidden; margin: 0 auto; }
.instagram-container .instagram-media { background: #FFF !important; border: 0 !important; border-radius: 3px !important; box-shadow: 0 0 1px 0 rgba(0,0,0,0.5), 0 1px 10px 0 rgba(0,0,0,0.15) !important; margin: 1px !important; max-width: 540px !important; min-width: 326px !important; padding: 0 !important; width: 99.375% !important; max-height: 500px !important; }
.ratio-social { aspect-ratio: 320 / 440; max-width: 320px; margin: 0 auto; }
.ratio-social iframe, .ratio-social img { width: 100%; height: 100%; display: block; border: 0; object-fit: cover; }
.iframe-box { width: 100%; max-width: 320px; margin: 0 auto; box-sizing: border-box; overflow: hidden; }
.iframe-box iframe, .iframe-box blockquote { width: 100% !important; height: 440px; display: block; border: 0; object-fit: cover; max-width: 100% !important; }


/* ==========================================
   14. CAROUSEL - 主視覺 Banner
   ========================================== */
/* 主視覺 Banner 圖片 */
.banner-frame { width: 100%; overflow: hidden; }
.banner-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.banner-frame .a11y-carousel__slide { aspect-ratio: 1280 / 360; overflow: hidden; }
@media (max-width: 992px) { .banner-frame .a11y-carousel__slide { aspect-ratio: 1280 / 280; } }
@media (max-width: 576px) { .banner-frame .a11y-carousel__slide { aspect-ratio: 1280 / 180; } }
.wrapper.container { padding-left: 0; padding-right: 0; }

/* 主題輪播容器 */
.theme-carousel-container { background: #f8f9fa; padding-top: 1rem;}
.theme-carousel-container .card { background: transparent; border: none; box-shadow: none; height: 80px !important; border-radius: 0 !important; }
.theme-carousel-container .card:hover { transform: none; box-shadow: none !important; }
.theme-banner-link { display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.3s ease; width: 100%;    background: transparent; overflow: hidden;}
.theme-banner-link:hover { transform: scale(1.05); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.theme-banner-img { max-width: 100%; max-height: 70px; width: auto; height: auto; object-fit: contain; display: block; transition: opacity 0.3s ease; }
.theme-banner-link:hover .theme-banner-img { opacity: 0.8; }
/* 企業合作夥伴 / 指定專題主題 輪播投影片項目 */
.a11y-carousel--multi .a11y-carousel__slide a { display: block; text-decoration: none; transition: transform 0.3s ease; }
.a11y-carousel--multi .a11y-carousel__slide a:hover { transform: translateY(-4px); }
.a11y-carousel--multi .a11y-carousel__slide img { max-width: 100%; max-height: 65px; width: auto; height: auto; object-fit: contain; display: block; }




/* ==========================================
   15. CONTENT STYLES - 內容樣式
   ========================================== */
.article-content, .page-content { line-height: 1.8; font-size: 1.143rem; }
.article-content h2, .article-content h3, .article-content h4, .page-content h2, .page-content h3, .page-content h4 { margin-top: 30px; margin-bottom: 15px; color: #2c3e50; }
.article-content p, .page-content p { margin-bottom: 15px; }
.article-content ul, .article-content ol, .page-content ul, .page-content ol { padding-left: 30px; }
.page-content img { max-width: 100%; height: auto; margin: 1rem 0; }
.page-content table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.page-content table th, .page-content table td { border: 1px solid #4F4F4F; }
.page-content table th { background-color: #f8f9fa; font-weight: 600; }
blockquote { border-left: 4px solid var(--primary); padding-left: 20px; margin: 20px 0; color: var(--text-muted); font-style: italic; }
pre { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 5px; padding: 15px; overflow-x: auto; }
code { color: #e83e8c; background: #f8f9fa; padding: 2px 6px; border-radius: 3px; }
.stretched-link::after { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; content: ""; }

/* ==========================================
   16. UTILITIES - 工具樣式
   ========================================== */
a.link-primary { color: var(--primary); text-decoration: none; transition: color 0.3s; }
a.link-primary:hover { color: var(--secondary); text-decoration: underline; }
hr.divider { border-top: 2px solid var(--primary); width: 60px; margin: 20px auto; }
.loading { text-align: center; padding: 50px; }
.spinner-border { color: var(--primary); }
.skeleton, .gallery-image[loading] { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }
.stats-number { font-size: 3rem; font-weight: bold; color: var(--primary); }
.stats-label { font-size: 1.2rem; color: var(--text-muted); }
.price-tag { font-size: 2.5rem; font-weight: bold; color: var(--primary); }
/* Timeline */
.timeline { position: relative; padding: 20px 0; }
.timeline::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: var(--primary); }
.timeline-item { position: relative; padding-left: 50px; margin-bottom: 30px; }
.timeline-item::before { content: ''; position: absolute; left: 14px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid white; box-shadow: 0 0 0 3px var(--primary); }
.progress { height: 25px; border-radius: 15px; }
.progress-bar { background: var(--gradient-primary); }
/* Back to top */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition-base); z-index: 1000; }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--secondary); transform: translateY(-5px); }

/* ==========================================
   17. ANIMATIONS - 動畫效果
   ========================================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.6s ease-out; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.pulse { animation: pulse 2s infinite; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================
   18. ACCESSIBILITY - 無障礙功能
   ========================================== */
.skip-link, .skip-to-main { position: absolute; top: -40px; left: 0; background: var(--primary); color: white; padding: 8px 16px; text-decoration: none; z-index: 100; border-radius: 0 0 4px 0; }
.skip-link:focus, .skip-to-main:focus { top: 0; outline: 3px solid #ffd700; outline-offset: 2px; }
*:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-contrast: high) { *:focus { outline: 3px solid #000; outline-offset: 3px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.visually-hidden-focusable { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; background: var(--primary); color: white; text-decoration: none; }
.visually-hidden-focusable:active, .visually-hidden-focusable:focus { position: fixed; top: 1rem; left: 1rem; width: auto; height: auto; padding: 0.75rem 1.25rem; overflow: visible; clip: auto; white-space: normal; z-index: 9999; border-radius: 6px; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); outline: 3px solid #ffd700; outline-offset: 2px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after, .rules-category-btn, .rules-category-btn i { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; transition: none !important; }
    .rules-category-btn:hover, .rules-category-btn:hover i { transform: none !important; }
}

/* ==========================================
   19. RESPONSIVE - 響應式設計
   ========================================== */
@media (max-width: 768px) {
    .logo-text { font-size: 1.286rem; }
    .main-header { padding: 10px 0; }
    .navbar-nav .nav-link { padding: 12px 15px !important; }
    .top-header { font-size: 0.857rem; }
    .main-footer { text-align: center; }
    .social-links { margin-top: 20px; }
    .rules-category-btn { min-height: 200px; padding: 2rem 1.5rem; }
    .rules-category-btn i { font-size: 3rem; margin-bottom: 1rem; }
    .rules-category-btn-title { font-size: 1.5rem; }
    .rules-category-btn-description { font-size: 0.9rem; }
    .rules-category-btn-size { min-height: 200px; padding: 2rem 1.5rem; }
    .rules-category-btn-size i { font-size: 3rem; margin-bottom: 1rem; }
    .rules-category-btn-size .rules-category-btn-title { font-size: 1.5rem; }
    .rules-category-btn-size .rules-category-btn-description { font-size: 0.9rem; }
    .banner-section { aspect-ratio: 16 / 10; margin: 1rem 0; }
    .carousel-hero { height: 320px; }
    .card:hover { transform: translateY(-4px) !important; box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15) !important; }
    article.card .card-header { padding: 1rem !important; }
    .nav-tabs .nav-link { padding: 0.75rem 1rem; font-size: 0.95rem; }
    .btn-group-actions { flex-direction: column; }
    .btn-group-actions .btn { width: 100%; }
    .gallery-item .card-img-top-wrapper { height: 200px !important; }
    .sitemap-section { padding: 1rem; }
    .sitemap-title { font-size: 1rem; padding: 0.6rem 0.8rem; margin: -1rem -1rem 0.8rem -1rem; }
    .social-section .col-md-6 { margin-bottom: 2rem; }
    .tab-content.theme { min-height: 180px; padding: 1rem; }
}
@media (max-width: 576px) {
    .rules-category-btn { min-height: 180px; padding: 1.5rem 1rem; }
    .rules-category-btn i { font-size: 2.5rem; margin-bottom: 0.75rem; }
    .rules-category-btn-title { font-size: 1.35rem; }
    .rules-category-btn-description { font-size: 0.85rem; }
    .rules-category-btn-size { min-height: 180px; padding: 1.5rem 1rem; }
    .rules-category-btn-size i { font-size: 2.5rem; margin-bottom: 0.75rem; }
    .rules-category-btn-size .rules-category-btn-title { font-size: 1.35rem; }
    .rules-category-btn-size .rules-category-btn-description { font-size: 0.85rem; }
    .news-card-btn { width: 100%; min-width: 0; }
    .news-item-row { flex-direction: column !important; align-items: flex-start !important; }
    .news-item-right { margin-top: 8px; margin-left: 0 !important; width: 100%; }
    .news-item-date { margin-left: 0; margin-top: 0.5rem; }
    .gallery-item .card-img-top-wrapper { height: 180px !important; }
    .pagination .page-link { padding: 0.375rem 0.5rem; min-width: 36px; font-size: 0.875rem; }
}

/* ==========================================
   20. PRINT - 列印樣式
   ========================================== */
@media print {
    .no-print, .skip-link, .skip-to-main, .nav-tabs, .btn, .main-header, .main-footer, .navbar, header, footer { display: none !important; }
    .content-card { box-shadow: none; border: 1px solid #000; }
    .sitemap-section { box-shadow: none; border: 1px solid #dee2e6; page-break-inside: avoid; }
    .sitemap-section:hover { transform: none; }
    .sitemap-title { background: var(--primary); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a[href]:after { content: " (" attr(href) ")"; }
}

/* ==========================================
   21. RULES DETAIL - 競賽辦法詳細頁面導航
   ========================================== */
.links_scroll { position: sticky; top: 75px; z-index: 997; }
@media screen and (max-width: 1199px) { .links_scroll { top: 100px; } }
@media screen and (max-width: 767px) { .links_scroll { top: 100px; text-align: center; } }
.links_scroll .container { background: rgb(248, 250, 252); padding: 1.5em 15px 0.5em 15px;
}
.links_scroll a { display: inline-block; padding: 5px 1%; background: white; border: 2px solid var(--primary); border-radius: 5px; color: var(--primary); font-size: 1.2rem; margin: 0 5px 5px; }
.links_scroll a:hover { background: var(--primary); color: white; }
@media screen and (max-width: 991px) { .links_scroll a { display: none; } .links_scroll select { display: inline-block; } }
.links_scroll select { display: none; padding: 5px 10px; width: 30%; border: 1px solid; border-radius: 5px; font-size: 1.2em; }


/* ==========================================
   END OF STYLESHEET - 優化完成
   總行數: 約 650 行（含注釋）
   ========================================== */
