.wd-arty-body {
    --wd-accent: #f78f1e;
    --wd-accent-hover: #ff9f2e;
    --wd-accent-soft: #ffc978;
    --wd-bg: #050d18;
    margin: 0;
    min-height: 100vh;
    background: var(--wd-bg);
    color: #e8f4ff;
    font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 143, 30, 0.55) #050d18;
}

.wd-arty-body::-webkit-scrollbar {
    width: 6px;
}

.wd-arty-body::-webkit-scrollbar-track {
    background: #050d18;
}

.wd-arty-body::-webkit-scrollbar-thumb {
    background: rgba(247, 143, 30, 0.5);
    border-radius: 6px;
}

.wd-arty-body .site-header {
    position: relative;
    z-index: 3;
}

.wd-arty-body .uss-site-footer {
    display: none;
}

.wd-arty-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 277px;
    gap: 0;
    align-items: stretch;
    box-sizing: border-box;
    min-height: calc(100vh - var(--navbar-height));
    background: var(--wd-bg);
}

.wd-arty-stage {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    min-height: 0;
    overflow: hidden;
    background: var(--wd-bg);
}

.wd-arty-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    filter: none;
}

.wd-arty-canvas.is-panning,
.wd-arty-canvas.is-dragging-point {
    cursor: grabbing;
}

.wd-arty-canvas.is-over-point {
    cursor: grab;
}

.wd-arty-scale {
    position: absolute;
    left: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: rgba(200, 220, 235, 0.86);
    pointer-events: none;
}

.wd-arty-scale span {
    display: block;
    width: 62px;
    height: 3px;
    background: var(--wd-accent);
}

.wd-arty-scale em {
    font-style: normal;
}

.wd-arty-cursor {
    position: absolute;
    right: 16px;
    bottom: 16px;
    margin: 0;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: rgba(5, 13, 24, 0.88);
    font-size: 0.78rem;
    color: #e8f4ff;
    pointer-events: none;
}

.wd-arty-sidebar {
    position: relative;
    box-sizing: border-box;
    width: 277px;
    min-height: calc(100vh - var(--navbar-height));
    max-height: calc(100vh - var(--navbar-height));
    background: var(--wd-bg);
}

.wd-arty-toolbox {
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-sizing: border-box;
    width: 280px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 11px 12px 13px;
    background: var(--wd-bg);
    /* 相对原 1.1 缩放再缩小 10%（280×0.99 ≈ 277 对齐栅格列） */
    zoom: 0.99;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 143, 30, 0.55) rgba(8, 18, 28, 0.9);
}

@supports not (zoom: 1) {
    .wd-arty-toolbox {
        font-size: 99%;
    }
    .wd-arty-toolbox .wd-arty-toolbox-title { font-size: 1.05em; }
    .wd-arty-toolbox .wd-arty-block-title { font-size: 0.8em; }
    .wd-arty-toolbox .wd-arty-map-select,
    .wd-arty-toolbox .wd-arty-actions button,
    .wd-arty-toolbox .wd-arty-add-mission,
    .wd-arty-toolbox .wd-arty-broadcast-now,
    .wd-arty-toolbox .wd-arty-broadcast-hotkey {
        font-size: 0.78em;
        min-height: 1.85em;
        height: auto;
        padding-top: 0.35em;
        padding-bottom: 0.35em;
    }
    .wd-arty-toolbox .wd-arty-wcard strong { font-size: 0.8em; }
    .wd-arty-toolbox .wd-arty-metric strong { font-size: 1.1em; }
    .wd-arty-toolbox .wd-arty-xy-grid input { font-size: 0.84em; height: 1.85em; line-height: 1.85em; }
}

.wd-arty-toolbox::-webkit-scrollbar,
.wd-arty-missions::-webkit-scrollbar {
    width: 6px;
}

.wd-arty-toolbox::-webkit-scrollbar-track,
.wd-arty-missions::-webkit-scrollbar-track {
    background: rgba(8, 18, 28, 0.9);
    border-radius: 6px;
}

.wd-arty-toolbox::-webkit-scrollbar-thumb,
.wd-arty-missions::-webkit-scrollbar-thumb {
    background: rgba(247, 143, 30, 0.5);
    border-radius: 6px;
}

.wd-arty-toolbox::-webkit-scrollbar-thumb:hover,
.wd-arty-missions::-webkit-scrollbar-thumb:hover {
    background: var(--wd-accent);
}

.wd-arty-toolbox-title {
    margin: 0 0 -12px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--wd-accent);
}

.wd-arty-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.wd-arty-block-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(200, 220, 235, 0.72);
}

.wd-arty-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wd-accent);
    cursor: pointer;
}

.wd-arty-hint svg {
    display: block;
    width: 14px;
    height: 14px;
}

.wd-arty-hint-pop {
    display: none;
    position: fixed;
    z-index: 4000;
    width: 228px;
    max-width: calc(100vw - 16px);
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.98);
    box-shadow: 0 0 0 1px rgba(247, 143, 30, 0.35), 0 8px 20px rgba(0, 0, 0, 0.45);
    color: rgba(232, 244, 255, 0.92);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    pointer-events: none;
}

.wd-arty-hint-pop.is-open {
    display: block;
}

.wd-arty-muted {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.4;
    color: rgba(148, 186, 212, 0.78);
}

.wd-arty-map-select,
.wd-arty-weapons,
.wd-arty-xy-grid,
.wd-arty-actions,
.wd-arty-result-grid {
    width: 100%;
    box-sizing: border-box;
}

.wd-arty-map-select {
    display: block;
    height: 26px;
    margin: 0;
    padding: 0 28px 0 8px;
    border: 1px solid rgba(247, 143, 30, 0.42);
    border-radius: 5px;
    background-color: rgba(8, 18, 28, 0.92);
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 214, 170, 0.9) 50%),
        linear-gradient(135deg, rgba(255, 214, 170, 0.9) 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: rgba(255, 214, 170, 0.92);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.wd-arty-map-select:hover {
    border-color: rgba(247, 143, 30, 0.75);
    background-color: rgba(247, 143, 30, 0.14);
    color: #ffe7c4;
}

.wd-arty-map-select:focus {
    outline: 1px solid rgba(247, 143, 30, 0.55);
    outline-offset: 0;
}

.wd-arty-map-select option {
    background: #0b1622;
    color: #e8f4ff;
}

.wd-arty-wcard.is-active {
    border-color: var(--wd-accent);
    box-shadow: 0 0 0 1px rgba(247, 143, 30, 0.35) inset;
    color: #fff8ec;
}

.wd-arty-weapons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
}

.wd-arty-wcard {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    min-height: 34px;
    padding: 5px 6px;
    text-align: left;
    border-radius: 6px;
    border: 1px solid rgba(247, 143, 30, 0.18);
    background: rgba(8, 18, 28, 0.88);
    color: #e8f4ff;
    cursor: pointer;
}

.wd-arty-wcard > span:last-child {
    min-width: 0;
    flex: 1 1 auto;
}

.wd-arty-wcard strong,
.wd-arty-wcard em {
    display: block;
}

.wd-arty-wcard strong {
    font-size: 0.64rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wd-arty-wcard em {
    margin-top: 1px;
    font-style: normal;
    font-size: 0.58rem;
    line-height: 1.2;
    color: rgba(148, 186, 212, 0.78);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wd-arty-wicon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: var(--wd-accent);
}

.wd-arty-wicon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.wd-arty-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(8, 18, 28, 0.96);
    color: var(--wd-accent);
    cursor: pointer;
}

.wd-arty-lock svg {
    display: none;
    width: 14px;
    height: 14px;
}

.wd-arty-lock .wd-lock-open {
    display: block;
}

.wd-arty-lock.is-locked {
    background: rgba(247, 143, 30, 0.28);
    color: var(--wd-accent-hover);
}

.wd-arty-lock.is-locked .wd-lock-open {
    display: none;
}

.wd-arty-lock.is-locked .wd-lock-closed {
    display: block;
}

.wd-arty-xy-grid {
    display: grid;
    grid-template-columns: 26px 18px minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 6px;
    row-gap: 7px;
    align-items: center;
}

.wd-arty-xy-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wd-accent);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.wd-arty-xy-key.is-active {
    background: rgba(247, 143, 30, 0.2);
    color: var(--wd-accent-hover);
}

.wd-arty-xy-grid input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 26px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 5px;
    background: rgba(8, 18, 28, 0.96);
    color: #e8f4ff;
    font-size: 0.76rem;
    line-height: 26px;
    box-shadow: inset 0 0 0 1px rgba(247, 143, 30, 0.12);
}

.wd-arty-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
}

.wd-arty-actions button {
    width: 100%;
    min-width: 0;
    height: 26px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 4px;
    border: 1px solid rgba(247, 143, 30, 0.42);
    border-radius: 5px;
    background: rgba(8, 18, 28, 0.92);
    color: rgba(255, 214, 170, 0.92);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.08s ease;
}

.wd-arty-actions button:hover {
    border-color: rgba(247, 143, 30, 0.75);
    background: rgba(247, 143, 30, 0.14);
    color: #ffe7c4;
}

.wd-arty-actions button:active {
    transform: translateY(1px) scale(0.98);
    background: rgba(247, 143, 30, 0.28);
    border-color: var(--wd-accent);
}

/* 当前放置模式：实心橙，一眼能分清 */
.wd-arty-actions button.is-active {
    border-color: #ffb45a;
    background: var(--wd-accent);
    color: #1a1208;
    box-shadow:
        0 0 0 1px rgba(255, 180, 90, 0.55),
        0 0 12px rgba(247, 143, 30, 0.35);
}

.wd-arty-actions button.is-active:hover {
    background: var(--wd-accent-hover, #ffa03a);
    color: #1a1208;
    border-color: #ffc078;
}

.wd-arty-actions button.is-active:active {
    background: #e07810;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28);
}

.wd-arty-xy-grid input:read-only {
    opacity: 0.7;
    cursor: default;
}

.wd-arty-xy-grid input:focus-visible,
.wd-arty-lock:focus-visible,
.wd-arty-hint:focus-visible,
.wd-arty-map-select:focus-visible,
.wd-arty-wcard:focus-visible,
.wd-arty-xy-key:focus-visible,
.wd-arty-actions button:focus-visible {
    outline: 2px solid var(--wd-accent);
    outline-offset: 2px;
}

.wd-arty-result {
    gap: 8px;
}

.wd-arty-status {
    margin: 0;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.96);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.wd-arty-status.is-ok {
    background: rgba(247, 143, 30, 0.28);
    color: #ffd9a0;
}

.wd-arty-status.is-bad {
    background: #8a2a24;
    color: #ffe2dc;
}

.wd-arty-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
}

.wd-arty-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.96);
}

.wd-arty-metric span {
    color: rgba(200, 220, 235, 0.72);
    font-size: 0.68rem;
    line-height: 1.15;
    font-weight: 600;
}

.wd-arty-metric strong {
    margin: 0;
    min-width: 0;
    color: var(--wd-accent);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.wd-arty-metric em {
    margin: 0;
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.wd-arty-result.is-bad .wd-arty-metric--mil strong {
    color: #ffb4a8;
}

.wd-arty-subline {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0;
    color: rgba(148, 186, 212, 0.78);
    font-size: 0.7rem;
    line-height: 1.3;
}

.wd-arty-subline strong {
    color: rgba(232, 244, 255, 0.88);
    font-weight: 600;
}

.wd-arty-broadcast {
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 7px;
    background: rgba(8, 18, 28, 0.96);
}

.wd-arty-broadcast-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
}

.wd-arty-broadcast-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #e8f4ff;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.wd-arty-broadcast-toggle input {
    width: 14px;
    height: 14px;
    accent-color: var(--wd-accent);
}

.wd-arty-broadcast-gear {
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(247, 143, 30, 0.35);
    border-radius: 5px;
    background: transparent;
    color: var(--wd-accent);
    cursor: pointer;
}

.wd-arty-broadcast-gear svg {
    width: 14px;
    height: 14px;
    display: block;
}

.wd-arty-broadcast-gear:hover,
.wd-arty-broadcast-gear[aria-expanded="true"] {
    background: rgba(247, 143, 30, 0.14);
}

.wd-arty-broadcast-now {
    height: 26px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: var(--wd-accent);
    color: #1a1208;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.wd-arty-broadcast-now:disabled {
    opacity: 0.45;
    cursor: default;
}

.wd-arty-broadcast-settings {
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(95, 184, 255, 0.16);
    background: rgba(5, 13, 24, 0.72);
}

.wd-arty-broadcast-settings[hidden] {
    display: none !important;
}

.wd-arty-broadcast-field {
    display: grid;
    gap: 4px;
    margin: 0;
    color: rgba(200, 220, 235, 0.78);
    font-size: 0.68rem;
}

.wd-arty-broadcast-field input,
.wd-arty-broadcast-field select {
    height: 28px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid rgba(95, 184, 255, 0.22);
    border-radius: 5px;
    background: rgba(8, 18, 28, 0.88);
    color: #e8f4ff;
    font-size: 0.74rem;
}

.wd-arty-broadcast-field input:focus,
.wd-arty-broadcast-field select:focus {
    outline: 1px solid rgba(247, 143, 30, 0.55);
    outline-offset: 0;
}

.wd-arty-broadcast-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wd-arty-broadcast-settings-msg {
    color: rgba(148, 186, 212, 0.78);
    font-size: 0.66rem;
    line-height: 1.3;
}

.wd-arty-broadcast-tools {
    display: grid;
    gap: 6px;
}

.wd-arty-broadcast-tools[hidden],
.wd-arty-broadcast[hidden] {
    display: none !important;
}

.wd-arty-broadcast-hotkey {
    height: 26px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid rgba(247, 143, 30, 0.35);
    border-radius: 5px;
    background: transparent;
    color: var(--wd-accent);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.wd-arty-broadcast-hotkey--wide {
    width: 100%;
}

.wd-arty-helper-wrap {
    position: relative;
}

.wd-arty-helper-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    border: 1px solid rgba(247, 143, 30, 0.35);
    border-radius: 6px;
    background: rgba(12, 22, 34, 0.96);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.wd-arty-helper-menu[hidden] {
    display: none !important;
}

.wd-arty-helper-menu-item {
    margin: 0;
    padding: 7px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: rgba(220, 236, 248, 0.92);
    font-size: 0.68rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.wd-arty-helper-menu-item:hover {
    background: rgba(247, 143, 30, 0.16);
    color: var(--wd-accent);
}

.wd-arty-helper-menu-item[hidden] {
    display: none !important;
}

.wd-arty-broadcast-hotkey:hover {
    background: rgba(247, 143, 30, 0.14);
}

.wd-arty-broadcast-hotkey:disabled {
    opacity: 0.45;
    cursor: default;
}

.wd-arty-broadcast-hint {
    margin: 0;
    color: rgba(148, 186, 212, 0.78);
    font-size: 0.66rem;
    line-height: 1.35;
}

.wd-arty-missions-block {
    gap: 8px;
}

.wd-arty-missions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 143, 30, 0.55) rgba(8, 18, 28, 0.9);
}

.wd-arty-mission {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 4px;
    align-items: stretch;
}

.wd-arty-mission-pick {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.96);
    color: #e8f4ff;
    text-align: left;
    cursor: pointer;
}

.wd-arty-mission.is-active .wd-arty-mission-pick {
    background: rgba(247, 143, 30, 0.22);
}

.wd-arty-mission-pick strong {
    color: var(--wd-accent);
    font-size: 0.72rem;
}

.wd-arty-mission-pick span {
    display: block;
    width: 100%;
    color: rgba(200, 220, 235, 0.88);
    font-size: 0.68rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wd-arty-mission-del {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.96);
    color: rgba(200, 220, 235, 0.72);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.wd-arty-mission-del:hover {
    color: #ffb4a8;
}

.wd-arty-add-mission {
    width: 100%;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: var(--wd-accent);
    color: #1a1208;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.wd-arty-license {
    margin: auto 0 0;
    padding: 10px 0 2px;
    flex-shrink: 0;
    font-size: 0.58rem;
    line-height: 1.3;
    word-break: break-all;
    color: rgba(255, 255, 255, 0.78);
    opacity: 0.85;
    pointer-events: none;
    user-select: none;
}

@media (max-width: 900px) {
    .wd-arty-main {
        grid-template-columns: 1fr;
    }

    .wd-arty-stage {
        width: 100%;
        /* 略高于全宽正方形 */
        height: min(110vw, 85vh);
        min-height: min(110vw, 85vh);
    }

    .wd-arty-sidebar {
        width: 100%;
        min-height: 0;
        max-height: none;
    }

    .wd-arty-toolbox {
        width: 100%;
        height: auto;
        max-height: none;
        zoom: 1;
        padding: 14px 14px 20px;
    }
}
