/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #06b6d4;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

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

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

/* 導航欄 */
.navbar {
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

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

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

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

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

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

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

.btn-secondary:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

/* 特色區塊 */
.features {
    padding: 5rem 0;
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

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

.feature-card p {
    color: var(--text-light);
}

/* 課程預覽 */
.courses-preview {
    padding: 5rem 0;
}

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

.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.course-image {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 3rem;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
}

.course-info {
    padding: 1.5rem;
}

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

.course-info p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.course-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.course-link:hover {
    color: var(--secondary-color);
}

/* 統計數據 */
.stats {
    background: var(--primary-color);
    color: white;
    padding: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* 頁面標題 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* 內容區塊 */
.content-section {
    padding: 3rem 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
}

/* 側邊欄 */
.sidebar {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.chapter-list {
    list-style: none;
}

.chapter-list li {
    margin-bottom: 0.5rem;
}

.chapter-list a {
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.3s;
    display: block;
    padding: 0.5rem;
    border-radius: 6px;
}

.chapter-list a:hover {
    color: var(--primary-color);
    background: white;
}

/* 主內容 */
.main-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.main-content article {
    margin-bottom: 3rem;
}

.main-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.main-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-dark);
}

.main-content h4 {
    font-size: 1.25rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-dark);
}

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

.main-content ul,
.main-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.main-content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* 高亮框 */
.highlight-box {
    background: linear-gradient(135deg, #e0e7ff 0%, #fce7f3 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.highlight-box h3 {
    margin-top: 0;
}

/* 信息卡片 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.info-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.info-card:hover {
    border-color: var(--primary-color);
}

.info-card h4 {
    color: var(--primary-color);
    margin-top: 0;
}

/* 算法區塊 */
.algorithm-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.algorithm-section h4 {
    margin-top: 0;
}

/* 代碼框 */
.code-box {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 1rem 0;
}

/* 特徵列表 */
.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 1rem;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* 項目列表 */
.project-list {
    margin: 1.5rem 0;
}

.project-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
}

.project-item h3,
.project-item h4 {
    margin-top: 0;
    color: var(--text-dark);
}

/* CTA框 */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.cta-box h3 {
    color: white;
    margin-top: 0;
}

.cta-box p {
    color: white;
    opacity: 0.95;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* 課程詳細卡片 */
.course-card-detail {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card-detail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.course-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.course-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-icon {
    font-size: 2.5rem;
}

.course-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

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

.course-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.course-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.topic-tag {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* 課程篩選 */
.course-filter {
    margin-bottom: 2rem;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 課程區塊 */
.courses-section {
    margin-bottom: 4rem;
}

/* 學習路徑 */
.learning-path {
    margin-top: 4rem;
}

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

.path-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
}

.path-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.path-steps {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.path-steps li {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.path-duration {
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 關於頁面 */
.about-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.intro-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-light);
}

.values-section {
    margin-bottom: 4rem;
}

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

.value-card {
    text-align: center;
    padding: 2rem;
}

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

.value-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

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

/* 團隊區塊 */
.team-section {
    margin-bottom: 4rem;
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

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

.team-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.team-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.team-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-bio {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.team-expertise {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.team-expertise span {
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-dark);
}

/* 時間線 */
.achievements-section {
    margin-bottom: 4rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.timeline-content p {
    color: var(--text-light);
}

/* 合作夥伴 */
.partners-section {
    margin-bottom: 4rem;
}

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

.partner-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.partner-item:hover {
    transform: translateY(-5px);
}

.partner-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.partner-item p {
    color: var(--text-dark);
    font-weight: 600;
}

/* 評價區塊 */
.testimonials-section {
    margin-bottom: 4rem;
}

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

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial-rating {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.testimonial-author strong {
    color: var(--text-dark);
}

.testimonial-author span {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 聯繫區塊 */
.contact-section {
    margin-bottom: 4rem;
}

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

.contact-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

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

.contact-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.contact-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.social-links {
    text-align: center;
}

.social-links h3 {
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-icon {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s;
}

.social-icon:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* CTA區塊 */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 2rem;
    border-radius: 12px;
    text-align: center;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
    border: none;
}

.cta-section p {
    color: white;
    opacity: 0.95;
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* 頁腳 */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

    .sidebar {
        position: static;
    }

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

    .button-group {
        flex-direction: column;
    }
}