/* ===== NordicTimeline 网盘页面样式 ===== */
/* 蔚蓝意式风格 */

/* === 页面容器 === */
.drive-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* === 页面标题 === */
.drive-title {
    font-family: 'LXGW WenKai Lite', 'Noto Serif SC', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--nordic-text, #1A2B3C);
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

/* === 工具栏 === */
.drive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

/* 搜索框 */
.drive-search {
    flex: 1;
    max-width: 320px;
}

.drive-search input {
    width: 100%;
    padding: 10px 20px;
    border: 2px solid var(--nordic-primary, #4A8DB7);
    border-radius: 24px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    outline: none;
}

.drive-search input:focus {
    box-shadow: 0 0 0 3px rgba(74, 141, 183, 0.15);
}

.drive-search input::placeholder {
    color: #999;
}

/* 视图切换按钮 */
.drive-view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--nordic-border, #DCE5EE);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--nordic-text-light, #6B7D8E);
}

.view-btn:hover {
    border-color: var(--nordic-primary, #4A8DB7);
    color: var(--nordic-primary, #4A8DB7);
}

.view-btn.active {
    background: var(--nordic-primary, #4A8DB7);
    border-color: var(--nordic-primary, #4A8DB7);
    color: #fff;
}

/* === 面包屑导航 === */
.drive-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: rgba(74, 141, 183, 0.04);
    border-radius: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--nordic-primary, #4A8DB7);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.breadcrumb-item:hover {
    background: rgba(74, 141, 183, 0.1);
}

.breadcrumb-item:last-child {
    color: var(--nordic-text, #1A2B3C);
    font-weight: 500;
    pointer-events: none;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin-left: 8px;
    color: var(--nordic-text-light, #6B7D8E);
}

/* === 内容区域 === */
.drive-content {
    min-height: 400px;
}

.drive-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--nordic-text-light, #6B7D8E);
    font-size: 14px;
}

.drive-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--nordic-text-light, #6B7D8E);
}

.drive-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === 网格视图 === */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.drive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    border: 1px solid var(--nordic-border, #DCE5EE);
}

.drive-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--nordic-primary, #4A8DB7);
}

.drive-item-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.drive-item-icon svg {
    width: 100%;
    height: 100%;
}

.drive-item-name {
    font-size: 14px;
    text-align: center;
    color: var(--nordic-text, #1A2B3C);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    width: 100%;
}

.drive-item-meta {
    font-size: 12px;
    color: var(--nordic-text-light, #6B7D8E);
    margin-top: 4px;
}

/* 文件夹图标 */
.drive-item.folder .drive-item-icon {
    color: var(--nordic-primary, #4A8DB7);
}

/* 文件类型图标颜色 */
.drive-item.file-type-image .drive-item-icon {
    color: #E91E63;
}

.drive-item.file-type-pdf .drive-item-icon {
    color: #F44336;
}

.drive-item.file-type-video .drive-item-icon {
    color: #2196F3;
}

.drive-item.file-type-audio .drive-item-icon {
    color: #4CAF50;
}

.drive-item.file-type-archive .drive-item-icon {
    color: #FF9800;
}

.drive-item.file-type-doc .drive-item-icon {
    color: #2B579A;
}

.drive-item.file-type-xls .drive-item-icon {
    color: #217346;
}

.drive-item.file-type-ppt .drive-item-icon {
    color: #D24726;
}

.drive-item.file-type-code .drive-item-icon {
    color: #607D8B;
}

.drive-item.file-type-default .drive-item-icon {
    color: #9E9E9E;
}

/* === 列表视图 === */
.drive-list {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--nordic-border, #DCE5EE);
}

.drive-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 150px;
    background: rgba(74, 141, 183, 0.04);
    border-bottom: 2px solid var(--nordic-primary, #4A8DB7);
    font-weight: 600;
    font-size: 13px;
    color: var(--nordic-text, #1A2B3C);
}

.drive-list-header > div {
    padding: 12px 16px;
}

.drive-list-row {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 150px;
    border-bottom: 1px solid var(--nordic-border, #DCE5EE);
    transition: background 0.2s ease;
    cursor: pointer;
}

.drive-list-row:hover {
    background: rgba(74, 141, 183, 0.04);
}

.drive-list-row:last-child {
    border-bottom: none;
}

.drive-list-row > div {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.drive-list-row .col-name {
    gap: 10px;
    font-weight: 500;
}

.drive-list-row.folder .col-name {
    font-weight: 600;
}

.drive-list-row .col-name svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.drive-list-row .col-size,
.drive-list-row .col-date {
    color: var(--nordic-text-light, #6B7D8E);
    font-size: 13px;
}

.drive-list-row .col-type {
    justify-content: center;
}

.type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.type-badge--folder {
    background: rgba(74, 141, 183, 0.1);
    color: var(--nordic-primary, #4A8DB7);
}

.type-badge--image {
    background: rgba(233, 30, 99, 0.1);
    color: #C2185B;
}

.type-badge--pdf {
    background: rgba(244, 67, 54, 0.1);
    color: #D32F2F;
}

.type-badge--video {
    background: rgba(33, 150, 243, 0.1);
    color: #1976D2;
}

.type-badge--audio {
    background: rgba(76, 175, 80, 0.1);
    color: #388E3C;
}

.type-badge--archive {
    background: rgba(255, 152, 0, 0.1);
    color: #F57C00;
}

.type-badge--default {
    background: rgba(158, 158, 158, 0.1);
    color: #616161;
}

/* === 预览遮罩 === */
.drive-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.drive-preview-content {
    background: #fff;
    border-radius: 12px;
    max-width: 80vw;
    max-height: 80vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.preview-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    min-height: 200px;
}

.preview-body img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

.preview-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 8px;
}

.preview-info {
    padding: 16px 20px;
    border-top: 1px solid var(--nordic-border, #DCE5EE);
    background: rgba(74, 141, 183, 0.02);
}

.preview-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--nordic-text, #1A2B3C);
}

.preview-info p {
    margin: 0;
    font-size: 13px;
    color: var(--nordic-text-light, #6B7D8E);
}

.preview-download {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: var(--nordic-primary, #4A8DB7);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.preview-download:hover {
    background: var(--nordic-primary-dark, #2E6E8F);
}

/* === 响应式适配 === */
@media (max-width: 768px) {
    .drive-page {
        padding: 20px 16px;
    }
    
    .drive-title {
        font-size: 1.5rem;
    }
    
    .drive-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .drive-search {
        max-width: none;
    }
    
    .drive-view-toggle {
        align-self: flex-end;
    }
    
    /* 移动端网格2列 */
    .drive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .drive-item {
        padding: 12px;
    }
    
    .drive-item-icon {
        width: 48px;
        height: 48px;
    }
    
    .drive-item-name {
        font-size: 13px;
    }
    
    /* 移动端列表隐藏类型和日期列 */
    .drive-list-header > div:nth-child(3),
    .drive-list-header > div:nth-child(4),
    .drive-list-row > div:nth-child(3),
    .drive-list-row > div:nth-child(4) {
        display: none;
    }
    
    .drive-list-header,
    .drive-list-row {
        grid-template-columns: 2fr 1fr;
    }
    
    .drive-preview-content {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .preview-body iframe {
        height: 60vh;
    }
}

@media (max-width: 480px) {
    .drive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .drive-item {
        padding: 10px;
    }
    
    .drive-item-icon {
        width: 40px;
        height: 40px;
    }
    
    .drive-item-name {
        font-size: 12px;
    }
}
