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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.nav-links a:hover {
    color: #4f46e5;
}

.nav-points {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.nav-logout {
    color: #dc2626 !important;
}

/* 主内容 */
.main-content {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

/* 认证页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 56px);
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    margin-bottom: 24px;
    text-align: center;
    color: #1a1a2e;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #4f46e5;
    color: #fff;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
}

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

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    background: #4f46e5;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}

.btn-large {
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 12px;
}

/* 提示 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-link a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

/* 仪表盘 */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-header h2 {
    color: #1a1a2e;
}

.points-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* 上传区域 */
.upload-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.upload-section h3 {
    margin-bottom: 16px;
    color: #1a1a2e;
}

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

.upload-area:hover,
.upload-area.dragover {
    border-color: #4f46e5;
    background: #f0f0ff;
}

.upload-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: underline;
}

.upload-hint {
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

/* 预览区 */
.preview-container {
    margin-top: 16px;
}

.preview-container h4 {
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

#preview-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#preview-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

/* 选项 */
.gen-options {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.option-group {
    flex: 1;
    min-width: 150px;
}

/* 任务列表 */
.tasks-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tasks-section h3 {
    margin-bottom: 16px;
    color: #1a1a2e;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.tasks-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #555;
}

/* 状态 */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-running {
    background: #fef3c7;
    color: #92400e;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #e5e7eb;
    color: #374151;
}

.task-actions {
    white-space: nowrap;
}

.error-text {
    color: #dc2626;
    font-size: 13px;
}

.pending-text {
    color: #f59e0b;
    font-size: 13px;
}

.empty-tasks {
    text-align: center;
    color: #888;
    padding: 24px;
}

/* 加载弹窗 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-modal {
    background: #fff;
    padding: 48px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-modal h3 {
    margin-bottom: 8px;
    color: #1a1a2e;
}

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

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4f46e5;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* 充值页 */
.recharge-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.recharge-card {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 480px;
    width: 100%;
}

.recharge-card h2 {
    margin-bottom: 16px;
    color: #1a1a2e;
}

.points-info {
    background: #f0f0ff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #4338ca;
}

.amount-presets {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.amount-presets button {
    flex: 1;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.amount-presets button:hover {
    background: #e5e7eb;
    border-color: #4f46e5;
}
