* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 { font-size: 2em; margin-bottom: 10px; }
.subtitle { opacity: 0.9; }

.main-content { padding: 30px; }

.upload-area {
    border: 2px dashed #FF9800;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff8f0;
}

.upload-area:hover, .upload-area.dragover {
    background: #fff3e0;
    border-color: #F57C00;
}

.upload-area input { display: none; }
.upload-placeholder span { display: block; margin-top: 15px; font-weight: 600; color: #FF9800; }
.upload-placeholder small { display: block; margin-top: 8px; color: #999; }

.settings { margin: 25px 0; }
.settings label { display: block; margin-bottom: 10px; font-weight: 600; }

.level-buttons { display: flex; gap: 10px; }
.level-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}
.level-btn:hover { border-color: #FF9800; }
.level-btn.active { background: #FF9800; color: white; border-color: #FF9800; }
.level-desc { margin-top: 10px; font-size: 0.9em; color: #666; text-align: center; }

.preview-section { margin: 25px 0; }
.preview-header h3 { margin-bottom: 15px; color: #333; }
.preview-compare { display: flex; gap: 20px; align-items: center; justify-content: center; }
.preview-item { flex: 1; text-align: center; max-width: 350px; }
.preview-label { display: block; margin-bottom: 10px; font-weight: 600; color: #666; }
.preview-item img { max-width: 100%; max-height: 250px; border-radius: 8px; border: 1px solid #e0e0e0; }
.preview-arrow { font-size: 2em; color: #FF9800; }
.result-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    color: #999;
}

.action-buttons { display: flex; gap: 15px; margin-top: 25px; }
.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary { background: linear-gradient(135deg, #FF9800, #F57C00); color: white; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,152,0,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

.tips { padding: 25px 30px; background: #fff8f0; border-top: 1px solid #ffe0b2; }
.tips h3 { color: #FF9800; margin-bottom: 15px; }
.tips ul { padding-left: 20px; }
.tips li { margin-bottom: 8px; line-height: 1.6; }

.friendlinks { padding: 30px; background: #fafafa; border-top: 1px solid #e8e8e8; }
.friendlinks h3 { text-align: center; color: #FF9800; margin-bottom: 20px; }
.links-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.link-item {
    display: flex; flex-direction: column; padding: 15px; background: white;
    border: 1px solid #e5e5e5; border-radius: 8px; text-decoration: none; color: #333; transition: all 0.3s;
}
.link-item:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(255,152,0,0.15); border-color: #FF9800; }
.link-name { font-weight: 600; color: #FF9800; margin-bottom: 5px; }
.link-desc { font-size: 0.85em; color: #999; }

.footer { padding: 20px; text-align: center; color: #999; font-size: 0.9em; background: #fafafa; border-top: 1px solid #e8e8e8; }

.loading {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 1000;
}
.loading p { color: white; margin-top: 15px; }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.3); border-top-color: #FF9800; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

@media (max-width: 600px) {
    .header { padding: 30px 20px; }
    .header h1 { font-size: 1.5em; }
    .main-content { padding: 20px; }
    .level-buttons { flex-direction: column; }
    .preview-compare { flex-direction: column; }
    .preview-arrow { transform: rotate(90deg); }
    .action-buttons { flex-direction: column; }
}
