/* ============================================
   Zoom AI 会议助手 - 样式表
   设计风格：现代、极简、深色主题
   ============================================ */

/* CSS 变量 - 主题色 */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1e2a47;
    --bg-hover: #253559;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #6c6c80;
    --accent-blue: #4a9eff;
    --accent-green: #4caf50;
    --accent-red: #ef5350;
    --accent-orange: #ff9800;
    --accent-purple: #b388ff;
    --border-color: #2a3a5c;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   应用容器
   ============================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   顶部标题栏
   ============================================ */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 28px;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);

}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.offline {
    background-color: var(--text-muted);
}

.status-dot.connecting {
    background-color: var(--accent-orange);
    animation: pulse 1s ease-in-out infinite;
}

.status-dot.online {
    background-color: var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   主体内容区 - 左右分栏
   ============================================ */
.main-content {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow: hidden;
    padding: 16px 0;
}

/* 左侧转录面板 */
.transcript-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* 右侧总结面板 */
.summary-panel {
    width: 380px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* 面板头部 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.transcript-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 3px 10px;
    border-radius: 12px;
}

.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-refresh:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-refresh:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   转录列表
   ============================================ */
.transcript-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
.transcript-list::-webkit-scrollbar {
    width: 6px;
}

.transcript-list::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.transcript-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

.empty-hint, .summary-hint {
    font-size: 12px !important;
    color: var(--text-muted);
    opacity: 0.7;
}

/* 转录消息项 */
.transcript-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transcript-time {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 52px;
    padding-top: 4px;
    flex-shrink: 0;
}

.transcript-text {
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-blue);
    flex: 1;
    word-break: break-word;
}

/* AI 纠错标识 */
.corrected-badge {
    display: inline-block;
    font-size: 10px;
    color: var(--accent-green);
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 500;
}

/* ============================================
   总结内容区
   ============================================ */
.summary-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.summary-content::-webkit-scrollbar {
    width: 6px;
}

.summary-content::-webkit-scrollbar-track {
    background: transparent;
}

.summary-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.summary-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.summary-icon {
    font-size: 40px;
    opacity: 0.5;
}

.summary-placeholder p {
    font-size: 13px;
    line-height: 1.6;
}

/* 总结文本卡片 */
.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 3px solid var(--accent-purple);
    animation: fadeInUp 0.3s ease;
}

.summary-card h3 {
    font-size: 13px;
    color: var(--accent-purple);
    margin-bottom: 10px;
    font-weight: 600;
}

.summary-text {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.summary-text strong {
    color: var(--accent-blue);
}

.summary-text ul, .summary-text ol {
    padding-left: 18px;
    margin: 8px 0;
}

.summary-text li {
    margin-bottom: 4px;
}

.summary-timestamp {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: right;
}

/* 加载动画 */
.summary-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 12px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   底部控制栏
   ============================================ */
.control-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.control-group {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-start {
    background: var(--accent-green);
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #43a047;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-stop {
    background: var(--accent-red);
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #e53935;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* 音频波形指示器 */
.audio-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.3s;
}

.audio-indicator.active {
    opacity: 1;
}

.audio-bar {
    width: 4px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.audio-indicator.active .audio-bar {
    animation: audioWave 1.2s ease-in-out infinite;
}

.audio-indicator.active .audio-bar:nth-child(1) { animation-delay: 0s; }
.audio-indicator.active .audio-bar:nth-child(2) { animation-delay: 0.15s; }
.audio-indicator.active .audio-bar:nth-child(3) { animation-delay: 0.3s; }
.audio-indicator.active .audio-bar:nth-child(4) { animation-delay: 0.45s; }
.audio-indicator.active .audio-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes audioWave {
    0%, 100% { height: 8px; }
    50% { height: 24px; }
}

/* 会议计时器 */
.meeting-timer {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: center;
}

.meeting-timer.active {
    color: var(--accent-green);
}

/* ============================================
   音频源状态徽章
   ============================================ */
.audio-sources {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.source-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.source-badge.active {
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.source-badge.active .source-status {
    color: var(--accent-green);
}

.source-icon {
    font-size: 14px;
}

.source-label {
    font-weight: 500;
}

.source-status {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   音频模式选择面板
   ============================================ */
.audio-mode-panel {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.audio-mode-panel.hidden {
    display: none;
}

.mode-panel-header {
    margin-bottom: 12px;
}

.mode-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mode-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.mode-options {
    display: flex;
    gap: 12px;
}

.mode-option {
    flex: 1;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    position: relative;
    padding: 14px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.mode-option:hover .mode-card {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.mode-option.selected .mode-card {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.08);
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.15);
}

.mode-option.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.mode-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mode-recommended {
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--accent-blue);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

/* ============================================
   说话人标签（转录列表中）
   ============================================ */
.source-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.source-tag-mic {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.source-tag-system {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.source-tag-unknown {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(160, 160, 176, 0.3);
}

/* 根据说话人来源调整转录条目左侧边框颜色 */
.transcript-item.source-mic .transcript-text {
    border-left-color: var(--accent-green);
}

.transcript-item.source-system .transcript-text {
    border-left-color: var(--accent-blue);
}

.transcript-item.source-unknown .transcript-text {
    border-left-color: var(--text-muted);
}

/* ============================================
   响应式布局
   ============================================ */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .summary-panel {
        width: 100%;
        max-height: 300px;
    }

    .control-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .app-header h1 {
        font-size: 16px;
    }

    .mode-options {
        flex-direction: column;
    }

    .audio-sources {
        display: none;
    }

    .header-right {
        gap: 6px;
    }
}
