﻿/* ========================================
    NMRehab 主樣式檔案 (模組化 v2.6.1)
    變數和基礎樣式、工具類已移至:
    - variables.css (CSS 變數)
    - base.css (基礎樣式)
    - utilities.css (工具類)
    此檔案包含佈局和特殊樣式
    行數: 約6113 行 > 約5786 行 (減少 327 行)
    ======================================== */

/* 自訂義變數 */
@font-face {
    font-family: 'DFYuan-XB';
    src: url('../fonts/DFYuan-XB-WIN-BF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BankGothic Lt BT';
    src: url('../fonts/BankGothic Lt BT Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

/* ?��??�置?�基礎樣�?*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #c3cfe2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* �����ɯ��� */
.top-header {
    background: transparent;
    background-image: url('../../imgs/bg/workspace-nav-bar-top-left-bg.png'), url('../../imgs/bg/workspace-nav-bar-top-right-bg.png');
    background-repeat: no-repeat, no-repeat;
    background-position: left center, right center;
    background-size: auto 100%, auto 100%;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    gap: 1rem;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-name .ai-text {
    font-family: 'Berlin Sans FB Demi', sans-serif;
    color: #4db8a8;
    text-shadow: 2px 2px 4px rgba(77, 184, 168, 0.3);
    margin-right: 0.3rem;
}

.brand-name .main-text {
    font-family: 'DFYuan-XB', sans-serif;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.logo i {
    font-size: 2rem;
    color: #ffd700;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-left: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.user-info i {
    font-size: 1.5rem;
}

.user-nickname {
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 1rem;
}

.powered-by {
    font-size: 0.8rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    pointer-events: auto;
}

/* 主�??�容?�??*/
.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
    margin-top: 80px;
    position: relative;
    z-index: 2;
}

/* ?�出?��? */
.logout-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 左側?��? */
.left-sidebar {
    width: 250px;
    background: white;
    border-radius: 15px;
}

/* ?�出?��? */
.logout-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 左側?��? */
.left-sidebar {
    width: 250px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    /* ? �ϥ� sticky �w��A���H�u�ʦ��O���b������ */
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    /* ? �]�m�̤p���׻P�k���@�P */
    min-height: calc(100vh - 2rem);
}

.main-navigation .nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
}

.nav-button:hover {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    transform: translateX(5px);
}

.nav-item.active .nav-button {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(77, 184, 168, 0.4);
}

.nav-button i {
    font-size: 1.3rem;
    width: 20px;
}

/* workflow生成時禁用其他按鈕 */
.nav-button.workflow-generating,
.nav-button.disabled,
.nav-button:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #ccc !important;
}

/* �������ʵ��� */
.center-panel {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.interaction-window {
    flex: 1;
    padding: 0.5rem 2rem;
    overflow-y: auto;
}

/* ���÷Ʊ� */
.interaction-window::-webkit-scrollbar {
    display: none;
}

.interaction-window {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.view-content {
    display: none;
    height: 100%;
}

.view-content.active {
    display: block;
}

.quick-btn {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: none;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    min-width: 150px;
    color: #2d3436;
    font-weight: 500;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(255, 171, 160, 0.3);
}

.quick-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 171, 160, 0.4);
}

.quick-btn i {
    font-size: 2rem;
}

/* ��Ѯe�� */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

.message .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-content {
    background: #f8f9fa;
    padding: 1.2rem 1.5rem;
    border-radius: 18px;
    max-width: 70%;
    font-size: 1.2rem;
    line-height: 1.5;
}

.system-message .message-content {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* �y���i�ΰʵe */
.voice-visualizer {
    display: none;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 20px;
    color: white;
    margin: 1rem 0;
}

.voice-visualizer.active {
    display: block;
    animation: pulse 2s infinite;
}

.wave-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin-bottom: 1rem;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 2px;
    animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.voice-text {
    font-size: 1.2rem;
    font-weight: 500;
}

/* �����_�{���� */
.timeline-container h3 {
    color: #4db8a8;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* �C��W�ǰϰ� */
.media-upload-section {
    margin-bottom: 2rem;
}

.upload-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    justify-content: center;
}

.upload-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-tab:hover {
    background: #e9ecef;
}

.upload-tab.active {
    background: #4db8a8;
    color: white;
    border-color: #4db8a8;
}

.upload-tab i {
    font-size: 16px;
}

.photo-upload-area {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    position: relative;
}

.upload-zone:hover {
    border-color: #4db8a8;
    background: #f0f4ff;
}

.upload-zone.dragover {
    border-color: #4db8a8;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-zone i {
    font-size: 3rem;
    color: #4db8a8;
    margin-bottom: 1rem;
    display: block;
}

.upload-zone p {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.upload-btn {
    background: #4db8a8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #5a6fd8;
}

/* �W�Ƕi�� */
.upload-progress {
    margin-top: 1rem;
}

/* �W�Ƕi�ױ� - ²��˦�?*/
.upload-section .progress-bar,
.file-upload .progress-bar {
    background: var(--border-light);
    border-radius: var(--border-radius-lg);
    height: 8px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.upload-section .progress-fill,
.file-upload .progress-fill {
    background: var(--primary-color);
    height: 100%;
    width: 0%;
    transition: width var(--transition-normal);
}

.upload-section .progress-text,
.file-upload .progress-text {
    font-size: 14px;
    color: var(--text-light);
}

/* �w�W�Ǥ��C�� */
.uploaded-files {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.uploaded-files h4 {
    color: #4db8a8;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.file-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-item i {
    font-size: 2rem;
    color: #4db8a8;
    margin-bottom: 0.5rem;
    display: block;
}

.file-item .file-name {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.file-item .file-size {
    font-size: 10px;
    color: #999;
}

.file-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item .delete-btn:hover {
    background: #c0392b;
}

/* ��X���G�ϰ� */
.output-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.output-section h4 {
    color: #4db8a8;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* ? �����ª� output-tabs �M output-tab �˦��]�w��Ρ^*/

.output-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-placeholder {
    text-align: center;
    color: #666;
}

.output-placeholder i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* ⭐ 音訊輸出使用縱向列表佈局 */
.output-grid.audio-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.output-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.output-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.output-item video {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.output-item audio {
    width: 100%;
    margin-bottom: 0.5rem;
}

.output-item .item-name {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-bottom: 8px;
}

.output-item .item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
}

.output-item .item-info small {
    color: #999;
}

.output-item .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 10px;
    transition: background-color 0.2s;
}

.output-item .download-btn:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
}

.output-item .download-btn i {
    font-size: 10px;
}

/* ⭐ Placeholder 載入樣式 (生成中的媒體) */
.placeholder-item {
    opacity: 0.7;
    pointer-events: none;
}

.placeholder-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 2.5rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 音訊placeholder樣式 */
.audio-list-item.placeholder-item {
    opacity: 0.7;
    background: #f8f9fa;
}

.audio-list-item.placeholder-item .audio-list-icon i {
    color: var(--primary-color);
}

#photoInput {
    display: none;
}

.video-preview {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
}

.video-placeholder i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

/* �����ʴ� */
.emotion-dashboard h3 {
    color: #4db8a8;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.emotion-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.emotion-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.emotion-card.happy i {
    color: #feca57;
}

.emotion-card.calm i {
    color: #48dbfb;
}

.emotion-card.anxious i {
    color: #ff9ff3;
}

.emotion-card span {
    display: block;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.emotion-level {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.emotion-level::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.happy .emotion-level::after {
    background: #feca57;
    width: 75%;
}

.calm .emotion-level::after {
    background: #48dbfb;
    width: 60%;
}

.anxious .emotion-level::after {
    background: #ff9ff3;
    width: 20%;
}

/* �]�w���� */
.settings-container h3 {
    color: #4db8a8;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.setting-item label {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.setting-item input,
.setting-item select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 150px;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #4db8a8;
}

/* �y������ϰ�?*/
.voice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
}

.voice-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#micBtn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

#playBtn,
#pauseBtn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.active {
    animation: pulse 1.5s infinite;
}

.voice-status {
    margin-left: 1rem;
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* �k�����@�����O */
.right-sidebar {
    width: 300px;
    min-width: 250px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    /* ? �ϥ� sticky �w��A���H�u�ʦ��O���b������ */
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    /* ? �]�m�̤p���׻P�����@�P */
    min-height: calc(100vh - 2rem);
}

.caregiver-panel h3 {
    color: #4db8a8;
    font-size: 1.2rem;
    /* ? �Y�p���D */
    margin-bottom: 1rem;
    /* ? ��ֶ��Z */
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.75rem;
    /* ? ��ֶ��Z */
}

.status-section,
.memory-section {
    margin-bottom: 1.2rem;
    /* ? ��ֶ��Z */
}

.status-section h4,
.memory-section h4 {
    color: #333;
    font-size: 1rem;
    /* ? �Y�p�l���D */
    margin-bottom: 0.75rem;
    /* ? ��ֶ��Z */
    font-weight: 600;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    /* ? ��֤���Z */
    border-bottom: 1px solid #f0f0f0;
}

.status-label {
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
    /* ? �Y�p�r�� */
}

.status-value {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    /* ? �Y�p�r�� */
}

.status-value.positive {
    color: #27ae60;
}

.current-topic {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* ? ��ֶ��Z */
    padding: 0.75rem;
    /* ? ��֤���Z */
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    /* ? ��ֶ��Z */
}

.current-topic i {
    color: #e74c3c;
    font-size: 1.2rem;
}

.topic-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #4db8a8;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* �������ƪ� control-btn �˦��A�ϥΫ᭱�w�q���˦� */

.control-btn.emergency {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.control-btn.emergency:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #c44569 100%);
}

/* �ʵe�ĪG */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.5);
    }
}

/* �T�����]�p */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .left-sidebar,
    .right-sidebar {
        width: 100%;
    }

    .main-navigation .nav-list {
        flex-direction: row;
        overflow-x: auto;
    }

    .nav-button {
        white-space: nowrap;
    }
}

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

    .main-content {
        padding: 0.5rem;
    }

    .emotion-indicators {
        grid-template-columns: 1fr;
    }

    .voice-controls {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* �]�w�����s�W�˦� */
.settings-section {
    margin-bottom: 3rem;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    background: #fdfdfd;
}

.settings-section h4 {
    color: #4db8a8;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
}

.settings-section h4 i {
    color: #3a9d8f;
}

/* �s�����A���?*/
.connection-status-display {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    text-align: center;
}

.connection-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.connection-indicator.connected {
    color: #28a745;
}

.connection-indicator.disconnected {
    color: #dc3545;
}

.connection-indicator.connecting {
    color: #ffc107;
}

.connection-indicator.local-mode {
    color: #fd7e14;
}

.connection-status.connected {
    color: #2ecc71;
}

.connection-status.disconnected {
    color: #e74c3c;
}

.connection-status.local-mode {
    color: #f39c12;
}

.connection-indicator i {
    font-size: 0.8rem;
    animation: pulse 2s infinite;
}

/* �����}���˦� */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* �d��Ʊ�����?*/
.range-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #4db8a8;
    background: #f0f4ff;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* �s��������s */
.connection-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(77, 184, 168, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.btn-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
}

.btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(77, 184, 168, 0.4);
}

/* �]�w�ʧ@���s */
.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* �[�����A */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #4db8a8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* �]�w���U��r */
.setting-help {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

/* Toast �q���˦� */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    min-width: 300px;
    max-width: 450px;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
    pointer-events: auto;
    border-left: 4px solid #4db8a8;
}

.toast-success {
    border-left-color: #2ecc71;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-warning {
    border-left-color: #f39c12;
}

.toast-info {
    border-left-color: #4db8a8;
}

.toast-content {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    line-height: 1.4;
    color: #2c3e50;
}

.toast-close {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 14px;
    margin-left: 12px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #ecf0f1;
    color: #7f8c8d;
}

.toast-message {
    flex: 1;
    line-height: 1.6;
}

.toast.fade-out {
    animation: slideOut 0.3s ease-in forwards;
}

/* �v�����n�˦� */
.permission-guide {
    padding: 10px 0;
}

.permission-guide h3 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 16px;
}

.guide-step {
    background: #fff9e6;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 6px;
    border-left: 3px solid #f39c12;
    font-size: 13px;
    line-height: 1.5;
}

.permission-guide .btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: #4db8a8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.permission-guide .btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* JSON �u�@�y�{�޲z�˦� */
.file-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.file-name {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.file-name.has-file {
    color: var(--success);
    font-style: normal;
}

.workflow-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 500;
    color: var(--text-secondary);
}

.workflow-inputs-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.workflow-input-item {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

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

.input-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.input-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-item-type {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.input-item-control {
    margin-top: 8px;
}

.input-item-control input,
.input-item-control textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-item-control textarea {
    min-height: 60px;
    resize: vertical;
}

.input-item-control input:focus,
.input-item-control textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(77, 184, 168, 0.2);
}

/* �u�@�y�{���A���ܾ� */
.workflow-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.workflow-status.loaded {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.workflow-status.error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error);
}

.workflow-status.empty {
    background: rgba(149, 165, 166, 0.2);
    color: var(--text-muted);
}

/* ���J���v������ */
.permission-hint {
    animation: slideInRight 0.3s ease-out;
}

.permission-hint .hint-content {
    background: white;
}

.permission-hint h4 {
    color: #f39c12;
    margin-bottom: 12px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-hint p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.permission-hint ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.permission-hint li {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.permission-hint button {
    width: 100%;
    padding: 10px;
    background: #4db8a8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.permission-hint button:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.3);
}

/* ComfyUI ���տ�X�϶� */
.comfyui-test-output {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comfyui-test-output h4 {
    color: #7c3aed;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-output-status {
    margin-bottom: 1.5rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e9efff 100%);
    border-radius: 8px;
    border-left: 4px solid #4db8a8;
}

.status-info.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #e6f7ed 100%);
    border-left-color: #28a745;
}

.status-info.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left-color: #e74c3c;
}

.status-info.processing {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left-color: #f39c12;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.status-text {
    font-weight: 500;
    color: #333;
}

/* ���տ�X�i�ױ� - �W�j�˦� */
.test-output .progress-bar,
.generation-progress .progress-bar {
    position: relative;
    height: 30px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 1rem;
}

.test-output .progress-fill,
.generation-progress .progress-fill {
    height: 100%;
    background: var(--gradient-progress);
    border-radius: 15px;
    transition: width var(--transition-normal);
    width: 0%;
}

.test-output .progress-text,
.generation-progress .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.test-output-content {
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.test-output-content:empty::before {
    content: '�ȵL��X���G';
    display: block;
    text-align: center;
    color: #999;
    padding: 3rem 0;
    font-style: italic;
}

.output-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.output-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.output-item-type {
    font-weight: 600;
    color: #4db8a8;
}

.output-item-timestamp {
    font-size: 0.85rem;
    color: #6c757d;
}

.output-item-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.output-item-info small {
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.output-item-preview {
    margin-top: 0.75rem;
}

.output-item-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.output-item-preview video {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.test-output-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.test-output-actions .btn {
    flex: 1;
}

/* ��X��x */
.output-log {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 1rem;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.output-log-entry {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.output-log-entry.info {
    color: #4fc3f7;
}

.output-log-entry.success {
    color: #66bb6a;
}

.output-log-entry.warning {
    color: #ffa726;
}

.output-log-entry.error {
    color: #ef5350;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* �ͦ�����ϰ�˦� */
.generation-controls {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.generation-controls h4 {
    color: #4db8a8;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

/* ���e���ȫH�� */
.current-task-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.task-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

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

/* �q�� info �˦� - ���C�u���šA�קK�Ĭ� */
.task-info .info-label {
    font-weight: 500;
    color: #333;
}

.task-info .info-value {
    color: #4db8a8;
    font-weight: 500;
}

.task-selection {
    margin-bottom: 1.5rem;
}

.task-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.task-selector {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.task-selector:focus {
    outline: none;
    border-color: #4db8a8;
}

.prompt-section {
    margin-bottom: 1.5rem;
}

.prompt-section label {
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    font-weight: 500;
    color: #333;
}

.prompt-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.prompt-input:focus {
    outline: none;
    border-color: #4db8a8;
}

.parameters-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.param-group {
    display: flex;
    flex-direction: column;
}

.param-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.param-input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.param-input:focus {
    outline: none;
    border-color: #4db8a8;
}

/* ⭐ Speaker 下拉選單樣式 */
select.param-input.param-select {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 32px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.param-input.param-select:hover {
    border-color: #4db8a8;
    background-color: #f8f9fa;
}

select.param-input.param-select:focus {
    border-color: #4db8a8;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

select.param-input.param-select option {
    padding: 8px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.generate-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.generate-btn:hover {
    background: #218838;
}

.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.stop-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.stop-btn:hover {
    background: #c82333;
}

.check-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.check-btn:hover {
    background: #138496;
}

.generation-status {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-text {
    font-weight: 500;
    color: #333;
}

.progress-info {
    font-size: 14px;
    color: #666;
}

.generation-progress {
    margin-top: 0.5rem;
}

.gen-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.gen-progress-fill {
    background: #28a745;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* Workflow �t�m�˦� */
.workflow-configs {
    display: grid;
    margin-bottom: 2rem;
}

.workflow-config-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.workflow-config-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.config-header h5 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    background: #6c757d;
    color: white;
}

.config-status.configured {
    background: #28a745;
}

.config-status.error {
    background: #dc3545;
}

.config-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.config-controls .file-name {
    flex: 1;
    min-width: 0;
    color: #666;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.config-controls .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.config-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.workflow-description {
    color: #666;
    font-style: italic;
}

.workflow-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.section-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* �T�����]�p */
@media (max-width: 768px) {
    .parameters-section {
        grid-template-columns: 1fr;
    }

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

    .workflow-controls {
        flex-direction: column;
    }

    .config-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .config-controls .file-name {
        text-align: center;
        margin: 0.5rem 0;
    }
}

/* �ʺA�ѼƼ˦� */
.workflow-parameters {
    min-height: 120px;
    transition: all 0.3s ease;
}

.no-workflow-message {
    text-align: center;
    color: #666;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 2px dashed #ddd;
    margin: 1rem 0;
}

.no-workflow-message p {
    margin: 0.5rem 0;
}

.no-workflow-message strong {
    color: #007bff;
    font-weight: 600;
}

#dynamicParameters {
    transition: all 0.3s ease;
}

.dynamic-param-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.dynamic-param-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.dynamic-param-group .param-description {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.dynamic-param-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dynamic-param-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dynamic-param-input[type="number"] {
    max-width: 200px;
}

.dynamic-param-input[type="range"] {
    cursor: pointer;
}

.param-range-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.param-range-display input[type="range"] {
    flex: 1;
}

.param-range-display .range-value {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: #007bff;
}

/* ���w���˦� */
.file-preview-area {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin-top: 1rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.preview-header h5 {
    margin: 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: 70vh;
    /* ����̤j���׬��������ת�70% */
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    /* ���ƹL��ĪG */
    padding: 16px;
    box-sizing: border-box;
}

/* Audio preview - 減少高度 */
.preview-container[data-preview-type="audio"] {
    min-height: 120px;
    max-height: 150px;
    padding: 20px;
}

/* Video/Image preview - 自適應內容高度 */
.preview-container[data-preview-type="video"],
.preview-container[data-preview-type="image"] {
    height: auto;
    min-height: auto;
    max-height: none;
}

.preview-container[data-preview-type="video"] .preview-video,
.preview-container[data-preview-type="image"] .preview-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

/* �����v����T�ɡA�վ�w���e�����˦� */
.preview-container.has-video-info {
    border-radius: 6px 6px 0 0;
    /* �u�O�d�W���?*/
    margin-bottom: 0;
    /* �����������Z */
    border-bottom: none;
    /* �����������?*/
}

.preview-container.auto-size {
    height: auto;
    min-height: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
}

.preview-video {
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    /* ����̤j���� */
    border-radius: 4px;
    transition: all 0.3s ease;
    /* ? ���W�m�����?*/
    display: block;
    margin: 0 auto;
}

.preview-video.auto-size {
    max-height: none;
    /* �������׭��� */
    height: auto;
}

/* �v�����񾹮e�� */
.video-player {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
}

/* �v����T�ϰ� - �{�b�O�W�ߤ��� */
.video-info {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    border-top: none;
    /* �P�W�誺�w���e���s�� */
    border-radius: 0 0 6px 6px;
    /* �P preview-container ���ꨤ�ǰt */
    margin-bottom: 1rem;
}

.video-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-title {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-date {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

.preview-audio {
    width: 100%;
    max-width: 800px;
    height: 54px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

/* 音訊播放器容器 */
.media-player {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
}

.preview-text {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    padding: 1rem;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.preview-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.preview-placeholder p {
    margin: 0;
    font-size: 0.875rem;
    text-align: center;
}

.file-info {
    background: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 12px;
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

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

.file-info-label {
    font-weight: 600;
    color: #495057;
}

.file-info-value {
    color: #6c757d;
}

/* �T�����w�� */
@media (max-width: 768px) {
    .preview-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .preview-container {
        min-height: 150px;
        max-height: 60vh;
        /* �b���ʳ]�ƤW�y�L���C�̤j���� */
    }

    .preview-container.auto-size {
        min-height: auto;
    }

    .preview-image,
    .preview-video {
        max-height: 150px;
    }

    .preview-video.auto-size {
        max-height: 60vh;
        /* ���ʳ]�ƤW���̤j���� */
    }

    .video-info {
        padding: 0.5rem;
    }

    .video-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .video-title {
        font-size: 13px;
    }

    .video-date {
        font-size: 11px;
    }
}

/* JSON �u�@�y�{�޲z�m���˦� */
.settings-group {
    text-align: center;
    margin-bottom: 2rem;
}

.settings-group h5 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.settings-group h5 i {
    color: #007bff;
}

.settings-group .setting-help {
    color: #666;
    font-size: 14px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

.settings-group .file-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.settings-group .file-input-container .btn {
    width: auto;
    min-width: 200px;
}

.settings-group .file-input-container .file-name {
    text-align: center;
}

/* ���Ȥu�@�y�d���˦� */
.task-workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem auto;
    max-width: 900px;
    justify-content: center;
    padding: 0 1rem;
}

.task-workflow-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.task-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.task-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.task-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.task-card-actions .btn-sm {
    font-size: 12px;
    padding: 0.4rem 0.8rem;
}

.task-file-info {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
    font-size: 12px;
    color: #666;
}

.task-file-info .file-name {
    font-weight: 500;
}

.config-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.config-status:not(.configured) {
    background: #f8d7da;
    color: #721c24;
}

.config-status.configured {
    background: #d4edda;
    color: #155724;
}

/* �u�@�y�d�ݾ��B�ʵ����˦� */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.workflow-viewer-modal {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.btn-cancel {
    padding: 8px 20px;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(127, 140, 141, 0.3);
}

.workflow-basic-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

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

/* �q�� info �˦� - ���C�u���� */
.modal-content .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content .info-label {
    font-weight: 600;
    color: #495057;
}

.modal-content .info-value {
    color: #007bff;
    font-weight: 500;
}

.workflow-nodes-section,
.workflow-parameters-section {
    margin-bottom: 1.5rem;
}

.workflow-nodes-section h4,
.workflow-parameters-section h4 {
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 16px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.nodes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.node-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 4px solid #007bff;
}

.node-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 14px;
}

.node-type {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

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

.parameter-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
}

.parameter-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 14px;
}

.parameter-type {
    font-size: 12px;
    color: #666;
    margin-bottom: 0.25rem;
}

.parameter-value {
    font-size: 13px;
    color: #007bff;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-family: monospace;
}

/* �T�����]�p - ���Ȥu�@�y */
@media (max-width: 768px) {
    .task-workflow-grid {
        grid-template-columns: 1fr;
    }

    .workflow-viewer-modal {
        width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

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

    .nodes-container,
    .parameters-container {
        grid-template-columns: 1fr;
    }

    .task-card-actions {
        flex-direction: column;
    }

    .task-card-actions .btn-sm {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   ??l?H?????��???
   ========================================== */

.seed-control-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.seed-checkbox-group {
    display: flex;
    align-items: center;
}

.seed-random-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    transition: all 0.3s ease;
}

.seed-random-label:hover {
    transform: translateX(2px);
}

.seed-random-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #f5576c;
}

.checkbox-icon {
    font-size: 18px;
    animation: rotate 2s linear infinite;
}

.seed-random-checkbox:checked~.checkbox-icon {
    animation: bounce 0.6s ease;
}

@keyframes rotate {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.seed-control-wrapper input.parameter-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.seed-control-wrapper input.parameter-input:focus {
    border-color: #f5576c;
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.1);
    outline: none;
}

.seed-control-wrapper input.parameter-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.seed-generate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.seed-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.seed-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.seed-generate-btn i {
    font-size: 16px;
}

.param-item:has(.parameter-seed) {
    border-left: 3px solid #f5576c;
    background: linear-gradient(90deg, rgba(245, 87, 108, 0.05) 0%, transparent 100%);
}

.param-item:has(.parameter-seed) .param-label {
    color: #f5576c;
    font-weight: 600;
}

/* ============================================
   �C��W�Ǭ����˦�
   ============================================ */

.media-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 選擇現有檔案小按鈕（內聯樣式） */
.btn-select-existing-media-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(118, 75, 162, 0.1);
    border: 1px solid rgba(118, 75, 162, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 500;
    color: #764ba2;
    white-space: nowrap;
}

.btn-select-existing-media-inline:hover {
    background: rgba(118, 75, 162, 0.2);
    border-color: #764ba2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.2);
}

.btn-select-existing-media-inline i {
    font-size: 10px;
}

/* 媒體選擇彈出視窗 */
.media-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.media-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.media-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.media-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.media-modal-header h3 i {
    color: #4db8a8;
}

.btn-close-modal {
    width: 36px;
    height: 36px;
    padding: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #6c757d;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.btn-close-modal:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.media-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.media-modal-loading,
.media-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 60px 20px;
    color: #6c757d;
}

.media-modal-loading i,
.media-modal-empty i {
    font-size: 48px;
    color: #4db8a8;
}

.media-modal-loading span,
.media-modal-empty p {
    font-size: 16px;
    margin: 0;
}

/* 媒體網格 */
.media-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.media-grid-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 0;
    /* Allow grid item to shrink below content size */
}

.media-grid-item:hover {
    border-color: #4db8a8;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(77, 184, 168, 0.2);
}

.media-preview-thumb {
    position: relative;
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-preview-thumb img,
.media-preview-thumb video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.media-preview-thumb .audio-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.media-preview-thumb .audio-placeholder i {
    font-size: 48px;
    color: #4db8a8;
}

.video-duration-badge,
.audio-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-duration-badge i,
.audio-duration-badge i {
    font-size: 12px;
}

.media-item-info {
    padding: 12px;
}

.media-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-item-meta {
    font-size: 11px;
    color: #6c757d;
}

.media-item-select {
    padding: 0 12px 12px;
}

.media-item-select .btn {
    width: 100%;
}

/* 舊版選擇按鈕容器 - 保持兼容性 */
.media-grid-item .media-item-select {
    padding: 0 12px 12px;
}

/* 音訊列表佈局（彈出視窗） */
.media-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.media-list-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.media-list-item:hover {
    border-color: #4db8a8;
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.15);
}

.media-list-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-list-icon i {
    font-size: 24px;
    color: #4db8a8;
}

.media-list-info {
    flex: 1;
    min-width: 0;
}

.media-list-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-list-meta {
    font-size: 11px;
    color: #6c757d;
}

.media-list-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.media-list-preview audio {
    height: 32px;
}

.media-list-actions {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.media-list-actions .btn {
    width: auto;
    padding: 6px 12px;
}

.media-list-actions .btn i {
    font-size: 14px;
}

/* 音訊列表佈局（輸出區域 - 縱向排列） */
.audio-list-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 10px;
}

.audio-list-item:hover {
    border-color: #4db8a8;
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.15);
    transform: translateY(-2px);
}

.audio-list-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-list-icon i {
    font-size: 24px;
    color: #4db8a8;
}

.audio-list-info {
    flex: 1;
    min-width: 0;
}

.audio-list-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-list-meta {
    font-size: 11px;
    color: #6c757d;
}

.audio-list-preview {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 12px;
}

.audio-list-preview audio {
    height: 32px;
    width: 100%;
    max-width: 500px;
    min-width: 200px;
}

/* 媒體名稱編輯樣式 */
.media-item-name,
.media-list-name {
    position: relative;
}

.media-name-input {
    font-family: inherit;
    outline: none;
}

.media-name-input:focus {
    border-color: #4db8a8 !important;
    box-shadow: 0 0 0 2px rgba(77, 184, 168, 0.2);
}

/* 媒體預覽樣式 */
.media-preview-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.media-preview-video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.audio-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.audio-preview-icon {
    font-size: 48px;
    color: #666;
    margin-bottom: 20px;
}

.audio-preview-icon.success {
    color: #4caf50;
}

.audio-preview-icon.error {
    color: #ff6b6b;
}

.media-preview-audio {
    width: 100%;
    max-width: 600px;
}

.audio-preview-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 12px;
}

.media-preview-error {
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.media-file-name {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Grid 模式按鈕組 */
.media-item-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.media-item-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}

.media-item-actions .btn i {
    font-size: 12px;
}

.media-list-item .audio-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-list-item .audio-icon i {
    font-size: 24px;
    color: #4db8a8;
}

.media-list-item .media-item-info {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.media-list-item .media-item-select {
    padding: 0;
    flex-shrink: 0;
}

.media-list-item .media-item-select .btn {
    width: auto;
}

.media-modal-footer {
    padding: 15px 25px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination-controls button {
    padding: 8px 16px;
    font-size: 14px;
}

.pagination-controls .page-number {
    font-weight: 600;
    color: var(--text-color);
    padding: 0 10px;
}

/* 懶加載觸發器 */
.lazy-load-trigger {
    height: 20px;
    width: 100%;
    grid-column: 1 / -1;
}

/* 防止圖片閃爍 */
.media-preview-thumb img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 媒體網格項目淡入動畫 */
.media-grid-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 上傳區域 */
.media-drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.drop-zone-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.drop-zone-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}

.media-drop-zone:hover {
    border-color: #4db8a8;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 184, 168, 0.15);
}

.media-drop-zone.drag-over {
    border-color: #4db8a8;
    border-width: 3px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    box-shadow: 0 8px 25px rgba(77, 184, 168, 0.25);
}

.media-drop-zone i {
    font-size: 48px;
    color: #4db8a8;
    transition: all 0.3s ease;
}

.media-drop-zone:hover i,
.media-drop-zone.drag-over i {
    color: #3a9d8f;
    transform: scale(1.1);
}

.media-drop-zone .drop-zone-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.media-drop-zone .upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.media-drop-zone .drop-zone-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #dee2e6;
}

.media-drop-zone .upload-hint {
    font-size: 12px;
    color: #999;
    margin: 8px 0 0 0;
    display: block;
}

/* ���í�l�ɮ׿�J */
input[type="file"][id*="_media_"] {
    display: none;
}

.btn-upload-media {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-upload-media:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 184, 168, 0.4);
}

.btn-upload-media i {
    font-size: 16px;
}

.media-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(77, 184, 168, 0.05);
    border: 2px dashed #4db8a8;
    border-radius: 8px;
}

.media-preview .preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
}

.media-preview img,
.media-preview video {
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.media-file-name {
    font-size: 13px;
    color: #666;
    text-align: center;
    word-break: break-all;
    max-width: 100%;
    overflow-wrap: break-word;
}

.btn-remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.btn-remove-media:hover {
    background: #c0392b;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-remove-media i {
    font-size: 16px;
}

/* ��X������ */
.output-file-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.output-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.output-file-item img,
.output-file-item video {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

.output-file-item audio {
    width: 250px;
}

/* �v���Y�϶��ؼ˦� */
.video-thumbnail-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(77, 184, 168, 0.3);
    z-index: 10;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #000;
    border-radius: 8px 8px 0 0;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-thumbnail-item:hover .video-thumbnail {
    transform: scale(1.1);
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail-item:hover .video-play-overlay {
    opacity: 1;
}

.video-play-overlay i {
    font-size: 48px;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.video-thumbnail-item:hover .video-play-overlay i {
    transform: scale(1.2);
}

/* ⭐ 媒體刪除按鈕樣式 */
.media-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 14px;
}

.media-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.video-thumbnail-item:hover .media-delete-btn,
.image-thumbnail-item:hover .media-delete-btn {
    opacity: 1;
}

/* 音訊列表刪除按鈕 */
.audio-list-item {
    position: relative;
}

.audio-list-item .audio-delete-btn {
    position: relative;
    top: auto;
    right: auto;
    margin-left: 10px;
    flex-shrink: 0;
    opacity: 0;
}

.audio-list-item:hover .audio-delete-btn {
    opacity: 1;
}

/* ⭐ 批量選擇相關樣式 */
.generated-content-wrapper {
    display: flex;
    flex-direction: column;
}

.batch-selection-controls {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e9ecef;
    border-bottom: none;
    align-items: center;
    flex-wrap: wrap;
}

.batch-selection-controls .btn {
    font-size: 13px;
    padding: 6px 12px;
}

.batch-selection-controls .btn.hidden {
    display: none;
}

/* 批量選擇模式下的項目樣式 */
.batch-select-mode .video-thumbnail-item,
.batch-select-mode .audio-list-item,
.batch-select-mode .image-thumbnail-item {
    cursor: pointer;
    user-select: none;
}

.batch-select-mode .video-thumbnail-item::before,
.batch-select-mode .image-thumbnail-item::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 15;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.batch-select-mode .audio-list-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #4db8a8;
    border-radius: 4px;
    background: white;
}

.batch-select-mode .video-thumbnail-item.batch-selected::before,
.batch-select-mode .image-thumbnail-item.batch-selected::before {
    background: #4db8a8;
    border-color: #4db8a8;
}

.batch-select-mode .video-thumbnail-item.batch-selected::after,
.batch-select-mode .image-thumbnail-item.batch-selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    left: 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    z-index: 16;
}

.batch-select-mode .audio-list-item.batch-selected::before {
    background: #4db8a8;
    border-color: #4db8a8;
}

.batch-select-mode .audio-list-item.batch-selected::after {
    content: '✓';
    position: absolute;
    left: -27px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.batch-select-mode .video-thumbnail-item.batch-selected,
.batch-select-mode .image-thumbnail-item.batch-selected {
    box-shadow: 0 0 0 3px #4db8a8;
}

.batch-select-mode .audio-list-item.batch-selected {
    border-color: #4db8a8;
    background: rgba(77, 184, 168, 0.05);
}

/* 隱藏刪除按鈕在多選模式下 */
.batch-select-mode .media-delete-btn {
    display: none !important;
}

/* 隱藏播放圖標在多選模式下 */
.batch-select-mode .video-play-overlay,
.batch-select-mode .image-overlay {
    display: none;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    word-break: break-all;
}

.file-date {
    font-size: 12px;
    color: #95a5a6;
}

.no-files {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

/* �Ѽ������ϼ� */
.param-item:has(.param-media-file) {
    border-left: 3px solid #3498db;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.05) 0%, transparent 100%);
}

.param-item:has(.param-media-file) .param-label {
    color: #3498db;
    font-weight: 600;
}

.param-item:has(.param-textarea) .param-label::before {
    content: "\f15c ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.param-item:has(.param-number) .param-label::before {
    content: "\f292 ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.param-item:has(.param-float) .param-label::before {
    content: "\f1de ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.param-item:has([data-media-type="image"]) .param-label::before {
    content: "\f03e ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.param-item:has([data-media-type="video"]) .param-label::before {
    content: "\f03d ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.param-item:has([data-media-type="audio"]) .param-label::before {
    content: "\f1c7 ";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* ����Ƶ{�즲�ϰ��?*/
.schedule-list {
    max-width: 100%;
    overflow: visible;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    max-width: 100%;
    box-sizing: border-box;
}

.schedule-item:hover {
    border-color: #4db8a8;
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.15);
    transform: translateY(-2px);
}

.schedule-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.schedule-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.schedule-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.schedule-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schedule-info {
    flex: 1;
    min-width: 0;
}

.schedule-info input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.schedule-duration {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-duration input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.schedule-actions {
    flex-shrink: 0;
}

.schedule-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

/* �s�W�Ƶ{���s hover �ĪG */
#addScheduleBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* ����Ƶ{�즲�ϰ��?- ��s���� */
.schedule-list-wrapper {
    overflow: visible;
}

.schedule-list {
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.schedule-placeholder {
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px;
    overflow: hidden;
}

.schedule-placeholder i {
    display: block;
    max-width: 100%;
}

.schedule-placeholder p {
    max-width: 100%;
    word-wrap: break-word;
}

/* �s�W�Ƶ{���s hover �ĪG�W�j */
#addScheduleBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 184, 168, 0.4) !important;
    background: #4db8a8 !important;
    color: white !important;
}

#addScheduleBtn:active {
    transform: translateY(0);
}

/* �C��w����ID��ܼ˦�?*/
.resident-id-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.id-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.id-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
}

/* �C��w���ϰ�˦���?- �w�������Ʃw�q�A�ϥΤW��Τ@�˦� */

/* ����Ƶ{ placeholder ��r������ */
.schedule-placeholder p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* �u�@�y���D�~�h�˦��]�m���B�Ŧ�^ - �Ȱw��u�@�y�����A���v�T�����M����Ƶ{ */
.view-content:not(#home-view):not(#schedule-view)>div:first-child {
    margin-bottom: 5px;
}

.view-content:not(#home-view):not(#schedule-view) h3 {
    color: #4db8a8;
    text-shadow: 0 2px 4px rgba(77, 184, 168, 0.1);
}

/* ����ID��ܼ˦���?*/
#mediaSidebarResidentId {
    font-weight: 600;
    color: #2c3e50;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* ���@������x - ������T�ƪ��ﵽ */
.caregiver-panel .resident-info {
    margin-top: 10px !important;
    padding: 5px !important;
    background: transparent !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.caregiver-panel .resident-info .info-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    /* ? ��ֶ��Z */
}

.caregiver-panel .resident-info .info-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    min-height: 40px !important;
}

.caregiver-panel .resident-info .info-item:nth-child(odd) {
    background: #59b89f !important;
}

.caregiver-panel .resident-info .info-item:nth-child(even) {
    background: #7fc8b5 !important;
}

.caregiver-panel .resident-info .info-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 14px !important;
    /* ? �Y�p�r�� */
    white-space: nowrap !important;
    font-weight: 600 !important;
    text-align: left !important;
    margin-right: auto !important;
    flex: 0 0 auto !important;
    min-width: 70px !important;
    /* ? ��ֳ̤p�e�� */
}

.caregiver-panel .resident-info .info-value {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    /* ? �Y�p�r�� */
    letter-spacing: 0.5px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    text-align: right !important;
    flex: 1 1 auto !important;
    padding-left: 12px !important;
    /* ? ��֤���Z */
}

/* UI Preferences Settings */
.ui-preferences .preference-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ui-preferences .preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ui-preferences .preference-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.1);
}

.ui-preferences .preference-info {
    flex: 1;
}

.ui-preferences .preference-info label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    cursor: pointer;
}

.ui-preferences .preference-info label i {
    color: #4db8a8;
}

.ui-preferences .preference-description {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    padding-left: 26px;
}

.ui-preferences .preference-control {
    flex: 0 0 auto;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
}

input:focus+.slider {
    box-shadow: 0 0 1px linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
}

/* ========================================
   Component-Specific Classes
   ======================================== */

/* Workflow title header */
.workflow-title-header {
    text-align: center;
}

.workflow-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #4db8a8;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Schedule components */
.schedule-container {
    max-width: 1400px;
    margin: 0 auto;
}

.schedule-header {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    padding: 28px 32px;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
}

.schedule-header-title {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.schedule-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 0;
    background: transparent;
    border: none;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .schedule-overview {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 0;
    }
}

.overview-item {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 5px 5px 5px;
    background: #f8f9fa;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-label {
    position: absolute;
    top: 8px;
    left: 14px;
    font-weight: 500;
    color: #495057;
    font-size: 12px;
    margin: 0;
}

.schedule-input-readonly {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: transparent;
    text-align: center;
    font-weight: 600;
    width: 100%;
}

.schedule-input-readonly.primary {
    color: #4db8a8;
}

.schedule-input-readonly.secondary {
    color: #3a9d8f;
}

.schedule-add-btn {
    background: white;
    color: #4db8a8;
    border: 2px solid #4db8a8;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.schedule-list-wrapper {
    padding: 2px 2px;
    background: white;
}

.schedule-list {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
    background: #fafbfc;
    box-sizing: border-box;
    width: 100%;
}

.schedule-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    color: #6c757d;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

.schedule-placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.schedule-placeholder-text {
    font-size: 16px;
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-placeholder-hint {
    font-size: 14px;
    margin: 8px 0 0 0;
    opacity: 0.7;
    white-space: nowrap;
}

.schedule-actions {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
    border-top: 2px solid #e0e0e0;
}

@media (max-width: 1200px) {
    .schedule-actions {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
    }
}

.schedule-action-btn {
    flex: 1;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
}

@media (max-width: 1200px) {
    .schedule-action-btn {
        width: 100%;
        flex: none;
    }
}

.schedule-action-btn.success {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.schedule-action-btn.primary {
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.3);
}

.schedule-action-btn.danger {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* ��²���R�����s */
.compact-delete-btn {
    flex: none !important;
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
    min-width: auto !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-delete-btn i {
    font-size: 14px;
}

/* ������ܰϰ�?*/
.resident-display {
    padding: 10px 12px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    color: var(--text-color);
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* �������O */
.hidden {
    display: none !important;
}

/* �ۭq�W�ټҺA�ؼ˦� */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: var(--background-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
}

.modal-header h3,
.modal-header h5 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #4db8a8;
    box-shadow: 0 0 0 4px rgba(77, 184, 168, 0.1);
}

.modal-body input:read-only {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.modal-body .form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.modal-footer .btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.modal-footer .btn-secondary:hover {
    background: #bbb;
}

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

.modal-footer .btn-primary:hover {
    background: #5a6fd8;
}

.page-title-container {
    text-align: center;
    margin: 2px 0 2px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-player-section {
    background: var(--background-light);
    border-radius: var(--border-radius-lg);
    padding: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.main-video-player {
    width: 100%;
    height: auto;
    min-height: 400px;
}

.video-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #006c50 0%, #00926b 100%);
    color: white;
}

.placeholder-content {
    text-align: center;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.placeholder-text {
    font-size: 18px;
    margin: 0 0 16px 0;
    opacity: 0.9;
}

.play-schedule-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.play-schedule-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-schedule-btn i {
    margin-right: 8px;
}

.video-controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--background-light);
    border-radius: var(--border-radius);
}

.current-video-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.current-video-info p {
    margin: 0;
    color: var(--text-light);
}

.playback-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.control-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.resident-info-section {
    display: flex;
    justify-content: center;
}

.info-card {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 200px;
}

.info-card h5 {
    margin: 0 0 12px 0;
    color: var(--text-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

.section-header-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header-icon {
    color: #4db8a8;
}

/* Resident list container */
.resident-list-container {
    margin-top: 0;
}

/* Status card toggle */
.status-card-toggle {
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.status-card-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.status-card-toggle-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Status section */
.status-section {
    margin-top: 20px;
}

/* Modal overlays */
.modal-overlay {
    display: none;
}

.modal-overlay.active {
    display: flex;
}

/* Media preview */
.media-preview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.media-preview.audio {
    width: 100%;
}

.media-file-name {
    margin-top: 12px;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* Progress width utilities */
.progress-0 {
    width: 0% !important;
}

.progress-25 {
    width: 25% !important;
}

.progress-50 {
    width: 50% !important;
}

.progress-75 {
    width: 75% !important;
}

.progress-100 {
    width: 100% !important;
}

/* Button display states */
.btn-show {
    display: inline-flex !important;
}

.btn-hide {
    display: none !important;
}

/* Workflow tag */
.workflow-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Info card gradient */
.info-card-gradient {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    margin-bottom: 20px;
}

.info-card-header {
    border-color: rgba(255, 255, 255, 0.3);
}

.info-card-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
}

.info-card-highlight {
    color: #ffeaa7;
}

/* Form control styles */
.form-control-schedule {
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

.schedule-display {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    cursor: default;
    transition: all 0.2s;
    width: 100%;
}

/* Transition utilities */
.transition-all {
    transition: all 0.3s ease !important;
}

.transform-translate-y-0 {
    transform: translateY(0) !important;
}

.transform-translate-y-n10 {
    transform: translateY(-10px) !important;
}

/* Disabled state */
.disabled-state {
    opacity: 0.5 !important;
    pointer-events: none !important;
}

.enabled-state {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Border utilities */
.border-success {
    border-color: #2ecc71 !important;
}

.border-warning {
    border-color: #f39c12 !important;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ???????U?????T?????u?? */
.resident-selector {
    margin-bottom: 20px;
}

.resident-selector h4 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.resident-selector select,
#residentSelect,
#scheduleResidentSelect {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: #333;
    transition: all 0.2s;
    box-sizing: border-box;
    /* ?????r???X */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resident-selector select:focus,
#residentSelect:focus,
#scheduleResidentSelect:focus {
    outline: none;
    border-color: #4db8a8;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

/* ?T?????]?p - ???O */
@media (max-width: 768px) {

    .resident-selector select,
    #residentSelect,
    #scheduleResidentSelect {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 16px;
    }

    .right-sidebar {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 1rem;
    }
}

/* ?T?????]?p - ??? */
@media (max-width: 480px) {

    .resident-selector select,
    #residentSelect,
    #scheduleResidentSelect {
        min-height: 50px;
        font-size: 16px;
        padding: 14px 16px;
    }

    .resident-selector h4 {
        font-size: 15px;
    }

    .right-sidebar {
        padding: 0.75rem;
    }

    .caregiver-panel h3 {
        font-size: 1.25rem;
    }
}

/* ?U???????u?? */
select option {
    padding: 10px;
    font-size: 15px;
}



/* ========================================
   Resident Management Section
   ======================================== */
.resident-management .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

.resident-management .section-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.resident-management .section-header h4 i {
    color: #4db8a8;
}

.resident-management .section-header button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.resident-management .resident-list-container {
    margin-top: 0;
    max-height: 450px;
    /* ����̦h��ܬ�?�Ӧ��� */
    overflow-y: auto;
    /* �K�[�����u�ʱ� */
    padding-right: 10px;
    /* ���u�ʱ��d�X�Ŷ� */
}

/* �����C���u�ʱ��˦� */
.resident-management .resident-list-container::-webkit-scrollbar {
    width: 8px;
}

.resident-management .resident-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.resident-management .resident-list-container::-webkit-scrollbar-thumb {
    background: #4db8a8;
    border-radius: 10px;
}

.resident-management .resident-list-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* ========================================
   Parameter Group Animations
   ======================================== */
.param-group-enter {
    animation: paramGroupFadeIn 0.3s ease;
}

.param-group-exit {
    animation: paramGroupFadeOut 0.3s ease;
}

@keyframes paramGroupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes paramGroupFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========================================
   ???????C????? (?L????)
   ======================================== */
.param-list-flat {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.param-list-flat .param-item {
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-light);
}

.param-list-flat .param-item:last-child {
    border-bottom: none;
}

/* ========================================
   ???????? - ???e???
   ======================================== */
.param-item {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 24px !important;
    margin: 0 !important;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.param-item:hover {
    background: #f8f9fa;
}

.param-item textarea,
.param-item input[type="text"],
.param-item input[type="number"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 16px;
    font-size: 15px;
}

.param-item textarea {
    min-height: 120px !important;
    resize: vertical;
}

/* ========================================
   [????] ???????? - ??????????
   ======================================== */
.param-item {
    border: 5px solid red !important;
    background: yellow !important;
}

.param-list {
    background: lightblue !important;
    border: 3px solid blue !important;
}

.param-list-flat {
    background: lightgreen !important;
    border: 3px solid green !important;
}

/* ========================================
   [????] ???????? - ??\??????
   ======================================== */
.param-item {
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    background: white !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 24px !important;
    margin: 0 !important;
}

.param-item:hover {
    background: #f8f9fa !important;
}

.param-item:last-child {
    border-bottom: none !important;
}

/* ????J????e */
.param-item textarea,
.param-item input[type="text"],
.param-item input[type="number"],
.param-item .parameter-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
}

.param-item textarea,
.param-item .param-textarea {
    min-height: 150px !important;
    resize: vertical !important;
    line-height: 1.6 !important;
}

/* ?????????C?? */
.param-list {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
}

.param-list-flat {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
}

/* ========================================
   ??????T?d???????_
   ======================================== */
.resident-info {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 16px !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.3) !important;
}

.resident-info .info-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
}

.resident-info .info-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    min-height: 52px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.resident-info .info-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 16px !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    text-align: left !important;
    margin-right: auto !important;
    flex: 0 0 auto !important;
    min-width: 90px !important;
}

.resident-info .info-value {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    text-align: right !important;
    flex: 1 1 auto !important;
    padding-left: 16px !important;
}

.resident-info .info-value.positive {
    color: #90EE90 !important;
}

.resident-info .info-value.negative {
    color: #FFB6C1 !important;
}

/* ========================================
   �����޲z�C���˦��]�]�w�����^
======================================== */

/* �����޲z�϶����D�˦� */
.resident-management .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 8px 20px 8px;
    border-bottom: 2px solid var(--border-color);
    gap: 40px;
}

.resident-management .section-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.resident-list-container {
    margin-top: 20px;
}

.resident-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.25);
    transition: all 0.3s ease;
    height: 70px;
    gap: 20px;
}

.resident-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.35);
}

.resident-card .resident-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 90px);
}

.resident-card .resident-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.resident-card .resident-details {
    flex: 1;
    color: white;
    min-width: 0;
    overflow: hidden;
}

.resident-card .resident-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resident-card .resident-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
}

.resident-card .resident-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.resident-card .resident-meta i {
    font-size: 10px;
}

.resident-card .resident-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
}

.resident-card .resident-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    flex-basis: 34px;
    width: 34px;
}

.resident-card .btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #4db8a8;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.resident-card .btn-icon:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.resident-card .edit-resident-btn {
    color: #4db8a8;
}

.resident-card .edit-resident-btn:hover {
    background: #4db8a8;
    color: white;
}

.resident-card .delete-resident-btn {
    color: #e74c3c;
}

.resident-card .delete-resident-btn:hover {
    background: #e74c3c;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state p {
    margin: 8px 0;
    font-size: 16px;
}

.empty-state .hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* �Ƶ{��ܼҺA�ؼ˦� */
.schedule-modal,
.schedule-selection-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.schedule-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 16px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-modal-header {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    gap: 16px;
}

.schedule-modal-header .modal-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.schedule-modal-header .modal-title-container {
    flex: 1;
    text-align: center;
}

.schedule-modal-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
}

.schedule-modal-header .modal-subtitle {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* �Ƶ{����j�p��� */
.grid-size-control {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-right: 50px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.grid-size-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.grid-size-slider {
    width: 160px;
    height: 10px;
    background: linear-gradient(to right, #e0e0e0 0%, #f5f5f5 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.grid-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.grid-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #66bb6a 0%, #4CAF50 100%);
}

.grid-size-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.grid-size-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.grid-size-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #66bb6a 0%, #4CAF50 100%);
}

.grid-size-slider::-moz-range-thumb:active {
    transform: scale(1.1);
}

.grid-size-value {
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 15px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.schedule-modal-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
}

.schedule-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.schedule-modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
    /* ? �T�O�Ū��A����m�� */
    display: flex;
    flex-direction: column;
}

/* ⭐ 旁白設定對話框 */
.narration-settings-content {
    max-width: 500px !important;
}

.narration-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f0fe 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.narration-info-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    color: #2c3e50;
}

.narration-info-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.narration-question {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.narration-question p {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.narration-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.narration-actions .btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.narration-actions .btn i {
    font-size: 16px;
}

.narration-no-btn {
    background: #95a5a6;
    color: #fff;
    border: none;
}

.narration-no-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.narration-yes-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
}

.narration-yes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* Grid �G���˦� */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 4px;
    transition: all 0.3s ease;
    /* ? ���u�� empty-state �ɡA�����񺡪Ŷ� */
    flex: 1;
}

/* ����j�p�ܤ� */
.schedule-grid.size-small {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.schedule-grid.size-medium {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.schedule-grid.size-large {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.schedule-grid.size-xlarge {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 28px;
}

.schedule-grid-item {
    aspect-ratio: 1;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.schedule-grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.schedule-grid-item:hover::before {
    opacity: 0.1;
}

.schedule-grid-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(77, 184, 168, 0.25);
}

/* ⭐ 排程刪除按鈕 */
.schedule-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.schedule-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.schedule-grid-item:hover .schedule-delete-btn {
    opacity: 1;
}

/* �Y�Ϻ���e�� - �@���I�� */
.schedule-thumbnail-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0;
    background: #f0f0f0;
    z-index: 0;
}

.schedule-thumbnail-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #e0e0e0;
}

/* �p�G�u��1�Ӽv���A������Ӻ���?*/
.schedule-thumbnail-grid.single .schedule-thumbnail-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

/* �p�G�u��2��3�Ӽv���A�վ�G�� */
.schedule-thumbnail-grid.two .schedule-thumbnail-item:first-child,
.schedule-thumbnail-grid.three .schedule-thumbnail-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
}

/* �S���Y�Ϯɪ������?*/
.schedule-thumbnail-placeholder {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8e9ff 100%);
    color: var(--primary-color);
    font-size: 4rem;
}

/* �Ƶ{��T�ϰ� - �B�b�Y�ϤW�� */
.schedule-grid-info-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.schedule-grid-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.schedule-grid-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.schedule-grid-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.schedule-grid-duration {
    color: #ffd700;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* �ª��C���˦� (�O�d�Ω��L�a��) */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.schedule-item:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.schedule-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.schedule-item-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.schedule-item-info {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
}

.schedule-item-duration {
    margin-top: 5px;
    color: var(--success-color);
    font-weight: 500;
}

.schedule-timing-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(0, 123, 255, 0.03);
    border: 1px solid rgba(0, 123, 255, 0.08);
    border-radius: 6px;
    font-size: 0.8rem;
}

.duration-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.duration-display-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.75rem;
}

.duration-display-label::before {
    font-size: 0.8rem;
}

.duration-display-value {
    color: var(--success-color);
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(40, 167, 69, 0.15);
    min-width: 35px;
    text-align: center;
    font-size: 0.75rem;
}

.repeat-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.6);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 123, 255, 0.15);
}

.repeat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
}

.repeat-label::before {
    font-size: 0.8rem;
}

.repeat-input {
    width: 35px;
    padding: 2px 4px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    background: white;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.repeat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.repeat-input:hover {
    border-color: var(--primary-color);
}

.repeat-label-suffix {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

.total-time-display {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    padding: 2px 6px;
    background: rgba(108, 117, 125, 0.08);
    border-radius: 8px;
    white-space: nowrap;
}

/* 轉場特效控件 */
.transition-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.6);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(156, 39, 176, 0.15);
}

.transition-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9c27b0;
}

.transition-label::before {
    font-size: 0.8rem;
}

.transition-effect-select {
    min-width: 100px;
    padding: 2px 6px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    color: #9c27b0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.transition-effect-select:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.1);
}

.transition-effect-select:hover {
    border-color: #9c27b0;
}

.transition-duration-input {
    width: 50px;
    padding: 2px 4px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    background: white;
    color: #9c27b0;
    transition: all 0.2s ease;
}

.transition-duration-input:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.1);
}

.transition-duration-input:hover {
    border-color: #9c27b0;
}

.transition-duration-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 排程設定按鈕 */
.schedule-settings-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.schedule-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.schedule-settings-btn i {
    font-size: 0.9rem;
}

.settings-summary {
    font-size: 0.7rem;
    opacity: 0.95;
}

/* 排程設定浮動視窗 */
.schedule-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.schedule-settings-modal.show {
    opacity: 1;
}

.schedule-settings-modal.fade-out {
    opacity: 0;
}

.settings-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInCenter 0.3s ease;
    z-index: 10001;
}

@keyframes slideInCenter {
    from {
        transform: translate(-50%, calc(-50% - 10px));
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.settings-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-modal-header h3 i {
    color: #667eea;
}

.settings-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.settings-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.settings-label i {
    color: #667eea;
    width: 16px;
}

.settings-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-repeat-input,
.settings-duration-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-repeat-input:focus,
.settings-duration-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-transition-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-transition-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-unit {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

/* ⭐ 旁白設定樣式 */
.narration-button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-narration-button {
    flex: 1;
    padding: 10px 16px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f8f9ff;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.settings-narration-button:hover {
    background: #667eea;
    color: white;
    border-style: solid;
}

.settings-narration-button i {
    font-size: 1rem;
}

.settings-narration-button.selected {
    background: #e8f5e9;
    border-color: #4caf50;
    border-style: solid;
    color: #2e7d32;
}

.settings-narration-button.selected:hover {
    background: #4caf50;
    color: white;
}

.settings-narration-clear-button {
    padding: 10px 12px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    background: #fff5f5;
    color: #e74c3c;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.settings-narration-clear-button:hover {
    background: #e74c3c;
    color: white;
}

/* 🎤 旁白音訊選擇模態框樣式 */
.narration-audio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.narration-audio-modal.show {
    opacity: 1;
}

.narration-audio-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    display: flex;
    flex-direction: column;
}

.narration-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.narration-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.narration-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.narration-item.selected {
    background: #e8f5e9;
    border-color: #4caf50;
}

.narration-item-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.narration-item.selected .narration-item-icon {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.narration-item-info {
    flex: 1;
    min-width: 0;
}

.narration-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.narration-item-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    gap: 15px;
}

.narration-item-meta i {
    margin-right: 4px;
}

.narration-item-preview {
    width: 36px;
    height: 36px;
    border: 2px solid #667eea;
    border-radius: 50%;
    background: white;
    color: #667eea;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.narration-item-preview:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.narration-item-preview i {
    margin-left: 2px;
}

.narration-item-preview i.fa-pause {
    margin-left: 0;
}

.narration-item-check {
    font-size: 1.5rem;
    color: #4caf50;
    flex-shrink: 0;
}

.search-bar {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.settings-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
    margin: 20px 0;
}

.settings-narration-select,
.settings-narration-delay-input,
.settings-narration-duration-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.settings-narration-select {
    background: white;
    cursor: pointer;
}

.settings-narration-duration-input[readonly] {
    background: #f8f9fa;
    cursor: not-allowed;
}

.settings-narration-select:focus,
.settings-narration-delay-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 6px;
    line-height: 1.4;
}

.settings-hint i {
    color: #667eea;
    font-size: 0.7rem;
}

.narration-warning {
    color: #e74c3c;
    background: #fff5f5;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

.narration-warning i {
    color: #e74c3c;
}

.settings-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-radius: 0 0 12px 12px;
}

.settings-confirm-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.settings-confirm-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.settings-confirm-btn.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===================================
   ?t?�c??J?i????\?h
   =================================== */

.system-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.system-loading-overlay .loading-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-loading-overlay .loading-logo {
    margin-bottom: 25px;
}

.system-loading-overlay .loading-logo img {
    height: 60px;
    object-fit: contain;
    animation: pulse 2s ease-in-out infinite;
}

.system-loading-overlay .loading-logo i {
    font-size: 64px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.system-loading-overlay .loading-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.system-loading-overlay .progress-container {
    margin-bottom: 25px;
}

.system-loading-overlay .progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(77, 184, 168, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.system-loading-overlay .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.system-loading-overlay .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.system-loading-overlay .progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.system-loading-overlay #systemProgressPercent {
    font-weight: 600;
    font-size: 18px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.system-loading-overlay #systemProgressStatus {
    font-style: italic;
}

.system-loading-overlay .loading-details {
    margin-top: 25px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    padding: 15px;
    background: rgba(77, 184, 168, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(77, 184, 168, 0.1);
}

.system-loading-overlay .loading-details::-webkit-scrollbar {
    width: 6px;
}

.system-loading-overlay .loading-details::-webkit-scrollbar-track {
    background: rgba(77, 184, 168, 0.05);
    border-radius: 3px;
}

.system-loading-overlay .loading-details::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 3px;
}

.system-loading-overlay .detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #2c3e50;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.system-loading-overlay .detail-item i {
    font-size: 16px;
    min-width: 16px;
}

@media (max-width: 480px) {
    .system-loading-overlay .loading-content {
        padding: 40px 25px;
    }

    .system-loading-overlay .loading-title {
        font-size: 20px;
    }

    .system-loading-overlay .loading-logo i {
        font-size: 48px;
    }
}

/* ==========================================
   Empty State �˦��]�Ƶ{�B�v�����Ū��A��ܡ^
   ========================================== */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light, #6c757d);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
    /* ? �T�O�b grid �e�����]��m�� */
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--text-light, #6c757d);
}

.empty-state h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--text-color, #495057);
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light, #6c757d);
    line-height: 1.6;
}

.empty-state p:not(:last-child) {
    margin-bottom: 10px;
}

.empty-state p:last-of-type {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 10px;
}

/* �Ū��A�T�����]�p */
@media (max-width: 768px) {
    .empty-state {
        padding: 40px 15px;
    }

    .empty-state i {
        font-size: 48px;
    }

    .empty-state h4 {
        font-size: 16px;
    }

    .empty-state p {
        font-size: 13px;
    }
}

/* ===========================
   �˸m�޲z�]�w�˦�
   =========================== */

.device-management {
    margin-bottom: 32px;
}

.device-management .section-header {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.device-management .section-header h4 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-management .section-header h4 i {
    color: white;
}

.device-management .section-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 6px 0 0 0;
}

.device-list-section {
    background: white;
    padding: 24px;
    border: 2px solid #e0e0e0;
    border-top: none;
}

.device-list-section .section-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.device-list-section h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

.device-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.device-card:hover {
    border-color: #4db8a8;
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.15);
    transform: translateY(-2px);
}

.device-card.selected {
    border-color: #4db8a8;
    background: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

.device-info {
    display: flex;
    gap: 16px;
    align-items: center;
    flex: 1;
}

.device-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-details h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.device-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.device-id {
    font-family: 'Courier New', monospace;
    color: #4db8a8 !important;
}

.device-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.device-actions .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.device-test-section {
    background: #f8f9fa;
    padding: 24px;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.device-test-section h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.device-selected-section {
    background: white;
    padding: 24px;
    border: 2px solid #e0e0e0;
    border-top: none;
}

.device-selected-section .form-group {
    margin-bottom: 0;
}

.device-selected-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.device-selected-section select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.device-selected-section select:focus {
    outline: none;
    border-color: #4db8a8;
    box-shadow: 0 0 0 4px rgba(77, 184, 168, 0.1);
}

/* ===========================
   ��i���ҺA�ؼ˦�
   =========================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-dialog .modal-content {
    background: white;
}

.modal-dialog .modal-header {
    padding: 24px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.modal-dialog .modal-header h3,
.modal-dialog .modal-header h5 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.modal-dialog .close-modal {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-dialog .close-modal:hover {
    background: #e9ecef;
    color: #333;
    transform: rotate(90deg);
}

.modal-dialog .modal-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-dialog .modal-body .form-group {
    margin-bottom: 20px;
}

.modal-dialog .modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-dialog .modal-body label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.modal-dialog .modal-body input,
.modal-dialog .modal-body textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-dialog .modal-body input:focus,
.modal-dialog .modal-body textarea:focus {
    outline: none;
    border-color: #4db8a8;
    box-shadow: 0 0 0 4px rgba(77, 184, 168, 0.1);
}

.modal-dialog .modal-body input:read-only {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

.modal-dialog .modal-body .form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

.modal-dialog .modal-footer {
    padding: 10px 10px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* �����޲z�ҺA�� */
.resident-modal-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
}

.resident-modal-wrapper .modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.resident-modal-wrapper .modal-content {
    position: relative !important;
    z-index: 2 !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-dialog .modal-footer .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* ========================================
   分頁控制器樣式（簡潔版）
   ======================================== */
.output-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(77, 184, 168, 0.08) 0%, rgba(77, 184, 168, 0.03) 100%);
    border-radius: 8px;
    border: 1px solid rgba(77, 184, 168, 0.15);
}

.pagination-info {
    color: var(--text-color);
    font-size: 13px;
    opacity: 0.7;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 導航按鈕（箭頭） */
.btn-page-nav {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(77, 184, 168, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-page-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.3);
}

.btn-page-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 頁碼按鈕 */
.btn-page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(77, 184, 168, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.btn-page-num:hover:not(:disabled) {
    background: rgba(77, 184, 168, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-page-num.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.4);
}

.btn-page-num:disabled {
    cursor: default;
}

/* 頁碼容器 */
.page-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 省略號 */
.page-dots {
    color: var(--text-color);
    opacity: 0.5;
    padding: 0 4px;
    font-size: 14px;
}