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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.logo {
    font-size: 64px;
    margin-bottom: 10px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.subtitle {
    opacity: 0.9;
    font-size: 14px;
}

/* ===== 服务器信息 ===== */
.server-info {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.server-info code {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    flex: 1;
    word-break: break-all;
}

.btn-copy {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #5568d3;
}

/* ===== 上传区域 ===== */
.upload-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-area h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.upload-area p {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-select:hover {
    transform: scale(1.05);
}

/* ===== 上传进度 ===== */
.upload-progress {
    text-align: center;
    padding: 20px;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    color: #666;
    font-size: 14px;
}

/* ===== 结果区域 ===== */
.result-section {
    text-align: center;
}

.success-message {
    margin-bottom: 20px;
}

.checkmark {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    font-size: 30px;
    line-height: 50px;
    margin-bottom: 10px;
}

.app-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: left;
}

.app-preview .app-icon {
    font-size: 40px;
}

.app-info h4 {
    font-size: 16px;
    margin-bottom: 3px;
}

.app-info p {
    font-size: 12px;
    color: #666;
}

/* ===== 安装区域 ===== */
.install-section h3 {
    text-align: left;
    margin-bottom: 15px;
    font-size: 16px;
}

.install-method {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.install-method h4 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.install-method p {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.install-method ol {
    padding-left: 20px;
    font-size: 13px;
    color: #555;
}

.install-method ol li {
    margin-bottom: 5px;
}

.install-method ol a {
    color: #667eea;
    word-break: break-all;
}

.btn-install {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    transition: transform 0.2s;
}

.btn-install:hover {
    transform: scale(1.02);
}

.qrcode {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.qrcode img, .qrcode canvas {
    border: 5px solid white;
    border-radius: 8px;
}

.btn-new {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.btn-new:hover {
    background: #e0e0e0;
}

/* ===== 历史列表 ===== */
.history-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.history-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.app-list {
    max-height: 300px;
    overflow-y: auto;
}

.app-list .loading,
.app-list .empty,
.app-list .error {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 14px;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.app-item .app-icon {
    font-size: 28px;
}

.app-item .app-details {
    flex: 1;
    min-width: 0;
}

.app-item .app-details h4 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item .app-details p {
    font-size: 12px;
    color: #888;
}

.btn-install-small {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 12px;
    white-space: nowrap;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    padding: 20px;
    font-size: 12px;
}

footer p {
    margin-bottom: 5px;
}

/* ===== 安装页面样式 ===== */
.install-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.install-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.app-icon-large {
    font-size: 80px;
    margin-bottom: 15px;
}

.install-card h1 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.app-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.app-meta span {
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.bundle-id {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
    word-break: break-all;
}

.trust-notice {
    background: #fff8e6;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
}

.trust-notice h3 {
    font-size: 14px;
    color: #b8860b;
    margin-bottom: 10px;
}

.trust-notice ol {
    padding-left: 20px;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.btn-install-main {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 18px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.btn-install-main:hover {
    transform: scale(1.02);
}

.tip {
    font-size: 12px;
    color: #888;
    margin-bottom: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 30px 15px;
    }
    
    .logo {
        font-size: 48px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    .upload-section,
    .history-section {
        padding: 20px;
    }
    
    .install-card {
        padding: 30px 20px;
    }
    
    .app-icon-large {
        font-size: 60px;
    }
    
    .btn-install-main {
        font-size: 18px;
        padding: 15px;
    }
}