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

:root {
    --bg-page: #f5f7fb;
    --bg-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #5b6475;
    --border-soft: #e7ebf3;
    --brand: #5b74f6;
    --brand-strong: #4f63d8;
    --radius-card: 12px;
    --shadow-card: 0 6px 18px rgba(33, 44, 80, 0.08);
    --shadow-card-hover: 0 10px 24px rgba(33, 44, 80, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html,
body,
#app {
    overscroll-behavior-y: none;
}

#app {
    min-height: 100vh;
}

.page-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: opacity 0.25s ease;
}

.page-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loading-text {
    color: #4f5b7d;
    font-size: 14px;
    font-weight: 600;
}

/* 头部导航 */
.header {
    background: linear-gradient(90deg, #5f79f7 0%, #5f88f8 100%);
    color: white;
    padding: 7px 10px;
    box-shadow: 0 4px 16px rgba(33, 44, 80, 0.14);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 50;
}


.header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}


    .grid-preview-confirm-dialog {
        width: min(860px, 92vw) !important;
        max-width: min(860px, 92vw) !important;
    }

    .grid-preview-modal {
        padding: 2px 0;
    }

    .grid-preview-title {
        font-size: 15px;
        font-weight: 600;
        color: #273043;
    }

    .grid-preview-sub {
        margin-top: 6px;
        font-size: 12px;
        color: #6b7280;
    }

    .grid-preview-list {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        max-height: 52vh;
        overflow: auto;
        padding-right: 2px;
    }

    .grid-preview-item {
        border: 1px solid #e6e9f2;
        border-radius: 8px;
        padding: 6px;
        background: #fafbff;
    }

    .grid-preview-item img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        border-radius: 6px;
        background: #fff;
        border: 1px solid #eef1f7;
    }

    .grid-preview-label {
        margin-top: 5px;
        text-align: center;
        font-size: 11px;
        color: #606a82;
    }

.header h1 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.header-user {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
}

.mobile-nav {
    width: 100%;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
    flex-wrap: nowrap;
}

.mobile-nav::-webkit-scrollbar {
    display: none;
}

.nav-pill {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 999px;
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-inline-title {
    color: rgba(255, 255, 255, 0.96);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 0 4px 0 2px;
}

.nav-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-pill.active {
    background: #fff;
    color: #5b6fd8;
    border-color: transparent;
}

.nav-pill.nav-danger {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 18px auto 24px;
    padding: 0 14px;
}

.container.container-fullscreen {
    max-width: none;
    margin: 6px 0 8px;
    padding: 0 8px 8px;
}

.group-review-page {
    width: 100%;
}

.group-review-page .result-section {
    margin-bottom: 6px;
    padding: 12px 10px;
}

/* 上传区域 */
.upload-section {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.upload-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.upload-tabs {
    margin-bottom: 20px;
}

.upload-stepper-section {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.upload-stepper-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.upload-stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.upload-nav-stepper {
    margin-top: 2px;
    padding-bottom: 2px;
}

.upload-step-pill {
    border: 1px solid #d9dff0;
    background: #f6f8ff;
    color: #4f5d87;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.upload-step-pill.active {
    border-color: var(--brand);
    background: #eaf0ff;
    color: var(--brand-strong);
}

.upload-nav-stepper .upload-step-pill {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.95);
}

.upload-nav-stepper .upload-step-pill.active {
    border-color: transparent;
    background: #fff;
    color: #4f63d8;
}

.upload-nav-stepper .upload-step-pill.done {
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.9);
    color: #2f9e44;
}

.upload-nav-stepper .upload-step-pill.todo {
    opacity: 0.72;
    color: rgba(255, 255, 255, 0.76);
}

.wizard-step3-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.upload-step3-floating-preview {
    top: 92px;
    right: 12px;
    left: auto;
    width: min(320px, calc(100vw - 24px));
    z-index: 60;
}

.upload-step3-floating-preview .group-review-floating-header {
    cursor: pointer;
}

.upload-step3-floating-preview .upload-original-preview-stage {
    min-height: 240px;
    max-height: 52vh;
}

.upload-step3-floating-preview .upload-original-preview-image {
    max-height: 50vh;
}

.upload-original-preview-panel {
    border: 1px solid #e6ebf5;
    border-radius: 10px;
    padding: 10px;
    background: #fafbff;
}

.upload-original-preview-title {
    font-size: 13px;
    color: #4d597b;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-original-preview-stage {
    position: relative;
    width: 100%;
    min-height: 320px;
    max-height: 62vh;
    overflow: hidden;
    border-radius: 8px;
    background: #eef2fb;
    border: 1px solid #dde3f1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.upload-original-preview-image {
    max-width: 100%;
    max-height: 62vh;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    pointer-events: none;
}

.upload-original-preview-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.wizard-step-question-card {
    border: 1px solid #e7ebf3;
    border-radius: 10px;
    background: #fafbff;
    padding: 14px;
}

.wizard-step-question-title {
    font-size: 15px;
    color: #2b3551;
    font-weight: 600;
}

.wizard-step-question-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #69748f;
}

.upload-area {
    border: 1.5px dashed #90a3ef;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8faff;
}

@media (max-width: 980px) {
    .wizard-step3-layout {
        grid-template-columns: 1fr;
    }

    .upload-step3-floating-preview {
        top: 84px;
        right: 8px;
        width: min(280px, calc(100vw - 16px));
    }
}

.upload-area:hover {
    border-color: var(--brand);
    background: #f3f6ff;
}

.upload-area.dragover {
    border-color: var(--brand);
    background: #edf2ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    color: #666;
    margin-bottom: 10px;
}

.upload-hint {
    color: #999;
    font-size: 12px;
}

/* XHS输入区 */
.xhs-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.xhs-input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.xhs-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 加载提示 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    margin: 15px 0;
    background: #f5f7fc;
    border-radius: 10px;
    border: 1px solid #dce4fb;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

.xhs-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.xhs-preview-item {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.xhs-preview-item:hover {
    transform: scale(1.05);
}

.xhs-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.xhs-preview-item.selected {
    border: 3px solid #667eea;
}

/* 微调区域 */
.adjust-section {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.adjust-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.adjust-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.adjust-container.full {
    grid-template-columns: 1fr;
}

/* 画布区域 */
.canvas-wrapper {
    position: relative;
    background: #f4f6fb;
    border-radius: 10px;
    border: 1px solid #e6ebf5;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.zoom-canvas-wrapper {
    padding: 6px;
}

.crop-modal-canvas-wrap {
    overflow: visible;
    background: #eef1f7;
    border: 1px solid #dde3ef;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.zoom-move-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
}

.zoom-move-btn {
    position: absolute;
    pointer-events: auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    min-width: 72px;
}

.zoom-move-overlay.axis-vertical .zoom-move-btn-up,
.zoom-move-overlay.axis-vertical .zoom-move-btn-down {
    left: 50%;
    transform: translateX(-50%);
}

.zoom-move-overlay.axis-vertical .zoom-move-btn-up {
    top: 38px;
}

.zoom-move-overlay.axis-vertical .zoom-move-btn-down {
    bottom: 12px;
}

.zoom-move-overlay.axis-horizontal .zoom-move-btn-left,
.zoom-move-overlay.axis-horizontal .zoom-move-btn-right {
    top: 50%;
    transform: translateY(-50%);
}

.zoom-move-overlay.axis-horizontal .zoom-move-btn-left {
    left: 10px;
}

.zoom-move-overlay.axis-horizontal .zoom-move-btn-right {
    right: 10px;
}

.canvas-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
}

canvas {
    display: block;
    /* 允许脚本控制 canvas 尺寸（避免全局 max-width 导致被压缩） */
    max-width: none;
    height: auto;
    touch-action: none;
}

/* 控制面板 */
.control-panel {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.help-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.help-pop {
    position: absolute;
    bottom: calc(100% + 8px);
    top: auto;
    left: 50%;
    transform: translateX(-10%);
    z-index: 30;
    min-width: 240px;
    max-width: 300px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.control-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9e0ef;
    border-radius: 8px;
    font-size: 14px;
}

.control-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-weight: 600;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--brand) 0%, #6983fb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 116, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(91, 116, 246, 0.36);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f6f8fd;
    color: #354158;
    border: 1px solid #d6deef;
}

.btn-secondary:hover {
    background: #eef2fb;
    border-color: #c3cee9;
}

.btn-danger {
    background: #f56c6c;
    color: white;
}

.btn-danger:hover {
    background: #dd6161;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-toggle {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d7dced;
    border-radius: 999px;
    cursor: pointer;
    color: #4b5673;
}

.auto-merge-fixed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3c4f9a;
    border: 1px solid #d7dff7;
    font-size: 12px;
    font-weight: 700;
}

.btn-toggle.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.28);
}

/* 任务列表 */
.task-view-segment {
    display: inline-flex;
    padding: 4px;
    background: #f3f5fb;
    border-radius: 999px;
    border: 1px solid #e5e9f6;
    gap: 4px;
}

.task-view-segment-btn {
    border: none;
    background: transparent;
    color: #5f677b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 14px;
    min-height: 32px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.task-view-segment-btn.active {
    background: #ffffff;
    color: #36415f;
    box-shadow: 0 1px 6px rgba(44, 60, 120, 0.16);
}

.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.task-status-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.task-status-column {
    border: 1px solid #eceef5;
    border-radius: 10px;
    background: #fafbff;
    padding: 10px;
}

.task-status-column-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #667085;
    margin-bottom: 8px;
}

.task-status-column-count {
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #eef2ff;
    color: #4c5ea8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.task-list.task-list-in-column {
    margin-bottom: 0;
    grid-template-columns: 1fr;
}

.task-status-column-empty {
    text-align: center;
    font-size: 12px;
    color: #9aa3b2;
    padding: 18px 6px;
}

.task-card {
    background: var(--bg-card);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(21, 33, 77, 0.10);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(137, 152, 193, 0.22);
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(24, 40, 90, 0.16);
}

.task-card:active {
    transform: translateY(-1px);
}

.task-thumb {
    position: relative;
    width: 100%;
    height: 170px;
    background: #ffffff;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.task-thumb::before {
    content: none;
}

.task-thumb img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.task-thumb-fallback {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    color: #6f7892;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.task-thumb-progress {
    position: absolute;
    z-index: 3;
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(18, 24, 45, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(1.5px);
}

.task-thumb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(77, 163, 255, 0.86) 0%, rgba(76, 118, 245, 0.92) 100%);
}

.task-thumb-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.task-spec-badge {
    position: absolute;
    z-index: 3;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(90, 96, 112, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.38);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15px;
    backdrop-filter: blur(2px);
}

.task-thumb-top {
    position: absolute;
    z-index: 2;
    top: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.task-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #b8c0cc;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.task-status-dot.dot-pending {
    background: #f8c12f;
    animation: dotBlinkYellow 1.15s ease-in-out infinite;
}

.task-status-dot.dot-processing {
    background: #ff4d4f;
    animation: dotRgbCycle 1.4s linear infinite;
}

.task-status-dot.dot-completed {
    background: #31c25a;
}

.task-status-dot.dot-failed {
    background: #ff6b6b;
}

.task-status-dot.dot-default {
    background: #b8c0cc;
}

@keyframes dotBlinkYellow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset; }
    50% { opacity: 0.35; box-shadow: 0 0 8px rgba(248,193,47,0.65); }
}

@keyframes dotRgbCycle {
    0% { background: #ff4d4f; box-shadow: 0 0 7px rgba(255,77,79,0.45); }
    33% { background: #37d67a; box-shadow: 0 0 7px rgba(55,214,122,0.45); }
    66% { background: #3a7afe; box-shadow: 0 0 7px rgba(58,122,254,0.45); }
    100% { background: #ff4d4f; box-shadow: 0 0 7px rgba(255,77,79,0.45); }
}

.task-menu-wrap {
    position: relative;
}

.task-menu-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    line-height: 1;
}

.task-menu-pop {
    position: absolute;
    top: 32px;
    right: 0;
    min-width: 90px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    padding: 4px;
    z-index: 4;
}

.task-menu-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    color: #333;
}

.task-menu-item:hover {
    background: #f5f7ff;
}

.task-thumb-meta {
    padding: 8px 10px;
    font-size: 11px;
    color: #8a8fa3;
}

.task-detail-action-btn {
    min-width: 122px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(40, 55, 96, 0.14);
    border-color: rgba(121, 137, 182, 0.24);
}

.task-detail-action-btn:hover {
    transform: none;
}

.task-detail-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.task-detail-action-primary {
    box-shadow: 0 8px 18px rgba(71, 97, 198, 0.28);
}

.draft-reentry-card {
    border: 1px solid #e5e9f6;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7f9ff 0%, #fbfcff 100%);
    padding: 12px;
}

.draft-reentry-title {
    font-size: 14px;
    font-weight: 700;
    color: #2f3a56;
    text-align: center;
}

.draft-reentry-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #6a7287;
    line-height: 1.6;
    text-align: center;
}

.task-detail-info-wrap {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.task-detail-text {
    flex: 1;
    min-width: 0;
    background: #fafbff;
    border: 1px solid #e7ebf5;
    border-radius: 10px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-detail-text a {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.task-detail-mini-thumb-wrap {
    width: 96px;
    min-width: 96px;
    flex-shrink: 0;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e9f6;
    background: linear-gradient(135deg, #eef2fb 0%, #f8f9fd 100%);
}

.task-detail-mini-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.task-detail-original-thumb {
    width: 170px;
    height: 170px;
    border-radius: 8px;
    border: 1px solid #e5e9f6;
    background: #ffffff;
    object-fit: contain;
    display: block;
}

.task-detail-thumb-grid {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.task-detail-thumb-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    background: #f8faff;
    border: 1px solid #e5e9f6;
    border-radius: 10px;
    padding: 8px;
}

.task-detail-thumb-label {
    font-size: 12px;
    color: #667085;
    line-height: 1;
}

.group-cell-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef1f7 0%, #f8f9fc 100%);
}

.group-cell-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.18s ease;
}

.group-cell-thumb-muted {
    opacity: 0.3;
}

.group-review-main {
    margin-top: 10px;
}

.group-review-floating-canvas {
    position: fixed;
    width: min(240px, calc(100vw - 24px));
    z-index: 80;
    border: 1px solid #e6e8ef;
    border-radius: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(2px);
}

.group-review-floating-canvas.collapsed {
    width: auto;
    min-width: 120px;
    padding: 8px;
}

.group-review-floating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.group-review-floating-body {
    margin-top: 8px;
}

.group-review-canvas-pane {
    border: 1px solid #e6e8ef;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.group-review-canvas {
    width: 100%;
    display: block;
    border-radius: 8px;
    border: 1px solid #dde2ef;
    background: #f5f7fb;
    touch-action: none;
    user-select: none;
    cursor: grab;
}

.group-cell-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7288;
    background: repeating-linear-gradient(
        -45deg,
        rgba(126, 138, 180, 0.12),
        rgba(126, 138, 180, 0.12) 8px,
        rgba(126, 138, 180, 0.06) 8px,
        rgba(126, 138, 180, 0.06) 16px
    );
    animation: groupCellShimmer 0.8s linear infinite;
}

.group-cell-loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(108, 122, 170, 0.3);
    border-top-color: #6f7fc0;
    animation: spin 0.8s linear infinite;
}

@keyframes groupCellShimmer {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 24px 0;
    }
}

.task-info {
    padding: 15px;
}

.task-id {
    font-size: 12px;
    color: #999;
    word-break: break-all;
    margin-bottom: 8px;
}

.task-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.status-pending {
    background: #ffd700;
    color: #333;
}

.status-processing {
    background: #87ceeb;
    color: white;
}

.status-completed {
    background: #90ee90;
    color: #333;
}

.status-failed {
    background: #ffcccc;
    color: #333;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.task-actions button {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

/* 加载指示 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    min-width: 280px;
    max-width: min(420px, calc(100vw - 24px));
    padding: 14px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    animation: toast-slide-in 0.22s ease-out;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    padding: 0;
    line-height: 1;
}

/* 边框线样式 */
.line-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: move;
}

.line-horizontal {
    cursor: row-resize;
}

.line-vertical {
    cursor: col-resize;
}

/* 网格预览 */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.3;
}

/* 错误状态 */
.error-container {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.error-title {
    color: #c53030;
    font-weight: 600;
    margin-bottom: 10px;
}

.error-message {
    color: #742a2a;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.48);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.22);
    border: 1px solid #e7ebf3;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

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

.crop-modal-content {
    max-height: 88vh;
}

.crop-modal-body {
    padding: 14px 16px 10px;
}

.crop-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.crop-modal-canvas-wrap {
    max-height: calc(88vh - 170px);
    overflow: auto;
}

.share-code-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #d8e0ef;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    background: #f8f9fa;
    color: #333;
    resize: vertical;
    cursor: text;
}

.share-code-textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
}

.share-message {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.share-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.share-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.share-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.task-detail-original-thumb {
    max-width: 100%;
}

input,
select,
textarea {
    border-radius: 8px;
    border: 1px solid #d8e0ef;
    color: #2b3447;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(91, 116, 246, 0.12);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 6px 8px;
        gap: 4px;
    }

    .header h1 {
        font-size: 13px;
    }

    .header-user {
        font-size: 10px;
    }

    .nav-pill { height: 24px; padding: 0 8px; font-size: 10px; }
    .nav-inline-title { font-size: 10px; padding-right: 2px; }

    .adjust-container {
        grid-template-columns: 1fr;
    }

    .btn-toggle,
    .auto-merge-fixed-badge {
        min-height: 32px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .task-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-card {
        border-radius: 16px;
    }

    .task-thumb {
        border-radius: 14px 14px 0 0;
    }

    .task-status-columns {
        grid-template-columns: 1fr;
    }

    .group-review-floating-canvas {
        width: min(220px, calc(100vw - 16px));
    }

    .container {
        padding: 0 10px;
    }

    .upload-section,
    .adjust-section,
    .result-section {
        padding: 14px;
        border-radius: 10px;
    }

    .xhs-input-group {
        flex-direction: column;
    }

    .xhs-input-group button,
    .button-group button,
    .task-actions button {
        min-height: 40px;
    }

    .task-thumb {
        height: 136px;
    }

    .task-detail-original-thumb {
        width: 120px;
        height: 120px;
    }

    .message {
        top: 12px;
        right: 12px;
        min-width: 0;
        max-width: calc(100vw - 24px);
    }

    .zoom-move-btn {
        min-width: 64px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .zoom-move-overlay.axis-vertical .zoom-move-btn-up {
        top: 34px;
    }

    .zoom-move-overlay.axis-horizontal .zoom-move-btn-left {
        left: 8px;
    }

    .zoom-move-overlay.axis-horizontal .zoom-move-btn-right {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        margin-top: 12px;
        padding: 0 8px;
    }

    .container.container-fullscreen {
        margin-top: 4px;
        padding: 0 6px 6px;
    }

    .header-top { align-items: center; flex-direction: row; gap: 6px; }

    .header-user {
        white-space: nowrap;
        line-height: 1;
        font-size: 9px;
    }

    .mobile-nav { gap: 3px; }
    .nav-pill { height: 23px; padding: 0 7px; font-size: 10px; }
    .nav-inline-title { font-size: 10px; }

    .task-list {
        gap: 10px;
    }

    .task-view-segment {
        width: 100%;
        justify-content: space-between;
        border-radius: 999px;
    }

    .task-view-segment-btn {
        flex: 1;
        text-align: center;
        min-height: 34px;
        font-size: 11px;
    }

    .modal-content {
        width: calc(100% - 12px);
        max-height: 86vh;
        border-radius: 10px;
    }

    .modal-header,
    .modal-body {
        padding-left: 14px;
        padding-right: 14px;
    }
}

