/* ================================================
   課程詳細頁面 — Anthropic Design Style
   Background: #FAF9F6  ·  Text: #1C1917  ·  Accent: #D97757
   ================================================ */

.detail-page {
    font-family: 'Taipei Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 'Helvetica Neue', Arial, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    color: #1C1917;
    background: #FAF9F6;
}

/* ── 麵包屑 ── */
.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: #78716C;
    margin-bottom: 12px;
}

.breadcrumb-link {
    color: #78716C;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb-link:hover {
    color: #D97757;
}

.breadcrumb-sep {
    font-size: 0.75rem;
    color: #C2BAB4;
}

.breadcrumb-current {
    color: #1C1917;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

/* ── 課程英雄區 ── */
.detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 12px;
}

.hero-content {
    flex: 1;
}

.hero-image {
    flex-shrink: 0;
}

.hero-badge-new {
    display: inline-block;
    background: #FEF3C7;
    color: #92400E;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 10px;
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}

.detail-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #1C1917;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.detail-teacher-name {
    font-size: 1.15rem;
    color: #78716C;
    font-weight: 500;
    margin: 0;
}

/* ── 區塊 Section ── */
.detail-section {
    margin-bottom: 6px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1C1917;
    letter-spacing: 0.04em;
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-number {
    font-size: 0.72rem;
    font-weight: 700;
    color: #D97757;
    letter-spacing: 0.1em;
    background: #FEF0E8;
    border-radius: 5px;
    padding: 2px 7px;
}

/* ── 課程資訊 Grid ── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid #E8E5DF;
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border-bottom: 1px solid #F0EDE8;
    border-right: 1px solid #F0EDE8;
}

.info-item:nth-child(2n) {
    border-right: none;
}

.info-item:nth-last-child(-n+2):not(.info-item-wide) {
    border-bottom: none;
}

.info-item:nth-child(5) {
    border-bottom: none;
}

.info-item-wide {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid #F0EDE8;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #78716C;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.info-label .bi {
    color: #D97757;
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.15rem;
    font-weight: 500;
    color: #1C1917;
    line-height: 1.5;
}

.info-sub {
    color: #78716C;
    font-size: 0.9rem;
}

/* ── 招生狀態 Badge ── */
.status-badge {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 10px;
    letter-spacing: 0.04em;
}

.status-open {
    background: #DCFCE7;
    color: #166534;
}

.status-full {
    background: #FEE2E2;
    color: #B91C1C;
}

.status-closed {
    background: #F1F5F9;
    color: #475569;
}

.status-pending {
    background: #FEF9C3;
    color: #713F12;
}

/* ── 費用 ── */
.fee-total {
    font-size: 1.05rem;
    font-weight: 700;
    color: #D97757;
}

.fee-breakdown {
    font-size: 0.85rem;
    color: #78716C;
}

.fee-other {
    font-size: 0.85rem;
    color: #78716C;
}

/* ── 師資卡片 ── */
.teacher-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    border: 1px solid #E8E5DF;
    border-radius: 12px;
    background: #FFFFFF;
    margin-bottom: 16px;
}

.teacher-card:last-child {
    margin-bottom: 0;
}

.teacher-avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #F0EDE8;
}

.teacher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #F0EDE8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A8A29E;
    font-size: 2rem;
}

.teacher-info {
    flex: 1;
    min-width: 0;
}

.teacher-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1C1917;
    margin-bottom: 4px;
}

.teacher-workplace,
.teacher-edu {
    font-size: 1rem;
    color: #78716C;
    margin-bottom: 2px;
}

.teacher-bio,
.teacher-experience,
.teacher-specialty {
    font-size: 1.05rem;
    color: #44403C;
    line-height: 1.7;
}

.bio-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #D97757;
    background: #FEF0E8;
    border-radius: 4px;
    padding: 1px 7px;
    margin-right: 8px;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* ── 關於這堂課 ── */
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #E8E5DF;
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
}

.about-item {
    padding: 18px 24px;
    border-bottom: 1px solid #F0EDE8;
}

.about-item:last-child {
    border-bottom: none;
}

.about-label {
    font-size: 0.98rem;
    font-weight: 700;
    color: #78716C;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.about-label .bi {
    color: #D97757;
}

.about-text {
    font-size: 1.1rem;
    color: #1C1917;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ── 課程大綱表格 ── */
.outline-table-wrapper {
    border: 1px solid #E8E5DF;
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
}

.outline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05rem;
}

.outline-table thead tr {
    background: #F7F5F1;
}

.outline-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 700;
    color: #78716C;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 2px solid #E8E5DF;
}

.outline-table td {
    padding: 13px 16px;
    color: #1C1917;
    vertical-align: top;
    border-bottom: 1px solid #F0EDE8;
    line-height: 1.6;
}

.outline-table tbody tr:last-child td {
    border-bottom: none;
}

.outline-table tbody tr:hover {
    background: #F7F5F1;
}

.outline-col-week  { width: 100px; }
.outline-col-topic { width: 200px; }
.outline-col-content { }

.outline-week {
    font-weight: 600;
    color: #D97757;
}

.week-info {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.week-date {
    font-size: 0.9rem;
    color: #78716C;
    font-weight: 400;
}

.outline-topic {
    font-weight: 600;
}

.outline-content {
    color: #44403C;
    white-space: pre-wrap;
}

/* ── 底部返回 ── */
.detail-footer {
    padding-top: 32px;
    border-top: 1px solid #E8E5DF;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    background: #FFFFFF;
    border: 1.5px solid #E8E5DF;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 500;
    color: #44403C;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.btn-back:hover {
    border-color: #D97757;
    background: #FEF0E8;
    color: #D97757;
}

/* ── RWD ── */
@media (max-width: 600px) {
    .detail-page {
        padding: 20px 16px 48px;
    }

    .detail-title {
        font-size: 1.6rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item {
        border-right: none;
    }

    .info-item:nth-last-child(-n+2):not(.info-item-wide) {
        border-bottom: 1px solid #F0EDE8;
    }

    .info-item:last-child,
    .info-item-wide {
        border-bottom: none;
    }

    .teacher-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .outline-col-content {
        display: none;
    }
}

/* ── 折疊功能 ── */
.detail-section-collapsible {
    position: relative;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #F0EDE8;
}

.section-toggle-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #FFFFFF;
    border: 1px solid #E8E5DF;
    border-radius: 6px;
    color: #D97757;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.section-toggle-btn:hover {
    border-color: #D97757;
    background: #FEF0E8;
}

.section-toggle-btn:active {
    transform: scale(0.95);
}

.section-content {
    max-height: 9999px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 1;
}

.detail-section-collapsible:not(.expanded) .section-content {
    max-height: 0;
    opacity: 0;
}

/* ── 課程照片 ── */
.course-image-section {
    margin-bottom: 24px;
}

.course-image-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E8E5DF;
}

.course-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #F5F3F0;
    cursor: zoom-in;
}

/* ── 課程圖片懸停大圖 ── */
.course-image-hover-container {
    display: none;
    position: fixed;
    width: 400px;
    height: 400px;
    border: 2px solid #D97757;
    border-radius: 8px;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(28, 25, 23, 0.15);
    z-index: 9999;
    pointer-events: none;
}

.course-image-hover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
