html, body {
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f1f6fd;
    color: #2b2635;
    font-family: "SF Pro SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

body > .layui-layer-shade,
body > .modal-backdrop,
body > .sweet-overlay,
body > .overlay,
body > [class*="layer-shade"],
body > [id*="layui-layer-shade"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

a {
    color: #8f1d2c;
    text-decoration: none;
}

.home-shell,
.tool-shell,
.video-preview-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .8fr);
    gap: 42px;
    align-items: center;
    min-height: calc(100vh - 96px);
    padding: 54px 0 28px;
}

.eyebrow {
    margin: 0 0 14px;
    color: #176d87;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

h1 {
    margin: 0 0 22px;
    color: #171347;
    font-size: 48px;
    line-height: 1.18;
    letter-spacing: 0;
}

.lead {
    max-width: 660px;
    color: #554e62;
    font-size: 19px;
    line-height: 1.75;
}

.home-actions {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 34px 0 22px;
}

.btn-main,
.btn-primary {
    position: relative;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(#fdcc52, #fdc539);
    color: #332411;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.btn-dark {
    background: #222;
    color: #fff;
}

.btn-line {
    background: transparent;
    border: 1px solid #b8ad9f;
    color: #473c37;
}

.support {
    color: #8b1d28;
    font-size: 16px;
    line-height: 1.7;
}

.hero-board {
    pointer-events: none;
    min-height: 520px;
    padding: 28px;
    border: 8px solid #d3a16d;
    background: #ead9c7;
    box-shadow: 0 24px 70px rgba(23, 19, 71, .16);
}

.live-bar {
    display: inline-flex;
    padding: 8px 18px;
    background: #b91c1c;
    color: #fff;
    font-weight: 800;
}

.stage-title {
    margin: 70px 0 56px;
    color: #9d2735;
    text-align: center;
    font-size: 42px;
    font-weight: 800;
}

.lottery-balls,
.draw-machine {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.lottery-balls span,
.draw-machine span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff8ee;
    color: #e11d48;
    font-weight: 800;
    box-shadow: inset -8px -8px 0 #ffd8ad;
}

.poster-strip {
    margin-top: 68px;
    padding: 18px;
    background: #aa2e38;
    color: #fff;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 24px 0 18px;
}

.top-nav a {
    padding: 9px 18px;
    border-radius: 999px;
    background: #fff;
    color: #40384a;
    font-weight: 700;
}

.top-nav a.active {
    background: #b91c1c;
    color: #fff;
}

.tool-panel,
.api-panel {
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
}

.panel-head h1 {
    font-size: 32px;
}

.license strong {
    color: #d11818;
}

.compose-table,
.api-panel table {
    width: 100%;
    border-collapse: collapse;
}

.compose-table td,
.api-panel td,
.api-panel th {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.label {
    width: 150px;
    font-weight: 700;
}

.label.required {
    color: #d11818;
}

input,
select {
    width: min(100%, 360px);
    min-height: 36px;
    padding: 5px 10px;
    border: 1px solid #999;
    font-size: 17px;
}

.preview {
    margin-top: 24px;
}

.preview img {
    display: none;
    max-width: min(100%, 520px);
    border: 1px solid #e6dfd8;
}

.preview img.ready {
    display: block;
}

.api-panel code {
    color: #c01818;
    word-break: break-all;
}

.video-form {
    display: grid;
    gap: 16px;
    max-width: 560px;
}

.video-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.video-form input {
    width: 100%;
}

.video-result {
    margin-top: 24px;
}

.video-result img {
    width: min(100%, 640px);
    display: block;
    border: 1px solid #e5e7eb;
}

.video-preview-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 0;
}

.video-canvas-wrap {
    width: min(100%, 960px);
}

.video-canvas-wrap canvas {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111827;
    display: block;
}

.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.error-text {
    color: #b91c1c;
    font-weight: 700;
}

.site-footer {
    margin-top: 54px;
    padding: 22px 12px;
    background: #222;
    color: rgba(255,255,255,.55);
    text-align: center;
}

@media (max-width: 820px) {
    .home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    h1 {
        font-size: 34px;
    }

    .hero-board {
        min-height: 420px;
    }

    .stage-title {
        margin: 46px 0 40px;
        font-size: 32px;
    }

    .label {
        width: 112px;
    }
}
