.cargo-grid-body {
    background: var(--home-page-bg, #122d48);
    color: #e8f4ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.cg-fit {
    flex: none;
    min-width: 0;
}

.cg-main {
    zoom: 1.2;
    box-sizing: border-box;
    width: max-content;
    max-width: none;
    margin: 0 auto;
    padding: 2.75rem var(--home-content-pad-x) 3.25rem;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.85rem;
    height: auto;
}

.cg-side {
    width: 17.5rem;
    height: calc(700px / 1.2);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.cg-brand {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding-bottom: 0.55rem;
}

.cg-title {
    margin: 0;
    font-family: 'Noto Sans SC', 'Segoe UI', sans-serif;
    font-size: calc(1.05rem * 0.8);
    font-weight: 600;
    letter-spacing: 0.12em;
}

.cg-picker {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(95, 184, 255, 0.35) transparent;
}

.cg-picker::-webkit-scrollbar {
    width: 6px;
}

.cg-picker::-webkit-scrollbar-thumb {
    background: rgba(95, 184, 255, 0.35);
    border-radius: 6px;
}

.cg-group + .cg-group {
    margin-top: 0.15rem;
}

.cg-maker {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 44px;
    padding: 0.3rem 0.55rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(200, 220, 235, 0.72);
    cursor: pointer;
    font: inherit;
    font-size: calc(0.92rem * 0.8);
    text-align: left;
}

.cg-maker:hover {
    color: #e8f4ff;
    background: rgba(95, 184, 255, 0.08);
}

.cg-maker.is-selected {
    color: #e8f4ff;
}

.cg-maker-logo {
    display: grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    flex: 0 0 auto;
    color: #8ee0ff;
}

.cg-maker-logo img {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
    object-fit: contain;
}


.cg-maker-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.cg-maker-name {
    font-weight: 600;
    line-height: 1.2;
}

.cg-maker-en {
    color: rgba(148, 186, 212, 0.78);
    font-size: calc(0.72rem * 0.8);
    font-weight: 400;
    line-height: 1.2;
}

.cg-maker.is-selected .cg-maker-en {
    color: rgba(142, 224, 255, 0.8);
}

.cg-maker-chevron {
    width: 0;
    height: 0;
    margin-left: auto;
    border-style: solid;
    border-width: 0.32rem 0 0.32rem 0.46rem;
    border-color: transparent transparent transparent currentColor;
    flex: 0 0 auto;
}

.cg-maker[aria-expanded='true'] .cg-maker-chevron {
    transform: rotate(90deg);
}

.cg-ships {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0 0 0.35rem 0.85rem;
    padding-left: 0.85rem;
    border-left: 1px solid rgba(95, 184, 255, 0.18);
}

.cg-ship-line {
    display: flex;
    align-items: center;
    gap: 0.28rem;
}

.cg-ship-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(142, 224, 255, 0.9);
    font: 600 0.68rem/1 'Segoe UI', sans-serif;
    cursor: pointer;
    padding: 0 0.05rem;
}

.cg-ship-add:hover {
    background: transparent;
    color: #fff;
}

.cg-ship-add.is-in {
    opacity: 0.35;
    cursor: default;
}

.cg-ship {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    width: auto;
    min-height: 44px;
    padding: 0.28rem 0.55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(200, 220, 235, 0.72);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
}

.cg-ship:hover {
    color: #e8f4ff;
    border-color: rgba(95, 184, 255, 0.28);
}

.cg-ship.is-selected {
    color: #e8f4ff;
    background: rgba(95, 184, 255, 0.12);
}

.cg-ship-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cg-ship-scu {
    flex: 0 0 auto;
    color: rgba(142, 224, 255, 0.9);
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.cg-maker:focus-visible,
.cg-ship:focus-visible,
.cg-ship-add:focus-visible,
.cg-view:focus-visible,
.cg-view-icon:focus-visible,
.cg-editor-toggle:focus-visible {
    outline: 2px solid #8ee0ff;
    outline-offset: 2px;
}

.cg-ship-zh {
    font-weight: 600;
    line-height: 1.2;
}

.cg-ship-en {
    color: rgba(148, 186, 212, 0.78);
    font-size: calc(0.72rem * 0.8);
    line-height: 1.2;
}

.cg-ship.is-selected .cg-ship-en {
    color: rgba(142, 224, 255, 0.8);
}

.cg-stage {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cg-view {
    position: relative;
    z-index: 1;
    flex: none;
    width: calc(1400px / 1.2);
    height: calc(700px / 1.2);
    overflow: hidden;
    border: 1px solid var(--home-surface-border);
    border-radius: var(--home-module-radius);
    background: #163048;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.cg-view.is-drag {
    cursor: grabbing;
}

.cg-view.is-pan {
    cursor: move;
}

.cg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.cg-editor button[hidden],
.cg-editor[hidden],
.cg-editor-add[hidden],
.cg-editor-toggle[hidden],
.cg-marquee[hidden] {
    display: none;
}

.cg-view-tools {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.cg-view-icons {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.cg-editor-toggle {
    border: 1px solid rgba(95, 184, 255, 0.35);
    background: rgba(52, 98, 138, 0.94);
    color: #e8f4ff;
    border-radius: 6px;
    padding: 0.28rem 0.7rem;
    font: 600 0.78rem 'Noto Sans SC', 'Segoe UI', sans-serif;
    cursor: pointer;
}

.cg-view-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 1px solid rgba(95, 184, 255, 0.35);
    border-radius: 6px;
    background: rgba(52, 98, 138, 0.94);
    color: #e8f4ff;
    cursor: pointer;
}

.cg-view-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
}

.cg-view-icon:hover,
.cg-editor-toggle:hover {
    border-color: #8ee0ff;
    color: #fff;
}

.cg-editor-toggle.is-on {
    border-color: #8ee0ff;
    color: #8ee0ff;
}

.cg-editor {
    position: absolute;
    top: 7.15rem;
    right: 0.55rem;
    bottom: 0.55rem;
    left: auto;
    width: 12.5rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.5rem;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--home-surface-border);
    border-radius: 10px;
    background: rgba(52, 98, 138, 0.94);
    color: #e8f4ff;
    pointer-events: auto;
}

.cg-editor-tools,
.cg-legend,
.cg-editor-add {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem;
}

.cg-editor-tools {
    flex-direction: column;
}

.cg-editor button,
.cg-editor-add button {
    border: 1px solid rgba(180, 220, 245, 0.45);
    background: rgba(255, 255, 255, 0.1);
    color: #e8f4ff;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font: 600 0.78rem 'Noto Sans SC', 'Segoe UI', sans-serif;
    cursor: pointer;
}

.cg-editor button.is-on,
.cg-legend-item.is-on {
    border-color: #8ee0ff;
    color: #8ee0ff;
}

.cg-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cg-legend-item i {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    display: block;
}

.cg-editor-readout {
    margin-left: 0;
    color: rgba(200, 220, 235, 0.72);
    font-size: 0.75rem;
    line-height: 1.35;
}

.cg-editor-readout.is-short {
    color: #ffd48a;
}

.cg-editor-hint {
    margin: 0;
    color: rgba(148, 186, 212, 0.78);
    font-size: 0.72rem;
    line-height: 1.35;
}

.cg-editor-add label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.72rem;
    color: rgba(200, 220, 235, 0.72);
}

.cg-editor-add input {
    border: 1px solid rgba(95, 184, 255, 0.28);
    background: rgba(28, 62, 92, 0.9);
    color: #e8f4ff;
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    width: 8.5rem;
}

.cg-view.is-place,
.cg-view.is-select {
    cursor: crosshair;
}

.cg-marquee {
    position: absolute;
    z-index: 2;
    border: 1px solid #8ee0ff;
    background: rgba(142, 224, 255, 0.12);
    pointer-events: none;
}

@media (max-width: 720px) {
    .cargo-grid-body {
        overflow-x: hidden;
    }

    .cg-fit {
        position: static;
        flex: none;
        width: 100%;
        height: auto;
    }

    .cg-main {
        zoom: 1;
        position: static;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 0.85rem 0.75rem 1.5rem;
        gap: 0.55rem;
    }

    .cg-side {
        width: 100%;
        height: 30vh;
        max-height: 30vh;
    }

    .cg-stage,
    .cg-view {
        width: 100%;
    }

    .cg-view {
        height: min(58vh, 520px);
        min-height: 240px;
    }
}

