/* style.css - 主应用核心样式（不包含认证界面） */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

.container {
    margin: 0;
    padding: 0;
    max-width: 1400px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* 改为固定高度计算 */
    max-height: calc(100vh - 100px);
    min-height: auto; /* 移除min-height */
}

.scrollable-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 15px 20px 15px;
    min-height: 0;
    
    /* 美化：背景和边框 */
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.98) 100%);
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    
    /* 美化：内阴影 */
    box-shadow: 
        inset 0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 2px 8px rgba(102, 126, 234, 0.08);
    
    /* 美化：边缘渐变遮罩 */
    position: relative;
}

/* 美化滚动条 */
.scrollable-container::-webkit-scrollbar {
    width: 10px;
}

.scrollable-container::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 10px;
    margin: 20px 0;
}

.scrollable-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.6), 
        rgba(118, 75, 162, 0.6));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.scrollable-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.8), 
        rgba(118, 75, 162, 0.8));
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    z-index: 1;
}

/* 修改：调整标题样式 */
.app-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #fff, #e2e8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    text-align: center;
}

.header-top-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-top-group h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #e2e8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    margin: 0;
}

/* 文件信息 */
.file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

/* 通用按钮样式 */
button {
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

/* 文件列表区域 */
.file-list-section {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* 关键！允许内容区域压缩 */
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.file-list-title {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    position: relative;
    padding-left: 20px;
}

.file-list-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.file-list-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    padding: 10px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list-item {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: normal;
    gap: 20px;
    border-radius: 12px;
    margin: 5px 0;
}

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

.file-list-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-color: rgba(102, 126, 234, 0.3);
}

.file-list-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.file-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.file-date {
    font-size: 13px;
    color: #718096;
    background: rgba(113, 128, 150, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.file-size {
    font-size: 13px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.file-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    font-style: italic;
    font-size: 16px;
}

/* 详细内容区域 */
.detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 关键！允许内容区域压缩 */
}

.content-area {
    padding: 2px 0;
    min-height: 400px;
}

/* 对话块样式 */
.conversation-block {
    background: white;
    padding: 8px;
    border-radius: 20px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    border: 2px solid #f7fafc;
    position: relative;
}

.conversation-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 6px 0 0 6px;
}

.conversation-block:hover {
    transform: translateX(5px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.1);
}

.conversation-block.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

/* 发言人和时间在同一行 */
.speaker-header {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    gap: 15px;
    flex-wrap: wrap;
}

/* 发言图标调小 */
.speaker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.speaker-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.speaker-name {
    font-weight: 700;
    font-size: 18px;
    color: #2d3748;
}

.time-range {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    font-size: 13px;
    color: #718096;
    background: rgba(113, 128, 150, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

.merged-text {
    font-size: 16px;
    line-height: 1.8;
    color: #4a5568;
    padding: 4px 0px;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.text-segment {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 8px;
    display: inline;
    position: relative;
}

.text-segment:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.text-segment.playing {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: #667eea;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.segment-divider {
    color: #cbd5e0;
    margin: 0 10px;
    font-size: 20px;
}

/* Mini播放器 */
.mini-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: move;
    user-select: none;
    min-width: 180px;
    max-width: 250px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-player.dragging {
    opacity: 0.8;
    cursor: grabbing;
    transform: scale(1.05);
}

.mini-player-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

.mini-player-info {
    font-size: 13px;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    font-weight: 600;
}

.mini-player-info.playing {
    color: #667eea;
    font-weight: 700;
}

.mini-player-controls {
    display: flex;
    gap: 8px;
}

.mini-player-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mini-player-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mini-player-btn.play {
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.mini-player-btn.stop {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

/* 关闭按钮 */
.close-detail-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 12px 28px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-detail-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 加载状态 */
.loading {
    display: none;
    text-align: center;
    padding: 100px 20px;
    color: #718096;
}

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-right: 4px solid #764ba2;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

/* 错误提示 */
.error {
    display: none;
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    padding: 25px;
    margin: 30px;
    border-radius: 20px;
    border-left: 6px solid #c53030;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(245, 101, 101, 0.2);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px;
    color: #718096;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2d3748;
}

.empty-state p {
    font-size: 16px;
    max-width: 500px;
    line-height: 1.8;
}

/* ==============================
   删除按钮样式 - Delete Button
   ============================== */

   .delete-file-btn {
    /* 基础样式 */
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #718096;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    
    /* 布局 */
    flex-shrink: 0; /* 防止按钮被压缩 */
    margin-left: 12px;
}

/* 按钮伪元素 - 悬停时的渐变背景 */
.delete-file-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, #fed7d7, #fc8181);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* 按钮内的图标/文字 */
.delete-file-btn span {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, color 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 鼠标悬停效果 */
.delete-file-btn:hover {
    border-color: #fc8181;
    box-shadow: 0 4px 12px rgba(252, 129, 129, 0.2);
    transform: translateY(-2px);
}

.delete-file-btn:hover::before {
    opacity: 1;
}

.delete-file-btn:hover span {
    color: white;
    transform: scale(1.1);
}

/* 按钮按下效果 */
.delete-file-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 4px rgba(252, 129, 129, 0.1);
    transition-duration: 0.1s;
}

/* 焦点状态 - 无障碍访问支持 */
.delete-file-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.3);
}

/* 删除中状态 */
.delete-file-btn.deleting {
    cursor: not-allowed;
    opacity: 0.7;
    border-color: #cbd5e0;
    pointer-events: none; /* 禁用交互 */
}

.delete-file-btn.deleting span {
    animation: deletingPulse 1.5s ease-in-out infinite;
}

@keyframes deletingPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 文件列表中的删除按钮布局 */
.file-list-item .file-actions {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.file-list-item:hover .file-actions {
    opacity: 1;
}

/* 简化版（备用方案） */
.delete-file-btn.simple {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fed7d7, #fc8181);
    color: #c53030;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-file-btn.simple:hover {
    background: linear-gradient(135deg, #fc8181, #f56565);
    color: white;
    transform: scale(1.05);
}

.delete-file-btn.simple:active {
    transform: scale(0.95);
}

/* 小尺寸删除按钮 */
.delete-file-btn.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* 大尺寸删除按钮 */
.delete-file-btn.large {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 12px;
}

/* 危险样式变体 */
.delete-file-btn.danger {
    background: linear-gradient(145deg, #fed7d7, #fc8181);
    color: #c53030;
    border-color: #fc8181;
}

.delete-file-btn.danger:hover {
    background: linear-gradient(145deg, #fc8181, #e53e3e);
}

/* ==============================
   删除确认对话框样式
   ============================== */

.delete-confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.delete-confirm-dialog {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.delete-dialog-header {
    background: linear-gradient(135deg, #fc8181, #f56565);
    color: white;
    padding: 24px;
    text-align: center;
}

.delete-dialog-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.delete-dialog-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.delete-dialog-content {
    padding: 24px;
}

.delete-file-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid #fc8181;
}

.delete-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ==============================
   文件列表项布局（补充）
   ============================== */

.file-list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
    cursor: pointer;
}

.file-list-item:hover {
    background-color: #f7fafc;
}

.file-list-item.selected {
    background-color: #ebf8ff;
    border-left: 4px solid #4299e1;
}

.file-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.file-info-main {
    flex: 1;
    display: flex;
    min-width: 0; /* 防止内容溢出 */
}

.file-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #718096;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        border-radius: 20px;
        margin: 15px;
    }
    
    .detail-content {
        padding: 20px;
    }
    
    .file-list-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 16px;
        margin: 10px;
    }
    
    .app-header h1 {
        font-size: 24px;
    }
    
    .close-detail-btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .file-list-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .file-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .speaker-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mini-player {
        bottom: 20px;
        right: 20px;
        min-width: 150px;
        max-width: 200px;
    }
    
    /* 移动端调整发言图标大小 */
    .speaker-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    
    .app-header h1 {
        font-size: 20px;
    }
    
    .detail-content {
        padding: 15px;
    }
    
    .file-list-section {
        padding: 15px;
    }
    
    .file-list-title {
        font-size: 18px;
    }
    
    .merged-text {
        font-size: 14px;
        padding: 12px;
    }
    
    /* 小屏幕调整发言图标大小 */
    .speaker-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .speaker-name {
        font-size: 16px;
    }
    
    .mini-player {
        bottom: 15px;
        right: 15px;
        border-radius: 20px;
    }
    
    .mini-player-content {
        padding: 12px 16px;
    }
    
    .mini-player-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}