/* ==========================================
   企业级文件管理系统 - 样式表
   简洁专业的B端设计
   ========================================== */

/* 全局样式 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --primary-active: #096dd9;
    --primary-light: #e6f7ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-tertiary: #8c8c8c;
    --border-color: #d9d9d9;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --sidebar-bg: #001529;
    --sidebar-text: rgba(255, 255, 255, 0.65);
    --sidebar-active: #1890ff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.09);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5715;
    color: var(--text-primary);
    background-color: var(--bg-color);
    font-size: 14px;
    margin: 0;
    padding: 0;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background-color: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-logo {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    padding: 16px 0;
}

.menu-item {
    display: block;
    padding: 12px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.08);
}

.menu-item.active {
    color: white;
    background-color: var(--sidebar-active);
    border-left-color: white;
}

/* 主内容区 */
.main-layout {
    flex: 1;
    margin-left: 200px;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-header {
    height: 64px;
    background-color: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breadcrumb {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-info:hover {
    background-color: var(--bg-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.logout-btn {
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.logout-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 内容区域 */
.content-wrapper {
    flex: 1;
    padding: 24px;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ==========================================
   导航栏（已废弃，使用侧边栏）
   ========================================== */

/* ==========================================
   主内容区
   ========================================== */

/* ==========================================
   页面标题
   ========================================== */
.page-header {
    margin-bottom: 24px;
    background-color: white;
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ==========================================
   卡片样式
   ========================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* ==========================================
   表单样式
   ========================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
    background-color: white;
}

.form-control:hover {
    border-color: var(--primary-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================
   按钮样式
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #15803d;
}

.btn-default {
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-default:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 4px 8px;
    border: none;
}

.btn-link:hover:not(:disabled) {
    color: var(--primary-hover);
    background-color: rgba(37, 99, 235, 0.05);
}

/* ==========================================
   表格样式
   ========================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background-color: #f8fafc;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格操作按钮 */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================================
   存储信息卡片
   ========================================== */
.storage-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.storage-stat {
    background-color: #ffffff;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.storage-stat:hover {
    box-shadow: var(--shadow-md);
}

.storage-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.storage-stat-value {
    font-size: 30px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ==========================================
   进度条
   ========================================== */
.progress {
    height: 6px;
    background-color: var(--bg-color);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 100px;
}

.progress-bar.warning {
    background: var(--warning-color);
}

.progress-bar.danger {
    background: var(--error-color);
}

/* 文件列表样式 */
#fileList {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

#fileListContent {
    max-height: 200px;
    overflow-y: auto;
}

/* 上传进度样式 */
#uploadProgress {
    margin-top: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 100px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==========================================
   消息提示
   ========================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    border: 1px solid;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #86efac;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-warning {
    background-color: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

/* ==========================================
   文件上传区域
   ========================================== */
.upload-section {
    margin-bottom: 24px;
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #dbeafe;
    border-style: solid;
    box-shadow: var(--shadow-lg);
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.upload-area .upload-hint {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ==========================================
   加载动画
   ========================================== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   空状态
   ========================================== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-tertiary);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================
   徽章
   ========================================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.badge-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}

.badge-warning {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.badge-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-200px);
    }
    
    .main-layout {
        margin-left: 0;
    }
    
    .storage-info {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   工具类
   ========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.ml-1 { margin-left: 8px; }
.ml-2 { margin-left: 16px; }

.mr-1 { margin-right: 8px; }
.mr-2 { margin-right: 16px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.hidden { display: none; }

.flex { display: flex; }
.flex-center { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.flex-between { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }


/* ==========================================
   统计面板样式
   ========================================== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    min-height: 380px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    background: #e3f2fd;
    color: #1976d2;
}

.rank-1 {
    background: #1976d2;
    color: white;
}

.rank-2 {
    background: #42a5f5;
    color: white;
}

.rank-3 {
    background: #90caf9;
    color: white;
}

.time-ago {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.badge-primary {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}


/* ==========================================
   分页样式
   ========================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0 16px;
}

.stat-value-small {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================
   文件详情页样式
   ========================================== */
.file-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    word-break: break-word;
}

.btn-copy-link {
    white-space: nowrap;
}
