/* 所有CSS样式都放在这里 */
:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --danger: #e63946;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    padding: 0;
    margin: 0;
}

.app-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 0.5rem;
    height: calc(100vh - 1rem);
    display: flex;
    flex-direction: column;
}

.app-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.app-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.template-list {
    background: var(--light);
    padding: 1rem;
    border-right: 1px solid #dee2e6;
    width: 15%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.template-edit {
    padding: 1.5rem;
    width: 85%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.template-edit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    padding: 0.4rem;
}

.template-content {
    min-height: 180px;
    border: 1px solid #dee2e6;
    padding: 0.8rem;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    width: 100%;
    flex: 1;
}

.replace-fields {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.preview-area {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #dee2e6;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-content {
    background: #f9f9f9;
    border-radius: 4px;
    padding: 0.8rem;
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
    border: 1px dashed #adb5bd;
    font-size: 14px;
    min-height: 0;
}

.btn {
    font-size: 14px;
    padding: 0.4rem 0.8rem;
    min-width: auto;
    white-space: nowrap;
}

.btn-sm {
    font-size: 12px;
    padding: 0.3rem 0.6rem;
}

.btn-primary {
    background: var(--primary);
    border: none;
}

.btn-success {
    background: var(--success);
    border: none;
}

.notification {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.notification.show {
    opacity: 1;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

.new-template-indicator {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 0.8rem;
    text-align: center;
    animation: pulse 2s infinite;
    font-size: 12px;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.search-box {
    margin-bottom: 0.8rem;
}

.search-box input {
    font-size: 12px;
    padding: 0.4rem 0.8rem;
}

.template-actions {
    margin-top: auto;
    background: var(--light);
    padding: 0.8rem 0;
    border-top: 1px solid #dee2e6;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

h5 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-control {
    font-size: 12px;
    padding: 0.4rem 0.8rem;
    height: 38px;
    box-sizing: border-box;
}

.badge {
    font-size: 10px;
    padding: 0.25rem 0.5rem;
}

.keyword-highlight {
    background-color: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.category-buttons {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.category-btn {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0.4rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}

.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.category-btn.massage.active {
    background: var(--primary);
}

.category-btn.edge.active {
    background: #ffc107;
}

.category-btn.large.active {
    background: var(--danger);
}

.template-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    overflow-y: auto;
    max-height: none;
    padding: 0.2rem 0;
    align-content: start;
}

.template-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-card.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
}

.template-number {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.template-title {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.template-edit-top-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.template-edit-top-actions .btn {
    flex: 1;
    font-size: 14px;
    padding: 0.4rem 0.6rem;
}

.btn-save-new {
    background: #20c997;
    border: none;
    color: white;
}

/* 修改后的名称行样式 - 三列布局 */
.name-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    height: 250px; /* 固定高度，防止过长 */
}

.name-setting-col, .notes-name-col, .name-preview-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 添加滚动条防止内容过长 */
    max-height: 320px;
    padding-right: 5px;
}

/* 名称设置列样式 - 统一高度和对齐 */
.name-setting-col .mb-2,
.notes-name-col .mb-2 {
    margin-bottom: 0.6rem !important; /* 减少间距 */
    display: flex;
    flex-direction: column;
    height: 50px; /* 统一每个字段的高度 - 可以调整这个值 */
}

/* 统一标签样式 */
.name-setting-col .form-label,
.notes-name-col .form-label {
    font-size: 11px;
    margin-bottom: 0.2rem; /* 标签与输入框的间距 - 调整这里 */
    color: #495057;
    font-weight: 600;
}

/* 统一输入框样式 */
.name-setting-col .form-control,
.notes-name-col .form-control {
    height: 32px; /* 输入框高度 - 调整这里 */
    font-size: 12px;
    padding: 0.4rem 0.6rem; /* 输入框内边距 - 调整这里 */
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* 字符计数容器 - 调整为不换行布局 */
.name-setting-col .char-count-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

/* 输入框在字符计数容器中 */
.name-setting-col .char-count-container .form-control {
    flex: 1;
    padding-right: 65px; /* 为字符计数留出空间 */
}

/* 字符计数位置 - 固定在输入框右侧 */
.name-setting-col .char-count {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 50px;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

/* 备注名称列的字符计数容器 */
.notes-name-col .char-count-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

/* 备注名称输入框 - 与左侧对齐 */
.notes-name-col .form-control {
    flex: 1;
    height: 34px;
    font-size: 12px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* 预览名称列的新样式 */
.name-preview-col .name-selection {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-bottom: 0.6rem; /* 减少间距 */
    min-height: 40px; /* 固定高度，减小卡片高度 */
}

/* 缩小选择预览名称卡片中的勾选按钮间距 */
.name-preview-col .name-selection .d-flex {
    justify-content: space-between; /* 保持两端对齐 */
    gap: 0.1rem; /* 减少间距 */
}

.name-preview-col .name-selection .form-check {
    margin: 0;
    flex: 1; /* 让每个选项平均分配空间 */
    display: flex;
    justify-content: center; /* 居中 */
}

.name-preview-col .name-selection .form-check-input {
    margin-right: 0.2rem; /* 减少间距 */
    transform: scale(1.5); /* 放大单选框 */
}

.name-preview-col .name-selection .form-check-label {
    font-size: 18px;
    white-space: nowrap; /* 防止换行 */
}

/* 预览名称样式 - 减小高度 */
.name-preview-content {
    background: #f9f9f9;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    height: calc(100% - 70px); /* 计算高度，减去上方元素 */
    border: 1px solid #dee2e6;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    white-space: pre-wrap;
    line-height: 1.4;
    box-sizing: border-box;
    overflow-y: auto;
    word-break: break-word;
}

.content-row {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.content-input-col, .notes-input-col, .content-preview-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-input-col .form-label,
.notes-input-col .form-label,
.content-preview-col .form-label {
    margin-bottom: 0.5rem;
}

.content-input-col .editor-container,
.notes-input-col .notes-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-input-col textarea,
.notes-input-col textarea {
    flex: 1;
    resize: none;
    min-height: 0;
}

.content-preview-col .preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-preview-col .preview-content {
    flex: 1;
    min-height: 0;
}

.notes-container textarea {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.8rem;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    width: 100%;
    flex: 1;
}

.ad-maker-modal .modal-dialog {
    max-width: 80%;
    width: 1000px;
    height: 95vh;
    margin: 2.5vh auto;
}

.ad-maker-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-maker-modal .modal-header {
    flex-shrink: 0;
}

.ad-maker-modal .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.ad-maker-modal .modal-footer {
    flex-shrink: 0;
}

.ad-maker-container {
    display: flex;
    height: 100%;
    gap: 20px;
}

.ad-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ad-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.ad-card-header {
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.ad-card-body {
    padding: 20px;
}

.ad-display-preview {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    background: white;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    min-height: 400px;
    max-height: none;
    box-sizing: border-box;
}

.ad-title-preview {
    font-size: 22px;
    margin-bottom: 20px;
    color: #de2600;
    word-wrap: break-word;
    line-height: 1.4;
}

.ad-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 25px;
    justify-content: flex-start;
}

.ad-image-preview {
    width: 140px;
    height: 180px;
    object-fit: contain;
    border-radius: 6px;
    flex: 0 0 auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.ad-content-preview {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    font-size: 15px;
    margin-top: 20px;
}

.ad-screenshot-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
    width: auto;
    align-self: flex-start;
}

.ad-preview-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ad-preview-actions .btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    padding: 8px 16px;
}

.category-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.category-modal-btn {
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.category-modal-btn.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
}

.category-modal-btn.massage.active {
    border-color: var(--primary);
}

.category-modal-btn.edge.active {
    border-color: #ffc107;
}

.category-modal-btn.large.active {
    border-color: var(--danger);
}

.category-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.ad-display-preview {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.ad-display-preview * {
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.ad-display-preview::-webkit-scrollbar {
    width: 6px;
}

.ad-display-preview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ad-display-preview::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.image-management-group {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.image-count-display {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    box-sizing: border-box;
    min-width: 120px;
}

.image-count-display .count-number {
    font-weight: bold;
    color: var(--primary);
    margin: 0 3px;
}

.btn-delete-images {
    background: var(--danger);
    border: none;
    color: white;
    height: 38px;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-images:hover {
    background: #c82333;
}

.btn-delete-images:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.replace-fields .row.g-2 {
    align-items: flex-end;
}

.address-col {
    flex: 1.5;
}

.phone-col,
.hours-col,
.upload-col,
.watermark-col,
.delete-col,
.count-col {
    flex: 1;
}

/* 字符计数样式 */
.form-label .badge {
    margin-left: 5px;
    font-size: 9px;
    padding: 0.2rem 0.4rem;
}

.form-text.text-end {
    font-size: 11px;
    color: #6c757d;
    margin-top: 3px;
}

/* 字符计数颜色状态 */
#skipNameCharCount.bg-secondary,
#adsNameCharCount.bg-secondary,
#adsShortNameCharCount.bg-secondary,
#bedNameCharCount.bg-secondary {
    background-color: #6c757d !important;
}

#skipNameCharCount.bg-warning,
#adsNameCharCount.bg-warning,
#adsShortNameCharCount.bg-warning,
#bedNameCharCount.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

#skipNameCharCount.bg-danger,
#adsNameCharCount.bg-danger,
#adsShortNameCharCount.bg-danger,
#bedNameCharCount.bg-danger {
    background-color: #dc3545 !important;
}

/* 无效状态 */
.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 水印合成工具样式 */
.watermark-modal .modal-dialog {
    max-width: 95%;
    width: 1200px;
}

.watermark-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.watermark-container .section-title {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

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

.upload-icon {
    margin-bottom: 10px;
}

.upload-text {
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: #6c757d;
}

.position-visual {
    width: 100%;
    height: 120px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.position-marker {
    width: 20px;
    height: 20px;
    background-color: rgba(67, 97, 238, 0.7);
    border-radius: 50%;
    position: absolute;
    cursor: move;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translate(-50%, -50%);
}

.position-coordinates {
    text-align: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #6c757d;
}

/* 新的水印预览布局 */
.watermark-preview-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.watermark-preview-top {
    display: flex;
    gap: 1rem;
    height: 620px; /* 水印预览 + 效果预览的总高度 */
}

.watermark-preview-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

/* 水印预览列包含按钮 */
.watermark-logo-preview-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.watermark-logo-preview-col .preview-container {
    flex: 1;
    min-height: 180px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

/* 效果预览列 */
.effect-preview-col {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.effect-preview-col .preview-container {
    flex: 1;
    min-height: 580px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

/* 按钮列竖向排列 */
.watermark-actions-col {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: auto;
}

.watermark-actions-col .btn {
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.watermark-actions-col .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 图片列表样式 */
.thumbnail-section {
    margin-top: 1rem;
}

.thumbnail-container {
    min-height: 100px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
    align-items: center;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
    flex-shrink: 0;
}

.thumbnail.active {
    border-color: var(--primary);
}

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

.watermark-status {
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    display: none;
    font-size: 0.8rem;
}

.watermark-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.watermark-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.watermark-status.info {
    background: #cce7ff;
    color: #004085;
    display: block;
}

.watermark-upload-section,
.watermark-preview-section {
    height: 100%;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.control-group .form-range {
    height: 6px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .watermark-preview-top {
        flex-direction: column;
        height: auto;
    }
    
    .watermark-logo-preview-col .preview-container {
        min-height: 150px;
    }
    
    .effect-preview-col .preview-container {
        min-height: 300px;
    }
    
    .watermark-actions-col {
        flex-direction: row;
        margin-top: 1rem;
    }
    
    .watermark-actions-col .btn {
        flex: 1;
        height: 44px;
        font-size: 14px;
    }
}

@media (max-width: 1400px) {
    .ad-maker-modal .modal-dialog {
        max-width: 85%;
        width: 900px;
    }
}

@media (max-width: 1200px) {
    .ad-maker-modal .modal-dialog {
        max-width: 90%;
        width: 800px;
    }
    
    .watermark-modal .modal-dialog {
        max-width: 98%;
        width: 98%;
    }
}

@media (max-width: 768px) {
    .ad-maker-modal .modal-dialog {
        max-width: 95%;
        width: 95%;
    }
    
    .ad-image-preview {
        width: 100px;
        height: 140px;
    }
    
    .ad-images-preview {
        gap: 20px;
    }
    
    .ad-preview-actions {
        flex-direction: column;
    }
    
    .watermark-modal .modal-dialog {
        max-width: 100%;
        width: 100%;
        margin: 10px;
    }
    
    .watermark-container .row {
        flex-direction: column;
    }
}

/* 调整备注名称区域向下移动 */
.notes-name-col {
    margin-top: -2px; /* 或者您想要的像素值，比如8px, 10px等 */
}

/* 调整备注名称区域内部间距 - 支持小数点 */
.notes-name-col .mb-2 {
    margin-bottom: 0.8rem !important;  /* 使用rem单位，支持小数点 */
    /* 或者使用像素单位 */
    /* margin-bottom: 12.5px !important; */
    /* 或者使用em单位 */
    /* margin-bottom: 1.1em !important; */
}

/* 固定预览名称区域的高度 */
.name-preview-content {
    height: 75px; /* 或者您想要的高度 */
    overflow-y: auto; /* 如果内容超出高度，显示滚动条 */
}

/* 调整预览名称区域内部间距 */
.name-preview-col .form-label {
    margin-bottom: 0.5rem; /* 调整标签与下方元素的间距 */
}

.name-preview-col .name-selection {
    margin-bottom: 1rem; /* 调整单选框组与预览框的间距 */
}

/* 调整预览名称框的内部上下间距 */
.name-preview-content {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* 调整名称行和内容行之间的间距 */
.name-row {
    margin-bottom: 0.1rem; /* 调整名称行与内容行之间的间距 */
}


/* 电话号生成器样式 */
.phone-generator-container {
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.phone-generator-toggle {
    background: linear-gradient(to right, #3498db, #9b59b6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.phone-generator-toggle:hover {
    background: linear-gradient(to right, #2980b9, #8e44ad);
}

.phone-generator-content {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.phone-generator-content.show {
    display: block;
}

.phone-preview-container {
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-radius: 10px;
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #dee2e6;
    overflow: hidden;
}

#phoneDisplay {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s;
    max-width: 100%;
    word-break: break-all;
}

.phone-digit {
    display: inline-block;
    transition: all 0.3s;
}

.watermark-modal .color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.watermark-modal .color-option {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.watermark-modal .color-option:hover {
    transform: scale(1.1);
}

.watermark-modal .color-option.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px #3498db;
}

.watermark-modal .color-mode-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.watermark-modal .color-mode-btn {
    flex: 1;
    padding: 8px;
    background-color: #e0e0e0;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}

.watermark-modal .color-mode-btn.active {
    background: linear-gradient(to right, #3498db, #9b59b6);
    color: white;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.watermark-modal .slider-container {
    margin: 10px 0;
}

.watermark-modal .slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.phone-generator-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.phone-generator-buttons .btn {
    flex: 1;
    padding: 12px;
}

.solid-color-options {
    margin-bottom: 15px;
}

//////////////////
/* 水印合成工具样式调整 */
.watermark-modal .modal-dialog.modal-xxl {
    max-width: 1400px;
    width: 95%;
    margin: 10px auto;
}

.watermark-modal .modal-body {
    max-height: 85vh;
    overflow-y: auto;
    padding: 15px;
}

.watermark-modal .card {
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.watermark-modal .card-header {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
}

.watermark-modal .card-body {
    padding: 15px;
}

/* 上传区域样式 */
.watermark-modal .upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
    padding: 15px;
}

.watermark-modal .upload-area:hover {
    background-color: #e9ecef;
    border-color: #4361ee;
}

.watermark-modal .upload-icon {
    margin-bottom: 10px;
}

.watermark-modal .upload-text {
    margin-bottom: 5px;
    font-size: 13px;
    color: #6c757d;
}

/* 电话号生成器样式 */
.watermark-modal .phone-preview-container {
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-radius: 6px;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.watermark-modal #phoneDisplay {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s;
    max-width: 100%;
    word-break: break-all;
}

.watermark-modal .phone-digit {
    display: inline-block;
    transition: all 0.3s;
}

.watermark-modal .color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.watermark-modal .color-option {
    width: 25px;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.watermark-modal .color-option:hover {
    transform: scale(1.1);
}

.watermark-modal .color-option.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #3498db;
}

.watermark-modal .color-mode-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.watermark-modal .color-mode-btn {
    flex: 1;
    padding: 8px;
    background-color: #e0e0e0;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}

.watermark-modal .color-mode-btn.active {
    background: linear-gradient(to right, #3498db, #9b59b6);
    color: white;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.watermark-modal .slider-container {
    margin: 8px 0;
}

.watermark-modal .slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.watermark-modal .phone-generator-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.watermark-modal .phone-generator-buttons .btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
}

/* 水印位置可视化 */
.watermark-modal .position-visual {
    width: 100%;
    height: 100px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.watermark-modal .position-marker {
    width: 16px;
    height: 16px;
    background-color: rgba(67, 97, 238, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

.watermark-modal .position-coordinates {
    text-align: center;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

/* 预览区域样式 */
.watermark-modal .watermark-logo-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.watermark-modal .watermark-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.watermark-modal .preview-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.watermark-modal .preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 图片列表样式 */
.watermark-modal .thumbnail-container {
    min-height: 80px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
    align-items: center;
    background-color: #f8f9fa;
}

.watermark-modal .thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
    flex-shrink: 0;
}

.watermark-modal .thumbnail.active {
    border-color: #4361ee;
}

.watermark-modal .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 状态消息 */
.watermark-modal .watermark-status {
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    display: none;
}

.watermark-modal .watermark-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.watermark-modal .watermark-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.watermark-modal .watermark-status.info {
    background: #cce7ff;
    color: #004085;
    display: block;
}

/* 操作按钮样式 */
.watermark-modal .d-grid.gap-2 .btn {
    padding: 10px;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 1400px) {
    .watermark-modal .modal-dialog.modal-xxl {
        max-width: 95%;
        width: 95%;
    }
}

@media (max-width: 1200px) {
    .watermark-modal .modal-dialog.modal-xxl {
        max-width: 98%;
        width: 98%;
    }
}

@media (max-width: 992px) {
    .watermark-modal .modal-dialog.modal-xxl {
        max-width: 100%;
        width: 100%;
        margin: 5px;
    }
    
    .watermark-modal .row.g-3 {
        flex-direction: column;
    }
    
    .watermark-modal .col-lg-6 {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .watermark-modal .modal-dialog.modal-xxl {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
    }
    
    .watermark-modal .modal-content {
        height: 100vh;
        border-radius: 0;
    }
    
    .watermark-modal .modal-body {
        max-height: calc(100vh - 120px);
        padding: 10px;
    }
}

/* 在CSS文件的最后添加 */
.watermark-modal .card-body.d-flex.flex-column {
    min-height: auto !important;
    height: auto !important;
}

.watermark-modal .card.mb-3.h-100 {
    height: auto !important;
}

/* ===== 图片剪裁工具样式 - 优化版本 ===== */
.image-crop-modal .modal-dialog {
    max-width: 65%;
    width: 65%;
    margin: 10px auto;
    height: 85vh;
}

.image-crop-modal .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.image-crop-modal .modal-header {
    background: linear-gradient(to right, #3498db, #9b59b6);
    color: white;
    padding: 12px 20px;
    border-bottom: none;
    flex-shrink: 0;
    height: 56px;
}

.image-crop-modal .modal-title {
    font-weight: 600;
    font-size: 1.2rem;
}

.image-crop-modal .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    max-height: calc(85vh - 120px);
}

.image-crop-modal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 12px 20px;
    flex-shrink: 0;
    height: 64px;
}

/* 图片剪裁工具布局 - 优化为大尺寸版本 */
.image-crop-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.image-crop-main {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 左侧控制面板 - 优化版本 */
.image-crop-controls {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 5px;
}

.image-crop-controls-section {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.image-crop-controls-section h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}

.image-crop-controls-section h5 i {
    color: #3498db;
    font-size: 0.9rem;
}

/* 表单控件样式 - 紧凑版本 */
.image-crop-form-group {
    margin-bottom: 10px;
}

.image-crop-form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.8rem;
    display: block;
}

.image-crop-dimensions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.image-crop-dimension input {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    height: 32px;
}

/* 上传区域 - 紧凑版本 */
.image-crop-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    padding: 15px 12px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.image-crop-upload-area:hover {
    border-color: #3498db;
    background-color: #e9ecef;
}

.image-crop-upload-icon {
    font-size: 24px;
    color: #3498db;
    margin-bottom: 6px;
}

.image-crop-upload-text {
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.image-crop-upload-hint {
    color: #6c757d;
    font-size: 0.75rem;
    line-height: 1.2;
}

.image-crop-file-input {
    display: none;
}

/* 状态显示 - 紧凑版本 */
.image-crop-status {
    padding: 6px;
    border-radius: 4px;
    background-color: #e8f4fd;
    border: 1px solid #b6d4fe;
    color: #084298;
    text-align: center;
    font-size: 0.8rem;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 右侧预览区域 - 大尺寸版本 */
.image-crop-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 12px;
    min-width: 0;
}

/* 预览区域 - 修改为自适应布局 */
.image-crop-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    min-height: 0;
    overflow: hidden;
}

.image-crop-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.image-crop-preview-info {
    font-weight: 500;
    color: #495057;
    font-size: 0.85rem;
}

.image-crop-nav-buttons {
    display: flex;
    gap: 6px;
}

.image-crop-nav-btn {
    padding: 5px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.8rem;
    min-width: 70px;
    text-align: center;
    height: 32px;
}

.image-crop-nav-btn:hover {
    background: #5a6268;
}

.image-crop-nav-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

/* 预览画布容器 - 使用aspect-ratio实现自适应 */
.image-crop-canvas-container {
    aspect-ratio: 3 / 4;           /* 宽高比 3:4，可调整为 9:16 或 1:1 */
    width: 100%;                    /* 宽度占满父容器 */
    height: auto;                    /* 高度由宽高比自动计算 */
    min-height: 0;
    max-height: 100%;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    position: relative;
    margin-bottom: 10px;
}

.image-crop-canvas-container-inner {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.image-crop-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: move;
}

/* 位置控制 - 紧凑版本 */
.image-crop-position-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
    flex-shrink: 0;
}

.image-crop-slider-container {
    display: flex;
    flex-direction: column;
}

.image-crop-slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #495057;
}

.image-crop-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

.image-crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.image-crop-position-display {
    text-align: center;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 6px 0;
    font-weight: 500;
    color: #495057;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.image-crop-control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    flex-shrink: 0;
}

.image-crop-control-btn {
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.85rem;
    text-align: center;
    height: 32px;
}

.image-crop-control-btn.primary {
    background: #3498db;
    color: white;
}

.image-crop-control-btn.primary:hover {
    background: #2980b9;
}

.image-crop-control-btn.secondary {
    background: #e74c3c;
    color: white;
}

.image-crop-control-btn.secondary:hover {
    background: #c0392b;
}

/* 缩略图区域 - 紧凑版本 */
.image-crop-thumbnails-container {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.image-crop-thumbnails-container h5 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-crop-thumbnails-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
}

.image-crop-thumbnail {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.image-crop-thumbnail.active {
    border-color: #3498db;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.image-crop-thumbnail canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-crop-thumbnail-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    font-size: 0.7rem;
    padding: 2px;
    display: none; /* 隐藏序号数字 */
}

/* 处理面板 - 紧凑版本 */
.image-crop-process-panel {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.image-crop-process-btn {
    width: 30%; /* 缩小为原来的30% */
    padding: 8px;
    background: linear-gradient(to right, #ff9800, #ff5722); /* 改为橙色渐变 */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    margin-bottom: 12px;
    height: 36px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.image-crop-process-btn:hover {
    background: linear-gradient(to right, #ff5722, #f4511e);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.3);
}

.image-crop-process-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 清除所有按钮 */
.image-crop-clear-btn {
    width: 30%;
    padding: 8px;
    background: linear-gradient(to right, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-crop-clear-btn:hover {
    background: linear-gradient(to right, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.image-crop-clear-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 进度条 - 紧凑版本 */
.image-crop-progress-container {
    margin-bottom: 12px;
    display: none; /* 隐藏进度条 */
}

.image-crop-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #495057;
}

.image-crop-progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.image-crop-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s;
    border-radius: 2px;
}

.image-crop-progress-text {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
    margin: 6px 0;
}

/* 按钮样式优化 */
.btn-compact {
    padding: 5px 10px;
    font-size: 0.8rem;
    min-width: 70px;
}

/* 响应式调整 - 优化版本 */
@media (max-width: 1400px) {
    .image-crop-modal .modal-dialog {
        max-width: 75%;
        width: 75%;
    }
}

@media (max-width: 1200px) {
    .image-crop-modal .modal-dialog {
        max-width: 85%;
        width: 85%;
    }
    
    .image-crop-main {
        flex-direction: column;
    }
    
    .image-crop-controls {
        flex: none;
        width: 100%;
        max-height: 180px;
        overflow-y: auto;
    }
    
    .image-crop-canvas-container {
        /* 移除原有高度，使用aspect-ratio自适应 */
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 992px) {
    .image-crop-modal .modal-dialog {
        max-width: 95%;
        width: 95%;
        margin: 5px;
    }
    
    .image-crop-canvas-container {
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .image-crop-modal .modal-dialog {
        max-width: 100%;
        width: 100%;
        margin: 0;
        height: 100vh;
    }
    
    .image-crop-modal .modal-content {
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .image-crop-modal .modal-body {
        max-height: calc(100vh - 120px);
        padding: 10px;
    }
    
    .image-crop-position-controls {
        grid-template-columns: 1fr;
    }
    
    .image-crop-control-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .image-crop-canvas-container {
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 576px) {
    .image-crop-canvas-container {
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        min-height: 0;
    }
    
    .image-crop-nav-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .image-crop-nav-btn {
        min-width: 60px;
        padding: 4px 6px;
        font-size: 0.75rem;
        height: 28px;
    }
    
    .image-crop-thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-height: 700px) {
    .image-crop-canvas-container {
        min-height: 250px;
    }
}

@media (max-height: 600px) {
    .image-crop-canvas-container {
        min-height: 200px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 剪裁工具按钮橙色样式 */
#openImageCropTool {
    background: linear-gradient(to right, #ff9800, #ff5722);
    border-color: #ff9800;
    color: white;
}

#openImageCropTool:hover {
    background: linear-gradient(to right, #ff5722, #f4511e);
    border-color: #ff5722;
    color: white;
}