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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

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

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.upload-area {
    border: 3px dashed #ccc;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8ecff;
}

.upload-icon {
    margin-bottom: 20px;
    color: #667eea;
}

.upload-icon svg {
    width: 64px;
    height: 64px;
}

.upload-area p {
    color: #666;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9em;
    color: #999;
}

/* 上传信息 */
.upload-info {
    margin: 20px 0;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.file-name {
    font-weight: bold;
    color: #333;
}

.file-size {
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* 按钮样式 */
.upload-controls,
.action-buttons,
.download-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
}

/* APK信息区域 */
.result-section {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 30px;
}

.apk-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1em;
    color: #333;
    font-weight: 500;
}

.download-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.download-section h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 状态显示 */
.status-section {
    text-align: center;
    padding: 40px 20px;
}

.status-message {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* 列表区域 */
.list-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.list-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.list-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.list-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.apk-list {
    margin-bottom: 20px;
}

.apk-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apk-item-info {
    flex: 1;
}

.apk-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.apk-item-details {
    font-size: 0.9em;
    color: #666;
}

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

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-uploaded {
    background: #e3f2fd;
    color: #1976d2;
}

.status-parsed {
    background: #fff3e0;
    color: #f57c00;
}

.status-reinforced {
    background: #e8f5e9;
    color: #388e3c;
}

.status-failed {
    background: #ffebee;
    color: #d32f2f;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
}

.pagination button:hover {
    background: #f0f0f0;
}

.pagination button.active {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* 响应式 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .main-content,
    .list-section {
        padding: 20px;
    }

    .apk-info {
        grid-template-columns: 1fr;
    }

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

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

    .upload-controls,
    .action-buttons,
    .download-buttons {
        flex-direction: column;
    }
}
