:root {
    /* 颜色变量 */
    --bg-main: #0f172a;          /* 主背景色 */
    --bg-card: #1e293b;          /* 卡片背景色 */
    --accent: #06b6d4;           /* 强调色(青色) */
    --text-primary: #f8fafc;     /* 主要文本色 */
    --text-secondary: #94a3b8;   /* 次要文本色 */
    --folder-accent: #fbbf24;    /* 文件夹强调色(黄色) */
    
    /* 布局变量 */
    --border-radius: 10px;       /* 圆角大小 */
    
    /* 阴影变量 */
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.3);          /* 基础阴影 */
    --shadow-hover: 0 0 20px rgba(6, 182, 212, 0.4);  /* 悬停阴影 */
}

/* 2. 全局样式重置与基础设置 */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    transition: all 0.2s ease; 
}

body { 
    font-family: "Inter", "Microsoft YaHei", sans-serif; 
    background: var(--bg-main); 
    min-height: 100vh; 
    padding: 15px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* 3. 主面板容器样式 */
.server-dashboard { 
    width: 100%; 
    max-width: 1200px; 
    background: var(--bg-card); 
    border-radius: var(--border-radius); 
    padding: 25px 20px; 
    box-shadow: var(--shadow); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
}

/* 4. 头部信息样式 */
.owner-header { 
    text-align: center; 
    margin: 0 auto 35px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
    max-width: 500px; 
}

.owner-icon { 
    font-size: 40px; 
    color: var(--accent); 
    margin-bottom: 10px; 
}

.owner-title { 
    font-size: 24px; 
    color: var(--text-primary); 
    font-weight: 600; 
    margin-bottom: 5px; 
}

.owner-subtitle { 
    font-size: 13px; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
}

/* 5. 面包屑导航样式 */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.breadcrumb-item { 
    color: var(--text-secondary); 
    cursor: pointer; 
}

.breadcrumb-item:hover { 
    color: var(--accent); 
}

.breadcrumb-separator { 
    color: var(--text-secondary); 
}

.breadcrumb-current { 
    color: var(--accent); 
    font-weight: 500; 
}

.breadcrumb-root { 
    color: var(--accent); 
    font-weight: 600; 
}

/* 6. 导航控制按钮样式 */
.nav-controls { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover:not(:disabled) { 
    background: var(--accent); 
    color: var(--bg-main); 
}

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

.nav-btn svg { 
    width: 16px; 
    height: 16px; 
    flex-shrink: 0;
}

/* 7. 文件/文件夹网格布局 */
.download-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 18px; 
    max-width: 1000px; 
    margin: 0 auto; 
}

/* 8. 文件卡片基础样式 */
.download-card { 
    background: rgba(255, 255, 255, 0.03); 
    border-radius: var(--border-radius); 
    padding: 22px 15px; 
    text-align: center; 
    border: 1px solid rgba(255, 255, 255, 0.07); 
    cursor: pointer; 
}

.download-card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-hover); 
    border-color: var(--accent); 
}

/* 9. 文件夹卡片特殊样式 */
.download-card.folder { 
    border-color: rgba(251, 191, 36, 0.3); 
}

.download-card.folder:hover { 
    border-color: var(--folder-accent); 
}

.download-card.folder .file-size { 
    background: rgba(251, 191, 36, 0.15); 
    color: var(--folder-accent); 
}

/* 10. 文件/文件夹图标样式 */
.download-icon { 
    width: 45px; 
    height: 45px; 
    margin: 0 auto 12px; 
    background-color: var(--accent); 
    mask-size: contain; 
    -webkit-mask-size: contain; 
    mask-repeat: no-repeat; 
    -webkit-mask-repeat: no-repeat; 
    mask-position: center; 
    -webkit-mask-position: center; 
}

/* 文件图标 */
.icon-91 { 
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M10.5 15.5 9 17l3 3 3-3-1.5-1.5'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); 
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M10.5 15.5 9 17l3 3 3-3-1.5-1.5'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); 
}

/* 文件夹图标 */
.icon-folder {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    background-color: var(--folder-accent);
}

/* 11. 文件信息文本样式 */
.file-name { 
    font-size: 16px; 
    color: var(--text-primary); 
    font-weight: 500; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    margin-bottom: 8px; 
}

.file-size { 
    font-size: 12px; 
    color: var(--accent); 
    background: rgba(6, 182, 212, 0.1); 
    padding: 3px 8px; 
    border-radius: 12px; 
    display: inline-block; 
}

/* 12. 辅助链接样式 */
.back-link { 
    text-align: center; 
    margin: 15px auto 0; 
    font-size: 14px; 
}

.back-link a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    margin: 0 10px; 
}

.back-link a:hover { 
    color: var(--accent); 
    text-decoration: underline; 
}

.backup-btn { 
    display: inline-block; 
    padding: 6px 14px; 
    background: rgba(6, 182, 212, 0.15); 
    color: var(--accent); 
    border: 1px solid var(--accent); 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 13px; 
    cursor: pointer; 
    margin: 0 10px; 
    transition: all 0.2s ease; 
}

.backup-btn:hover { 
    background: var(--accent); 
    color: var(--bg-main); 
}

/* 13. 版权信息样式 */
.copyright { 
    text-align: center; 
    margin: 35px auto 0; 
    font-size: 12px; 
    color: var(--text-secondary); 
    opacity: 0.7; 
    max-width: 500px; 
}

/* 14. 状态提示样式 (加载/错误/空数据) */
.loading { 
    text-align: center; 
    padding: 40px; 
    color: var(--text-secondary); 
}

.loading-spinner { 
    width: 40px; 
    height: 40px; 
    border: 3px solid rgba(6, 182, 212, 0.2); 
    border-top-color: var(--accent); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin: 0 auto 15px; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.error-message { 
    text-align: center; 
    padding: 40px; 
    color: #ef4444; 
}

.error-message .retry-btn { 
    margin-top: 15px; 
    padding: 8px 20px; 
    background: var(--accent); 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 14px; 
}

.error-message .retry-btn:hover { 
    opacity: 0.8; 
}

.empty-message { 
    text-align: center; 
    padding: 40px; 
    color: var(--text-secondary); 
}

.source-badge { 
    display: inline-block; 
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 4px; 
    margin-left: 5px; 
    background: rgba(6, 182, 212, 0.2); 
    color: var(--accent); 
}

/* 15. 模态对话框样式 - 修复按钮大小自适应问题 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: clamp(15px, 4vw, 30px);
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: clamp(16px, 4vw, 18px);
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.modal-file-name {
    font-size: clamp(12px, 3vw, 14px);
    color: var(--text-secondary);
    margin-bottom: 8px;
    word-break: break-all;
    text-align: center;
    line-height: 1.4;
}

.modal-file-size {
    font-size: clamp(11px, 2.5vw, 12px);
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
    justify-content: center;
    width: 100%;
}

.modal-btn {
    flex: 1;
    min-width: 0;
    max-width: 180px;
    padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 20px);
    border-radius: 8px;
    font-size: clamp(13px, 3vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1vw, 8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-btn svg {
    width: clamp(16px, 4vw, 18px);
    height: clamp(16px, 4vw, 18px);
    flex-shrink: 0;
}

.modal-btn span,
.modal-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-btn-preview {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.modal-btn-preview:hover {
    background: var(--accent);
    color: var(--bg-main);
}

.modal-btn-download {
    background: var(--accent);
    color: var(--bg-main);
    border: 1px solid var(--accent);
}

.modal-btn-download:hover {
    background: #0891b2;
    border-color: #0891b2;
}

.modal-hint {
    font-size: clamp(10px, 2.5vw, 11px);
    color: var(--text-secondary);
    text-align: center;
    margin-top: 15px;
    opacity: 0.7;
    line-height: 1.4;
}

/* 16. 响应式适配 */
@media (min-width: 768px) { 
    .download-grid { 
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
        gap: 22px; 
    } 
    .server-dashboard { 
        padding: 30px 25px; 
    } 
}

@media (min-width: 1024px) { 
    .download-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 25px; 
    } 
    .download-card { 
        padding: 25px 15px; 
    } 
    .owner-icon { 
        font-size: 42px; 
    } 
    .owner-title { 
        font-size: 26px; 
    } 
}

/* 17. 极小屏幕适配 */
@media (max-width: 360px) {
    .modal-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-btn {
        max-width: 100%;
        justify-content: center;
    }
}

/* 18. 中等屏幕优化 */
@media (min-width: 361px) and (max-width: 768px) {
    .modal-btn {
        max-width: 160px;
    }
}

/* 19. 大屏幕模态框优化 */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 480px;
    }
    
    .modal-btn {
        max-width: 200px;
        padding: 14px 24px;
    }
}

/* 20. 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-overlay {
        align-items: center;
        padding: 10px;
    }
    
    .modal-content {
        padding: 15px 20px;
        max-width: 380px;
    }
    
    .modal-title {
        margin-bottom: 10px;
    }
    
    .modal-file-size {
        margin-bottom: 15px;
    }
}
