/**
 * PLT排料系统 - WordPress插件样式
 * 主色调: #f04494
 */

/* 容器样式 */
.plt-nesting-wrapper {
    width: 100%;
    margin: 0;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 头部样式 - 简化版 */
.plt-header {
    background: #ffffff;
    color: #333;
    padding: 20px 30px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.plt-header h1 {
    font-size: 24px;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
}

.plt-header p {
    font-size: 14px;
    color: #666;
    opacity: 1;
}

/* 控制面板 - 简洁设计 */
.plt-control-panel {
    padding: 20px 30px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.plt-control-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.plt-control-row:not(:last-child) {
    margin-bottom: 16px;
}

.plt-control-group {
    flex: 1;
    min-width: 180px;
}

.plt-control-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.plt-control-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fafafa;
}

.plt-control-group input:focus {
    outline: none;
    border-color: #f04494;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(240, 68, 148, 0.1);
}

/* 文件上传样式 */
.plt-file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.plt-file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.plt-file-input-label {
    display: inline-block;
    padding: 10px 20px;
    background: #f04494;
    color: #fff!important;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.plt-file-input-label:hover {
    background: #e03a85;
    transform: none;
    box-shadow: 0 2px 8px rgba(240, 68, 148, 0.3);
}

.plt-file-name {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    text-align: left;
}

/* 按钮样式 */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #f04494;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #e03a85;
    transform: none;
    box-shadow: 0 2px 8px rgba(240, 68, 148, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 主要内容区域 */
.plt-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f5f5f5;
}

/* 左侧面板 */
.plt-left-panel {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #eee;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 右侧面板 */
.plt-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
}

/* 信息面板 - 简洁设计 */
.plt-info-panel {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.plt-info-panel h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 统计信息 */
.plt-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.plt-stat-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #f04494;
    transition: all 0.2s;
}

.plt-stat-item:hover {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
}

.plt-stat-label {
    font-weight: 500;
    color: #666;
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plt-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.plt-stat-value.good {
    color: #f04494;
}

.plt-stat-value.warning {
    color: #faad14;
}

.plt-stat-value.bad {
    color: #ff4d4f;
}

.plt-stat-extra {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 画布容器 */
.plt-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    overflow: hidden;
    padding: 16px;
}

.plt-canvas-toolbar {
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.plt-canvas-container {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 20px;
}

#plt-canvas {
    cursor: grab;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    border-radius: 4px;
}

#plt-canvas:active {
    cursor: grabbing;
}

.plt-canvas-info {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.plt-canvas-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plt-canvas-info-label {
    font-size: 11px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
}

.plt-canvas-info-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* 部件列表 */
.plt-parts-list {
    flex: 1;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #eee;
    overflow-y: auto;
}

.plt-parts-list h3 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plt-parts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plt-part-item {
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 3px solid #ddd;
    transition: all 0.2s;
    cursor: pointer;
}

.plt-part-item:hover {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
}

.plt-part-item.placed {
    border-left-color: #f04494;
}

.plt-part-item.not-placed {
    border-left-color: #ff6b6b;
}

.plt-part-item.highlighted {
    background: #fef0f5;
    box-shadow: 0 0 0 2px rgba(240, 68, 148, 0.2);
}

.plt-part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.plt-part-name {
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.plt-part-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.plt-part-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.plt-part-info {
    font-size: 11px;
    color: #666;
    display: flex;
    flex-direction: column;
}

.plt-part-info-label {
    font-weight: 500;
    color: #999;
    font-size: 10px;
    text-transform: uppercase;
}

.plt-part-info-value {
    color: #333;
    font-weight: 500;
}

.plt-part-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.plt-part-status.placed {
    background: #fef0f5;
    color: #f04494;
}

.plt-part-status.not-placed {
    background: #fff1f0;
    color: #ff6b6b;
}

.plt-part-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* 加载动画 */
.plt-loading {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: #f04494;
    font-size: 14px;
    font-weight: 500;
}

.plt-loading.active {
    display: block;
}

.plt-spinner {
    border: 2px solid #f5f5f5;
    border-top: 2px solid #f04494;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: plt-spin 0.8s linear infinite;
    margin: 16px auto;
}

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

/* 缩放控制 */
.plt-zoom-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.plt-zoom-btn {
    padding: 6px 12px;
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.plt-zoom-btn:hover {
    background: #f04494;
    color: #fff;
    border-color: #f04494;
}

.plt-zoom-level {
    font-weight: 600;
    color: #f04494;
    background: #fef0f5;
    padding: 6px 10px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
    font-size: 12px;
}

.plt-toolbar-separator {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
}

.plt-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.plt-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.plt-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #eee;
}

.plt-scroll-hint {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.plt-scroll-hint.show {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .plt-control-row {
        flex-direction: column;
    }

    .plt-control-group {
        width: 100%;
    }

    .plt-left-panel {
        width: 100%;
        max-height: 350px;
    }

    .plt-main-content {
        flex-direction: column;
    }

    .plt-canvas-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .plt-legend {
        flex-wrap: wrap;
    }

    .plt-stats {
        grid-template-columns: 1fr;
    }

    .plt-header,
    .plt-control-panel {
        padding: 16px;
    }
}
