:root {
    --primary-color: #43C2FF;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --white: #ffffff;
    --black: #000000;
    --secondary-color: #6c757d;
    --light-bg: #f6f8fc;
}

/*公共样式*/
.body {
    margin-bottom: 82px;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.row-start {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

.row-end {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.column-center {
    display: flex;
    flex-direction: column;
    align-content: center;
}

.column-between {
    display: flex;
    flex-direction: column;
    align-content: space-between;
}

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

.space-between {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.align-center {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.space-around {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center {
    text-align: center;
}

.wrap {
    width: 1600px;
    margin: 0 auto;
    position: relative;
}

.margin {
    margin-top: 130px;
    margin-bottom: 130px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    color: unset;
    text-decoration: none;
}

a:hover {
    color: unset;
    text-decoration: none;
}

button {
    border: none;
    background-color: unset;
}

button:focus {
    outline: none;
}

.pointer {
    cursor: pointer;
}

.border-bottom {
    border-bottom: 1px solid #EFEFEF;
}

/*登录页面*/
.login {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.login-card {
    width: 80vw;
    height: 80vh;
    box-shadow: 0px 6px 13px 0px rgba(58, 9, 123, 0.35);
    margin: 10vh auto;
    overflow: hidden;
    background-size: contain;
    background-position: right;
    background-color: #FFFFFF;
}

.login-title {
    font-size: 32px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: var(--primary-color);
    margin: 15px 33px 25px;
    text-shadow: 2px 2px 1px var(--white);
}

.login-prompt{
    color: #FFFFFF;
    font-size: 15px;
    text-shadow: 1px 1px #333333;
}

.check{
    margin-top: 2px;
    color: var(--white);
    background-color: var(--primary-color);
    padding: 2px 10px;
    letter-spacing: .2em;
}

.login-form {
    width: 25%;
    margin-left: 10%;
    margin-top: 5%;
}

.login-form > p {
    font-size: 30px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: var(--primary-color);
    text-shadow: 2px 2px 1px var(--white);
    text-align: center;
}

.only-need {
    display: block;
    text-align: right;
    color: var(--primary-color);
    margin: 10px 0;
    font-size: 14px;
}
.login-form-label {
    display: inline-block;
    font-size: 18px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #7C7C7C;
    margin: 3px 0 15px;
}

.login-problem{
    width: 70%;
    margin-left: 10%;
    margin-top: 3em;
    color: #FFFFFF;
    text-shadow: 1px 1px  #333333;
    font-size: 20px;
}

.login-form-item > input {
    padding: 15px;
    font-size: 18px;
    outline: none;
    border: 1px solid #D4D4D4;
}

.login-form-item > input::placeholder {
    color: #D3D3D3;
}

.login-button {
    display: block;
    width: 100%;
    padding: 15px 0;
    background: var(--primary-color);
    color: var(--white);
    font-size: 24px;
    box-shadow: 0px 6px 13px 0px rgba(67, 194, 255, 0.35);
    border: none;
}

/*订单*/

/*顶栏*/
.header {
    background: var(--primary-color);
    height: 100px;
    padding: 0 40px;
}

.name {
    color: #fff;
    font-size: 30px;
}

.otherOrders {
    color: #DDF4FF;
    font-size: 18px;
}

/*内容*/
.order-margin {
    margin-top: 20px;
    margin-bottom: 20px;
}

.order-titleCard {
    margin: 0 auto;
    background: #FFFFFF;
    padding: 12px 17px;
    font-size: 22px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #666666;
}

.order-card {
    margin: 0 auto;
    background: #FFFFFF;
    padding: 0 17px;
    font-size: 16px;
    font-family: Microsoft YaHei;
}

.order-card-padding {
    padding: 23px 0;
}

.order-card-line {
    border-bottom: 1px solid #F1F1F1;
}

.order-card-key {
    color: #B3B3B3;
    margin-right: 15px;
    min-width: 4em;
}

.order-card-val {
    color: #666666;
}

.order-num {
    color: #666666;
    margin-bottom: 20px;
}

.order-operation {
    padding: 17px 0;
}

.order-operation  button {
    width: 150px;
    height: 29px;
    border-radius: 15px;
    color: #fff;
    font-size: 14px;
    margin-left: 10px;
}

/*等待传图*/
.wait {
    color: var(--primary-color);
}
/*等待传图*/
.cancel {
    color: #9E9E9E;
}

.wait-button {
    background: linear-gradient(-86deg, var(--primary-color), #56DFFF);
}

/*等待印刷*/
.wait-print {
    color: #4943ff;
}

.wait-print-button {
    background-color: #4943ff;
}

/*查看图片*/
.preview-button{
    background-color: var(--orange);
}
/*印刷中*/
.printing {
    color: #FFA443;
}

.printing-button {
    background: linear-gradient(-86deg, #43e3ff, #FDDD86);
}

/*完成*/
.completed {
    color: var(--success);
}

/*照片编辑*/
.edit-card {
    padding: 17px;
    font-size: 12px;
    font-family: Microsoft YaHei;
    color: #A9A8A8;
    margin: 0;
    line-height: 22px;
}

.explain-item {
    font-size: 12px;
    line-height: 22px;
    font-family: Microsoft YaHei;
    color: #A9A8A8;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0;
}

.explain-item-left {
    width: 5%;
    text-align: right;
}

.explain-item-left > img {
    float: right;
    width: 14px;
    height: 18px;
}

.explain-item-right {
    width: 95%;
    margin-left: 5px;
}

/*批量操作*/
.bulkOperation {
    color: #BCBCBC;
    font-size: 14px;
    margin: 20px 0;
    position: relative;
    /* --- 优化 --- */
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.show-help {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.operation {
    padding: 8px 15px;
    border: 1px solid #BDBDBD;
    border-radius: 6px;
    font-size: 13px;
    color: #666666;
    margin: 0 5px;
    height: auto;
    transition: all 0.2s ease;
}

.operation:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #e9f8ff;
}


.operation > i {
    margin-top: -3px;
    margin-right: 5px;
}

.operation-sub {
    font-size: 13px;
    color: #666666;
    padding: 10px 0;
    border-bottom: 1px solid #BDBDBD;
}

.operation:active {
    color: #BDBDBD;
}

.operation > i, .operation > img {
    font-size: 15px;
    width: 15px;
    height: 15px;
    margin-right: 5px;
}

.img-list {
    min-height: 250px;
}

.img-main {
    position: relative;
}

.img-edit > img {
    cursor: pointer;
}


.img-step {
    border: 1px solid #BDBDBD;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex; /* 确保内部元素水平排列 */
}

.img-step > button, .img-step > input {
    width: 32px;
    height: 32px;
    text-align: center;
    outline: none;
    border: none;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #333;
}

.img-step > input {
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    background: #f8f9fa;
    color: var(--primary-color);
    font-weight: bold;
}

.img-step > button:hover {
    background: var(--primary-color);
    color: #fff;
}

.img-step > button:active {
    transform: scale(0.95);
}


.checkAll {
    justify-content: center;
    margin: 0 7px 0 0;
    padding-left: 5px;
    font-weight: 500;
    color: #333;
}

.checkAll > span {
    margin-left: 8px;
}

.checkAll input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}


.radio {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 999;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.margin-auto {
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    background: #fff;
}


.currentImg {
    max-width: none;
    max-height: none;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.currentImg1 {
    max-width: none;
    max-height: none;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.currentImg2 {
    max-width: none;
    max-height: none;
    width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
}

.img-container {
    width: 100%;
    background-color: #F2F0F3;
    position: relative;
    min-height: 50vh;
}

.img-container-wrap {
    width: 100%;
    overflow: hidden;
    height: 100%;
    position: relative;
    padding: 2px;
}


.bottomBar {
    padding: 15px 0; /* --- 修改点：减小了上下内边距，降低底部栏高度 --- */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.addImg {
    width: auto; /* 自动宽度，根据内容调整 */
    min-width: 120px; /* 最小宽度保持120px */
    max-width: 160px; /* 最大宽度限制 */
    height: 38px; /* 调小高度：38px → 32px */
    background: linear-gradient(-86deg, #43C2FF, #56DFFF);
    border-radius: 8px; /* 稍微减小圆角，与高度匹配 */
    color: #fff;
    font-size: 14px; /* 文字放大20%：11px * 1.2 ≈ 13px */
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(67, 194, 255, 0.3);
    white-space: nowrap; /* 强制文字在一行内显示 */
    display: inline-flex; /* 使用inline-flex布局，自适应宽度 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    font-weight: 500; /* 增加字体粗细 */
    padding: 0 16px; /* 左右padding确保文字不贴边 */
    box-sizing: border-box; /* 包含padding在宽度计算内 */
}

.addImg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 194, 255, 0.4);
}

.addImg:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(67, 194, 255, 0.3);
}

.addImg > input {
    width: 100%; /* 与按钮宽度保持一致 */
    height: 100%; /* 与按钮高度保持一致 */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* 按钮内的span标签样式 */
.addImg span {
    margin-left: 8px; /* 与主文字保持小间距 */
    font-size: 12px; /* 稍小的字体显示数字 */
    opacity: 0.9; /* 稍微透明，突出主文字 */
    white-space: nowrap; /* 确保数字不换行 */
    display: inline-block; /* 确保span正常显示 */
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
}


/* 文字溢出处理 - 当按钮达到最大宽度时 */
.addImg {
    text-overflow: ellipsis; /* 文字溢出显示省略号 */
    overflow: hidden; /* 隐藏溢出内容 */
}

.nextstep {
    text-overflow: ellipsis; /* 文字溢出显示省略号 */
    overflow: hidden; /* 隐藏溢出内容 */
}

/* 响应式字体大小调整 */
@media screen and (max-width: 480px) {
    .addImg, .nextstep {
        font-size: 13px; /* 小屏幕时稍微缩小字体 */
        min-width: 100px; /* 小屏幕时减少最小宽度 */
        max-width: 150px; /* 小屏幕时减少最大宽度 */
        padding: 10px 14px; /* 小屏幕时减少padding */
        height: 40px;
    }

    .addImg span {
        font-size: 11px; /* 小屏幕时数字更小 */
        margin-left: 4px; /* 减少间距 */
    }
}

/* 确保按钮在底部栏中正确对齐 */
.bottomBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* 防止按钮换行 */
}

.bottomBar .addImg,
.bottomBar .nextstep {
    flex-shrink: 0; /* 防止按钮被压缩 */
}

/* 修复可能的布局问题 */
.addImg, .nextstep {
    vertical-align: middle; /* 垂直对齐 */
    line-height: normal; /* 重置行高，让flex处理对齐 */
}

/* 确保span标签不会影响布局 */
.addImg span {
    flex-shrink: 0; /* 防止数字被压缩 */
}

/* 移动端拖拽优化 */
.canvas-wrap {
    /* 允许垂直滚动，只在移动模式下禁用触摸 */
    touch-action: pan-y; /* 允许垂直滚动，禁用水平滚动和缩放 */
    user-select: none; /* 防止文字选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 只有在移动模式下才完全禁用触摸 */
.img-item.move-mode .canvas-wrap {
    touch-action: none; /* 移动模式下禁用所有触摸行为 */
}

.canvas-wrap.dragging {
    cursor: grabbing !important;
    transition: none; /* 拖拽时禁用过渡动画 */
}

.canvas-wrap.dragging .myCanvas {
    transition: none; /* 拖拽时禁用canvas过渡 */
}

/* 提升触摸响应性 */
.myCanvas {
    /* 允许垂直滚动，只在移动模式下禁用触摸 */
    touch-action: pan-y; /* 允许垂直滚动 */
    will-change: transform; /* 优化GPU加速 */
}

/* 只有在移动模式下才完全禁用触摸 */
.img-item.move-mode .myCanvas {
    touch-action: none; /* 移动模式下禁用所有触摸行为 */
}

/* 移动端手势提示优化 */
.gesture-hint {
    pointer-events: none; /* 不阻挡触摸事件 */
    backdrop-filter: blur(4px); /* 添加背景模糊效果 */
    -webkit-backdrop-filter: blur(4px);
}

/* 移动端性能优化 */
@media screen and (max-width: 1000px) {
    .canvas-wrap {
        transform: translateZ(0); /* 强制GPU加速 */
        -webkit-transform: translateZ(0);
        backface-visibility: hidden; /* 隐藏背面，提升性能 */
        -webkit-backface-visibility: hidden;
        perspective: 1000px; /* 启用3D加速 */
        -webkit-perspective: 1000px;
    }

    .myCanvas {
        transform: translateZ(0); /* 强制GPU加速 */
        -webkit-transform: translateZ(0);
        image-rendering: optimizeSpeed; /* 优化图像渲染速度 */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
    }

    /* 减少重绘和回流 */
    .img-item {
        contain: layout style paint; /* CSS containment优化 */
    }

    /* 优化滚动性能 */
    body {
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
}

.nextstep {
    width: auto; /* 自动宽度，根据内容调整 */
    min-width: 129px; /* 最小宽度保持129px */
    max-width: 180px; /* 最大宽度限制 */
    height: 38px; /* 调小高度：38px → 32px，与addImg保持一致 */
    background: var(--success-color);
    border-radius: 8px; /* 稍微减小圆角，与高度匹配 */
    color: #fff;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    white-space: nowrap; /* 强制文字在一行内显示 */
    display: inline-flex; /* 使用inline-flex布局，自适应宽度 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    font-weight: 500; /* 增加字体粗细 */
    text-align: center; /* 文字居中 */
    padding: 0 18px; /* 左右padding确保文字不贴边 */
    box-sizing: border-box; /* 包含padding在宽度计算内 */
}

.nextstep:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.nextstep:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 167, 69, 0.3);
}

.bgc {
    position: relative;
}

.bgc > input {
    position: absolute;
    width: 25px;
    height: 25px;
    opacity: 0;
    left: 0;
}

.bgc > img {
    width: 25px;
    height: 25px;
}

.dialog-imgContainer {
    width: 114px;
    height: 130px;
    background: #F2F0F3;
}

.dialog-imgEdit {
    flex: 1;
    margin-left: 27px;
}

.dialog-imgEdit-num {
    padding: 20px 0;
}

.dialog-imgEdit-operation {
    padding: 20px 0;
    font-size: 14px;
    color: #A5A5A5;
}

.dialog-imgEdit-operation input[name=dialog-operation] {
    margin: 0 5px;
}

#img-wrap {
    position: relative;
}

.exclamation {
    position: absolute;
    font-size: 25px;
    color: #dc3535;
    left: 10px;
    bottom: 10px;
    z-index: 101;
    text-shadow: 0 0 5px white;
}

.img-item {
    width: 33.3333%;
    padding: 8px; /* --- 优化 --- */
}

.assignment_type {
    border: 1px solid #dee2e6;
    border-radius: 8px; /* --- 优化 --- */
    overflow: hidden; /* --- 优化 --- */
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.assignment_type:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.img-edit {
    padding: 8px;
    border-top: 1px solid #dee2e6;
    display: flex;
    flex-direction: column; /* --- 优化 --- */
    gap: 8px; /* --- 优化 --- */
    background-color: var(--light-bg);
    margin-top: auto; /* Push edit section to the bottom */
}
/* --- 新增：编辑按钮分组 --- */
.img-edit-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}


.resolution-title {
    color: var(--primary-color);
    font-size: 16px;
    text-align: center;
}

.resolution-title > i {
    margin-right: 5px;
}

.resolution-content {
    font-size: 14px;
    color: #999999;
    display: inline-block;
    width: 60%;
}

.completed-list {
    padding-left: 10px;
    padding-bottom: 10px;
}

.completed-img {
    width: 25%;
    margin-top: 10px;
}

.completed-wrap {
    height: 200px;
    margin-right: 10px;
}

.completed-img img {
    border: 1px solid var(--black);
}

.myCanvas {
    background: var(--white);
    z-index: 99;
    box-sizing: border-box;
    will-change: transform; /* 启用硬件加速 */
    backface-visibility: hidden; /* 防止闪烁 */
    cursor: grab; /* Add grab cursor */
    border: 1px solid #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.myCanvas:active {
    cursor: grabbing; /* Change to grabbing when dragging */
}

.canvas-wrap {
    position: absolute;
    display: flex;
    cursor: grab;
    transition: cursor 0.2s ease;
    will-change: transform; /* 启用硬件加速 */
    backface-visibility: hidden; /* 防止闪烁 */
}

.canvas-wrap.dragging {
    cursor: grabbing;
}

.canvas-wrap:active {
    cursor: grabbing;
}

/* 优化触摸滚动性能 */
.img-container-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}


.cover-div {
    cursor: move;
    z-index: 101;
}

.shape-top, .shape-bottom, .shape-left, .shape-right {
    position: absolute;
    z-index: 100;
    background: var(--white);
    opacity: .9;
}

.shape-middle {
    position: absolute;
    z-index: 100;
    border: 1px solid;
}

.shape-top {
    top: 0;
}

.shape-left {
    left: 0;
}

.shape-right {
    right: 0;
}

.shape-bottom {
    bottom: 0;
}

/* --- 优化：统一为 modern-btn --- */
.leaveWhite, .clip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 4px 6px;
    background: linear-gradient(135deg, #6c757d 0%, #343a40 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(108, 117, 125, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
}
.leaveWhite:hover, .clip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}
.leaveWhite.active, .clip.active {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}
.leaveWhite i, .clip i {
    font-size: 16px;
    margin-bottom: 2px;
}

.eyedropper {
    width: 30px;
    height: 25px;
    background: var(--primary-color);
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eyedropper:hover {
    background: #2196F3;
    transform: scale(1.05);
}

.eyedropper:active {
    transform: scale(0.95);
}

.eyedropper.active {
    background: #FF5722;
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.5);
}

.eyedropper i {
    color: var(--white) !important;
}

/* 手机端专用缩放控制 - 优化间距 */
.mobile-zoom-controls {
    display: flex;
    gap: 6px; /* 减小：4px → 3px */
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

/* 现代化按钮基础样式 - 优化尺寸比例 */
.modern-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px; /* 减小：48px → 40px */
    min-height: 44px; /* 减小：48px → 40px */
    padding: 4px;
    border: none;
    border-radius: 10px; /* 减小：12px → 10px */
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.25);
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modern-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.modern-btn i {
    font-size: 16px; /* 减小：18px → 16px */
    margin-bottom: 2px; /* 减小：2px → 1px */
    line-height: 1;
}

.modern-btn .btn-text {
    font-size: 8px; /* 减小：10px → 9px */
    font-weight: 500;
    line-height: 1.1;
    opacity: 0.9;
}

/* 不同类型按钮的颜色 */
.delete-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}
.delete-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.move-edit-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}
.move-edit-btn:hover {
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}
.move-edit-btn.active {
    background: linear-gradient(135deg, #ff9a44 0%, #fc6076 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(252, 96, 118, 0.5);
}
.move-edit-btn.active .btn-text {
    font-weight: bold;
}

.preview-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2196F3 100%);
    box-shadow: 0 4px 15px rgba(67, 194, 255, 0.3);
}
.preview-btn:hover {
    box-shadow: 0 8px 25px rgba(67, 194, 255, 0.4);
}


.color-btn-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}
.color-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}
.color-btn:hover {
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}
.color-btn-wrap input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.eyedropper-btn {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    box-shadow: 0 4px 15px rgba(255, 234, 167, 0.3);
    color: #2d3436;
}

.eyedropper-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 234, 167, 0.4);
}

.eyedropper-btn.active {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: #fff;
    animation: eyedropperPulse 1.5s infinite;
}

@keyframes eyedropperPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(253, 121, 168, 0.3);
        transform: translateY(-2px);
    }
    50% {
        box-shadow: 0 8px 25px rgba(253, 121, 168, 0.6);
        transform: translateY(-3px);
    }
}

.color-preview {
    transition: all 0.2s ease;
}

.eyedropper-crosshair {
    animation: crosshairPulse 1s infinite;
}

@keyframes crosshairPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.color-picked-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media screen and (max-width: 767px) {
    .eyedropper-tip {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    .color-preview {
        width: 50px !important;
        height: 25px !important;
        top: -35px !important;
    }
}



.modern-btn.active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.xs-hide-block {
    display: none;
}

.bi-question-circle::before {
    vertical-align: middle;
}

.bottom-banner {
    position: fixed;
    bottom: 0;
    z-index: 1000;
}

.b-dialog-alert .layui-m-layerbtn span, .b-dialog-confirm .layui-m-layerbtn span {
    color: var(--primary-color) !important;
}


.circle {
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    right: 15px;
    position: absolute;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 102;
    transition: all 0.2s ease;
    cursor: pointer;
}

.circle:hover {
    background-color: rgba(67, 194, 255, 0.9);
    transform: scale(1.1);
}

.circle:active {
    transform: scale(0.95);
}

.circle i {
    color: #333;
    font-size: 18px !important;
    margin-top: -2px;
    transition: color 0.2s ease;
}

.circle:hover i {
    color: #fff;
}

.move-tool {
    background-color: #ff6600;
    color: white;
}

.move-handle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: move;
    display: flex; /* Initially hidden */
    align-items: center;
    justify-content: center;
    z-index: 103;
}

.move-handle i {
    font-size: 20px;
}

.img-item.selected .move-handle {
    display: flex;
}

.move-handle.move-active {
    background-color: #e65c00;
    cursor: grabbing;
}

.webuploader-pick {
    display: block !important;
    background: none !important;
    padding: 0 !important;
}

.batch-operation {
    position: fixed;
    left: 0;
    top: 50%;
    width: 35px;
    align-items: center;
    transform: translateY(-50%);
    z-index: 105;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    border: 1px solid #e9ecef;
    border-left: none;
    border-radius: 0 10px 10px 0;
    padding: 10px 0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.batch-operation  button,
.batch-operation  label {
    font-size: 12px;
    text-align: center;
    color: var(--white);
    background: var(--primary-color);
    border-radius: 5px;
    line-height: 1.2;
    padding: 8px 2px;
    margin: 5px;
    width: calc(100% - 10px);
    word-wrap: break-word;
    writing-mode: vertical-lr; /* --- 优化 --- */
    text-orientation: mixed;
    min-height: 60px;
}

.batch-operation  label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    writing-mode: initial;
    min-height: auto;
}
.batch-operation  label input {
    margin-bottom: 4px;
}

.batch-operation-toggle {
    z-index: 10;
    width: 100%;
    font-size: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    padding: 10px 0;
    height: 100%;
}

#clarity .modal-body > p:first-child {
    font-size: 25px;
    color: #fe434a;
}
#clarity .modal-body > p:nth-child(2) {
    font-size: 26px;
    color: #333333;
}
#clarity .modal-body > button   {
    color: #fff;
    background: #fe434a;
    border-radius: 5px;
    width: 120px;
    font-size: 22px;
}
.progress-bar-striped{
    background-image: linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
}
div#driver-popover-item .driver-popover-title{
    font-weight:500!important;
}
div#driver-popover-item .driver-popover-footer button{
    color: var(--white) !important;
    border: none!important;
    background-color: var(--primary-color) !important;
    text-shadow: none!important;
    margin-right: 10px;
}
div#driver-popover-item .driver-popover-footer button.driver-disabled{
    background-color: #d4d4d4!important;
}
div#driver-popover-item .driver-popover-footer .driver-close-btn{
    background-color: transparent!important;
    color: var(--black) !important;
    padding: 0;
    line-height: 21px;
}

/* Canva-style Selection Box */
.canva-selection-box {
    position: absolute;
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
    z-index: 1000;
    pointer-events: none; /* The box itself doesn't capture events */
    display: none; /* Hidden by default */
}

/* 移动模式下的变换框样式 */
.img-item.move-mode .canva-selection-box {
    border-color: var(--success-color);
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.3);
}

.img-item.move-mode .selection-handle {
    background-color: var(--success-color);
    border-color: var(--white);
}

/* 平板设备适配 */
@media screen and (max-width: 1200px) and (min-width: 768px) {
    .img-item {
        width: 50%; /* 平板显示两列 */
    }

    .circle {
        width: 32px;
        height: 32px;
    }

    .circle i {
        font-size: 16px !important;
    }
}

@media screen and (max-width: 1000px) {
    .body {
        margin-bottom: 42px;
    }

    .bottomBar {
        padding: 6px 14px; /* 减小移动端边距 */
        gap: 15px;
    }

    .addImg, .nextstep {
        padding: 0 15px; /* 移除上下 padding, 高度由 min-height 控制 */
        font-size: 14px;
        border-radius: 8px;
        font-weight: 500;
        min-height: 35px; /* 显著减小按钮的最小高度 */
        width: auto;
        min-width: 110px;
        max-width: 180px;
    }

    .addImg span {
        margin-left: 6px;
        font-size: 11px;
    }

    .addImg:active, .nextstep:active {
        transform: scale(0.98);
    }

    .xs-hide-block {
        display: block;
    }

    .move {
        display: block;
    }

    .none {
        display: none;
    }

    .block {
        display: block;
    }

    .explain-item {
        width: 100%;
    }

    .explain-item-left {
        width: unset;
    }

    .img-item {
        width: 100%;
        padding: 5px; /* --- 优化 --- */
    }

    .img-list {
        justify-content: center;
    }

    .circle {
        width: 45px;
        height: 45px;
        right: 10px;
    }

    .circle i {
        font-size: 20px !important;
    }

    .img-container-wrap {
        touch-action: pan-x pan-y;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .leaveWhite:active, .clip:active, .eyedropper:active {
        transform: scale(0.95);
    }

    .img-step > button:active {
        transform: scale(0.9);
        background: #007bff;
    }

    .circle:active {
        transform: scale(0.85);
    }

    /* --- 移动端按钮统一尺寸 --- */
    .leaveWhite, .clip, .eyedropper, .modern-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 6px;
    }
    .modern-btn i, .leaveWhite i, .clip i { font-size: 18px; }
    .modern-btn .btn-text, .leaveWhite, .clip { font-size: 10px; }


    .img-step > button, .img-step > input {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    .img-edit {
        padding: 10px 5px;
        gap: 10px;
    }
    .img-edit-group {
        gap: 8px;
    }

    .mobile-zoom-controls {
        display: flex !important;
        gap: 8px;
    }

    .img-container {
        min-height: 280px;
    }

    .bulkOperation {
        padding: 10px;
        margin: 10px 0;
        flex-direction: column;
        gap: 8px;
    }
    .bulkOperation .operation {
        width: 100%;
        justify-content: center;
    }
    .bulkOperation .show-help {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }
    .checkAll { display: flex; width: 100%; justify-content: center; }

    .login-card {
        background-size: cover;
    }
}

@media screen and (max-width: 767px) {
    .xs-hide-block {
        display: block;
    }

    .block {
        display: block;
    }

    .login-title {
        text-align: center;
        font-size: 27px;
    }

    .login-card {
        width: 100%;
        background-size: cover;
    }

    .login-form {
        width: 100%;
        margin: 0;
        padding: 0 15%;
    }


    .login-form-label {
        font-size: 15px;
    }

    .login-form > p {
        font-size: 25px;
        font-weight: bold;
    }

    .login-form-item > input {
        font-size: 15px;
        padding: 5px;
    }

    .login-button {
        width: 100%;
        padding: 5px 0;
        font-size: 16px;
    }

    .login {
        background-size: 100% 100% !important;
    }

    .login-problem{
        width: 100%;
        margin-left: 0;
        padding: 0 15%;
        font-size: 13px;
    }

    /*订单*/
    .header {
        height: 50px;
        padding: 0 17px;
    }

    .order-margin {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .order-info > div {
        display: flex;
        justify-content: space-between;
    }

    .order-titleCard {
        font-size: 17px;
        padding: 5px 17px;
    }

    .order-card-line {
        padding: 8px 0;
    }

    .name {
        font-size: 25px;
    }

    .otherOrders {
        font-size: 15px;
    }

    .order-operation {
        padding: 8px 0;
    }

    /*照片剪辑*/
    .explain-item {
        width: 100%;
    }

    .completed-img {
        width: 50%;
    }

    .only-need {
        margin: 20px 0;
    }
}

/* ==================== 移动按键防误操作系统 ==================== */

.canva-selection-box {
    position: absolute;
    border: 2px solid #007bff;
    background: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.move-button {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: 2px solid var(--white);
    border-radius: 50%;
    cursor: grab;
    z-index: 1001;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.move-button:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.move-button:active,
.move-button.dragging {
    cursor: grabbing;
    background: #004085;
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.move-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.move-button.active {
    background: var(--success-color);
    animation: pulse 1.5s infinite;
}

.move-button.active::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>');
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.drag-hint {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1002;
    display: none;
    white-space: nowrap;
}

.drag-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .move-button {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    .move-button::before {
        width: 24px;
        height: 24px;
    }

    .drag-hint {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* From photoEditing.html */
.swiper-slide img {
    width: auto;
    height: 77vh;
}

.swiper-slide {
    display: flex;
    justify-content: center;
}

.guide {
    background: var(--primary-color);
    color: var(--white);
    margin: 0 10px;
}

.guide-disabled {
    background: #9e9e9e !important;
}

.guide-help {
    font-size: 22px;
    color: var(--black);
}

.selection-box {
    position: absolute;
    border: 2px solid var(--primary-color);
    background: transparent;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.selection-handle {
    position: absolute;
    width: 20px; /* Increased size */
    height: 20px; /* Increased size */
    background: var(--primary-color);
    border: 2px solid var(--white);
    border-radius: 50%;
    pointer-events: all;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4); /* Added shadow for depth */
    transition: transform 0.1s ease; /* Added transition for feedback */
}

.selection-handle:hover {
    transform: scale(1.2); /* Enlarge on hover */
}

.selection-handle.nw { top: -10px; left: -10px; cursor: nwse-resize; }
.selection-handle.ne { top: -10px; right: -10px; cursor: nesw-resize; }
.selection-handle.sw { bottom: -10px; left: -10px; cursor: nesw-resize; }
.selection-handle.se { bottom: -10px; right: -10px; cursor: nwse-resize; }
.selection-handle.n { top: -10px; left: 50%; margin-left: -10px; cursor: ns-resize; }
.selection-handle.s { bottom: -10px; left: 50%; margin-left: -10px; cursor: s-resize; }
.selection-handle.w { top: 50%; left: -10px; margin-top: -10px; cursor: ew-resize; }
.selection-handle.e { top: 50%; right: -10px; margin-top: -10px; cursor: ew-resize; }

@media (max-width: 767px) {
    .selection-handle::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        background: transparent; /* This creates a larger, invisible touch target */
        border-radius: 50%;
    }
}

.img-item.selected .hide-img {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.img-item.move-mode .hide-img {
    box-shadow: 0 0 0 2px var(--success-color);
}

#guide .jump{
    position: absolute;
    top: 0;
    right: 0;
    color: var(--white);
    text-shadow: 1px 1px var(--black);
    padding: 10px;
    z-index: 1000;
    cursor: pointer;
}
@media screen and (max-width: 767px) {
    #guide .modal-dialog {
        margin: 0;
    }

    #guide .modal-content {
        background: none;
        width: 100vw;
        height: 100vh;
    }
    #guide .modal-body{
        padding: 0;
        display: flex;
        align-items: center;
        position: relative;
    }
    .swiper-slide {
        display: block;
        height: auto;
        align-self: center;
    }
    .swiper-slide img {
        width: 100%;
        height: auto!important;
    }

    .swiper-wrapper {
        height: 100vh!important;
    }
}

.eyedropper-cursor-override,
.eyedropper-cursor-override * {
    cursor: crosshair !important;
}

.eyedropper-active-mode .canvas-wrap,
.eyedropper-active-mode .myCanvas {
    cursor: crosshair !important;
}

.eyedropper-disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.eyedropper-tools-disabled .leaveWhite,
.eyedropper-tools-disabled .clip,
.eyedropper-tools-disabled .scale,
.eyedropper-tools-disabled .rotate,
.eyedropper-tools-disabled i[data-name="move"] {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}
.guide-line {
    position: absolute;
    background-color: #ff4757; /* A bright, visible color */
    z-index: 9999; /* Ensure it's on top */
    display: none; /* Hidden by default */
    pointer-events: none;
    opacity: 0.9;
    box-shadow: 0 0 5px rgba(255, 71, 87, 0.7);
}

.guide-line.horizontal {
    width: 100%;
    height: 2px;
    left: 0;
}

.guide-line.vertical {
    height: 100%;
    width: 2px;
    top: 0;
}