* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8C94 50%, #FFC371 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 70px;
}

/* 导航栏 */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    padding: 15px 30px;
    display: flex;
    gap: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: #FF6B9D;
}

.container { max-width: 900px; margin: 0 auto; }

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.hint {
    font-size: 12px;
    color: #888;
    font-weight: normal;
    margin-left: 8px;
}

input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #FF6B9D;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8C94 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,107,157,0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 进度状态 */
.status {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status.show { display: block; }

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #666;
}

.status-item.active { color: #FF6B9D; font-weight: 600; }
.status-item.done { color: #28a745; }

.status-item::before {
    content: '○';
    margin-right: 10px;
    font-size: 12px;
}

.status-item.active::before { content: '◉'; }
.status-item.done::before { content: '✓'; }

/* 结果展示 */
.result {
    display: none;
    margin-top: 30px;
}

.result.show { display: block; }

.result-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-section h3 {
    color: #FF6B9D;
    margin-bottom: 12px;
    font-size: 16px;
}

.result-section pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    line-height: 1.8;
    color: #333;
}

.cover-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.copy-btn {
    background: #FF6B9D;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
}

.copy-btn:hover { background: #ff5588; }

.error {
    color: #e74c3c;
    background: #fdf0f0;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

/* 流式输出 */
.stream-output {
    background: #1a1a2e;
    color: #eee;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 20px;
}

.stream-output.show { display: block; }

/* 进度消息动画 */
.progress-message {
    font-size: 16px;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-message::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* 流式文本实时显示 */
.stream-text {
    background: #fff9e6;
    border: 2px solid #ffc107;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    display: none;
}

.stream-text strong {
    color: #FF6B9D;
    display: block;
    margin-bottom: 10px;
}

.stream-text pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    line-height: 1.8;
    color: #333;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}


/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.image-item {
    text-align: center;
}

.image-item img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
}

.image-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.image-actions .copy-btn {
    font-size: 12px;
    padding: 5px 10px;
}


/* 操作按钮区域 */
.action-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.save-btn {
    width: auto;
    padding: 12px 24px;
}

.share-link {
    font-size: 14px;
    color: #666;
}

.share-link a {
    color: #FF6B9D;
    text-decoration: none;
}

.share-link a:hover {
    text-decoration: underline;
}

/* 分享页面元信息 */
.meta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #999;
}


/* 任务队列页面 */
.task-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.task-form h3 {
    margin-bottom: 15px;
    color: #333;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.form-row .btn {
    width: auto;
    padding: 12px 24px;
    white-space: nowrap;
}

.stats {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    font-size: 14px;
    color: #666;
}

.stat.pending { color: #f39c12; }
.stat.running { color: #3498db; }
.stat.completed { color: #27ae60; }
.stat.failed { color: #e74c3c; }

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover { background: #ddd; }
.btn-small.danger { background: #fee; color: #c00; }
.btn-small.danger:hover { background: #fdd; }

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ccc;
}

.task-item.pending { border-left-color: #f39c12; }
.task-item.running { border-left-color: #3498db; background: #e8f4fc; }
.task-item.completed { border-left-color: #27ae60; }
.task-item.failed { border-left-color: #e74c3c; background: #fef0f0; }

.task-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.task-id {
    font-family: monospace;
    color: #999;
}

.task-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #eee;
}

.status-running { background: #e8f4fc; color: #3498db; }
.status-completed { background: #e8f8f0; color: #27ae60; }
.status-failed { background: #fef0f0; color: #e74c3c; }

.task-zhuti {
    color: #333;
}

.task-meta {
    font-size: 12px;
    color: #999;
}

.error-msg {
    color: #e74c3c;
    margin-left: 10px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.empty, .loading {
    text-align: center;
    padding: 40px;
    color: #999;
}


/* Dashboard 布局 */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.card h2 .count {
    background: #FF6B9D;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    margin-left: auto;
}

.header-btns {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.btn-text {
    background: #f5f5f5;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.btn-text:hover {
    background: #eee;
    color: #333;
}

.stats-inline {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.stat-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: normal;
}

.stat-badge.pending { background: #fff3cd; color: #856404; }
.stat-badge.running { background: #cce5ff; color: #004085; }
.stat-badge.failed { background: #f8d7da; color: #721c24; }

/* 紧凑任务列表 */
.task-list.compact {
    max-height: 300px;
    overflow-y: auto;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.task-row.running { background: #e8f4fc; }
.task-row.failed { background: #fef0f0; }

.task-status-icon { font-size: 14px; }
.task-title { flex: 1; color: #333; }
.task-time { color: #999; font-size: 12px; }

.btn-tiny {
    padding: 3px 8px;
    font-size: 11px;
    background: #eee;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-tiny { background: #fee; color: #c00; }
.btn-tiny.danger { background: #fee; color: #c00; }
.btn-tiny.primary { background: #e8f4fc; color: #0066cc; }

/* 文案列表 */
.post-list {
    max-height: 500px;
    overflow-y: auto;
}

.post-row {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.post-row:hover { background: #f0f0f0; }

.post-preview {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 6px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.post-meta .share-link {
    color: #FF6B9D;
    text-decoration: none;
}

.empty-small {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
    color: #999;
}

.modal-content-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    line-height: 1.8;
    color: #333;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.modal-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.modal-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: fadeInUp 0.3s;
}

.toast.error { background: #e74c3c; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.filter-bar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.page-info {
    font-size: 12px;
    color: #999;
    margin-right: 10px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #FF6B9D;
    color: #FF6B9D;
}

.page-btn.active {
    background: #FF6B9D;
    border-color: #FF6B9D;
    color: white;
}

.page-dots {
    color: #999;
    padding: 0 5px;
}


/* 已分享标记 */
.post-row.shared {
    background: #f0fff4;
}

.shared-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 5px;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}


/* 登录弹窗 */
.login-modal {
    max-width: 400px;
    text-align: center;
    padding: 40px 30px;
}

.login-modal h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
}

.login-modal .form-group {
    margin-bottom: 20px;
}

.login-modal input {
    text-align: center;
    font-size: 16px;
    padding: 15px 20px;
}

.login-modal .btn {
    padding: 15px 40px;
    font-size: 16px;
}

.login-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 15px;
    min-height: 20px;
}

.logout-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: white;
    color: #e74c3c;
}

.header-actions {
    text-align: right;
    margin-bottom: 10px;
}

h1 {
    display: block;
    margin-bottom: 20px;
}

/* 多选模式 */
.batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 12px;
    color: #666;
}

.post-row.selected {
    background: #fff0f5;
    border: 1px solid #FF6B9D;
}

.post-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #FF6B9D;
    flex-shrink: 0;
}

.post-row {
    display: flex;
    align-items: flex-start;
}

.post-row .post-preview {
    flex: 1;
}

/* 分享页面样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    margin: 0;
}

.image-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}
