/* ==========================================================================
   图片分割拼接（/tools/image-splitter）与前台工具引导页
   仅服务 public/assets/js/image-tools.js 生成的界面，命名统一带 jx-it / jx-tool-locked
   前缀，避免影响站点其他板块。
   ========================================================================== */

.jx-it {
    padding-bottom: 3rem;
}

.jx-it__tabs {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    background: var(--fill-secondary);
}

.jx-it__tab {
    padding: 0.5rem 1.4rem;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default);
}

.jx-it__tab:hover {
    color: var(--text);
}

.jx-it__tab.is-active {
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.jx-it__pane {
    display: none;
}

.jx-it__pane.is-active {
    display: block;
}

.jx-it__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.25rem;
    align-items: start;
}

/* ---------- 画布区 ---------- */

.jx-it__stage {
    min-width: 0;
}

.jx-it__canvas-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background-color: var(--surface-secondary);
    background-image:
        linear-gradient(45deg, var(--surface-tertiary) 25%, transparent 25%, transparent 75%, var(--surface-tertiary) 75%),
        linear-gradient(45deg, var(--surface-tertiary) 25%, transparent 25%, transparent 75%, var(--surface-tertiary) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    overflow: hidden;
}

.jx-it__canvas-wrap.is-dropping {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent-soft);
}

.jx-it__canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.jx-it__canvas.is-empty {
    display: none;
}

.jx-it__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 2.5rem 1rem;
    text-align: center;
    pointer-events: none;
}

.jx-it__empty.is-hidden {
    display: none;
}

.jx-it__empty-icon {
    display: block;
    width: 42px;
    height: 42px;
    color: var(--text-muted);
}

.jx-it__empty-icon svg {
    width: 100%;
    height: 100%;
}

.jx-it__empty-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.jx-it__empty-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.jx-it__stagebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.jx-it__stagebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.jx-it__status {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.jx-it__info {
    margin: 0.6rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.jx-it__info:empty {
    display: none;
}

.jx-it__info.is-error {
    color: var(--hot);
    font-weight: 600;
}

.jx-it__file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 缩略图列表（拼接） ---------- */

.jx-it__thumbs {
    display: flex;
    gap: 0.65rem;
    margin: 0.9rem 0 0;
    padding: 0 0 0.35rem;
    list-style: none;
    overflow-x: auto;
}

.jx-it__thumbs:empty {
    display: none;
}

.jx-it__thumb {
    flex: 0 0 auto;
    width: 132px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.jx-it__thumb-img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: contain;
    border-radius: calc(var(--radius) - 4px);
    background: var(--surface-secondary);
}

.jx-it__thumb-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.jx-it__thumb-index {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent);
}

.jx-it__thumb-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jx-it__thumb-dims {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.jx-it__thumb-actions {
    display: flex;
    gap: 0.25rem;
}

.jx-it__thumb-btn {
    flex: 1 1 auto;
    padding: 0.2rem 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--fill-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.2;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
}

.jx-it__thumb-btn:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
}

.jx-it__thumb-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.jx-it__thumb-btn--remove:hover:not(:disabled) {
    color: var(--hot);
    border-color: var(--hot);
}

/* ---------- 右侧面板 ---------- */

.jx-it__panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
}

.jx-it__block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.jx-it__block[hidden] {
    display: none;
}

.jx-it__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.jx-it__value {
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
}

.jx-it__hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.jx-it__range {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.jx-it__seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    border-radius: var(--radius);
    background: var(--fill-secondary);
}

.jx-it__seg-item {
    padding: 0.4rem 0.3rem;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default);
}

.jx-it__seg-item:hover {
    color: var(--text);
}

.jx-it__seg-item.is-active {
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.jx-it__note {
    margin: 1.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---------- 需要登录的引导页 ---------- */

.jx-tool-locked {
    display: flex;
    justify-content: center;
    padding: 3rem 0 4rem;
}

.jx-tool-locked__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    max-width: 460px;
    padding: 2.5rem 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
    text-align: center;
}

.jx-tool-locked__icon {
    display: block;
    width: 46px;
    height: 46px;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.jx-tool-locked__icon svg {
    width: 100%;
    height: 100%;
}

.jx-tool-locked__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.jx-tool-locked__desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.jx-tool-locked__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.jx-tool-locked__note {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
    .jx-it__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .jx-it__panel {
        order: 2;
    }

    .jx-it__canvas-wrap {
        min-height: 240px;
    }
}
