/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f1f1f1;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: #000;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* 导航链接 */
.nav-links {
    position: absolute;
    top: 20px;
    right: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.admin-link {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.admin-link:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e74c3c 100%);
}

/* 主要内容区域 */
main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 上传区域 */
.upload-section {
    padding: 40px;
    border-bottom: 1px solid #f0f0f0;
}

.upload-section h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 400;
}

.upload-area {
    max-width: 500px;
    margin: 0 auto;
}

.file-input-container {
    margin-bottom: 30px;
}

.file-input-container input[type="file"] {
    display: none;
}

.file-label {
    display: block;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.file-label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-label-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.file-label-content svg {
    color: #a0aec0;
    transition: color 0.3s ease;
}

.file-label:hover svg {
    color: #667eea;
}

.file-label-content span {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

.file-label-content small {
    color: #718096;
    font-size: 0.9rem;
}

.upload-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 状态消息 */
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* APK列表区域 */
.apk-list-section {
    padding: 40px;
}

.apk-list-section h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 400;
}

.refresh-btn-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.refresh-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.refresh-btn:hover {
    background: #5a6268;
}

.apk-list {
    display: grid;
    gap: 20px;
}

/* APK文件卡片 */
.apk-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.apk-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.apk-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.apk-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.apk-details {
    flex: 1;
}

.apk-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.apk-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.apk-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 400;
}

.empty-state p {
    font-size: 1rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    margin-bottom: 25px;
    color: #6c757d;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-section,
    .apk-list-section {
        padding: 20px;
    }

    .apk-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .apk-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 加载动画 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 分享链接容器 */
.share-link-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-link-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.close-share-link {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-share-link:hover {
    opacity: 1;
}

.share-link-content p {
    margin-bottom: 15px;
    font-weight: 500;
}

.share-link-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-link-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: monospace;
    font-size: 0.9rem;
}

.share-link-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.share-link-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.share-link-tip {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .share-link-container {
        margin: 20px;
        padding: 20px;
    }

    .share-link-input-group {
        flex-direction: column;
    }

    .share-link-input {
        font-size: 0.8rem;
    }
}