* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    height: 100vh;
    overflow: hidden;
    color: #e2e8f0;
    font-size: 13px;
}

.container {
    display: flex;
    height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.sidebar-title span {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 13px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 6px 8px 6px 28px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: #e2e8f0;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 12px;
}

.nav-items {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.nav-item-icon {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    font-size: 12px;
}

.nav-item.active .nav-item-icon {
    color: #60a5fa;
}

/* 投影片導航項目特別樣式 */
.slide-nav-item {
    position: relative;
    z-index: 10;
}

.slide-nav-item:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: translateX(2px);
}

.slide-nav-item.active {
    background: #4CAF50 !important;
    color: white !important;
    font-weight: 600;
}

.slide-nav-item.active .nav-item-icon {
    color: white !important;
}

/* Agent Status */
.agent-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.agent-status:hover {
    background: rgba(148, 163, 184, 0.05);
}

.agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(148, 163, 184, 0.2);
}

.agent-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.agent-name {
    font-size: 12px;
    font-weight: 600;
    color: #f1f5f9;
}

.agent-state {
    font-size: 11px;
    color: #64748b;
}

.agent-state.active {
    color: #10b981;
}

.agent-state.processing {
    color: #f59e0b;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.add-slide-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.add-slide-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.add-slide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-link:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    min-height: 44px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
}

.slide-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slide-nav-btn {
    width: 28px;
    height: 28px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    font-size: 12px;
}

.slide-nav-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
}

.slide-counter {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 4px;
    font-weight: 500;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 6px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.status-dot.processing {
    background: #f59e0b;
    animation: pulse 1.5s infinite;
}

.status-dot.error {
    background: #ef4444;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-text {
    color: #94a3b8;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.save-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: linear-gradient(135deg, #db2777, #9d174d);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.view-container {
    display: none;
    height: 100%;
}

.view-container.active {
    display: block;
}

/* Pipeline Container */
.pipeline-container {
    max-width: 1200px;
    margin: 0 auto;
}

.pipeline-header {
    text-align: center;
    margin-bottom: 32px;
}

.pipeline-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.pipeline-header p {
    color: #94a3b8;
    font-size: 14px;
}

.keyword-input-section {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: center;
}

.keyword-input-section h3 {
    font-size: 16px;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.input-hint {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 16px;
}

.keyword-input-group {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.keyword-input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.keyword-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Keyword Suggestions */
.keyword-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.keyword-tag {
    background: linear-gradient(135deg, #00B050, #0070C0);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-block;
}

.keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 176, 80, 0.3);
    background: linear-gradient(135deg, #00C055, #0080D0);
}

.start-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.start-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pipeline Flow */
.pipeline-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.agent-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.agent-card.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.agent-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(148, 163, 184, 0.2);
}

.agent-card.active .agent-img {
    border-color: #3b82f6;
}

.agent-details {
    flex: 1;
}

.agent-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.agent-details p {
    font-size: 12px;
    color: #94a3b8;
}

.agent-status-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
}

.agent-status-icon.active {
    color: #f59e0b;
    animation: spin 2s linear infinite;
}

.agent-status-icon.completed {
    color: #10b981;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.agent-content {
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
    color: #cbd5e1;
}

.waiting-text {
    color: #64748b;
    font-style: italic;
}

/* 任務容器樣式 */
.task-container {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
}

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.task-header:hover {
    background: rgba(59, 130, 246, 0.1);
}

.task-header.collapsible {
    cursor: pointer;
}

.task-title {
    color: #60a5fa;
    font-weight: 600;
    font-size: 12px;
    flex: 1;
}

.task-status {
    font-size: 11px;
    color: #f59e0b;
    margin-left: 8px;
}

.task-status.completed {
    color: #10b981;
}

.collapse-icon {
    margin-left: 8px;
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.analysis-text {
    padding: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 11px;
    color: #cbd5e1;
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 關鍵字分析進度 */
.keyword-progress-container {
    margin-bottom: 16px;
}

.keyword-progress {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-title {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
}

.progress-count {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    padding: 2px 8px;
    border-radius: 10px;
}

.current-keyword {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.keyword-label {
    font-size: 11px;
    color: #94a3b8;
}

.keyword-name {
    font-size: 12px;
    font-weight: 600;
    color: #f1f5f9;
    background: rgba(59, 130, 246, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressShine 2s linear infinite;
    position: relative;
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 進度條細微動畫 */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: progressGlide 1.5s linear infinite;
}

@keyframes progressGlide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}





/* Results Section */
.results-section {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
    padding: 24px;
}

.results-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 16px;
}

.results-content {
    display: grid;
    gap: 16px;
}

/* Analysis View Styles */
.analysis-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.analysis-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.analysis-header h2 {
    color: #60a5fa;
    font-size: 2.2em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.analysis-subtitle {
    color: #94a3b8;
    font-size: 1.1em;
    margin: 0;
    font-weight: 300;
}

.analysis-content {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.default-content h3 {
    color: #f1f5f9;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.default-content p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 20px;
}

.current-keywords h4 {
    color: #fbbf24;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.keywords-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keywords-display .keyword-tag {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.keywords-display .keyword-tag:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Reports Section */
.reports-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
}

.reports-section h3 {
    color: #60a5fa;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.report-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.report-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.report-icon {
    font-size: 2.5em;
    opacity: 0.8;
}

.report-info h4 {
    color: #f1f5f9;
    margin: 0 0 5px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.report-info p {
    color: #94a3b8;
    margin: 0;
    font-size: 0.9em;
}

/* Analysis Results Styles */
.analysis-result {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
}

.analysis-result h3 {
    color: #60a5fa;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analysis-section {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
    padding: 20px;
    border-left: 4px solid #60a5fa;
}

.analysis-section h4 {
    color: #fbbf24;
    margin: 0 0 12px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.section-content {
    color: #e2e8f0;
    line-height: 1.6;
    font-size: 1em;
}

.section-content br {
    margin-bottom: 8px;
}

/* Pipeline Result Button Styles */
.pipeline-result-section {
    margin-top: 30px;
    padding-top: 20px;
}

.pipeline-result-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #60a5fa, transparent);
    margin-bottom: 20px;
    border-radius: 1px;
}

.pipeline-result-section h4 {
    color: #60a5fa;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-align: center;
}

.pipeline-result-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    color: inherit;
    font-family: inherit;
}

.pipeline-result-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.btn-icon {
    font-size: 2.5em;
    opacity: 0.9;
}

.btn-content {
    flex: 1;
    text-align: left;
}

.btn-title {
    color: #f1f5f9;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.btn-subtitle {
    color: #94a3b8;
    font-size: 0.9em;
    line-height: 1.4;
}

.btn-arrow {
    font-size: 1.5em;
    color: #60a5fa;
    transition: transform 0.3s ease;
}

.pipeline-result-btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* Reports View Styles */
.report-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.report-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #00B050 0%, #0070C0 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.report-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.report-controls {
    display: flex;
    gap: 12px;
}

.report-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.report-content {
    flex: 1;
    padding: 0;
    background: white;
    position: relative;
    overflow: hidden;
}

#reportFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Loading state for iframe */
.report-content.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #0070C0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.report-content.loading::after {
    content: '載入報告中...';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 0.9em;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Slide View */
.slide-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.slide-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(167, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.slide-content {
    background: transparent;
    border-radius: 20px;
    padding: 40px;
    max-width: 95%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: #60a5fa #1e293b;
}

.slide-content::-webkit-scrollbar {
    width: 8px;
}

.slide-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.slide-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #60a5fa, #10b981);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.slide-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3b82f6, #059669);
}



/* 投影片模板樣式 */
.slide-header {
    text-align: center;
    margin-bottom: 32px;
}

.slide-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.slide-title {
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 12px;
}

.slide-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin-top: 12px;
}

.slide-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    margin: 16px auto;
    border-radius: 2px;
}

/* Template: Design */
.template-design .feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: transparent;
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 20px;
}

.feature-title {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Template: Analysis */
.template-analysis .slide-layout {
    display: flex;
    gap: 32px;
}

.template-analysis .slide-layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.slide-metrics-section,
.slide-results-section {
    width: 100%;
}

.slide-left, .slide-right {
    flex: 1;
}

.slide-right h3 {
    font-size: 18px;
    color: #f1f5f9;
    margin-bottom: 16px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: transparent;
    padding: 16px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    text-align: center;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 12px;
    color: #94a3b8;
}

/* Template: Context */
.template-context .slide-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.slide-item {
    padding: 20px;
    background: transparent;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.item-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.item-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.item-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.item-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.item-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.item-content h3, .item-content h4 {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 6px;
    font-size: 14px;
}

.item-content p {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-line;
    text-align: justify;
    padding: 3px 0;
}

.item-content p::-webkit-scrollbar {
    width: 2px;
}

.item-content p::-webkit-scrollbar-track {
    background: transparent;
}

.item-content p::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 1px;
}

/* Template: Strategy */
.strategy-brief {
    background: rgba(30, 41, 59, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
}

.template-strategy h3 {
    font-size: 18px;
    color: #f1f5f9;
    margin: 24px 0 16px;
}

.strategy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.strategy-card {
    background: rgba(30, 41, 59, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.strategy-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    margin-bottom: 12px;
}

.strategy-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.strategy-card p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.execution-list {
    list-style: none;
    padding: 0;
}

.execution-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.execution-list li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #60a5fa;
}

/* Template: Content */
.content-preview {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.content-preview pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

.content-meta h3 {
    font-size: 18px;
    color: #f1f5f9;
    margin: 24px 0 16px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.content-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.content-feature .feature-icon {
    width: 28px;
    height: 28px;
    margin: 0;
    font-size: 14px;
}

.content-feature h4 {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.content-feature p {
    font-size: 12px;
    color: #94a3b8;
}

.steps-list {
    list-style: none;
    padding: 0;
}

.steps-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.steps-list li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: #10b981;
}

.slide-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.slide-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #60a5fa, #10b981, #f59e0b);
    animation: gradient-flow 3s ease-in-out infinite;
}

@keyframes gradient-flow {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.slide-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 12px;
}

.slide-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 8px;
}

.slide-content p {
    font-size: 14px;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: justify;
    max-height: 250px;
    overflow-y: auto;
    white-space: pre-line;
    padding: 5px 0;
}

.slide-content p strong {
    color: #60a5fa;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
}

.slide-content p::-webkit-scrollbar {
    width: 3px;
}

.slide-content p::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.slide-content p::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 2px;
}

.slide-content ul {
    list-style: none;
    padding-left: 20px;
}

.slide-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.slide-content ul li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #60a5fa;
}

/* Right Sidebar - Chat */
.chat-sidebar {
    width: 300px;
    background: rgba(15, 23, 42, 0.95);
    border-left: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.chat-title span {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 13px;
}

.chat-messages {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
}

.chat-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message {
    margin-bottom: 12px;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.message-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
}

.message-avatar.system {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.message-avatar.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.message-avatar.agent {
    background-size: cover;
    background-position: center;
}

/* Agent 訊息樣式 */
.message.agent-message .message-bubble {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.agent-name {
    font-size: 11px;
    font-weight: 600;
    color: #60a5fa;
}

.task-indicator {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.task-indicator.task-start {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.task-indicator.task-complete {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.message-bubble {
    flex: 1;
}

.message-text {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-text.system {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.message-text.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.message-text.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.message-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #64748b;
}

.chat-input {
    padding: 12px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.pipeline-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.control-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
}

.control-btn.danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Icons */
.icon-home::before { content: '🏠'; }
.icon-file::before { content: '📄'; }
.icon-chart::before { content: '📊'; }
.icon-settings::before { content: '⚙️'; }
.icon-search::before { content: '🔍'; }
.icon-plus::before { content: '+'; }
.icon-left::before { content: '‹'; }
.icon-right::before { content: '›'; }
.icon-globe::before { content: '🌐'; }
.icon-sparkles::before { content: '✨'; }
.icon-check::before { content: '✓'; }
.icon-clock::before { content: '🕐'; }
.icon-user::before { content: '👤'; }
.icon-send::before { content: '➤'; }
.icon-brain::before { content: '🧠'; }
.icon-design::before { content: '🎨'; }
.icon-text::before { content: '📝'; }
.icon-target::before { content: '📱'; }
.icon-data::before { content: '📈'; }
.icon-pause::before { content: '⏸'; }
.icon-play::before { content: '▶'; }
.icon-stop::before { content: '⏹'; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 2px;
}

/* Markdown Content Styling */
.markdown-content {
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
}

.markdown-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.markdown-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: #f1f5f9;
    margin-top: 24px;
    margin-bottom: 12px;
}

.markdown-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #60a5fa;
    margin-top: 16px;
    margin-bottom: 8px;
}

.markdown-content p {
    margin-bottom: 12px;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 6px;
}

.markdown-content code {
    background: rgba(148, 163, 184, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: rgba(15, 23, 42, 0.6);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 16px;
    margin: 16px 0;
    color: #94a3b8;
}

.markdown-content hr {
    border: none;
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 24px 0;
}
