/* 文件共享平台 - 样式表 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

a { color: #4a90d9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶部导航 */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.navbar .logo {
    font-size: 20px;
    font-weight: 700;
    color: #4a90d9;
}
.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.navbar .user-info span { color: #666; }
.navbar .user-info a {
    color: #e74c3c;
    font-size: 14px;
}

/* 容器 */
.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 30px;
    margin-bottom: 20px;
}

/* 登录/注册表单 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    padding: 40px;
    width: 400px;
    max-width: 440px;
    animation: slideUp 0.5s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
    color: #333;
    font-size: 24px;
}
.auth-card .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 28px;
    font-size: 14px;
}
.auth-card .form-group {
    margin-bottom: 18px;
}
.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-card input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.auth-card .btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
}
.auth-card .btn-primary:hover { opacity: 0.9; }
.auth-card .btn-primary:active { transform: scale(0.97); opacity: 0.85; }
.auth-card .auth-link {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 14px;
}

/* ========== 手机端优化 ========== */
@media (max-width: 520px) {
    .auth-page {
        padding: 0;
    }
    .auth-card {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        padding: 32px 22px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .auth-card h2 {
        font-size: 22px;
        margin-bottom: 4px;
    }
    .auth-card .subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }
    .auth-card .form-group {
        margin-bottom: 16px;
    }
    .auth-card label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    .auth-card input[type="text"],
    .auth-card input[type="password"],
    .auth-card input[type="email"] {
        padding: 14px 14px;
        font-size: 16px;
        border-radius: 10px;
    }
    .auth-card .btn-primary {
        padding: 15px;
        font-size: 17px;
        border-radius: 10px;
        letter-spacing: 2px;
    }
    .auth-card .auth-link {
        margin-top: 22px;
        font-size: 14px;
    }
}

/* 小尺寸手机优化 */
@media (max-width: 360px) {
    .auth-card {
        padding: 24px 18px;
    }
    .auth-card h2 {
        font-size: 20px;
    }
    .auth-card .subtitle {
        margin-bottom: 20px;
    }
    .auth-card input[type="text"],
    .auth-card input[type="password"],
    .auth-card input[type="email"] {
        padding: 12px 12px;
        font-size: 15px;
    }
    .auth-card .btn-primary {
        padding: 13px;
        font-size: 16px;
    }
}

/* 消息提示 */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* 上传区域 */
.upload-area {
    border: 2px dashed #c0c8d8;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbff;
    margin-bottom: 24px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}
.upload-area .icon { font-size: 42px; margin-bottom: 10px; }
.upload-area p { color: #888; font-size: 15px; }
.upload-area .hint { font-size: 12px; color: #bbb; margin-top: 6px; }

/* 上传表单 */
.upload-form {
    display: none;
    margin-top: 16px;
}
.upload-form.show { display: block; }
.upload-form .form-group { margin-bottom: 14px; }
.upload-form label { display: block; font-weight: 600; margin-bottom: 6px; color: #555; font-size: 14px; }
.upload-form input[type="text"],
.upload-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.upload-form textarea { resize: vertical; min-height: 60px; }
.upload-form input:focus, .upload-form textarea:focus {
    outline: none;
    border-color: #667eea;
}
.upload-form .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-form .checkbox-group input { width: 18px; height: 18px; }
.upload-form .btn-primary {
    padding: 10px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
}
.upload-form .btn-primary:hover { opacity: 0.9; }

/* 文件列表 */
.file-list { margin-top: 10px; }
.file-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #e8ecf2;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
    background: #fff;
}
.file-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.file-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 14px;
    flex-shrink: 0;
}
.file-icon.img { background: #fff3e0; }
.file-icon.doc { background: #e3f2fd; }
.file-icon.zip { background: #fce4ec; }
.file-icon.video { background: #e8f5e9; }
.file-icon.audio { background: #f3e5f5; }
.file-icon.other { background: #f5f5f5; }
.file-info { flex: 1; min-width: 0; }
.file-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-meta {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}
.file-meta span { margin-right: 12px; }
.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.file-actions .btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}
.file-actions .btn-download {
    background: #4a90d9;
    color: #fff;
}
.file-actions .btn-share {
    background: #27ae60;
    color: #fff;
}
.file-actions .btn-delete {
    background: #e74c3c;
    color: #fff;
}
.file-actions .btn:hover { opacity: 0.85; }

/* 公开分享标记 */
.public-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* 分享弹窗 */
.share-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.share-modal.show { display: flex; }
.share-content {
    background: #fff;
    border-radius: 14px;
    padding: 30px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.share-content h3 { margin-bottom: 16px; font-size: 18px; }
.share-link-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.share-link-box input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}
.share-link-box .btn-copy {
    padding: 10px 18px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.share-content .btn-close {
    margin-top: 16px;
    padding: 8px 20px;
    background: #eee;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-box input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}
.search-box input:focus { outline: none; border-color: #667eea; }
.search-box button {
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #bbb;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

/* 统计栏 */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.stat-item {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 16px 24px;
    text-align: center;
    flex: 1;
}
.stat-item .num {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}
.stat-item .label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ========== 手机端适配 ========== */
@media (max-width: 520px) {
    /* 导航栏 */
    .navbar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .navbar .logo { font-size: 16px; }
    .user-info { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .user-info span { font-size: 13px; }
    .user-info a { font-size: 13px; }
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 13px; }
    .nav-links a:last-child { display: none; }

    /* 容器 */
    .container { padding: 16px; }

    /* 统计栏 */
    .stats-bar { gap: 10px; margin-bottom: 16px; }
    .stat-item { padding: 12px 10px; border-radius: 8px; }
    .stat-item .num { font-size: 22px; }
    .stat-item .label { font-size: 11px; }

    /* 文件卡片 — 改为竖向网格布局 */
    .file-item {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px 12px;
        align-items: start;
        padding: 14px;
    }
    .file-icon {
        grid-row: 1;
        grid-column: 1;
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 0;
    }
    .file-info {
        grid-row: 1;
        grid-column: 2;
        flex: none;
        min-width: auto;
    }
    .file-name { font-size: 15px; }
    .file-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        margin-top: 6px;
    }
    .file-meta span { margin-right: 0; }
    .file-actions {
        grid-row: 2;
        grid-column: 1 / 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        flex-shrink: 0;
    }
    .file-actions .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
        min-width: 60px;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 8px;
    }

    /* 搜索框 */
    .search-box { margin-bottom: 16px; }
    .search-box input { padding: 12px 14px; font-size: 16px; }
    .search-box button { padding: 12px 18px; font-size: 14px; }

    /* 上传区域 */
    .upload-area { padding: 30px 16px; border-radius: 8px; }
    .upload-area .icon { font-size: 36px; }
    .upload-area p { font-size: 14px; }

    /* 弹窗 */
    .modal-content {
        margin: 20px auto;
        padding: 20px;
        max-width: calc(100vw - 24px);
        border-radius: 12px;
    }
    .share-content h3 { font-size: 16px; margin-bottom: 12px; }
    .share-link-box { flex-wrap: wrap; }
    .share-link-box input { font-size: 14px; }
    .share-link-box .btn-copy { flex: 1; padding: 10px; font-size: 14px; }
    .share-content .btn-close { padding: 10px 20px; }

    /* 分区标题 */
    .section-title { font-size: 15px; margin-bottom: 12px; }

    /* 空状态 */
    .empty-state { padding: 40px 20px; }
    .empty-state .icon { font-size: 40px; }
    .empty-state p { font-size: 14px; }
}

/* 极小屏（360px以下） */
@media (max-width: 360px) {
    .file-item { padding: 12px; gap: 8px 10px; }
    .file-icon { width: 36px; height: 36px; font-size: 16px; }
    .file-name { font-size: 14px; }
    .file-actions .btn {
        min-width: 52px;
        padding: 8px 8px;
        font-size: 13px;
    }
    .stat-item .num { font-size: 20px; }
    .stat-item .label { font-size: 10px; }
    .search-box input { padding: 10px 12px; font-size: 15px; }
    .search-box button { padding: 10px 14px; font-size: 13px; }
}
