/* hangtag.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}
.container {
    max-width: 1200px;
}
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-2px);
}
.preview-container {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    height: 600px;
    position: relative;
    overflow: auto;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
}
.preview-area {
    position: relative;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.hangtag-preview {
    position: absolute;
    border: 1px solid #343a40;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.shape {
    position: absolute;
    cursor: move;
    transition: all 0.2s;
}
.shape:hover {
    box-shadow: 0 0 0 2px rgba(0,123,255,0.5);
}
.shape.ellipse {
    border: 2px solid #007bff;
    border-radius: 50%;
}
.shape.plane-hole-jpg {
    border: 2px solid #007bff;
}
.shape.selected {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40,167,69,0.5) !important;
}
.form-group label {
    font-weight: 500;
    color: #495057;
}
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}
.alert {
    margin-top: 10px;
}
.toolbox {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}
.toolbox-item {
    display: inline-block;
    margin: 5px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: move;
    transition: all 0.2s;
}
.toolbox-item:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}
.property-panel {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,123,255,0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.message-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message-toast.success {
    background-color: #67c23a;
}

.message-toast.error {
    background-color: #f56c6c;
}
/* 按钮样式 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 按钮间距 */
}

.action-button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.action-button.primary {
    background-color: #007bff;
    color: white;
}

.action-button.secondary {
    background-color: #6c757d;
    color: white;
}

.action-button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-button:active:not(:disabled) {
    transform: translateY(0);
}
/* 全屏布局 */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 预览容器 */
.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #f8f9fa;
    border: 2px dashed #ced4da;
    border-radius: 8px;
}

.hangtag-preview {
    position: relative;
    /* 外框由后端 SVG 提供，这里不再画矩形边框 */
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 形状样式 */
.shape {
    position: absolute;
    cursor: move;
    transition: all 0.2s;
}

.shape.ellipse {
    border: 2px solid #007bff;
    border-radius: 50%;
}

.shape.plane-hole-jpg {
    border: 2px solid #007bff;
}

.shape.selected {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40,167,69,0.5) !important;
}

/* 工具栏项 */
.toolbox-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: move;
    transition: all 0.2s;
    font-size: 12px;
}

.toolbox-item:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 消息提示 */
.message-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.message-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message-toast.success {
    background-color: #67c23a;
}

.message-toast.error {
    background-color: #f56c6c;
}
/* hangtag.css (新增关键样式) */
.main-container {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 120px); /* 减去header/footer空间 */
    margin-top: 1.5rem;
}

.left-column {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 10px;
}

.right-column {
    flex: 1;
    min-width: 0; /* 允许收缩 */
}

/* 距离辅助线设置栏 */
.guide-settings {
    font-size: 0.875rem;
}
.guide-settings .form-control-sm {
    vertical-align: middle;
}
.guide-overlay {
    z-index: 5;
}
.guide-dimension-svg line {
    vector-effect: non-scaling-stroke;
}
.guide-label {
    white-space: nowrap;
    z-index: 6;
}

.preview-container {
    width: 100%;
    min-height: 0;
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    overflow: auto;
    margin: 10px;
}

.hangtag-preview {
    position: absolute;
    /* 只作为坐标容器，不再额外加背景/阴影，避免“蒙版感” */
    background: transparent;
    box-shadow: none;
    transition: all 0.2s;
}

/* 消息提示优化 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s, fadeOut 0.5s 2.5s forwards;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }
.success { background: #28a745; }
.error { background: #dc3545; }
/* hangtag.css - 添加旋转标签样式 */
.rotation-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 53, 69, 0.85);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* 飞机孔特殊样式 */
.plane-hole-jpg {
    display: block;
    pointer-events: none; /* 防止图片拦截事件 */
}
/* 飞机孔样式 - 关键：允许拉伸变形 */
.plane-hole {
    display: block;
    /* object-fit: fill 是默认行为，确保图片拉伸填充容器 */
    image-rendering: auto; /* 允许平滑拉伸 */
}

/* 选中状态高亮 */
.shape.selected {
    border: 2px solid #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.plane-hole-rotator {
    position: relative;
    overflow: hidden;
}
.plane-hole-rotator img {
    width: 100%;
    height: 100%;

    /* 如果图片是 32×10，而你要显示为 10×32，应该用 scale 而不是拉伸 */
}
