/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

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

/* ===== Header & Navigation ===== */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ===== Language Switch Button ===== */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', sans-serif;
}

.lang-switch:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.lang-option {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.lang-option:hover {
    color: var(--primary-color);
}

.lang-option.active {
    color: var(--primary-color);
    font-weight: 700;
    background-color: rgba(37, 99, 235, 0.1);
}

.lang-divider {
    color: var(--border-color);
    font-weight: 300;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.hero-position {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.8;
}

.hero-awards {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.award-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: white;
    border-color: white;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);
}

/* ===== Section Styles ===== */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background-color: var(--bg-white);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

.about-text p strong {
    color: var(--text-dark);
}

.about-info {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.info-value {
    color: var(--text-light);
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* ===== Experience Section ===== */
.experience {
    background-color: var(--bg-light);
}

.experience-item {
    background-color: var(--bg-white);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.exp-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.exp-company {
    font-size: 1.125rem;
    color: var(--text-light);
}

.exp-date {
    background-color: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.exp-content h4 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.exp-content h5 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.exp-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.exp-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.exp-content li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.exp-subsection {
    margin-top: 1.5rem;
}

.exp-project {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.exp-project:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.project-period {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

/* ===== Tech Stack Tags ===== */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--primary-color);
}

/* ===== Project Awards ===== */
.project-awards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.award {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== Skills Section ===== */
.skills {
    background-color: var(--bg-white);
}

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

.skill-category {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.skill-category h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.skill-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 50px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 50px;
    transition: width 1s ease;
}

/* ===== Projects Section ===== */
.projects {
    background-color: var(--bg-light);
}

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

.project-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.project-card.featured {
    border: 2px solid var(--accent-color);
}

.project-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.project-card.featured .project-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.project-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.project-company {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.project-period {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===== Education Section ===== */
.education {
    background-color: var(--bg-white);
}

.education-content {
    max-width: 900px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.edu-icon {
    font-size: 3rem;
}

.edu-details h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.edu-school {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.edu-period {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.certificates h3,
.courses h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.cert-grid {
    display: grid;
    gap: 1.5rem;
}

.cert-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.cert-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.cert-date {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.cert-org {
    color: var(--text-light);
    font-size: 0.9rem;
}

.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.course-name {
    font-weight: 600;
    color: var(--text-dark);
}

.course-date {
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* ===== Contact Section ===== */
.contact {
    background-color: var(--bg-light);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

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

.contact-item {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-details h3 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.contact-details p,
.contact-details a {
    color: var(--text-light);
    text-decoration: none;
}

.contact-details a:hover {
    color: var(--primary-color);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .exp-header {
        flex-direction: column;
        gap: 1rem;
    }

    .exp-date {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .education-item {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .course-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}