/* 全局样式 */
* {
    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);
}

/* 输入行（邮箱+验证码按钮） */
.input-row {
    display: flex;
    gap: 8px;
}
.input-row input {
    flex: 1;
}
.input-row button {
    white-space: nowrap;
    padding: 0 14px;
    border: 1px solid #4f46e5;
    border-radius: 8px;
    background: #fff;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}
.input-row button:hover:not(:disabled) {
    background: #4f46e5;
    color: #fff;
}
.input-row button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 按钮 */
.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;
}

.btn-delete {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-delete:hover {
    background: #fee2e2;
}

.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;
}

/* 充值联系方式 */
.recharge-contact {
    text-align: center;
    padding: 8px 0;
}

.contact-text {
    font-size: 15px;
    color: #555;
    font-weight: 500;
    margin-bottom: 12px;
}

.qr-code-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-code {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.contact-tip {
    font-size: 13px;
    color: #888;
}

/* 提示词弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    color: #1a1a2e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.prompt-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.prompt-card h4 {
    margin-bottom: 12px;
    color: #4f46e5;
    font-size: 15px;
}

.prompt-item {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.7;
}

.prompt-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.prompt-value {
    color: #333;
}

.prompt-full {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.loading-prompts {
    text-align: center;
    color: #888;
    padding: 24px;
}

/* 加载中的场景信息 */
.loading-scene-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
}
.loading-scene-name {
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 4px;
    font-size: 14px;
}
.loading-scene-desc {
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}
.loading-scene-info details summary {
    cursor: pointer;
    color: #4f46e5;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
    user-select: none;
}
.loading-scene-info details summary:hover {
    text-decoration: underline;
}
.loading-prompt {
    color: #666;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    margin-top: 4px;
}
/* 建议与反馈 */
.suggestion-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}
.suggestion-section h3 {
    margin-bottom: 12px;
    color: #1a1a2e;
    font-size: 16px;
}
.suggestion-section textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    background: #f9fafb;
}
.suggestion-section textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    background: #fff;
}
.suggestion-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.suggestion-actions .btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}
.suggestion-actions label.btn-small {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}
.suggestion-actions label.btn-small:hover {
    background: #e5e7eb;
}
.suggestion-actions .btn-primary {
    width: auto;
    padding: 8px 24px;
}
#suggestion-file-name {
    font-size: 12px;
    color: #9ca3af;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.suggestion-msg {
    margin-top: 8px;
    font-size: 13px;
    display: none;
    padding: 8px 12px;
    border-radius: 6px;
}
.suggestion-msg.success {
    display: block;
    color: #065f46;
    background: #ecfdf5;
}
.suggestion-msg.error {
    display: block;
    color: #991b1b;
    background: #fef2f2;
}

/* 预览行 */
.preview-row td {
    padding: 16px 24px;
    background: #fafafa;
    border-bottom: 2px solid #e5e7eb;
}

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

.preview-thumb {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    background: #fff;
}

.preview-thumb:hover {
    border-color: #4f46e5;
    transform: scale(1.05);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-preview {
    color: #888;
    font-size: 13px;
    padding: 8px 0;
}

/* 灯箱 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 48px;
    text-align: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.35);
}

/* ── 管理后台 ── */
.admin-container {
    max-width: 1100px;
}

/* 统计卡片 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #888;
}

/* 工具栏 */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-wrap: wrap;
    gap: 12px;
}

.admin-toolbar h3 {
    color: #1a1a2e;
    font-size: 16px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-search-input {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    width: 220px;
}

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

/* 用户表格 */
.users-table {
    background: #fff;
    border-radius: 0 0 12px 12px;
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

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

.points-cell {
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border-radius: 6px;
    padding: 4px 12px;
    display: inline-block;
}

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

.error-cell {
    text-align: center;
    color: #dc2626;
    padding: 24px;
}

.user-actions .btn-add-points {
    background: #fff;
    color: #059669;
    border: 1px solid #6ee7b7;
}

.user-actions .btn-add-points:hover {
    background: #ecfdf5;
}

.btn-logout {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-logout:hover {
    background: #fee2e2;
}

.btn-batch {
    background: #fff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.btn-batch:hover {
    background: #ede9fe;
}

/* 分页 */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.page-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #f0f0ff;
    border-color: #4f46e5;
}

.page-info {
    font-size: 13px;
    color: #888;
}

/* 管理后台导航栏标识 */
.navbar-admin {
    border-bottom: 2px solid #4f46e5;
}

/* 弹窗小尺寸 */
.modal-small {
    max-width: 420px;
}
