* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

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

/* Header */
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px 20px; text-align: center; margin-bottom: 30px; border-radius: 12px; }
.header h1 { font-size: 24px; font-weight: 600; }
.header p { opacity: 0.85; margin-top: 8px; font-size: 14px; }

/* Card */
.card { background: white; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card h2 { font-size: 18px; margin-bottom: 16px; color: #1a1a1a; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: #667eea; }

/* Button */
.btn { display: inline-block; padding: 12px 32px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-danger { background: #ff4d4f; color: white; }
.btn-sm { padding: 6px 16px; font-size: 12px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-item { background: white; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-value { font-size: 28px; font-weight: 700; color: #667eea; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* Result */
.result-box { background: #f8f9ff; border: 1px solid #e8e8ff; border-radius: 8px; padding: 16px; margin-top: 16px; display: none; }
.result-box.show { display: block; }
.result-box h3 { font-size: 16px; margin-bottom: 12px; color: #333; }
.result-box .video-title { font-size: 15px; font-weight: 500; margin-bottom: 12px; word-break: break-all; }
.result-box .download-link { word-break: break-all; }
.result-box .download-link a { color: #667eea; text-decoration: none; font-size: 13px; }
.result-box .download-link a:hover { text-decoration: underline; }

/* History */
.history-item { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.history-item:last-child { border-bottom: none; }
.history-meta { display: flex; justify-content: space-between; font-size: 12px; color: #999; margin-top: 8px; }
.history-url { font-size: 13px; color: #555; word-break: break-all; max-height: 40px; overflow: hidden; }
.history-platform { display: inline-block; padding: 2px 8px; background: #f0f0ff; color: #667eea; border-radius: 4px; font-size: 11px; margin-right: 8px; }
.history-status { font-size: 12px; }
.history-status.success { color: #52c41a; }
.history-status.failed { color: #ff4d4f; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination button { padding: 6px 12px; border: 1px solid #ddd; background: white; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pagination button.active { background: #667eea; color: white; border-color: #667eea; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 8px; color: white; font-size: 14px; z-index: 9999; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }
.toast.error { background: #ff4d4f; }
.toast.success { background: #52c41a; }

/* Login */
.login-container { max-width: 400px; margin: 80px auto; }
.login-card { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.login-card h2 { text-align: center; margin-bottom: 24px; font-size: 22px; }

/* Nav */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; margin-bottom: 20px; }
.nav-left { display: flex; gap: 16px; align-items: center; }
.nav-left a { text-decoration: none; color: #667eea; font-weight: 500; font-size: 14px; }
.nav-left a.active { color: #333; }
.nav-right { font-size: 13px; color: #888; }

/* Loading */
.loading { text-align: center; padding: 20px; color: #888; }
.loading::after { content: ''; display: inline-block; width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 12px; }
    .header { padding: 20px; }
}
