/* ============================================
   2026 AI 公益創新競賽 - 現代科技風格
   藍底設計，類似海報風格
   ============================================ */

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

/* ============================================
   基本樣式
   ============================================ */

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', 'Noto Sans CJK TC', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(135deg, #0f2e5e 0%, #1a4d8f 50%, #0d3b7a 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* 背景粒子效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 50px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 10px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

/* ============================================
   頁首 (Header)
   ============================================ */

header {
    background: linear-gradient(135deg, rgba(15, 46, 94, 0.8) 0%, rgba(26, 77, 143, 0.8) 50%, rgba(13, 59, 122, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* 頁首光效 */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    animation: shimmer 3s infinite;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
    background: linear-gradient(135deg, #64c8ff 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   導航列 (Navigation)
   ============================================ */

nav {
    background: linear-gradient(90deg, rgba(15, 46, 94, 0.9) 0%, rgba(26, 77, 143, 0.9) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(100, 200, 255, 0.2);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

nav li {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

nav a {
    display: block;
    padding: 14px 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #64c8ff 0%, #00d4ff 100%);
    transition: width 0.3s ease;
}

nav a:active,
nav a:hover {
    color: #64c8ff;
}

nav a:active::before,
nav a:hover::before {
    width: 100%;
}

nav a.active {
    color: #64c8ff;
}

nav a.active::before {
    width: 100%;
}

/* ============================================
   區段 (Section)
   ============================================ */

section {
    background: linear-gradient(135deg, rgba(20, 60, 120, 0.6) 0%, rgba(30, 80, 150, 0.6) 100%);
    backdrop-filter: blur(10px);
    margin: 24px 0;
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 200, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* 區段背景光效 */
section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

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

section h2 {
    color: #64c8ff;
    font-size: 1.8rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(100, 200, 255, 0.4);
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
}

section h3 {
    color: #b0d8ff;
    font-size: 1.2rem;
    margin-top: 22px;
    margin-bottom: 14px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

section h4 {
    color: #64c8ff;
    font-size: 1.05rem;
    margin-top: 14px;
    margin-bottom: 10px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ============================================
   文字樣式
   ============================================ */

p {
    margin-bottom: 14px;
    text-align: justify;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

ul, ol {
    margin-left: 24px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

li {
    margin-bottom: 10px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

strong {
    color: #64c8ff;
    font-weight: 600;
}

a {
    color: #64c8ff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #64c8ff;
    transition: width 0.3s ease;
}

a:active,
a:hover {
    color: #00d4ff;
}

a:active::after,
a:hover::after {
    width: 100%;
}

/* ============================================
   表格 (Table)
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

table th {
    background: linear-gradient(90deg, #0f4d8f 0%, #1a6db3 100%);
    color: #64c8ff;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(100, 200, 255, 0.3);
}

table td {
    padding: 14px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

table tr:hover {
    background-color: rgba(100, 200, 255, 0.1);
    transition: background-color 0.3s ease;
}

table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   高亮框 (Highlight Box)
   ============================================ */

.highlight {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    padding: 18px;
    border-left: 4px solid #ffc107;
    margin: 18px 0;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 193, 7, 0.2);
    position: relative;
    z-index: 1;
}

.highlight:active,
.highlight:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.2);
    transform: translateY(-2px);
}

.highlight p {
    margin-bottom: 10px;
}

.highlight ul {
    margin-left: 24px;
}

/* ============================================
   獎項盒子 (Award Box)
   ============================================ */

.award-box {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.15) 0%, rgba(0, 212, 255, 0.1) 100%);
    color: white;
    padding: 20px;
    margin: 14px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(100, 200, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.3);
    flex-wrap: wrap;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.award-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(100, 200, 255, 0.5) 50%, transparent 100%);
}

.award-box:active,
.award-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
}

.award-box strong {
    font-size: 1.1rem;
    color: #64c8ff;
}

.award-box div {
    flex: 1;
    min-width: 150px;
}

.award-box div:last-child {
    text-align: right;
}

.award-box p {
    margin: 4px 0;
    text-align: inherit;
    font-size: 0.95rem;
}

/* ============================================
   聯絡資訊 (Contact Info)
   ============================================ */

.contact-info {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
    padding: 18px;
    border-radius: 8px;
    margin: 18px 0;
    border-left: 4px solid #64c8ff;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 200, 255, 0.2);
    position: relative;
    z-index: 1;
}

.contact-info:active,
.contact-info:hover {
    box-shadow: 0 6px 16px rgba(100, 200, 255, 0.2);
    transform: translateY(-2px);
}

.contact-info p {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.contact-info a {
    color: #64c8ff;
    font-weight: 500;
    word-break: break-all;
}

/* ============================================
   下載區 (Download Section)
   ============================================ */

.download-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 18px 0;
    position: relative;
    z-index: 1;
}

.download-card {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.2) 0%, rgba(0, 212, 255, 0.15) 100%);
    color: white;
    padding: 24px 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(100, 200, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.3);
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #64c8ff 50%, transparent 100%);
    border-radius: 10px 10px 0 0;
}

.download-card:active,
.download-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 32px rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
}

.download-card h3 {
    color: #64c8ff;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.download-card p {
    margin-bottom: 14px;
    text-align: center;
    font-size: 0.9rem;
}

.download-card a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 14px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0f4d8f 0%, #1a6db3 100%);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border: 1px solid rgba(100, 200, 255, 0.3);
}

.download-card a:active,
.download-card a:hover {
    background: linear-gradient(135deg, #1a6db3 0%, #2587d4 100%);
    box-shadow: 0 4px 12px rgba(100, 200, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================
   頁尾 (Footer)
   ============================================ */

footer {
    background: linear-gradient(90deg, rgba(15, 46, 94, 0.9) 0%, rgba(26, 77, 143, 0.9) 100%);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 28px 20px;
    margin-top: 40px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(100, 200, 255, 0.2);
    position: relative;
    z-index: 1;
}

footer p {
    margin-bottom: 8px;
    text-align: center;
}

footer a {
    color: #64c8ff;
}

/* ============================================
   返回頂部按鈕 (Back to Top Button)
   ============================================ */

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 16px;
    background: linear-gradient(135deg, #0f4d8f 0%, #1a6db3 100%);
    color: #64c8ff;
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    z-index: 99;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(100, 200, 255, 0.3);
    -webkit-appearance: none;
    appearance: none;
}

#backToTop:active,
#backToTop:hover {
    background: linear-gradient(135deg, #1a6db3 0%, #2587d4 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(100, 200, 255, 0.4);
    border-color: rgba(100, 200, 255, 0.5);
}

#backToTop.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideUp 0.3s ease-out;
}

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

/* ============================================
   手機優化 (Mobile - < 480px)
   ============================================ */

@media (max-width: 479px) {
    html {
        font-size: 14px;
    }
    
    header {
        padding: 32px 12px;
    }
    
    header h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    nav a {
        padding: 12px 8px;
        font-size: 0.75rem;
    }
    
    section {
        margin: 16px 0;
        padding: 20px 14px;
    }
    
    section h2 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    section h3 {
        font-size: 1rem;
        margin-top: 14px;
    }
    
    ul, ol {
        margin-left: 18px;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th, table td {
        padding: 10px;
    }
    
    .award-box {
        padding: 14px;
        gap: 10px;
    }
    
    .award-box strong {
        font-size: 1rem;
    }
    
    .award-box p {
        font-size: 0.85rem;
    }
    
    .download-card {
        padding: 18px 14px;
    }
    
    .download-card h3 {
        font-size: 1rem;
    }
    
    .download-card p {
        font-size: 0.8rem;
    }
    
    .contact-info {
        padding: 14px;
    }
    
    .contact-info p {
        font-size: 0.85rem;
    }
    
    #backToTop {
        width: 44px;
        height: 44px;
        font-size: 18px;
        bottom: 16px;
        right: 12px;
    }
    
    footer {
        padding: 20px 12px;
        font-size: 0.8rem;
    }
}

/* ============================================
   平板優化 (Tablet - 480px to 1024px)
   ============================================ */

@media (min-width: 480px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    header {
        padding: 48px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    nav a {
        padding: 13px 12px;
        font-size: 0.9rem;
    }
    
    section {
        margin: 22px 0;
        padding: 28px 20px;
    }
    
    section h2 {
        font-size: 1.6rem;
        margin-bottom: 14px;
    }
    
    section h3 {
        font-size: 1.15rem;
        margin-top: 18px;
    }
    
    .download-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .award-box {
        padding: 18px;
    }
    
    table {
        font-size: 0.93rem;
    }
    
    table th, table td {
        padding: 12px;
    }
}

/* ============================================
   筆電優化 (Desktop - > 1024px)
   ============================================ */

@media (min-width: 1025px) {
    header {
        padding: 60px 20px;
    }
    
    header h1 {
        font-size: 2.8rem;
    }
    
    header p {
        font-size: 1.15rem;
    }
    
    nav a {
        padding: 15px 20px;
    }
    
    section {
        margin: 28px 0;
        padding: 36px 32px;
    }
    
    section h2 {
        font-size: 2rem;
        margin-bottom: 18px;
    }
    
    section h3 {
        font-size: 1.3rem;
        margin-top: 24px;
    }
    
    .download-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .award-box {
        padding: 22px;
    }
    
    #backToTop {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 30px;
        right: 30px;
    }
}

/* ============================================
   觸控設備優化
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    nav a:hover {
        background-color: transparent;
    }
    
    .award-box:hover {
        transform: none;
    }
    
    .download-card:hover {
        transform: none;
    }
    
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   列印樣式 (Print Styles)
   ============================================ */

@media print {
    nav {
        display: none;
    }
    
    #backToTop {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background-color: white;
        color: #333;
    }
}
