* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: #f6f8fc;
    color: #202938;
    overflow-x: hidden
}

.page {
    max-width: 1420px;
    margin: 0 auto;
    padding: 22px 18px 36px;
    padding-bottom: max(36px, env(safe-area-inset-bottom))
}

.card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid #eef1f6;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(33, 53, 84, .06)
}

.hero {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    margin-bottom: 16px
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 18px
}

.hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 10px;
    object-fit: cover
}

.title-row {
    display: flex;
    align-items: center;
    gap: 10px
}

h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: .2px
}

.hero p {
    margin: 10px 0 0;
    color: #6b7280
}

.pill {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700
}

.orange {
    background: #fff0e3;
    color: #f47b20
}

.env {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f3f6f8;
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    color: #354052
}

.env i {
    width: 8px;
    height: 8px;
    background: #37d47c;
    border-radius: 50%;
    display: block
}

.layout {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 16px;
    align-items: start
}

.form-card {
    padding: 24px 24px 20px
}

.section-title {
    font-size: 16px;
    margin: 0 0 18px;
    padding-left: 12px;
    border-left: 4px solid #1f5cff;
    color: #111827
}

.form-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    margin-bottom: 18px;
    align-items: start
}

.form-item>label {
    padding-top: 10px;
    color: #344054;
    font-weight: 600
}

.form-item>div {
    min-width: 0
}

.required>label:after {
    content: " *";
    color: #ef4444
}

input,
select {
    width: 100%;
    height: 38px;
    border: 1px solid #d9dee8;
    border-radius: 4px;
    background: #fff;
    color: #172033;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    transition: .2s
}

input:focus,
select:focus {
    border-color: #1f5cff;
    box-shadow: 0 0 0 3px rgba(31, 92, 255, .08)
}

.help {
    margin: 7px 0 0;
    color: #8a94a6;
    font-size: 13px
}

.attach-help {
    margin: -8px 0 14px
}

.attach-help code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #f3f6fb;
    color: #1f5cff;
    font-size: 12px
}

.input-suffix,
.inline-input {
    display: flex;
    min-width: 0
}

.input-suffix input,
.inline-input input {
    flex: 1;
    min-width: 0;
    border-radius: 4px 0 0 4px
}

.input-suffix span {
    min-width: 50px;
    height: 38px;
    border: 1px solid #d9dee8;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667085;
    background: #fafbfc
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    margin-left: 10px;
    border: 1px solid #d9dee8;
    border-radius: 4px;
    background: #fff;
    color: #566070;
    padding: 0;
    cursor: pointer
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor
}

.count-input {
    position: relative
}

.count-input span {
    position: absolute;
    right: 12px;
    top: 10px;
    color: #8a94a6;
    font-size: 13px
}

.pay-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 12px
}

.pay-methods button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    color: #263244;
    transition: all .2s;
    font-size: 14px;
    line-height: 1.2
}

.pay-methods button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0
}

.pay-methods button:hover {
    border-color: #1677ff
}

.pay-methods button.active {
    color: #1677ff;
    border-color: #1677ff;
    background: #f0f7ff
}

.params-table {
    border: 1px solid #d9dee8;
    border-radius: 4px;
    overflow: hidden
}

.table-head,
.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr 160px
}

.table-head {
    height: 38px;
    align-items: center;
    background: #fafafa;
    font-weight: 700;
    color: #4b5563
}

.table-head span,
.param-row>div {
    padding: 0 12px
}

.param-row {
    border-top: 1px solid #eef1f6;
    align-items: center;
    padding: 6px 0
}

.param-row input {
    height: 34px
}

.delete-param {
    border: 0;
    background: transparent;
    color: #1f5cff;
    cursor: pointer
}

.add-btn {
    height: 40px;
    width: 100%;
    border: 0;
    border-top: 1px solid #eef1f6;
    background: #fff;
    color: #1f5cff;
    text-align: left;
    padding-left: 14px;
    font-weight: 700;
    cursor: pointer
}

.preview {
    margin-top: 18px
}

.preview summary {
    font-weight: 700;
    cursor: pointer;
    color: #263244
}

.preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px
}

.preview-bar em {
    flex: 1;
    min-width: 0;
    font-style: normal;
    font-weight: 400;
    color: #8a94a6;
    font-size: 13px;
    line-height: 1.5
}

.preview-bar button {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #1f5cff;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px
}

pre {
    margin: 10px 0 0;
    background: #fbfcff;
    border: 1px solid #d9dee8;
    border-radius: 4px;
    padding: 14px 18px;
    line-height: 1.65;
    min-height: 145px;
    color: #217a38;
    overflow: auto;
    word-break: break-all;
    white-space: pre-wrap
}

.side {
    display: grid;
    gap: 16px
}

.side-card {
    padding: 22px
}

h3 {
    margin: 0 0 16px;
    font-size: 16px
}

.side-card button {
    width: 100%;
    height: 42px;
    border-radius: 4px;
    font-weight: 800;
    cursor: pointer
}

.action-buttons {
    display: grid;
    gap: 14px
}

.action-buttons button {
    margin: 0
}

.primary {
    border: 0;
    background: #1557ff;
    color: white;
    box-shadow: 0 6px 16px rgba(21, 87, 255, .22)
}

.outline {
    background: white;
    border: 1px solid #1557ff;
    color: #1557ff
}

.note p {
    font-size: 14px;
    color: #333b49;
    line-height: 1.9;
    margin: 0
}

.note a {
    display: block;
    margin-top: 14px;
    color: #1f5cff;
    font-weight: 700;
    text-decoration: none
}

.result-block {
    margin-top: 24px
}

.result-empty {
    margin: 0;
    text-align: center;
    color: #9aa4b2;
    padding: 24px 0;
    font-weight: 700;
    background: #fbfcff;
    border: 1px solid #d9dee8;
    border-radius: 4px
}

.result-preview {
    min-height: 120px;
    margin: 0
}

.divider {
    position: relative;
    margin: 24px 0
}

.divider::before {
    content: '';
    display: block;
    border-top: 1px dashed #eef2f7
}

@media(max-width:1050px) {
    .layout {
        grid-template-columns: 1fr
    }

    .hero {
        height: auto
    }
}

@media(max-width:768px) {
    .page {
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px))
    }

    .layout {
        display: flex;
        flex-direction: column;
        gap: 12px
    }

    .side-card.note {
        display: none
    }

    .side-actions {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 0;
        z-index: 100;
        margin: 0;
        padding: 12px 14px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -8px 24px rgba(33, 53, 84, .12)
    }

    .side-actions h3 {
        display: none
    }

    .side-actions .action-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }

    .side-actions .action-buttons button {
        height: 44px;
        font-size: 15px
    }
}

@media(max-width:640px) {
    .page {
        padding: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px))
    }

    .card {
        border-radius: 10px
    }

    .hero {
        display: block;
        padding: 18px 16px;
        min-height: 0
    }

    .hero-left {
        gap: 12px;
        align-items: flex-start
    }

    .hero-icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0
    }

    .hero-left>div {
        min-width: 0
    }

    h1 {
        font-size: 20px
    }

    .title-row {
        flex-wrap: wrap;
        gap: 8px
    }

    .hero p {
        font-size: 13px;
        line-height: 1.6;
        word-break: break-word
    }

    .env {
        margin-top: 12px;
        font-size: 13px
    }

    .form-card {
        padding: 16px 14px
    }

    .section-title {
        font-size: 15px;
        margin-bottom: 14px
    }

    .form-item {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 16px
    }

    .form-item>label {
        padding-top: 0;
        font-size: 14px
    }

    input,
    select {
        height: 44px;
        font-size: 16px;
        max-width: 100%
    }

    .input-suffix span,
    .icon-btn {
        height: 44px
    }

    .icon-btn {
        width: 44px;
        margin-left: 8px
    }

    .count-input span {
        top: 12px
    }

    .pay-methods {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%
    }

    .pay-methods button {
        width: 100%;
        min-width: 0;
        justify-content: center;
        height: 44px;
        padding: 0 10px;
        font-size: 13px
    }

    .attach-help {
        margin: 0 0 12px;
        line-height: 1.6;
        word-break: break-word
    }

    .table-head {
        display: none
    }

    .param-row {
        display: block;
        padding: 12px
    }

    .param-row>div {
        padding: 0 0 10px
    }

    .param-row>div:nth-child(1)::before,
    .param-row>div:nth-child(2)::before {
        display: block;
        margin-bottom: 6px;
        color: #8a94a6;
        font-size: 12px;
        font-weight: 600
    }

    .param-row>div:nth-child(1)::before {
        content: "参数名"
    }

    .param-row>div:nth-child(2)::before {
        content: "参数值"
    }

    .param-row>div:last-child {
        padding-bottom: 0;
        text-align: right
    }

    .param-row input {
        height: 40px
    }

    .delete-param {
        min-height: 36px;
        padding: 6px 0
    }

    .add-btn {
        height: 44px
    }

    pre {
        padding: 12px;
        font-size: 12px;
        min-height: 100px;
        max-width: 100%
    }

    .result-empty {
        padding: 20px 12px;
        font-size: 14px
    }

    .divider {
        margin: 20px 0
    }

    .preview-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px
    }

    .preview-bar button {
        padding: 0
    }
}

@media(max-width:400px) {
    .pay-methods {
        grid-template-columns: 1fr
    }
}