/**
 * 文件详情查看页面样式
 * 响应式设计，适配各种设备屏幕
 */

/* ==================== CSS变量定义 ==================== */
:root {
    --primary-color: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    
    --success-color: #10b981;
    --success-light: #34d399;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    --danger-color: #ef4444;
    --danger-light: #f87171;
    --info-color: #3b82f6;
    --info-light: #60a5fa;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius-sm: 6px;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
}

/* ==================== 基础重置 ==================== */
* {
    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;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* ==================== 主容器 ==================== */
.file-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 头部区域 ==================== */
.file-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 48px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-title {
    min-width: 0;
}

.file-title h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-hash {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.header-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-light) 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ==================== 内容区域 ==================== */
.file-view-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.file-view-content.has-preview {
    grid-template-columns: 400px 1fr;
}

/* ==================== 信息面板 ==================== */
.file-info-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.info-section {
    margin-bottom: 24px;
}

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

.info-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section h3 i {
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

/* ==================== 徽章样式 ==================== */
.file-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.normal {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-badge.banned {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.uid-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}

.pwd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ==================== 链接列表 ==================== */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.link-input-group {
    display: flex;
    gap: 8px;
}

.link-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--gray-50);
    outline: none;
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ==================== 预览面板 ==================== */
.file-preview-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-header h3 i {
    color: var(--primary-color);
}

.btn-close-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-preview:hover {
    background: var(--danger-color);
    color: white;
}

.preview-content {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-900);
    min-height: 400px;
}

.preview-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
}

.preview-video {
    max-width: 100%;
    max-height: 600px;
    border-radius: var(--border-radius-sm);
}

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

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    color: var(--success-color);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .file-view-content.has-preview {
        grid-template-columns: 1fr;
    }
    
    .file-preview-panel {
        order: -1;
    }
    
    .preview-content {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .file-view-container {
        padding: 12px;
    }
    
    .file-view-header {
        padding: 16px;
    }
    
    .file-icon {
        font-size: 36px;
    }
    
    .file-title h1 {
        font-size: 16px;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .file-info-panel {
        padding: 16px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-content {
        min-height: 250px;
        padding: 12px;
    }
    
    .preview-image,
    .preview-video {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .file-view-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-right {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
}
