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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導航欄 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* 英雄區域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideDown 0.8s ease-out;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

/* 按鈕 */
.btn-primary {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 關於我 */
.about {
    padding: 80px 0;
    background-color: white;
}

.about h2,
.skills h2,
.portfolio h2,
.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
    position: relative;
    padding-bottom: 1rem;
}

.about h2::after,
.skills h2::after,
.portfolio h2::after,
.contact h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #555;
    text-align: center;
}

/* 技能部分 */
.skills {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.skill-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skill-card p {
    color: #666;
    font-size: 0.95rem;
}

/* 作品集 */
.portfolio {
    padding: 80px 0;
    background-color: white;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 讓 <img> 在容器內填滿並保持裁切（避免被裁切不完整） */
.portfolio-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-card h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    color: #333;
}

.portfolio-card p {
    padding: 0 1.5rem 1.5rem;
    color: #666;
    font-size: 0.95rem;
}

/* 聯絡區域 */
.contact {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.contact p {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.2);
}

.social-links {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #764ba2;
}

/* 頁尾 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

footer p {
    margin: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }
    
    .about h2,
    .skills h2,
    .portfolio h2,
    .contact h2 {
        font-size: 2rem;
    }
}