/* --- 通用與全域設定 --- */
:root {
    /* 深色模式變數 */
    --bg-dark: #314f68;
    --surface-dark: #738b8f;
    --accent-dark: #e0ffff;
    --text-dark: #f7fafc;
    --text-muted-dark: #a0aec0;

    /* 淺色模式變數 */
    --bg-light: #e6e6fa;
    --surface-light: #ffffff;
    --accent-light: 	#5f9ea0;
    --text-light: #1a202c;
    --text-muted-light: #4a5568;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 動畫 --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 排版 --- */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-dark);
    transition: color 0.3s ease;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; text-align: center; margin-bottom: 2.5rem; }
h3 { font-size: 1.5rem; }

a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
a:hover { color: #ffffff; }

p { color: var(--text-muted-dark); transition: color 0.3s ease; }

section {
    padding: 80px 20px;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeIn 0.7s ease-out forwards;
}

/* --- 導覽列 --- */
header {
    background-color: var(--surface-dark);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav .logo { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: bold; }
nav ul { list-style: none; display: flex; gap: 2.5rem; margin: 0; padding: 0; }
nav a { font-weight: 400; }

/* --- 按鈕 --- */
.cta-button, #theme-toggle {
    background-color: var(--accent-dark);
    color: var(--bg-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover, #theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(79, 209, 197, 0.4);
}
#hero { text-align: center; }

/* --- 專案區塊 --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--surface-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.project-card img { border-bottom: 3px solid var(--accent-dark); }
.project-card h3 { padding: 1rem 1.5rem 0; margin: 0; }
.project-card p { padding: 0.5rem 1.5rem; flex-grow: 1; }
.project-card a { display: inline-block; padding: 0 1.5rem 1.5rem; }

/* --- 聯絡與頁尾 --- */
#contact { text-align: center; }
#contact .contact-links { margin-top: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
#contact i { margin-right: 0.75rem; }

footer {
    text-align: center;
    padding: 2.5rem;
    background-color: var(--surface-dark);
    transition: background-color 0.3s ease;
}

footer .social-icons { margin-bottom: 1rem; }
footer .social-icons a { font-size: 1.75rem; margin: 0 1rem; color: var(--text-muted-dark); }
footer .social-icons a:hover { color: var(--accent-dark); }
footer p { color: var(--text-muted-dark); font-size: 0.9rem; margin: 0; }

/* --- 淺色模式 --- */
body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode a {
    color: var(--accent-light);
}
body.light-mode a:hover { color: #1a202c; }
body.light-mode p, body.light-mode footer p, body.light-mode footer .social-icons a { color: var(--text-muted-light); }
body.light-mode header, body.light-mode footer { background-color: var(--surface-light); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
body.light-mode .cta-button, body.light-mode #theme-toggle { background-color: var(--accent-light); color: var(--bg-light); }
body.light-mode .cta-button:hover, body.light-mode #theme-toggle:hover { box-shadow: 0 5px 15px rgba(43, 108, 176, 0.4); }
body.light-mode .project-card { background-color: var(--surface-light); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
body.light-mode .project-card:hover { box-shadow: 0 12px 20px rgba(0,0,0,0.1); }
body.light-mode .project-card img { border-color: var(--accent-light); }
body.light-mode footer .social-icons a:hover { color: var(--accent-light); }
