body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    min-height: calc(100vh - 4rem);
}

.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
}

.hidden {
    display: none;
}

.title {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.75rem;
}

input, select, textarea {
    transition: all 0.2s ease;
    border-color: #d1d5db;
}

input:focus, select:focus, textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    outline: none;
}

.btn {
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.btn:active {
    transform: scale(0.98);
}

.copy-btn {
    background-color: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.copy-btn:hover {
    background-color: #1d4ed8;
}

/* 新增的儲存按鈕樣式 */
.save-btn {
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
}

.save-btn:hover {
    background-color: #059669;
}

.tab {
    padding: 0.75rem 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab:not(.active):hover {
    color: #4b5563;
    border-bottom-color: #d1d5db;
}

.tab-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.tab-scroll::-webkit-scrollbar {
    height: 4px;
}

.tab-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 2px;
}

.add-tab-btn {
    background-color: #f3f4f6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.add-tab-btn:hover {
    background-color: #e5e7eb;
}

.close-btn {
    opacity: 0.6;
    margin-left: 0.5rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
    background-color: #f3f4f6;
}

.content-area {
    background-color: white;
    border-radius: 0.5rem;
}

pre {
    white-space: pre-wrap;
    word-break: break-all;
    background-color: #1e293b;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block; /* 確保 pre 總是以 block 形式顯示 */
}

/* 新增的 code-display 類別，用於代碼顯示區域 */
/* 修改 CSS 檔案中的 .code-display 類別 */
.code-display {
    min-height: 120px;
    /* 移除 max-height: 300px; */
    overflow-y: visible; /* 改為 visible 而不是 auto */
    margin: 0;
    transition: height 0.2s ease;
    display: block !important; /* 強制顯示 */
    opacity: 1 !important; /* 確保可見 */
    visibility: visible !important; /* 確保可見 */
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}

.modal-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.events-list {
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.event-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-item:hover {
    background-color: #f9fafb;
}

.event-item.selected {
    background-color: #ebf5ff;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.btn-cancel {
    background-color: #e5e7eb;
    color: #4b5563;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background-color: #d1d5db;
}

.btn-create {
    background-color: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-create:hover {
    background-color: #1d4ed8;
}

.btn-create:disabled {
    background-color: #bfdbfe;
    color: #93c5fd;
    cursor: not-allowed;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.tip-box {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.tip-text {
    color: #92400e;
}

/* 新增的儲存狀態顯示樣式 */
.save-success, .save-error, .save-loading {
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
}

.save-success {
    background-color: #d1fae5;
}

.save-error {
    background-color: #fee2e2;
}

.save-loading {
    background-color: #dbeafe;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 白底綠字的下載 PPT 按鈕 */
.ppt-btn {
    background-color: white;
    color: #10b981; /* 綠色文字 */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #10b981;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.ppt-btn:hover {
    background-color: #ecfdf5; /* 淡綠背景 */
}
