/* 通用彈窗與學習歷程彈窗專屬樣式 */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-paper {
    background: linear-gradient(135deg, #fdf8eb 0%, #f3e2b9 100%);
    border: 3px solid var(--color-gold);
    outline: 2px solid #4a2e12;
    border-radius: 24px;
    width: 880px;
    max-width: 90vw;
    max-height: 85vh;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9), inset 0 0 25px rgba(212, 175, 55, 0.3);
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-overlay.active .modal-paper {
    transform: scale(1) translateY(0);
}

.modal-header {
    font-size: 1.5rem;
    font-weight: 900;
    color: #4a2e12;
    margin-bottom: 12px;
    border-bottom: 2px dashed #c5a059;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.modal-body-scrollable {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-reflect-box {
    font-size: 0.92rem;
    color: #5a3c1e;
    font-style: italic;
    background: rgba(212,175,55,0.18);
    padding: 10px 16px;
    border-radius: 10px;
    text-align: center;
}

.skills-section-title {
    text-align: left;
    font-size: 1.05rem;
    font-weight: 800;
    color: #4a2e12;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 4px;
}

.skill-item-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--color-gold);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.25s ease;
}

.skill-item-card:hover {
    transform: translateY(-3px) scale(1.02);
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4);
    border-color: var(--color-gold-bright);
}

.skill-item-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #4a2e12 0%, #2b1808 100%);
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    border: 1.5px solid var(--color-gold-bright);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.skill-item-icon i {
    color: #ffffff !important;
}

.skill-item-info {
    flex: 1;
    text-align: left !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skill-item-info h5 {
    font-size: 0.98rem;
    color: #3a2211;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 2px;
    text-align: left !important;
}

.skill-item-info p {
    font-size: 0.78rem;
    color: #6d5235;
    text-align: left !important;
    line-height: 1.35;
}

.reward-equip-card {
    background: rgba(255, 235, 235, 0.85);
    border-color: #a83232;
}

.reward-equip-card .skill-item-icon {
    background: linear-gradient(135deg, #7a1c1c 0%, #4a0c0c 100%);
    border-color: #ffd700;
}

.equip-status-tag {
    font-size: 0.88rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 6px;
    background: linear-gradient(180deg, #8a1c1c 0%, #5a0c0c 100%);
    color: #ffe082;
    border: 1px solid var(--color-gold-bright);
    margin-right: 8px;
    display: inline-block;
}

.modal-footer-fixed {
    flex-shrink: 0;
    padding-top: 12px;
    border-top: 2px dashed #c5a059;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-modal-action {
    padding: 10px 28px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
}

.btn-claim {
    background: linear-gradient(180deg, #d4af37 0%, #8a6d1c 100%);
    border: 1.5px solid #fff;
    color: #fff;
}

.btn-claim:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.9);
}

.btn-view-history {
    background: linear-gradient(180deg, #3a2211 0%, #1f1107 100%);
    border: 1.5px solid var(--color-gold);
    color: #fbe6be;
}

.btn-view-history:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    border-color: #fff;
}

/* 學習歷程彈窗專用 */
.history-modal-paper {
    background: linear-gradient(135deg, #fefbf3 0%, #f1e2c3 100%);
    border: 3px solid var(--color-gold);
    outline: 2px solid #3a2211;
    border-radius: 24px;
    width: 85% !important;
    max-width: 1200px;
    height: 84vh;
    padding: 28px 32px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    transform: scale(0.85) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.modal-overlay.active .history-modal-paper {
    transform: scale(1) translateY(0);
}

.history-header {
    font-size: 1.45rem;
    font-weight: 900;
    color: #3a2211;
    padding-bottom: 10px;
    border-bottom: 2px dashed #c5a059;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.history-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #5a3c1e;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.history-close-btn:hover {
    transform: scale(1.25) rotate(90deg);
    color: #d32f2f;
}

.history-tabs-nav {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    border-bottom: 2px solid #b89355;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.history-tab-btn {
    padding: 6px 18px;
    background: rgba(74, 46, 18, 0.1);
    border: 1.5px solid #b89355;
    border-radius: 10px;
    color: #5a3c1e;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
}

.history-tab-btn:hover {
    background: rgba(212, 175, 55, 0.35);
    border-color: var(--color-gold);
    transform: translateY(-2px);
}

.history-tab-btn.active {
    background: linear-gradient(180deg, #3a2211 0%, #1f1107 100%);
    border-color: var(--color-gold-bright);
    color: #fbe6be;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

/* 網格佈局：固定左側 320px 拍立得，右側自動延展文字 */
.history-grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding-top: 14px;
    overflow: hidden;
}

.history-left-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    align-items: center;
    justify-content: flex-start;
}

/* 拍立得照片外框 */
/* 拍立得照片外框 */
.history-image-holder {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px; /* 拍立得四周純白邊框 */
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: rotate(-1.5deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.history-image-holder:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.48), 0 0 20px rgba(212, 175, 55, 0.4);
}

/* 圖片區域高度 100% 滿版加大 */
.polaroid-img-area {
    width: 100%;
    height: 100%;
    flex: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f7f7f7;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* 懸停出現放大鏡 Icon */
.history-image-holder::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(45, 26, 14, 0.85);
    color: #ffd700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.88rem;
    border: 1px solid #d4af37;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.polaroid-caption {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    color: #3d2712;
    font-size: 0.98rem;
    font-weight: 800;
    font-style: italic;
    line-height: 1.35;
    font-family: var(--font-main);
}

.history-right-column {
    background: rgba(255, 255, 255, 0.88);
    border: 1.5px solid #c5a059;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: inset 0 0 10px rgba(197, 160, 89, 0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-right-column h4 {
    font-size: 1.32rem;
    color: #3a2211;
    border-bottom: 1.5px solid #e2c07b;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-text-content {
    font-size: 1.22rem;
    line-height: 1.9;
    font-weight: 600;
    color: #3a2211;
    white-space: pre-line;
}

/* 圖片大圖檢視燈箱 (Lightbox Modal) */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    border: 3px solid #d4af37;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(212, 175, 55, 0.5);
}

.lightbox-close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 42px;
    height: 42px;
    background: #3a2211;
    border: 2px solid #ffd700;
    color: #ffd700;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    z-index: 2;
}

.lightbox-close-btn:hover {
    transform: scale(1.15) rotate(90deg);
    color: #fff;
}

.lightbox-caption {
    margin-top: 14px;
    color: #fbe6be;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}