*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #f0f0f0;
}

.icon {
    padding: 0;
    margin: 0;
    border: 0;
    font-size: 20px;
}

#app {
    width: min(1400px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    background-color: #fff;
    font-family: Arial, sans-serif;
}

.app-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding-right: 140px;
    padding-left: 140px;
    padding-bottom: 18px;
    border-bottom: 2px solid #eee;
    text-align: center;
}

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    flex: 0 0 auto;
}

.page-title {
    min-width: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.page-switcher {
    position: absolute;
    top: 4px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-switcher .el-button {
    margin: 0;
}

.page-tabs {
    width: 100%;
}

.page-tabs .el-tabs__header {
    display: none;
}

.page-tabs .el-tabs__content {
    overflow: visible;
}

.page-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.deploy-page {
    width: min(760px, 100%);
    margin: 0 auto;
}

.deploy-page .el-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.panel-block {
    width: 100%;
    padding: 20px;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    background: #fff;
}

.section-header,
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.section-header {
    justify-content: space-between;
    gap: 12px;
}

.card-header {
    justify-content: flex-start;
}

.section-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.section-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header-actions .el-button {
    margin: 0;
}

.account-count {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid #dcdfe6;
    border-radius: 999px;
    color: #606266;
    font-size: 12px;
    line-height: 1.4;
    background: #f5f7fa;
}

.account-item {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    background: #fafbfc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.account-single {
    margin-bottom: 18px;
}

.account-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.account-switcher .el-button {
    max-width: 180px;
    margin: 0;
}

.account-switcher .el-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.account-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.account-index {
    color: #303133;
    font-weight: 600;
}

.account-preview {
    min-width: 0;
    color: #909399;
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.action-grid .el-button {
    width: 100%;
    margin: 0;
}

.action-result {
    width: 100%;
    margin-top: 14px;
}

.action-result .el-alert {
    width: 100%;
}

.env-page {
    gap: 12px;
}

.env-card {
    width: 100%;
    border-radius: 6px;
    box-shadow: none;
}

.env-card .el-card__header {
    padding: 16px 20px;
}

.env-card .el-card__body {
    padding: 20px;
}

.config-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 15px;
}

.config-item:last-child {
    margin-bottom: 0;
}

.config-item .label {
    min-width: 0;
    color: #303133;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.item-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.item-actions .el-button {
    min-width: 92px;
    margin: 0;
}

.env-actions {
    display: flex;
    justify-content: flex-end;
}

.env-copy-button {
    min-width: 220px;
}

@media (max-width: 768px) {
    #app {
        padding: 12px;
        border-radius: 0;
    }

    .page-header {
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        min-height: 0;
        padding-right: 0;
        padding-left: 0;
        padding-bottom: 12px;
        text-align: left;
    }

    .brand-lockup {
        flex: 1 1 220px;
        justify-content: flex-start;
    }

    .page-title {
        font-size: 20px;
    }

    .page-switcher {
        position: static;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .panel-block {
        padding: 16px;
    }

    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .section-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .section-header-actions .el-button {
        flex: 1 1 120px;
    }

    .el-form,
    .el-form-item__content,
    .el-form-item__content > .el-input,
    .el-form-item__content > .el-select,
    .el-form-item__content > .el-input-number,
    .el-form-item__content > .el-textarea,
    .el-form-item__content > .el-input-tag {
        width: 100%;
        max-width: 100%;
    }

    .env-card .el-card__header,
    .env-card .el-card__body {
        padding: 16px;
    }

    .config-item {
        flex-direction: column;
        align-items: stretch;
    }

    .account-switcher {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .account-switcher .el-button {
        flex: 0 0 auto;
    }

    .account-item-head {
        align-items: stretch;
        flex-direction: column;
    }

    .account-item-head .el-button {
        width: 100%;
    }

    .item-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .item-actions .el-button {
        flex: 1 1 100%;
        min-width: 0;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .env-actions,
    .env-copy-button {
        width: 100%;
    }
}
