/* Shared shell chrome for diy.php and diy_shell.php */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f0f2f5;
}

.diy-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.diy-shell__bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #001529;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.diy-shell__title {
    font-size: 16px;
    font-weight: 600;
}

.diy-shell__title small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, .65);
}

.diy-shell__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.diy-shell__btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: #fff;
    background: #e1251b;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
}

.diy-shell__btn:hover { background: #c81623; color: #fff; }

.diy-shell__btn--ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .45);
}

.diy-shell__btn--ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .08);
}

.diy-shell__btn.is-active {
    border-color: #95de64;
    color: #95de64;
}

.diy-shell__btn--outline {
    background: #fff;
    color: #e1251b;
    border: 1px solid #e1251b;
}

.diy-shell__btn--outline:hover {
    background: #fff1f0;
    color: #c81623;
}

.diy-shell__crop-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    padding: 8px 16px;
    font-size: 12px;
    color: #595959;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.diy-shell__crop-bar label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.diy-shell__crop-bar input[type="range"] {
    width: 100px;
    vertical-align: middle;
}

.diy-shell__crop-val {
    min-width: 42px;
    color: #8c8c8c;
}

.diy-shell__sub-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 10px 16px;
    font-size: 13px;
    color: #595959;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.diy-shell__sub-bar strong {
    color: #262626;
    font-weight: 600;
}

.diy-shell__frame-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.diy-shell__frame {
    position: absolute;
    left: 0;
    width: 100%;
    border: 0;
    top: calc(-1 * var(--crop-top, 32px));
    height: calc(100% + var(--crop-top, 32px) + var(--crop-bottom, 630px));
}

.diy-shell__fallback {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: #fafafa;
}

.diy-shell__fallback.is-show { display: flex; }

.diy-shell__fallback p {
    margin: 0 0 16px;
    max-width: 480px;
    line-height: 1.6;
    color: #595959;
}

.diy-shell.is-full-jd {
    --crop-top: 0px;
    --crop-bottom: 0px;
}

.diy-shell:not(.is-full-jd) {
    --crop-top: 32px;
    --crop-bottom: 630px;
}

@media (max-width: 768px) {
    .diy-shell:not(.is-full-jd) {
        --crop-top: 32px;
        --crop-bottom: 630px;
    }
    .diy-shell__crop-bar input[type="range"] { width: 72px; }
}
