/* player-template.css */
/* 全局與排版美化 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    padding: 40px 20px;
    margin: 0;
    display: flex;
    justify-content: center;
    /* 封鎖選取文字功能 */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* 標準語法 */
}

.container {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 1280px; 
    width: 100%;
}
h2 {
    color: #d32f2f;
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
p {
    color: #555;
    font-size: 1.15rem;
    margin-bottom: 25px;
}

/* 影片區塊設定 */
.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}
video {
    width: 100%;
    display: block;
}

/* ★ 完全自訂的 HTML 字幕層 ★ */
.custom-subtitle {
    position: absolute;
    bottom: 55px;
    left: 5%;
    right: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; 
    pointer-events: none; 
    z-index: 15;
    opacity: 0; 
    transition: opacity 0.2s;
}

.custom-subtitle span {
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 1.6rem;
    padding: 4px 12px;
    border-radius: 6px;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word; 
    line-height: 1.4;
}

/* 預覽圖正中央的大播放鍵 */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background-color: rgba(211, 47, 47, 0.85);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border: none;
}
.center-play-btn:hover {
    background-color: rgba(211, 47, 47, 1);
    transform: translate(-50%, -50%) scale(1.1);
}
.center-play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 0 20px 32px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 8px;
}

/* 客製化控制列 */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    align-items: center;
    padding: 15px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
    gap: 15px;
}

.video-wrapper:hover .custom-controls,
.custom-controls.active {
    opacity: 1;
}

/* 控制列按鈕通用樣式 */
.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}
.control-btn:hover {
    color: #d32f2f;
    transform: scale(1.1);
}

/* CC 字幕按鈕特殊樣式 */
.cc-btn {
    font-size: 15px;
    font-weight: 900;
    border: none;
    border-radius: 6px;
    padding: 4px 9px;
    background-color: #9e9e9e;
    color: #333;
    transition: all 0.3s ease;
}
.cc-btn:hover {
    background-color: #bdbdbd;
}
.cc-btn.active {
    background-color: #ffffff;
    color: #333;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* 進度條與音量條樣式 */
input[type=range] {
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    height: 6px;
    outline: none;
    cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d32f2f;
    cursor: pointer;
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.progress-bar {
    flex-grow: 1;
}
.volume-bar {
    width: 80px;
}

/* 時間顯示 */
.time-display {
    color: white;
    font-size: 14px;
    font-family: monospace;
    user-select: none;
    white-space: nowrap;
}

/* 底部返回連結 */
.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #3f51b5;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    background: #e8eaf6;
    transition: background 0.3s, transform 0.2s;
}
.back-link:hover {
    background: #c5cae9;
    transform: translateX(-5px);
}

/* --- 響應式設計 (RWD) 區塊 --- */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
    .container {
        padding: 15px;
    }
    h2 {
        font-size: 1.4rem;
    }
    .custom-subtitle {
        bottom: 35px;
    }
    .custom-subtitle span {
        font-size: 0.95rem; 
    }
    .custom-controls {
        padding: 8px 5px;
        gap: 3px;         
    }
    .control-btn {
        font-size: 14px;
        padding: 2px;
    }
    .time-display {
        font-size: 10px;
        letter-spacing: -0.5px; 
    }
    .volume-bar {
        width: 35px; 
    }
    .cc-btn {
        font-size: 11px;
        padding: 3px 6px;
    }
}